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

View File

@ -315,35 +315,13 @@
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"/>

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>