@Test public void testIndexWithSetIndexVersionedFilesOnly() throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); env.setSourceRoot(repository.getSourceRoot()); env.setDataRoot(repository.getDataRoot()); env.setRepositories(repository.getSourceRoot()); List<RepositoryInfo> repos = env.getRepositories(); Repository r = null; for (RepositoryInfo ri : repos) { if (ri.getDirectoryName().equals(repository.getSourceRoot() + "/rfe2575")) { r = RepositoryFactory.getRepository(ri, CommandTimeoutType.INDEXER); break; } } if (r != null && r.isWorking()) { Project project = new Project("rfe2575"); project.setPath("/rfe2575"); IndexDatabase idb = new IndexDatabase(project); assertNotNull(idb); MyIndexChangeListener listener = new MyIndexChangeListener(); idb.addIndexChangedListener(listener); idb.update(); assertEquals(2, listener.files.size()); repository.purgeData(); RuntimeEnvironment.getInstance().setIndexVersionedFilesOnly(true); idb = new IndexDatabase(project); listener = new MyIndexChangeListener(); idb.addIndexChangedListener(listener); idb.update(); assertEquals(1, listener.files.size()); RuntimeEnvironment.getInstance().setIndexVersionedFilesOnly(false); } else { System.out.println("Skipping test. Repository for rfe2575 not found or an sccs I could use in path."); } }
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; }