Skip to content

Commit d44d3a4

Browse files
committed
Rewrite module test in kotlin
1 parent 2ab80d8 commit d44d3a4

File tree

4 files changed

+29
-21
lines changed

4 files changed

+29
-21
lines changed

okio/build.gradle.kts

+7-1
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,14 @@ tasks {
251251
options.release = 9
252252
}
253253

254+
val integrationTest = named<Test>("integrationTest") {
255+
jvmArgumentProviders.add(CommandLineArgumentProvider {
256+
listOf("--patch-module", "okio.test.integration=${sourceSets["integrationTest"].output.asPath}")
257+
})
258+
}
259+
254260
check {
255-
dependsOn(testing.suites.named("integrationTest"))
261+
dependsOn(integrationTest)
256262
}
257263
}
258264

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
open module okio.test.integration {
22
requires okio;
33
requires junit;
4+
requires kotlin.stdlib;
45
}

okio/src/jvmIntegrationTest/java/okio/test/integration/ModuleTest.java

-20
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package okio.test.integration
2+
3+
import okio.FileSystem
4+
import org.junit.Assert.assertEquals
5+
import org.junit.Assert.assertFalse
6+
import org.junit.Assert.assertTrue
7+
import org.junit.Test
8+
9+
class ModuleTest {
10+
@Test
11+
fun testModule() {
12+
// test okio.test.integration is modular
13+
assertTrue(ModuleTest::class.java.module.isNamed)
14+
assertEquals(ModuleTest::class.java.module.name, "okio.test.integration")
15+
assertFalse(ModuleTest::class.java.module.descriptor.isAutomatic)
16+
// test okio is modular
17+
assertTrue(FileSystem::class.java.module.isNamed)
18+
assertEquals(FileSystem::class.java.module.name, "okio")
19+
assertFalse(FileSystem::class.java.module.descriptor.isAutomatic)
20+
}
21+
}

0 commit comments

Comments
 (0)