core unit tests working

This commit is contained in:
Greg DiCristofaro 2022-11-15 17:10:21 -05:00
parent 5f3601c36f
commit a73fac0e07
5 changed files with 133 additions and 155 deletions

226
.gitignore vendored
View File

@ -1,113 +1,113 @@
/dist/
/build/
/*/build/
*/nbproject/private/*
/nbproject/private/*
/apidiff_output/
/Core/release/
/Core/src/org/sleuthkit/autopsy/coreutils/Version.properties
/Core/src/org/sleuthkit/autopsy/casemodule/docs/QuickStart.html
/Core/src/org/sleuthkit/autopsy/casemodule/docs/screenshot.png
/Core/src/org/sleuthkit/autopsy/datamodel/ranges.csv
/Core/build/
/Core/dist/
/Core/nbproject/*
/Core/test/qa-functional/data/*
!/Core/nbproject/project.xml
!/Core/nbproject/project.properties
/CoreLibs/release/
/CoreLibs/build/
/CoreLibs/dist/
/CoreLibs/nbproject/*
!/CoreLibs/nbproject/project.xml
!/CoreLibs/nbproject/project.properties
/CoreTestLibs/release/
/CoreTestLibs/build/
/CoreTestLibs/dist/
/Core/test/qa-functional/data/*
!/Core/test/qa-functional/data/PasswordDetection_img1_v1.img
/KeywordSearch/release/
/KeywordSearch/build/
/KeywordSearch/dist/
/KeywordSearch/nbproject/*
!/KeywordSearch/nbproject/project.xml
!/KeywordSearch/nbproject/project.properties
*/genfiles.properties
genfiles.properties
/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties
/branding/build/
/branding/dist/
/branding/nbproject/*
!/branding/nbproject/project.xml
!/branding/nbproject/project.properties
/test/input/*
!/test/input/notablehashes.txt-md5.idx
!/test/input/notablekeywords.xml
!/test/input/NSRL.txt-md5.idx
/test/output/*
!/test/output/gold
/test/script/output_dir_link.txt
/test/output/gold/tmp
/test/script/ScriptLog.txt
/test/script/__pycache__/
/test/script/*.pyc
/test/script/DBDump-Diff.txt
/test/script/DBDump.txt
/test/script/SortedData-Diff.txt
/test/script/SortedData.txt
/test/script/myconfig.xml
/test/script/*/*.xml
/test/build/
/test/dist/
/test/nbproject/*
!/Testing/nbproject/project.xml
!/Testing/nbproject/project.properties
*~
/netbeans-plat/*
# include netbeans platform 15 because it doesn't seem to download consistently or is being updated
!/netbeans-plat/15
/docs/doxygen-user/user-docs
/docs/doxygen-dev/build-docs
/jdiff-javadocs/*
/jdiff-logs/*
/gen_version.txt
hs_err_pid*.log
.DS_Store
.*.swp
/Experimental/release/
/ImageGallery/release/
/thunderbirdparser/release/
/RecentActivity/release/
/CentralRepository/release/
/Tika/release
.idea/
*.iml
*.img
*.vhd
*.E01
/thirdparty/yara/yarabridge/yarabridge/x64/
/thirdparty/yara/yarabridge/yarabridge.VC.db
/thirdparty/yara/yarabridge/yarabridge.VC.VC.opendb
/thirdparty/yara/yarabridge/x64/
/thirdparty/yara/YaraWrapperTest/nbproject/private/
/thirdparty/yara/YaraWrapperTest/build/
/thirdparty/yara/YaraJNIWrapper/dist/
/thirdparty/yara/YaraJNIWrapper/build/
/thirdparty/yara/YaraJNIWrapper/nbproject/private/
/thirdparty/yara/yarabridge/.vs/
*/path_list.txt
/dist/
/build/
/*/build/
*/nbproject/private/*
/nbproject/private/*
/apidiff_output/
/Core/release/
/Core/src/org/sleuthkit/autopsy/coreutils/Version.properties
/Core/src/org/sleuthkit/autopsy/casemodule/docs/QuickStart.html
/Core/src/org/sleuthkit/autopsy/casemodule/docs/screenshot.png
/Core/src/org/sleuthkit/autopsy/datamodel/ranges.csv
/Core/build/
/Core/dist/
/Core/nbproject/*
/Core/test/qa-functional/data/*
!/Core/nbproject/project.xml
!/Core/nbproject/project.properties
/CoreLibs/release/
/CoreLibs/build/
/CoreLibs/dist/
/CoreLibs/nbproject/*
!/CoreLibs/nbproject/project.xml
!/CoreLibs/nbproject/project.properties
/CoreTestLibs/release/
/CoreTestLibs/build/
/CoreTestLibs/dist/
/Core/test/qa-functional/data/*
!/Core/test/qa-functional/data/PasswordDetection_img1_v1.img
/KeywordSearch/release/
/KeywordSearch/build/
/KeywordSearch/dist/
/KeywordSearch/nbproject/*
!/KeywordSearch/nbproject/project.xml
!/KeywordSearch/nbproject/project.properties
*/genfiles.properties
genfiles.properties
/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties
/branding/build/
/branding/dist/
/branding/nbproject/*
!/branding/nbproject/project.xml
!/branding/nbproject/project.properties
/test/input/*
!/test/input/notablehashes.txt-md5.idx
!/test/input/notablekeywords.xml
!/test/input/NSRL.txt-md5.idx
/test/output/*
!/test/output/gold
/test/script/output_dir_link.txt
/test/output/gold/tmp
/test/script/ScriptLog.txt
/test/script/__pycache__/
/test/script/*.pyc
/test/script/DBDump-Diff.txt
/test/script/DBDump.txt
/test/script/SortedData-Diff.txt
/test/script/SortedData.txt
/test/script/myconfig.xml
/test/script/*/*.xml
/test/build/
/test/dist/
/test/nbproject/*
!/Testing/nbproject/project.xml
!/Testing/nbproject/project.properties
*~
/netbeans-plat/*
# include netbeans platform 15 because it doesn't seem to download consistently or is being updated
!/netbeans-plat/15
/docs/doxygen-user/user-docs
/docs/doxygen-dev/build-docs
/jdiff-javadocs/*
/jdiff-logs/*
/gen_version.txt
hs_err_pid*.log
.DS_Store
.*.swp
/Experimental/release/
/ImageGallery/release/
/thunderbirdparser/release/
/RecentActivity/release/
/CentralRepository/release/
/Tika/release
.idea/
*.iml
*.img
*.vhd
*.E01
/thirdparty/yara/yarabridge/yarabridge/x64/
/thirdparty/yara/yarabridge/yarabridge.VC.db
/thirdparty/yara/yarabridge/yarabridge.VC.VC.opendb
/thirdparty/yara/yarabridge/x64/
/thirdparty/yara/YaraWrapperTest/nbproject/private/
/thirdparty/yara/YaraWrapperTest/build/
/thirdparty/yara/YaraJNIWrapper/dist/
/thirdparty/yara/YaraJNIWrapper/build/
/thirdparty/yara/YaraJNIWrapper/nbproject/private/
/thirdparty/yara/yarabridge/.vs/
*/path_list.txt

View File

@ -315,36 +315,14 @@
More information in Jira: 6970.
-->
<target name="unit-test-path-simplification" depends="projectized-common.test-init">
<property name="unit-test-path-simplification.dir.path" value="${thirdparty.dir}/ClasspathSimplification/target"/>
<property name="unit-test-path-simplification.jar.path" value="${unit-test-path-simplification.dir.path}/ClasspathSimplification-1.0-jar-with-dependencies.jar"/>
<taskdef name="classpathsimplify" classname="org.sleuthkit.autopsy.classpathsimplification.ClasspathSimplification" classpath="${unit-test-path-simplification.jar.path}"/>
<sequential>
<script language="javascript">
<![CDATA[
var moduleRunClasspath = project.getProperty("module.run.classpath");
var directories = [];
// searches for jar file parent directories with path separators of \ or /
var individualPathRegex = /^\s*(.+?[\\\/])[^\\\/]+?\.jar\s*$/i;
// split on ':' but not 'C:\'
var classPathRegex = /((C:\\)?.+?)(:|$)/gi;
var match;
while((match = classPathRegex.exec(moduleRunClasspath)) !== null) {
var thisPath = match[1];
var pathMatch = thisPath.match(individualPathRegex);
// find unique matches
if (pathMatch && directories.indexOf(pathMatch[1]) < 0) {
directories.push(pathMatch[1]);
}
}
// suffix with *
for (var i = 0; i < directories.length; i++) {
directories[i] = directories[i] + "*";
}
// set project property
project.setNewProperty("test.unit.abbreviatedModuleRunClassPath", directories.join(":"));
]]>
</script>
<classpathsimplify classpath="${module.run.classpath}" outputprop="test.unit.abbreviatedModuleRunClassPath" />
<!--grab properties from common.xml:test-init so that "test.unit.run.cp" can be properly formed-->
<property name="build.test.unit.dir" location="${build.dir}/test/unit"/>
<property name="build.test.unit.classes.dir" location="${build.test.unit.dir}/classes"/>

View File

@ -4,10 +4,10 @@
<conf name="coretestlibs"/>
</configurations>
<dependencies >
<dependency conf="coretestlibs->default" org="org.mockito" name="mockito-core" rev="3.5.7"/>
<dependency conf="coretestlibs->default" org="net.bytebuddy" name="byte-buddy" rev="1.10.13"/>
<dependency conf="coretestlibs->default" org="net.bytebuddy" name="byte-buddy-agent" rev="1.10.13"/>
<dependency conf="coretestlibs->default" org="org.objenesis" name="objenesis" rev="3.1"/>
<dependency conf="coretestlibs->default" org="org.mockito" name="mockito-core" rev="4.8.1"/>
<dependency conf="coretestlibs->default" org="net.bytebuddy" name="byte-buddy" rev="1.12.18"/>
<dependency conf="coretestlibs->default" org="net.bytebuddy" name="byte-buddy-agent" rev="1.12.18"/>
<dependency conf="coretestlibs->default" org="org.objenesis" name="objenesis" rev="3.3"/>
<dependency conf="coretestlibs->default" org="junit" name="junit" rev="4.13.2"/>
</dependencies>
</ivy-module>

View File

@ -2,7 +2,7 @@ file.reference.byte-buddy-1.10.13.jar=release/modules/ext/byte-buddy-1.10.13.jar
file.reference.byte-buddy-agent-1.10.13.jar=release/modules/ext/byte-buddy-agent-1.10.13.jar
file.reference.hamcrest-core-1.3.jar=release/modules/ext/hamcrest-core-1.3.jar
file.reference.junit-4.13.2.jar=release/modules/ext/junit-4.13.2.jar
file.reference.mockito-core-3.5.7.jar=release/modules/ext/mockito-core-3.5.7.jar
file.reference.mockito-core-4.8.1.jar=release/modules/ext/mockito-core-4.8.1.jar
file.reference.objenesis-3.1.jar=release/modules/ext/objenesis-3.1.jar
javac.source=11
javac.compilerargs=-Xlint -Xlint:-serial

View File

@ -44,12 +44,12 @@
<package>org.junit.validator</package>
</public-packages>
<class-path-extension>
<runtime-relative-path>ext/byte-buddy-1.10.13.jar</runtime-relative-path>
<binary-origin>release/modules/ext/byte-buddy-1.10.13.jar</binary-origin>
<runtime-relative-path>ext/byte-buddy-1.12.18.jar</runtime-relative-path>
<binary-origin>release/modules/ext/byte-buddy-1.12.18.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/byte-buddy-agent-1.10.13.jar</runtime-relative-path>
<binary-origin>release/modules/ext/byte-buddy-agent-1.10.13.jar</binary-origin>
<runtime-relative-path>ext/byte-buddy-agent-1.12.18.jar</runtime-relative-path>
<binary-origin>release/modules/ext/byte-buddy-agent-1.12.18.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/hamcrest-core-1.3.jar</runtime-relative-path>
@ -60,12 +60,12 @@
<binary-origin>release/modules/ext/junit-4.13.2.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/mockito-core-3.5.7.jar</runtime-relative-path>
<binary-origin>release/modules/ext/mockito-core-3.5.7.jar</binary-origin>
<runtime-relative-path>ext/mockito-core-4.8.1.jar</runtime-relative-path>
<binary-origin>release/modules/ext/mockito-core-4.8.1.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/objenesis-3.1.jar</runtime-relative-path>
<binary-origin>release/modules/ext/objenesis-3.1.jar</binary-origin>
<runtime-relative-path>ext/objenesis-3.3.jar</runtime-relative-path>
<binary-origin>release/modules/ext/objenesis-3.3.jar</binary-origin>
</class-path-extension>
</data>
</configuration>