@Test public void testCreateFinder() throws Exception { final ExecutionParameters executionParameters = new ExecutionParameters(); executionParameters.setArchiveType(archiveType); executionParameters.setLsLog(TestUtil.createTestLog()); executionParameters.setNpmExcludedDirectoryNames(new ArrayList<>()); executionParameters.setScanLocation(new ScanLocation(new File("."))); final FinderParameters finderParameters = TestUtil.createFinderParameters(); final AbstractFinder finder = FinderFactory.getInstance().createFinder(executionParameters, null, finderParameters); Assert.assertEquals("class type returned by createFinder()", expectedFinderClass, finder.getClass()); }
public AbstractFinder createFinder(final ExecutionParameters executionParameters, final LicenseStoreData licenseStoreData, final FinderParameters finderParameters) throws LicenseScoutExecutionException { final AbstractFinder finder; if (executionParameters.getArchiveType() == ArchiveType.JAVA) { finder = new JavaJarFinder(licenseStoreData, finderParameters.getArtifactServerUtil(), executionParameters.getLsLog()); } else if (executionParameters.getArchiveType() == ArchiveType.JAVASCRIPT) { finder = new JavascriptNpmFinder(licenseStoreData, executionParameters.getLsLog(), executionParameters.getNpmExcludedDirectoryNames()); } else { throw new LicenseScoutExecutionException( "Cannot create finder instance for type: " + executionParameters.getArchiveType()); } finder.setScanLocation(executionParameters.getScanLocation()); return finder; }
FinderFactory { public AbstractFinder createFinder(final ExecutionParameters executionParameters, final LicenseStoreData licenseStoreData, final FinderParameters finderParameters) throws LicenseScoutExecutionException { final AbstractFinder finder; if (executionParameters.getArchiveType() == ArchiveType.JAVA) { finder = new JavaJarFinder(licenseStoreData, finderParameters.getArtifactServerUtil(), executionParameters.getLsLog()); } else if (executionParameters.getArchiveType() == ArchiveType.JAVASCRIPT) { finder = new JavascriptNpmFinder(licenseStoreData, executionParameters.getLsLog(), executionParameters.getNpmExcludedDirectoryNames()); } else { throw new LicenseScoutExecutionException( "Cannot create finder instance for type: " + executionParameters.getArchiveType()); } finder.setScanLocation(executionParameters.getScanLocation()); return finder; } }
FinderFactory { public AbstractFinder createFinder(final ExecutionParameters executionParameters, final LicenseStoreData licenseStoreData, final FinderParameters finderParameters) throws LicenseScoutExecutionException { final AbstractFinder finder; if (executionParameters.getArchiveType() == ArchiveType.JAVA) { finder = new JavaJarFinder(licenseStoreData, finderParameters.getArtifactServerUtil(), executionParameters.getLsLog()); } else if (executionParameters.getArchiveType() == ArchiveType.JAVASCRIPT) { finder = new JavascriptNpmFinder(licenseStoreData, executionParameters.getLsLog(), executionParameters.getNpmExcludedDirectoryNames()); } else { throw new LicenseScoutExecutionException( "Cannot create finder instance for type: " + executionParameters.getArchiveType()); } finder.setScanLocation(executionParameters.getScanLocation()); return finder; } private  FinderFactory(); }
FinderFactory { public AbstractFinder createFinder(final ExecutionParameters executionParameters, final LicenseStoreData licenseStoreData, final FinderParameters finderParameters) throws LicenseScoutExecutionException { final AbstractFinder finder; if (executionParameters.getArchiveType() == ArchiveType.JAVA) { finder = new JavaJarFinder(licenseStoreData, finderParameters.getArtifactServerUtil(), executionParameters.getLsLog()); } else if (executionParameters.getArchiveType() == ArchiveType.JAVASCRIPT) { finder = new JavascriptNpmFinder(licenseStoreData, executionParameters.getLsLog(), executionParameters.getNpmExcludedDirectoryNames()); } else { throw new LicenseScoutExecutionException( "Cannot create finder instance for type: " + executionParameters.getArchiveType()); } finder.setScanLocation(executionParameters.getScanLocation()); return finder; } private  FinderFactory(); static FinderFactory getInstance(); AbstractFinder createFinder(final ExecutionParameters executionParameters,
                                       final LicenseStoreData licenseStoreData, final FinderParameters finderParameters); }
FinderFactory { public AbstractFinder createFinder(final ExecutionParameters executionParameters, final LicenseStoreData licenseStoreData, final FinderParameters finderParameters) throws LicenseScoutExecutionException { final AbstractFinder finder; if (executionParameters.getArchiveType() == ArchiveType.JAVA) { finder = new JavaJarFinder(licenseStoreData, finderParameters.getArtifactServerUtil(), executionParameters.getLsLog()); } else if (executionParameters.getArchiveType() == ArchiveType.JAVASCRIPT) { finder = new JavascriptNpmFinder(licenseStoreData, executionParameters.getLsLog(), executionParameters.getNpmExcludedDirectoryNames()); } else { throw new LicenseScoutExecutionException( "Cannot create finder instance for type: " + executionParameters.getArchiveType()); } finder.setScanLocation(executionParameters.getScanLocation()); return finder; } private  FinderFactory(); static FinderFactory getInstance(); AbstractFinder createFinder(final ExecutionParameters executionParameters,
                                       final LicenseStoreData licenseStoreData, final FinderParameters finderParameters);  }