From 3fd7600864e1f3ff083fc495056cbca5eb4fa922 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 31 Aug 2022 12:33:56 -0400 Subject: [PATCH 1/2] hardcoding property file location to avoid qa functional classloader issues --- .../datamodel/CentralRepoDatamodelTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 d4b188d7db..c2c122f1fa 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 @@ -43,7 +43,6 @@ import org.sleuthkit.autopsy.casemodule.CaseDetails; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.datamodel.TskData; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; -import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings; import org.sleuthkit.autopsy.coreutils.FileUtil; /** @@ -57,7 +56,10 @@ import org.sleuthkit.autopsy.coreutils.FileUtil; */ public class CentralRepoDatamodelTest extends TestCase { - private static final String PROPERTIES_FILE = CentralRepoSettings.getInstance().getModuleSettingsKey(); + // Classloader for qa functional tests is having trouble with loading NbBundle. + // Path is hard-coded to avoid that issue instead of using + // CentralRepoSettings.getInstance().getModuleSettingsKey() + private static final String PROPERTIES_FILE = "ModuleConfig/CentralRepository/CentralRepository"; private static final String CR_DB_NAME = "testcentralrepo.db"; private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); From 1e62607cc6e42aa45ed1f45972535212e7efd98c Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 31 Aug 2022 14:40:20 -0400 Subject: [PATCH 2/2] commenting --- .../autopsy/centralrepository/CentralRepoSettings.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/CentralRepoSettings.java b/Core/src/org/sleuthkit/autopsy/centralrepository/CentralRepoSettings.java index b7ec071f27..d24b6245a6 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/CentralRepoSettings.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/CentralRepoSettings.java @@ -44,6 +44,8 @@ public class CentralRepoSettings { private static final String DEFAULT_DB_PARENT_PATH = Paths.get(CENTRAL_REPO_BASE_PATH, "LocalDatabase").toString(); private static final String DEFAULT_DB_NAME = "central_repository.db"; + + // NOTE: if this changes, an equivalent fix will be needed in CentralRepoDatamodelTest for the String PROPERTIES_FILE private static final String MODULE_SETTINGS_KEY = Paths.get( Paths.get(PlatformUtil.getUserConfigDirectory()).relativize(Paths.get(PlatformUtil.getModuleConfigDirectory())).toString(), CENTRAL_REPOSITORY_FOLDER,