Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
java-package: 'jdk+fx'
distribution: 'zulu'

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ Desktop.ini
donkey/donkey-src
donkey/donkey-test
.sonar
# Unit Tests:
**/junit-reports
**/junit-html
**/code-coverage-reports
/exports/
/MapUtilTestDB/
/testconf/

# /client/
/client/logs
Expand Down
2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=8.0.442.fx-zulu
java=17.0.17.fx-zulu
ant=1.10.14
24 changes: 19 additions & 5 deletions client/ant-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,23 @@
<classpath refid="testclasspath" />
</javac>
</target>

<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${server}/lib/ant/jacocoant.jar"/>
</taskdef>


<path id="jacoco.classpath">
<fileset dir="../server/lib/ant">
<include name="org.jacoco.ant-0.8.8.jar"/>
<include name="org.jacoco.core-0.8.8.jar"/>
<include name="org.jacoco.report-0.8.8.jar"/>
<include name="org.jacoco.agent-0.8.8.jar"/>
<include name="asm-9.2.jar"/>
<include name="asm-tree-9.2.jar"/>
<include name="asm-commons-9.2.jar"/>
</fileset>
</path>

<taskdef uri="antlib:org.jacoco.ant"
resource="org/jacoco/ant/antlib.xml"
classpathref="jacoco.classpath"/>

<target name="test-run" depends="test-compile">
<property name="junit-reports" value="junit-reports" />
<property name="code-coverage-reports" value="code-coverage-reports" />
Expand All @@ -347,6 +359,8 @@
<junit haltonfailure="false" fork="true" forkmode="once">
<jvmarg value="-Xms128m" />
<jvmarg value="-Xmx2048m" />
<!-- https://stackoverflow.com/questions/54205486 -->
<jvmarg value="-Xshare:off" />
<classpath>
<path refid="testclasspath" />
<dirset dir="${test_classes}"/>
Expand Down
Binary file added client/lib/commons-vfs2-2.10.0.jar
Binary file not shown.
Binary file removed client/lib/commons-vfs2-2.9.0.jar
Binary file not shown.
Binary file removed client/lib/guava-28.2-jre.jar
Binary file not shown.
Binary file added client/lib/guava-32.0.1-jre.jar
Binary file not shown.
Binary file not shown.
26 changes: 20 additions & 6 deletions command/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,23 @@
<classpath refid="testclasspath" />
</javac>
</target>

<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${server}/lib/ant/jacocoant.jar"/>
</taskdef>


<path id="jacoco.classpath">
<fileset dir="../server/lib/ant">
<include name="org.jacoco.ant-0.8.8.jar"/>
<include name="org.jacoco.core-0.8.8.jar"/>
<include name="org.jacoco.report-0.8.8.jar"/>
<include name="org.jacoco.agent-0.8.8.jar"/>
<include name="asm-9.2.jar"/>
<include name="asm-tree-9.2.jar"/>
<include name="asm-commons-9.2.jar"/>
</fileset>
</path>

<taskdef uri="antlib:org.jacoco.ant"
resource="org/jacoco/ant/antlib.xml"
classpathref="jacoco.classpath"/>

<target name="test-run" depends="test-compile">
<property name="junit-reports" value="junit-reports" />
<property name="code-coverage-reports" value="code-coverage-reports" />
Expand All @@ -86,6 +98,8 @@
<junit haltonfailure="false" fork="true" forkmode="once">
<jvmarg value="-Xms128m" />
<jvmarg value="-Xmx2048m" />
<!-- https://stackoverflow.com/questions/54205486 -->
<jvmarg value="-Xshare:off" />
<classpath>
<path refid="testclasspath" />
<dirset dir="${test_classes}"/>
Expand All @@ -99,4 +113,4 @@
</junit>
</jacoco:coverage>
</target>
</project>
</project>
Binary file added command/lib/commons-vfs2-2.10.0.jar
Binary file not shown.
Binary file removed command/lib/commons-vfs2-2.9.0.jar
Binary file not shown.
Binary file removed command/lib/guava-28.2-jre.jar
Binary file not shown.
Binary file added command/lib/guava-32.0.1-jre.jar
Binary file not shown.
Binary file not shown.
22 changes: 18 additions & 4 deletions donkey/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,22 @@
<classpath refid="testclasspath" />
</javac>
</target>

<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${server}/lib/ant/jacocoant.jar"/>
</taskdef>

<path id="jacoco.classpath">
<fileset dir="../server/lib/ant">
<include name="org.jacoco.ant-0.8.8.jar"/>
<include name="org.jacoco.core-0.8.8.jar"/>
<include name="org.jacoco.report-0.8.8.jar"/>
<include name="org.jacoco.agent-0.8.8.jar"/>
<include name="asm-9.2.jar"/>
<include name="asm-tree-9.2.jar"/>
<include name="asm-commons-9.2.jar"/>
</fileset>
</path>

<taskdef uri="antlib:org.jacoco.ant"
resource="org/jacoco/ant/antlib.xml"
classpathref="jacoco.classpath"/>

<target name="test-run" depends="test-compile">
<property name="junit-reports" value="junit-reports" />
Expand All @@ -85,6 +97,8 @@
<junit haltonfailure="false" fork="true" forkmode="once">
<jvmarg value="-Xms128m" />
<jvmarg value="-Xmx2048m" />
<!-- https://stackoverflow.com/questions/54205486 -->
<jvmarg value="-Xshare:off" />
<classpath>
<path refid="testclasspath" />
<dirset dir="${test_classes}"/>
Expand Down
Binary file removed donkey/lib/database/mysql-connector-j-8.2.0.jar
Binary file not shown.
Binary file added donkey/lib/database/mysql-connector-j-8.4.0.jar
Binary file not shown.
Binary file removed donkey/lib/guava/guava-28.2-jre.jar
Binary file not shown.
Binary file added donkey/lib/guava/guava-32.0.1-jre.jar
Binary file not shown.
Binary file added donkey/testlib/byte-buddy-1.14.13.jar
Binary file not shown.
Binary file removed donkey/testlib/byte-buddy-1.8.8.jar
Binary file not shown.
Binary file added donkey/testlib/byte-buddy-agent-1.14.13.jar
Binary file not shown.
Binary file removed donkey/testlib/byte-buddy-agent-1.8.8.jar
Binary file not shown.
Binary file removed donkey/testlib/mockito-core-2.7.9.jar
Binary file not shown.
Binary file added donkey/testlib/mockito-core-5.1.1.jar
Binary file not shown.
Binary file removed manager/lib/guava-28.2-jre.jar
Binary file not shown.
Binary file added manager/lib/guava-32.0.1-jre.jar
Binary file not shown.
83 changes: 56 additions & 27 deletions server/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1198,13 +1198,11 @@
<target name="create-javadocs" depends="init">
<mkdir dir="${docs.javadocs}" />

<javadoc sourcepath="${src}:${jdk_src_path}" destdir="${docs.javadocs.userapi}" packagenames="com.mirth.connect.server.userutil,com.mirth.connect.userutil,com.mirth.connect.plugins.httpauth.userutil" link="https://docs.oracle.com/javase/8/docs/api/">
<javadoc sourcepath="${src}:${jdk_src_path}" destdir="${docs.javadocs.userapi}" packagenames="com.mirth.connect.server.userutil,com.mirth.connect.userutil,com.mirth.connect.plugins.httpauth.userutil" link="https://docs.oracle.com/en/java/javase/17/docs/api/">
<classpath refid="classpath" />
<!-- Uncomment the following and add additional dashes in front of the arguments to allow Java 9+
<arg line="-html5"/>
<arg line="-add-modules java.sql.rowset"/>
<arg line="-add-exports java.sql.rowset/com.sun.rowset=ALL-UNNAMED"/>
-->
<arg line="-html5"/>
<arg line="--add-modules=java.sql.rowset"/>
<arg line="--add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED"/>
</javadoc>
</target>

Expand Down Expand Up @@ -1266,12 +1264,10 @@

<javac srcdir="${test}" destdir="${test_classes}" debug="on" includeAntRuntime="false">
<classpath refid="testclasspath" />
<!-- Uncomment the following and add additional dashes in front of the arguments to allow Java 9+
<compilerarg value="-add-modules" />
<compilerarg value="java.sql.rowset,java.xml.ws" />
<compilerarg value="-add-exports" />
<compilerarg value="java.sql.rowset/com.sun.rowset=ALL-UNNAMED" />
-->
<compilerarg value="--add-modules=java.sql.rowset" />
<compilerarg value="--add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED" />
<compilerarg value="--add-exports=java.base/com.sun.crypto.provider=ALL-UNNAMED" />
<compilerarg value="--add-exports=java.base/sun.security.provider=ALL-UNNAMED" />
</javac>

<copy todir="${test_classes}">
Expand All @@ -1285,30 +1281,55 @@
<include name="**/*" />
</jar>
</target>

<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="lib/ant/jacocoant.jar"/>
</taskdef>


<path id="jacoco.classpath">
<fileset dir="lib/ant">
<include name="org.jacoco.ant-0.8.8.jar"/>
<include name="org.jacoco.core-0.8.8.jar"/>
<include name="org.jacoco.report-0.8.8.jar"/>
<include name="org.jacoco.agent-0.8.8.jar"/>
<include name="asm-9.2.jar"/>
<include name="asm-tree-9.2.jar"/>
<include name="asm-commons-9.2.jar"/>
</fileset>
</path>

<taskdef uri="antlib:org.jacoco.ant"
resource="org/jacoco/ant/antlib.xml"
classpathref="jacoco.classpath"/>

<target name="test-run" depends="test-compile">
<property name="junit-reports" value="junit-reports" />
<property name="junit-html" value="junit-html" />
<property name="code-coverage-reports" value="code-coverage-reports" />
<delete dir="${junit-reports}" />
<delete dir="${code-coverage-reports}" />
<delete dir="${junit-html}" />

<mkdir dir="${junit-reports}" />
<mkdir dir="${code-coverage-reports}" />

<mkdir dir="${junit-html}" />

<jacoco:coverage destfile="${code-coverage-reports}/jacoco.exec" xmlns:jacoco="antlib:org.jacoco.ant" exclclassloader="sun.reflect.DelegatingClassLoader:javassist.Loader" >
<junit haltonfailure="false" fork="true" forkmode="once">
<jvmarg value="-Xms128m" />
<jvmarg value="-Xmx2048m" />
<!-- Uncomment the following and add additional dashes in front of the arguments to allow Java 9+
<jvmarg value="-add-opens=java.base/java.util=ALL-UNNAMED" />
<jvmarg value="-add-opens=java.base/java.lang=ALL-UNNAMED" />
<jvmarg value="-add-opens=java.base/java.lang.reflect=ALL-UNNAMED" />
<jvmarg value="-add-opens=java.base/java.text=ALL-UNNAMED" />
<jvmarg value="-add-opens=java.desktop/java.awt=ALL-UNNAMED" />
<jvmarg value="-add-opens=java.desktop/java.awt.font=ALL-UNNAMED" />
<jvmarg value="-add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED" />
-->
<!-- https://stackoverflow.com/questions/54205486 -->
<jvmarg value="-Xshare:off" />
<jvmarg value="--add-exports=java.base/com.sun.crypto.provider=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.base/java.util=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.base/java.lang=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.base/java.lang.reflect=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.base/java.text=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED"/>
<jvmarg value="--add-opens=java.desktop/java.awt=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.desktop/java.awt.font=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.sql/java.sql=ALL-UNNAMED"/>
<jvmarg value="--add-opens=java.sql.rowset/com.sun.rowset=ALL-UNNAMED"/>
<jvmarg value="--add-opens=java.sql.rowset/com.sun.rowset.internal=ALL-UNNAMED"/>
<jvmarg value="--add-opens=java.sql.rowset/com.sun.rowset.providers=ALL-UNNAMED"/>
<jvmarg value="--add-opens=java.sql.rowset/javax.sql.rowset=ALL-UNNAMED"/>
<jvmarg value="--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED" />
<classpath>
<path refid="testclasspath" />
<dirset dir="${test_classes}"/>
Expand All @@ -1321,6 +1342,14 @@
</batchtest>
</junit>
</jacoco:coverage>

<!-- Generate HTML report from JUnit XML output -->
<junitreport todir="${junit-reports}">
<fileset dir="${junit-reports}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit-html}" />
</junitreport>
</target>

<target name="remove-classes" depends="init">
Expand Down
Binary file removed server/lib/ant/ant-header.jar
Binary file not shown.
Binary file added server/lib/ant/asm-9.2.jar
Binary file not shown.
Binary file added server/lib/ant/asm-commons-9.2.jar
Binary file not shown.
Binary file added server/lib/ant/asm-tree-9.2.jar
Binary file not shown.
Binary file removed server/lib/ant/jacocoant.jar
Binary file not shown.
Binary file added server/lib/ant/org.jacoco.agent-0.8.8.jar
Binary file not shown.
Binary file added server/lib/ant/org.jacoco.ant-0.8.8.jar
Binary file not shown.
Binary file added server/lib/ant/org.jacoco.core-0.8.8.jar
Binary file not shown.
Binary file added server/lib/ant/org.jacoco.report-0.8.8.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added server/lib/classgraph-4.8.179.jar
Binary file not shown.
Binary file removed server/lib/classgraph-4.8.53.jar
Binary file not shown.
Binary file removed server/lib/commons/commons-email-1.3.1.jar
Binary file not shown.
Binary file added server/lib/commons/commons-email-1.6.0.jar
Binary file not shown.
Binary file removed server/lib/commons/commons-net-3.3.jar
Binary file not shown.
Binary file added server/lib/commons/commons-net-3.9.0.jar
Binary file not shown.
Binary file added server/lib/commons/commons-vfs2-2.10.0.jar
Binary file not shown.
Binary file removed server/lib/commons/commons-vfs2-2.9.0.jar
Binary file not shown.
Binary file removed server/lib/database/mysql-connector-j-8.2.0.jar
Binary file not shown.
Binary file added server/lib/database/mysql-connector-j-8.4.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed server/lib/jetty/jsp/apache-jsp-9.4.53.v20231009.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,9 @@ private void testMalformedInput(EncryptionSettings encryptionSettings, Object me

// Incorrect algorithm
try {
String wrongAlgorithm = "AES/GCM/NoPadding";
String wrongAlgorithm = "FOO/BAR/BAZ";
if (wrongAlgorithm.equals(encryptionSettings.getEncryptionAlgorithm())) {
wrongAlgorithm = "AES/CBC/PKCS5Padding";
wrongAlgorithm = "FOO/BAR/BAZ";
}
decryptMalformedInput(encryptor, "{alg=" + wrongAlgorithm + ",cs=UTF-8,iv=" + correctIV + "}", encrypted);
fail("Should have thrown an exception");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testResponseData() throws DonkeyElementException {
Response response = dispatcher.send(props, message);
String responseData = response.getMessage();

String expectedResponseString = "<dicom>\n" + "<tag00000900 len=\"2\" tag=\"00000900\" vr=\"IS\">0</tag00000900>\n" + "</dicom>\n" + "";
String expectedResponseString = "<dicom><tag00000900 len=\"2\" tag=\"00000900\" vr=\"IS\">0</tag00000900></dicom>";
DonkeyElement dicom = new DonkeyElement(expectedResponseString);
assertEquals(dicom.toXml(), responseData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Calendar;
Expand Down Expand Up @@ -95,7 +96,7 @@ public void tearDown() throws Exception {
dispatcher.stop();
log("Undeploying TCP Dispatcher...");
dispatcher.onUndeploy();
Thread.sleep(1000);
Thread.sleep(3000);
}
}

Expand All @@ -122,7 +123,7 @@ private void setupDispatcher(TcpDispatcherProperties props) throws Exception {
Thread.sleep(1000);
}

private TcpDispatcherProperties createTcpDispatcherProperties() {
private TcpDispatcherProperties createTcpDispatcherProperties() throws IOException {
TcpDispatcherProperties dispatcherProps = new TcpDispatcherProperties();
dispatcherProps.getTransmissionModeProperties().setPluginPointName("Basic");
FrameModeProperties frameProps = new FrameModeProperties();
Expand Down Expand Up @@ -682,7 +683,7 @@ private static void log(Object message) {

private static void logError(String message) {
if (PRINT_DEBUG_MESSAGES) {
logError(message);
System.out.println(message);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import java.sql.Connection;
Expand Down Expand Up @@ -447,7 +447,7 @@ private void assertReadOnly() {
verify(donkey, times(0)).getDaoFactory();
verify(sqlConfig, times(0)).getSqlSessionManager();
if (connection != null) {
verifyZeroInteractions(connection);
verifyNoInteractions(connection);
}

int count = 0;
Expand All @@ -469,7 +469,7 @@ private void assertWriteOnly() {
verify(donkey, times(0)).getReadOnlyDaoFactory();
verify(sqlConfig, times(0)).getReadOnlySqlSessionManager();
if (readOnlyConnection != null) {
verifyZeroInteractions(readOnlyConnection);
verifyNoInteractions(readOnlyConnection);
}

int count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import java.util.Collections;
Expand Down Expand Up @@ -94,7 +94,7 @@ public void testReAttachMessage2() throws Exception {

String result = new String(attachmentHandlerProvider.reAttachMessage(encoded, connectorMessage, CHARSET, false, false), CHARSET);

verifyZeroInteractions(messageController);
verifyNoInteractions(messageController);

String expected = new StringBuilder("test1${ATTACH:").append(channelId1).append(':').append(messageId1).append(':').append(attachment1.getId()).append("}test2").toString();

Expand Down Expand Up @@ -152,7 +152,7 @@ public void testReAttachMessage5() throws Exception {

String result = new String(attachmentHandlerProvider.reAttachMessage(encoded, connectorMessage, CHARSET, false, false), CHARSET);

verifyZeroInteractions(messageController);
verifyNoInteractions(messageController);

String expected = encoded;

Expand Down Expand Up @@ -210,7 +210,7 @@ public void testReAttachMessage8() throws Exception {

String result = new String(attachmentHandlerProvider.reAttachMessage(encoded, connectorMessage, CHARSET, false, true), CHARSET);

verifyZeroInteractions(messageController);
verifyNoInteractions(messageController);

String expected = encoded;

Expand All @@ -229,7 +229,7 @@ public void testReAttachMessage9() throws Exception {

String result = new String(attachmentHandlerProvider.reAttachMessage(encoded, connectorMessage, CHARSET, false, true), CHARSET);

verifyZeroInteractions(messageController);
verifyNoInteractions(messageController);

String expected = encoded;

Expand Down
Loading