use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by google.
the class MainClassFinderTest method testFindMainClass_multiple.
@Test
public void testFindMainClass_multiple() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/multiple").toURI());
MainClassFinder.Result mainClassFinderResult = MainClassFinder.find(new DirectoryWalker(rootDirectory).walk(), logEventConsumer);
Assert.assertEquals(Result.Type.MULTIPLE_MAIN_CLASSES, mainClassFinderResult.getType());
Assert.assertEquals(2, mainClassFinderResult.getFoundMainClasses().size());
Assert.assertTrue(mainClassFinderResult.getFoundMainClasses().contains("multi.layered.HelloMoon"));
Assert.assertTrue(mainClassFinderResult.getFoundMainClasses().contains("HelloWorld"));
}
use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by google.
the class MainClassFinderTest method testFindMainClass_innerClasses.
@Test
public void testFindMainClass_innerClasses() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/inner-classes").toURI());
MainClassFinder.Result mainClassFinderResult = MainClassFinder.find(new DirectoryWalker(rootDirectory).walk(), logEventConsumer);
Assert.assertSame(Result.Type.MAIN_CLASS_FOUND, mainClassFinderResult.getType());
MatcherAssert.assertThat(mainClassFinderResult.getFoundMainClass(), CoreMatchers.containsString("HelloWorld$InnerClass"));
}
use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by google.
the class MainClassFinderTest method testMainClass_synthetic.
@Test
public void testMainClass_synthetic() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/synthetic").toURI());
MainClassFinder.Result mainClassFinderResult = MainClassFinder.find(new DirectoryWalker(rootDirectory).walk(), logEventConsumer);
Assert.assertSame(MainClassFinder.Result.Type.MAIN_CLASS_FOUND, mainClassFinderResult.getType());
MatcherAssert.assertThat(mainClassFinderResult.getFoundMainClass(), CoreMatchers.containsString("HelloWorldKt"));
}
use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by google.
the class MainClassFinderTest method testFindMainClass_extension.
@Test
public void testFindMainClass_extension() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/extension").toURI());
MainClassFinder.Result mainClassFinderResult = MainClassFinder.find(new DirectoryWalker(rootDirectory).walk(), logEventConsumer);
Assert.assertSame(Result.Type.MAIN_CLASS_FOUND, mainClassFinderResult.getType());
MatcherAssert.assertThat(mainClassFinderResult.getFoundMainClass(), CoreMatchers.containsString("main.MainClass"));
}
use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by google.
the class MainClassFinderTest method testFindMainClass_simple.
@Test
public void testFindMainClass_simple() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/simple").toURI());
MainClassFinder.Result mainClassFinderResult = MainClassFinder.find(new DirectoryWalker(rootDirectory).walk(), logEventConsumer);
Assert.assertSame(Result.Type.MAIN_CLASS_FOUND, mainClassFinderResult.getType());
MatcherAssert.assertThat(mainClassFinderResult.getFoundMainClass(), CoreMatchers.containsString("HelloWorld"));
}
Aggregations