use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by GoogleContainerTools.
the class MainClassFinderTest method testFindMainClass_importedMethods.
@Test
public void testFindMainClass_importedMethods() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/imported-methods").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 GoogleContainerTools.
the class MainClassFinderTest method testFindMainClass_externalClasses.
@Test
public void testFindMainClass_externalClasses() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/external-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("main.MainClass"));
}
use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by GoogleContainerTools.
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 GoogleContainerTools.
the class MainClassFinderTest method testMainClass_varargs.
@Test
public void testMainClass_varargs() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/varargs").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"));
}
use of com.google.cloud.tools.jib.filesystem.DirectoryWalker in project jib by GoogleContainerTools.
the class MainClassFinderTest method testFindMainClass_subdirectories.
@Test
public void testFindMainClass_subdirectories() throws URISyntaxException, IOException {
Path rootDirectory = Paths.get(Resources.getResource("core/class-finder-tests/subdirectories").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("multi.layered.HelloWorld"));
}
Aggregations