Merge pull request #7664 from gdicristofaro/centralRepoTestFix

central repo test fix
This commit is contained in:
eugene7646 2022-08-31 14:49:54 -04:00 committed by GitHub
commit 6e8aa91be3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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_PARENT_PATH = Paths.get(CENTRAL_REPO_BASE_PATH, "LocalDatabase").toString();
private static final String DEFAULT_DB_NAME = "central_repository.db"; 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( private static final String MODULE_SETTINGS_KEY = Paths.get(
Paths.get(PlatformUtil.getUserConfigDirectory()).relativize(Paths.get(PlatformUtil.getModuleConfigDirectory())).toString(), Paths.get(PlatformUtil.getUserConfigDirectory()).relativize(Paths.get(PlatformUtil.getModuleConfigDirectory())).toString(),
CENTRAL_REPOSITORY_FOLDER, CENTRAL_REPOSITORY_FOLDER,

View File

@ -43,7 +43,6 @@ import org.sleuthkit.autopsy.casemodule.CaseDetails;
import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
import org.sleuthkit.autopsy.coreutils.FileUtil; import org.sleuthkit.autopsy.coreutils.FileUtil;
/** /**
@ -57,7 +56,10 @@ import org.sleuthkit.autopsy.coreutils.FileUtil;
*/ */
public class CentralRepoDatamodelTest extends TestCase { 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 String CR_DB_NAME = "testcentralrepo.db";
private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest");