From 05fdf573e92b59f13d0499af58c12366d5b54406 Mon Sep 17 00:00:00 2001 From: Eugene Livis Date: Thu, 28 Oct 2021 16:24:05 -0400 Subject: [PATCH] More functional tests --- .../mainui/datamodel/TableSearchTest.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/mainui/datamodel/TableSearchTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/mainui/datamodel/TableSearchTest.java index 8fd5209e3a..d4cf05dbae 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/mainui/datamodel/TableSearchTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/mainui/datamodel/TableSearchTest.java @@ -538,6 +538,20 @@ public class TableSearchTest extends NbTestCase { assertEquals(3, results.getTotalResultsCount()); assertEquals(3, results.getItems().size()); + // Get "Tag1" file tags from data source 2 + param = new TagsSearchParams(knownTag1, TagsSearchParams.TagType.FILE, dataSource2.getId()); + results = tagsDAO.getTags(param, 0, null, false); + assertEquals(1, results.getTotalResultsCount()); + assertEquals(1, results.getItems().size()); + + // Get the row + RowDTO rowDTO = results.getItems().get(0); + assertTrue(rowDTO instanceof BaseRowDTO); + BaseRowDTO tagResultRowDTO = (BaseRowDTO) rowDTO; + + // Check that the file tag is for the custom file + assertTrue(tagResultRowDTO.getCellValues().contains(customFile.getName())); + // Check that a few of the expected file tag column names are present List columnDisplayNames = results.getColumns().stream().map(p -> p.getDisplayName()).collect(Collectors.toList()); assertTrue(columnDisplayNames.contains(MD5_COLUMN)); @@ -567,9 +581,9 @@ public class TableSearchTest extends NbTestCase { assertEquals(1, results.getItems().size()); // Get the row - RowDTO rowDTO = results.getItems().get(0); + rowDTO = results.getItems().get(0); assertTrue(rowDTO instanceof BaseRowDTO); - BaseRowDTO tagResultRowDTO = (BaseRowDTO) rowDTO; + tagResultRowDTO = (BaseRowDTO) rowDTO; // Check that some of the expected result tag column values are present assertTrue(tagResultRowDTO.getCellValues().contains(TAG_COMMENT));