Package scanner - test for "mixed" (JAR + local files) loading

This commit is contained in:
Emmanuel BENOîT 2015-09-13 11:25:24 +02:00
parent 1f16faa61b
commit 5b3d927aae
2 changed files with 24 additions and 0 deletions

View file

@ -108,4 +108,21 @@ public class TestPackageScanner
Assert.assertTrue( result.stream( ).allMatch( s -> s.startsWith( "org.junit." ) ) );
Assert.assertTrue( result.stream( ).anyMatch( s -> s.startsWith( "org.junit.experimental." ) ) );
}
/**
* Test: list the class names in the org package, with recursion; both JUnit's classes and the PSTest3 class should
* be in there
*/
@Test
public void testGetClassNamesMixed( )
throws Exception
{
final PackageScanner scanner = new PackageScanner( "org" , true );
final ArrayList< String > result = scanner.getClassNames( );
Assert.assertTrue( !result.isEmpty( ) );
Assert.assertTrue( result.stream( ).anyMatch( s -> s.startsWith( "org.junit." ) ) );
Assert.assertTrue( result.contains( "org.PSTest3" ) );
}
}

View file

@ -0,0 +1,7 @@
package org;
public class PSTest3
{
}