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

View File

@ -315,36 +315,14 @@
More information in Jira: 6970. More information in Jira: 6970.
--> -->
<target name="unit-test-path-simplification" depends="projectized-common.test-init"> <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> <sequential>
<script language="javascript"> <classpathsimplify classpath="${module.run.classpath}" outputprop="test.unit.abbreviatedModuleRunClassPath" />
<![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>
<!--grab properties from common.xml:test-init so that "test.unit.run.cp" can be properly formed--> <!--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.dir" location="${build.dir}/test/unit"/>
<property name="build.test.unit.classes.dir" location="${build.test.unit.dir}/classes"/> <property name="build.test.unit.classes.dir" location="${build.test.unit.dir}/classes"/>

View File

@ -4,10 +4,10 @@
<conf name="coretestlibs"/> <conf name="coretestlibs"/>
</configurations> </configurations>
<dependencies > <dependencies >
<dependency conf="coretestlibs->default" org="org.mockito" name="mockito-core" rev="3.5.7"/> <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.10.13"/> <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.10.13"/> <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.1"/> <dependency conf="coretestlibs->default" org="org.objenesis" name="objenesis" rev="3.3"/>
<dependency conf="coretestlibs->default" org="junit" name="junit" rev="4.13.2"/> <dependency conf="coretestlibs->default" org="junit" name="junit" rev="4.13.2"/>
</dependencies> </dependencies>
</ivy-module> </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.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.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.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 file.reference.objenesis-3.1.jar=release/modules/ext/objenesis-3.1.jar
javac.source=11 javac.source=11
javac.compilerargs=-Xlint -Xlint:-serial javac.compilerargs=-Xlint -Xlint:-serial

View File

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