Merge branch 'develop' of https://github.com/sleuthkit/autopsy into new_table_load

This commit is contained in:
eugene.livis 2022-09-02 13:06:57 -04:00
commit 406c655f11
3 changed files with 9 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,6 +43,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
import org.sleuthkit.autopsy.report.GeneralReportModule; import org.sleuthkit.autopsy.report.GeneralReportModule;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.FileReader; import java.io.FileReader;
import java.util.Comparator;
/** /**
* Finds and loads Autopsy modules written using the Jython variant of the * Finds and loads Autopsy modules written using the Jython variant of the
@ -124,6 +125,8 @@ public final class JythonModuleLoader {
} }
} }
} }
Collections.sort(objects, Comparator.comparing((T obj) -> obj.getClass().getSimpleName(), (s1, s2) -> s1.compareToIgnoreCase(s2)));
return objects; return objects;
} }

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");