@Test @ConditionalRun(RepositoryInstalled.MercurialInstalled.class) @ConditionalRun(RepositoryInstalled.GitInstalled.class) public void testSetRepositories() throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); TestRepository testrepo = new TestRepository(); testrepo.create(HistoryGuru.class.getResourceAsStream("repositories.zip")); env.setSourceRoot(testrepo.getSourceRoot()); env.setRepositories(testrepo.getSourceRoot()); assertEquals(10, env.getRepositories().size()); String[] repoNames = {"mercurial", "git"}; env.setRepositories(Arrays.stream(repoNames). map(t -> Paths.get(env.getSourceRootPath(), t).toString()).distinct().toArray(String[]::new)); assertEquals(2, env.getRepositories().size()); }
public static Indexer getInstance() { return index; }
Indexer { public static Indexer getInstance() { return index; } }
Indexer { public static Indexer getInstance() { return index; } private  Indexer(); }
Indexer { public static Indexer getInstance() { return index; } private  Indexer(); static Indexer getInstance(); @SuppressWarnings("PMD.UseStringBufferForStringAppends") static void main(String[] argv); static String[] parseOptions(String[] argv); static void writeConfigToFile(RuntimeEnvironment env, String filename); void prepareIndexer(RuntimeEnvironment env,
                               boolean searchRepositories,
                               boolean addProjects,
                               boolean createDict,
                               List<String> subFiles,
                               List<String> repositories); @SuppressWarnings("PMD.SimplifyStartsWith") void prepareIndexer(RuntimeEnvironment env,
            Set<String> searchPaths,
            boolean addProjects,
            boolean createDict,
            boolean createHistoryCache,
            List<String> subFiles,
            List<String> repositories); void doIndexerExecution(final boolean update, List<String> subFiles,
        IndexChangedListener progress); void refreshSearcherManagers(RuntimeEnvironment env, List<String> projects, String host); void sendToConfigHost(RuntimeEnvironment env, String host); }
Indexer { public static Indexer getInstance() { return index; } private  Indexer(); static Indexer getInstance(); @SuppressWarnings("PMD.UseStringBufferForStringAppends") static void main(String[] argv); static String[] parseOptions(String[] argv); static void writeConfigToFile(RuntimeEnvironment env, String filename); void prepareIndexer(RuntimeEnvironment env,
                               boolean searchRepositories,
                               boolean addProjects,
                               boolean createDict,
                               List<String> subFiles,
                               List<String> repositories); @SuppressWarnings("PMD.SimplifyStartsWith") void prepareIndexer(RuntimeEnvironment env,
            Set<String> searchPaths,
            boolean addProjects,
            boolean createDict,
            boolean createHistoryCache,
            List<String> subFiles,
            List<String> repositories); void doIndexerExecution(final boolean update, List<String> subFiles,
        IndexChangedListener progress); void refreshSearcherManagers(RuntimeEnvironment env, List<String> projects, String host); void sendToConfigHost(RuntimeEnvironment env, String host); static final char PATH_SEPARATOR; static final String PATH_SEPARATOR_STRING; }