mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
Fixed tests.
This commit is contained in:
parent
cd8a044560
commit
a43274134d
@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.commonfilessearch;
|
|||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.util.Set;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import org.netbeans.junit.NbModuleSuite;
|
import org.netbeans.junit.NbModuleSuite;
|
||||||
import org.netbeans.junit.NbTestCase;
|
import org.netbeans.junit.NbTestCase;
|
||||||
@ -96,7 +97,7 @@ public class IngestedWithHashAndFileTypeInterCaseTests extends NbTestCase {
|
|||||||
*/
|
*/
|
||||||
public void testOne() {
|
public void testOne() {
|
||||||
try {
|
try {
|
||||||
AbstractCommonAttributeSearcher builder = new AllInterCaseCommonAttributeSearcher(false, false, this.utils.FILE_TYPE, 0);
|
AbstractCommonAttributeSearcher builder = new AllInterCaseCommonAttributeSearcher(false, false, this.utils.FILE_TYPE, 100);
|
||||||
CommonAttributeCountSearchResults metadata = builder.findMatchesByCount();
|
CommonAttributeCountSearchResults metadata = builder.findMatchesByCount();
|
||||||
|
|
||||||
assertTrue("Results should not be empty", metadata.size() != 0);
|
assertTrue("Results should not be empty", metadata.size() != 0);
|
||||||
@ -143,9 +144,18 @@ public class IngestedWithHashAndFileTypeInterCaseTests extends NbTestCase {
|
|||||||
*/
|
*/
|
||||||
public void testTwo() {
|
public void testTwo() {
|
||||||
try {
|
try {
|
||||||
int matchesMustAlsoBeFoundInThisCase = this.utils.getCaseMap().get(CASE2);
|
int matchesMustAlsoBeFoundInThisCase = 0;
|
||||||
|
|
||||||
|
// Filter out the time stamp to get the correct case name.
|
||||||
|
Set<String> caseNames = this.utils.getCaseMap().keySet();
|
||||||
|
for (String caseName : caseNames) {
|
||||||
|
if (caseName.substring(0, caseName.length() - 20).equalsIgnoreCase(CASE2)) {
|
||||||
|
// Case match found. Get the number of matches.
|
||||||
|
matchesMustAlsoBeFoundInThisCase = this.utils.getCaseMap().get(caseName);
|
||||||
|
}
|
||||||
|
}
|
||||||
CorrelationAttributeInstance.Type fileType = CorrelationAttributeInstance.getDefaultCorrelationTypes().get(0);
|
CorrelationAttributeInstance.Type fileType = CorrelationAttributeInstance.getDefaultCorrelationTypes().get(0);
|
||||||
AbstractCommonAttributeSearcher builder = new SingleInterCaseCommonAttributeSearcher(matchesMustAlsoBeFoundInThisCase, false, false, fileType, 0);
|
AbstractCommonAttributeSearcher builder = new SingleInterCaseCommonAttributeSearcher(matchesMustAlsoBeFoundInThisCase, false, false, fileType, 100);
|
||||||
|
|
||||||
CommonAttributeCountSearchResults metadata = builder.findMatchesByCount();
|
CommonAttributeCountSearchResults metadata = builder.findMatchesByCount();
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ class InterCaseTestUtils {
|
|||||||
|
|
||||||
boolean sameFileName = testFileName.equalsIgnoreCase(fileName);
|
boolean sameFileName = testFileName.equalsIgnoreCase(fileName);
|
||||||
boolean sameDataSource = testDataSource.equalsIgnoreCase(dataSource);
|
boolean sameDataSource = testDataSource.equalsIgnoreCase(dataSource);
|
||||||
boolean sameCrCase = testCaseName.equalsIgnoreCase(crCase);
|
boolean sameCrCase = testCaseName.substring(0, testCaseName.length() - 20).equalsIgnoreCase(crCase);
|
||||||
|
|
||||||
if (sameFileName && sameDataSource && sameCrCase) {
|
if (sameFileName && sameDataSource && sameCrCase) {
|
||||||
tally++;
|
tally++;
|
||||||
@ -443,7 +443,7 @@ class InterCaseTestUtils {
|
|||||||
final String testDataSource = node.getDataSource();
|
final String testDataSource = node.getDataSource();
|
||||||
|
|
||||||
boolean sameFileName = testFileName.equalsIgnoreCase(fileName);
|
boolean sameFileName = testFileName.equalsIgnoreCase(fileName);
|
||||||
boolean sameCaseName = testCaseName.equalsIgnoreCase(crCase);
|
boolean sameCaseName = testCaseName.substring(0, testCaseName.length() - 20).equalsIgnoreCase(crCase);
|
||||||
boolean sameDataSource = testDataSource.equalsIgnoreCase(dataSource);
|
boolean sameDataSource = testDataSource.equalsIgnoreCase(dataSource);
|
||||||
|
|
||||||
if (sameFileName && sameDataSource && sameCaseName) {
|
if (sameFileName && sameDataSource && sameCaseName) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user