Skip to content

Commit

Permalink
[utbot-rd]
Browse files Browse the repository at this point in the history
compilation fix
  • Loading branch information
Domonion committed Oct 14, 2022
1 parent ca2d65a commit b95d74a
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,40 @@ class TestGetSourceFileName {

@Test
fun testThis() {
assertEquals("TestGetSourceFileName.kt", Instrumenter.computeSourceFileName(TestGetSourceFileName::class.java))
assertEquals("TestGetSourceFileName.kt", Instrumenter.adapter.computeSourceFileName(TestGetSourceFileName::class.java))
}

@Test
fun testJavaExample1() {
assertEquals("ExampleClass.java", Instrumenter.computeSourceFileName(ExampleClass::class.java))
assertEquals("ExampleClass.java", Instrumenter.adapter.computeSourceFileName(ExampleClass::class.java))
}

@Test
fun testJavaExample2() {
assertEquals(
"ClassWithInnerClasses.java",
Instrumenter.computeSourceFileName(ClassWithInnerClasses::class.java)
Instrumenter.adapter.computeSourceFileName(ClassWithInnerClasses::class.java)
)
}

@Test
fun testInnerClass() {
assertEquals(
"ClassWithInnerClasses.java",
Instrumenter.computeSourceFileName(ClassWithInnerClasses.InnerStaticClass::class.java)
Instrumenter.adapter.computeSourceFileName(ClassWithInnerClasses.InnerStaticClass::class.java)
)
}

@Test
fun testSameNameButDifferentPackages() {
assertEquals(
true,
Instrumenter.computeSourceFileByClass(org.utbot.examples.samples.root.MyClass::class.java)?.toPath()
Instrumenter.adapter.computeSourceFileByClass(org.utbot.examples.samples.root.MyClass::class.java)?.toPath()
?.endsWith(Paths.get("root", "MyClass.java"))
)
assertEquals(
true,
Instrumenter.computeSourceFileByClass(org.utbot.examples.samples.root.child.MyClass::class.java)
Instrumenter.adapter.computeSourceFileByClass(org.utbot.examples.samples.root.child.MyClass::class.java)
?.toPath()?.endsWith(Paths.get("root", "child", "MyClass.java"))
)
}
Expand All @@ -69,7 +69,7 @@ class TestGetSourceFileName {
fun testEmptyPackage() {
assertEquals(
true,
Instrumenter.computeSourceFileByClass(ClassWithoutPackage::class.java)?.toPath()
Instrumenter.adapter.computeSourceFileByClass(ClassWithoutPackage::class.java)?.toPath()
?.endsWith("java/ClassWithoutPackage.java")
)
}
Expand All @@ -78,7 +78,7 @@ class TestGetSourceFileName {
fun testPackageDoesNotMatchDir() {
assertEquals(
true,
Instrumenter.computeSourceFileByClass(ClassWithWrongPackage::class.java)?.toPath()
Instrumenter.adapter.computeSourceFileByClass(ClassWithWrongPackage::class.java)?.toPath()
?.endsWith("org/utbot/examples/samples/ClassWithWrongPackage.kt")
)
}
Expand All @@ -87,15 +87,15 @@ class TestGetSourceFileName {
fun testSearchDir() {
assertEquals(
null,
Instrumenter.computeSourceFileByClass(
Instrumenter.adapter.computeSourceFileByClass(
org.utbot.examples.samples.root.MyClass::class.java,
Paths.get("src/test/kotlin")
)?.name
)

assertEquals(
"MyClass.java",
Instrumenter.computeSourceFileByClass(
Instrumenter.adapter.computeSourceFileByClass(
org.utbot.examples.samples.root.MyClass::class.java,
Paths.get("src/test")
)?.name
Expand Down

0 comments on commit b95d74a

Please sign in to comment.