@Test public void locateTestClasses() throws Exception { File baseDir = new File( new File( "target/test-classes" ).getCanonicalPath() ); TestListResolver resolver = new TestListResolver( filter ); DirectoryScanner surefireDirectoryScanner = new DirectoryScanner( baseDir, resolver ); ScanResult classNames = surefireDirectoryScanner.scan(); assertThat( classNames, is( notNullValue() ) ); assertThat( classNames.size(), is( expectedClassesCount ) ); Map<String, String> props = new HashMap<>(); classNames.writeTo( props ); assertThat( props.values(), hasSize( expectedClassesCount ) ); }
public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List<String> result = new ArrayList<>(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); }
DirectoryScanner { public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List<String> result = new ArrayList<>(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); } }
DirectoryScanner { public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List<String> result = new ArrayList<>(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); } DirectoryScanner( File basedir, TestListResolver filter ); }
DirectoryScanner { public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List<String> result = new ArrayList<>(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); } DirectoryScanner( File basedir, TestListResolver filter ); DefaultScanResult scan(); }
DirectoryScanner { public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List<String> result = new ArrayList<>(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); } DirectoryScanner( File basedir, TestListResolver filter ); DefaultScanResult scan();  }