diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 357d5e0641786ffa040ca6c314144d544c43407a..65907e8e879d6e828497d343b673310d7ee2303c 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -1256,7 +1256,8 @@ public void testCorrelationTypes() { List<CorrelationAttributeInstance.Type> types = CentralRepository.getInstance().getDefinedCorrelationTypes(); // We expect 11 total - 10 default and the custom one made earlier - assertTrue("getDefinedCorrelationTypes returned " + types.size() + " entries - expected 11", types.size() == 11); + // Note: this test will need to be updated based on the current default items defined in the correlation_types table + assertTrue("getDefinedCorrelationTypes returned " + types.size() + " entries - expected 28", types.size() == 28); } catch (CentralRepoException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex.getMessage()); @@ -1267,7 +1268,8 @@ public void testCorrelationTypes() { List<CorrelationAttributeInstance.Type> types = CentralRepository.getInstance().getEnabledCorrelationTypes(); // We expect 10 - the custom type is disabled - assertTrue("getDefinedCorrelationTypes returned " + types.size() + " enabled entries - expected 10", types.size() == 10); + // Note: this test will need to be updated based on the current default items defined in the correlation_types table + assertTrue("getDefinedCorrelationTypes returned " + types.size() + " enabled entries - expected 27", types.size() == 27); } catch (CentralRepoException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex.getMessage()); @@ -1278,7 +1280,8 @@ public void testCorrelationTypes() { List<CorrelationAttributeInstance.Type> types = CentralRepository.getInstance().getSupportedCorrelationTypes(); // We expect 10 - the custom type is not supported - assertTrue("getDefinedCorrelationTypes returned " + types.size() + " supported entries - expected 10", types.size() == 10); + // Note: this test will need to be updated based on the current default items defined in the correlation_types table + assertTrue("getDefinedCorrelationTypes returned " + types.size() + " supported entries - expected 27", types.size() == 27); } catch (CentralRepoException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex.getMessage()); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseTestUtils.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseTestUtils.java index 014b08fe84bdaa59a7620f197276bb055af7106e..f76676cd2593994d0c967b9a92acf95dfd719fc9 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseTestUtils.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseTestUtils.java @@ -218,7 +218,9 @@ class InterCaseTestUtils { // kitchenSink.add(keywordSearchTemplate); this.kitchenShink = new IngestJobSettings(InterCaseTestUtils.class.getCanonicalName(), IngestType.ALL_MODULES, kitchenSink); + } + void setupCorrelationTypes() { try { Collection<CorrelationAttributeInstance.Type> types = CentralRepository.getInstance().getDefinedCorrelationTypes(); @@ -254,16 +256,16 @@ void clearTestDir() { } } } - + Map<Long, String> getDataSourceMap() throws NoCurrentCaseException, TskCoreException, SQLException { return DataSourceLoader.getAllDataSources(); - } + } Map<String, Integer> getCaseMap() throws CentralRepoException { if (CentralRepository.isEnabled()) { Map<String, Integer> mapOfCaseIdsToCase = new HashMap<>(); - + for (CorrelationCase correlationCase : CentralRepository.getInstance().getCases()) { mapOfCaseIdsToCase.put(correlationCase.getDisplayName(), correlationCase.getID()); } @@ -300,7 +302,7 @@ void enableCentralRepo() throws CentralRepoException { RdbmsCentralRepoFactory centralRepoSchemaFactory = new RdbmsCentralRepoFactory(CentralRepoPlatforms.SQLITE, crSettings); centralRepoSchemaFactory.initializeDatabaseSchema(); centralRepoSchemaFactory.insertDefaultDatabaseContent(); - + crSettings.saveSettings(); CentralRepoDbManager.saveDbChoice(CentralRepoDbChoice.SQLITE); } @@ -313,10 +315,10 @@ void enableCentralRepo() throws CentralRepoException { * The length of caseNames and caseDataSourcePaths should be the same, and * cases should appear in the same order. * - * @param caseNames list case names - * @param caseDataSourcePaths two dimensional array listing the datasources - * in each case - * @param ingestJobSettings HashLookup FileType etc... + * @param caseNames list case names + * @param caseDataSourcePaths two dimensional array listing the datasources + * in each case + * @param ingestJobSettings HashLookup FileType etc... * @param caseReferenceToStore */ Case createCases(String[] caseNames, Path[][] caseDataSourcePaths, IngestJobSettings ingestJobSettings, String caseReferenceToStore) throws TskCoreException { diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java index 262e54774ffde28af61957f5ffefa8db22b93e13..ce0ffb15262c7496a011c3b6dcec5f9ac86b955f 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java @@ -253,7 +253,7 @@ public void testCarvingWithExtRuleAndUnallocSpace() { IngestUtils.runIngestJob(currentCase.getDataSources(), ingestJobSettings); FileManager fileManager = currentCase.getServices().getFileManager(); List<AbstractFile> results = fileManager.findFiles("%%"); - assertEquals(70, results.size()); + assertEquals(71, results.size()); int carvedJpgGifFiles = 0; for (AbstractFile file : results) { if (file.getNameExtension().equalsIgnoreCase("jpg") || file.getNameExtension().equalsIgnoreCase("gif")) { //Unalloc file and .jpg files in dir1, dir2, $CarvedFiles, root directory should have MIME type diff --git a/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java b/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java index 95871dae2e94fec4c81b373e9e78c0db2962513d..068f0c3904f8e517842d60500d4f12de018cb4ce 100644 --- a/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java +++ b/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java @@ -308,7 +308,7 @@ public void getRecentlyOpenedDocuments_filtersMissingData() throws SleuthkitCase // verify results (only successItem) Assert.assertNotNull(results); Assert.assertEquals(1, results.size()); - Assert.assertEquals((Long) DAY_SECONDS, (Long) results.get(0).getDateAsLong()); + Assert.assertEquals((Long) DAY_SECONDS, results.get(0).getDateAsLong()); Assert.assertTrue("/a/path".equalsIgnoreCase(results.get(0).getPath())); } @@ -386,7 +386,7 @@ public void getRecentDownloads_filtersMissingData() throws SleuthkitCaseProvider // verify results Assert.assertNotNull(results); Assert.assertEquals(1, results.size()); - Assert.assertEquals((Long) DAY_SECONDS, (Long) results.get(0).getDateAsLong()); + Assert.assertEquals((Long) DAY_SECONDS, results.get(0).getDateAsLong()); Assert.assertTrue("/a/path1".equalsIgnoreCase(results.get(0).getPath())); } @@ -668,12 +668,12 @@ public void getRecentAttachments_filterData() throws SleuthkitCaseProviderExcept RecentAttachmentDetails successItem2Details = results.get(0); RecentAttachmentDetails successItemDetails = results.get(1); - Assert.assertEquals((Long) successItemDetails.getDateAsLong(), (Long) DAY_SECONDS); + Assert.assertEquals(successItemDetails.getDateAsLong(), (Long) DAY_SECONDS); Assert.assertTrue(Paths.get(successItem.getFileParentPath(), successItem.getFileName()) .toString().equalsIgnoreCase(successItemDetails.getPath())); Assert.assertTrue(successItem.getEmailFrom().equalsIgnoreCase(successItemDetails.getSender())); - Assert.assertEquals((Long) successItem2Details.getDateAsLong(), (Long) (DAY_SECONDS + 1)); + Assert.assertEquals(successItem2Details.getDateAsLong(), (Long) (DAY_SECONDS + 1)); Assert.assertTrue(Paths.get(successItem2.getFileParentPath(), successItem2.getFileName()) .toString().equalsIgnoreCase(successItem2Details.getPath())); Assert.assertTrue(successItem2.getEmailFrom().equalsIgnoreCase(successItem2Details.getSender()));