ScannerFactory { public Scanner getScanner (String url) { return getScanner(url, null, null, null); }  List<DrbCortexItemClass> getScannerSupport(); static synchronized String[] getDefaultCortexSupport(); Scanner getScanner(String url); Scanner getScanner(String url, String username, String password,
         String pattern); Scanner getUploadScanner(String url, final String username,
      final String password, String pattern); void processScan(final Long scan_id); boolean stopScan(final Long scan_id); static final SimpleDateFormat SDF; }
@Test public void runFileScanner() throws InterruptedException { ScannerFactory sf = new ScannerFactory (); Scanner scanner = sf.getScanner (tmpDir.getPath()); scanner.setSupportedClasses(classes); scanner.getScanList().simulate(false); scanner.scan(); Assert.assertTrue (scanner.getScanList().size()>0, "No item found."); Assert.assertEquals (scanner.getScanList().size(), 2, "Wrong number of items found."); }
@Test (groups="slow") public void runFtpScanner() throws InterruptedException { ScannerFactory sf = new ScannerFactory (); Scanner scanner = sf.getScanner ("ftp: "user", "password", null); scanner.setSupportedClasses(ImmutableList.of (DrbCortexItemClass .getCortexItemClassByName ("http: scanner.getScanList().simulate(false); scanner.scan(); Assert.assertTrue (scanner.getScanList().size()>0, "No item found."); }