diff --git a/okio/build.gradle.kts b/okio/build.gradle.kts index 8a0ae60b0e..9d7d49689e 100644 --- a/okio/build.gradle.kts +++ b/okio/build.gradle.kts @@ -251,8 +251,14 @@ tasks { options.release = 9 } + val integrationTest = named("integrationTest") { + jvmArgumentProviders.add(CommandLineArgumentProvider { + listOf("--patch-module", "okio.test.integration=${sourceSets["integrationTest"].output.asPath}") + }) + } + check { - dependsOn(testing.suites.named("integrationTest")) + dependsOn(integrationTest) } } diff --git a/okio/src/jvmIntegrationTest/java/module-info.java b/okio/src/jvmIntegrationTest/java/module-info.java index 67f08ae51f..26fa87c2fa 100644 --- a/okio/src/jvmIntegrationTest/java/module-info.java +++ b/okio/src/jvmIntegrationTest/java/module-info.java @@ -1,4 +1,5 @@ open module okio.test.integration { requires okio; requires junit; + requires kotlin.stdlib; } diff --git a/okio/src/jvmIntegrationTest/java/okio/test/integration/ModuleTest.java b/okio/src/jvmIntegrationTest/java/okio/test/integration/ModuleTest.java deleted file mode 100644 index 0c7668521d..0000000000 --- a/okio/src/jvmIntegrationTest/java/okio/test/integration/ModuleTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package okio.test.integration; - -import okio.FileSystem; -import org.junit.Test; - -import static org.junit.Assert.*; - -public class ModuleTest { - @Test - public void testModule() { - // test okio.test.integration is modular - assertTrue(ModuleTest.class.getModule().isNamed()); - assertEquals(ModuleTest.class.getModule().getName(), "okio.test.integration"); - assertFalse(ModuleTest.class.getModule().getDescriptor().isAutomatic()); - // test okio is modular - assertTrue(FileSystem.class.getModule().isNamed()); - assertEquals(FileSystem.class.getModule().getName(), "okio"); - assertFalse(FileSystem.class.getModule().getDescriptor().isAutomatic()); - } -} diff --git a/okio/src/jvmIntegrationTest/kotlin/okio/test/integration/ModuleTest.kt b/okio/src/jvmIntegrationTest/kotlin/okio/test/integration/ModuleTest.kt new file mode 100644 index 0000000000..4124f3e61d --- /dev/null +++ b/okio/src/jvmIntegrationTest/kotlin/okio/test/integration/ModuleTest.kt @@ -0,0 +1,21 @@ +package okio.test.integration + +import okio.FileSystem +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class ModuleTest { + @Test + fun testModule() { + // test okio.test.integration is modular + assertTrue(ModuleTest::class.java.module.isNamed) + assertEquals(ModuleTest::class.java.module.name, "okio.test.integration") + assertFalse(ModuleTest::class.java.module.descriptor.isAutomatic) + // test okio is modular + assertTrue(FileSystem::class.java.module.isNamed) + assertEquals(FileSystem::class.java.module.name, "okio") + assertFalse(FileSystem::class.java.module.descriptor.isAutomatic) + } +}