Skip to content

Commit

Permalink
Rewrite module test in kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sineaggi committed Jun 4, 2024
1 parent 2ab80d8 commit d44d3a4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
8 changes: 7 additions & 1 deletion okio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,14 @@ tasks {
options.release = 9
}

val integrationTest = named<Test>("integrationTest") {
jvmArgumentProviders.add(CommandLineArgumentProvider {
listOf("--patch-module", "okio.test.integration=${sourceSets["integrationTest"].output.asPath}")
})
}

check {
dependsOn(testing.suites.named("integrationTest"))
dependsOn(integrationTest)
}
}

Expand Down
1 change: 1 addition & 0 deletions okio/src/jvmIntegrationTest/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
open module okio.test.integration {
requires okio;
requires junit;
requires kotlin.stdlib;
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit d44d3a4

Please sign in to comment.