diff --git a/jsystem-archetypes/jsystem-so-archetype/src/main/resources/archetype-resources/pom.xml b/jsystem-archetypes/jsystem-so-archetype/src/main/resources/archetype-resources/pom.xml index 9ae6163c..6fe85ca3 100644 --- a/jsystem-archetypes/jsystem-so-archetype/src/main/resources/archetype-resources/pom.xml +++ b/jsystem-archetypes/jsystem-so-archetype/src/main/resources/archetype-resources/pom.xml @@ -7,8 +7,8 @@ ${jsystem.dependency.version} UTF-8 - 1.8 - 1.8 + 17 + 17 diff --git a/jsystem-archetypes/jsystem-tests-archetype/src/main/resources/archetype-resources/pom.xml b/jsystem-archetypes/jsystem-tests-archetype/src/main/resources/archetype-resources/pom.xml index 4ae9fd87..80223096 100644 --- a/jsystem-archetypes/jsystem-tests-archetype/src/main/resources/archetype-resources/pom.xml +++ b/jsystem-archetypes/jsystem-tests-archetype/src/main/resources/archetype-resources/pom.xml @@ -7,8 +7,8 @@ ${jsystem.dependency.version} UTF-8 - 1.8 - 1.8 + 17 + 17 diff --git a/jsystem-assembly/jsystem-runner/pom.xml b/jsystem-assembly/jsystem-runner/pom.xml index 0c7eb3b1..e22ac780 100644 --- a/jsystem-assembly/jsystem-runner/pom.xml +++ b/jsystem-assembly/jsystem-runner/pom.xml @@ -13,6 +13,25 @@ junit junit + + javax.xml.bind + jaxb-api + + + com.sun.xml.bind + jaxb-core + 2.3.0.1 + + + com.sun.xml.bind + jaxb-impl + 2.3.1 + + + org.javassist + javassist + 3.25.0-GA + ant ant-full @@ -77,11 +96,6 @@ comm - org.apache.ftpserver ftpserver-core @@ -174,8 +188,31 @@ ${project.version} sources - - + + com.fasterxml.jackson.core + jackson-core + 2.15.2 + + + com.fasterxml.jackson.core + jackson-databind + 2.15.2 + + + com.fasterxml.jackson.core + jackson-annotations + 2.15.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.15.2 + + + org.codehaus.woodstox + stax2-api + 4.2.2 + jar @@ -203,4 +240,4 @@ - \ No newline at end of file + diff --git a/jsystem-assembly/jsystem-runner/src/main/assembly/runner.xml b/jsystem-assembly/jsystem-runner/src/main/assembly/runner.xml index 1577c537..c5a19a05 100644 --- a/jsystem-assembly/jsystem-runner/src/main/assembly/runner.xml +++ b/jsystem-assembly/jsystem-runner/src/main/assembly/runner.xml @@ -126,6 +126,12 @@ *:jackson-databind:* *:jackson-annotations:* *:jackson-core:* + *:jackson-dataformat-xml:* + *:stax2-api:* + *:jaxb-api:* + *:jaxb-core:* + *:jaxb-impl:* + *:javassist:* *:difido-reports-common:* @@ -170,4 +176,4 @@ - \ No newline at end of file + diff --git a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/WaitDialog.java b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/WaitDialog.java index 2189dbfb..ec6d51d6 100644 --- a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/WaitDialog.java +++ b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/WaitDialog.java @@ -23,8 +23,6 @@ import javax.swing.JProgressBar; import javax.swing.SwingWorker; -import sun.awt.AppContext; - import jsystem.framework.TestRunnerFrame; /** @@ -177,9 +175,6 @@ public synchronized static void launchWaitDialog(final String title, final WaitD /* * Execute the open of the dialog in a thread as the dialog is modal */ - // This line suppose to fix bug in the SwingWorker that causes deadlocks - // in some of the Java versions. Please see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6880336 - AppContext.getAppContext().put(SwingWorker.class, Executors.newCachedThreadPool()); dialog = new WaitDialog(TestRunnerFrame.guiMainFrame, listener, title); class RunWaitDiaolg extends SwingWorker { public String doInBackground() { diff --git a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/agents/AgentsDialog.java b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/agents/AgentsDialog.java index d7a38fb5..91958a9a 100644 --- a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/agents/AgentsDialog.java +++ b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/agents/AgentsDialog.java @@ -145,7 +145,7 @@ public void initDialog() throws Exception { } private void buildAgentsListTableModel() throws Exception { - Vector model = new Vector(); + Vector> model = new Vector>(); RunnerEngine[] clients = JSystemAgentClientsPool.getClients(null); for (RunnerEngine client : clients) { Vector clientRow = getJSystemAgentDataVector(client, false); @@ -231,7 +231,7 @@ private void refreshUrl(String url, ProgressNotifier notifier, int progress) { } class AgentListTableModel extends DefaultTableModel { - AgentListTableModel(Vector model, Vector columns) { + AgentListTableModel(Vector> model, Vector columns) { super(model, columns); } diff --git a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/params/AgentsSelectionDialog.java b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/params/AgentsSelectionDialog.java index 301803b3..6d7de82b 100644 --- a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/params/AgentsSelectionDialog.java +++ b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/params/AgentsSelectionDialog.java @@ -85,7 +85,7 @@ public void initDialog(String[] selectedUrls) throws Exception { } private void buildAgentsListTableModel() throws Exception { - Vector model = new Vector(); + Vector> model = new Vector>(); JSystemAgentClient[] clients = (JSystemAgentClient[]) JSystemAgentClientsPool.getClients(null); for (JSystemAgentClient client : clients) { Vector clientRow = getJSystemAgentDataVector(client); @@ -132,7 +132,7 @@ public String[] getSelectedUrls() { class AgentSelectTableModel extends DefaultTableModel { private static final long serialVersionUID = 1L; - AgentSelectTableModel(Vector model, Vector columns) { + AgentSelectTableModel(Vector> model, Vector columns) { super(model, columns); } diff --git a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/teststable/ScenarioTreeNode.java b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/teststable/ScenarioTreeNode.java index ef6b6867..f86c1a98 100644 --- a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/teststable/ScenarioTreeNode.java +++ b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/teststable/ScenarioTreeNode.java @@ -88,7 +88,7 @@ public boolean isLeaf() { return (!isJTestContainer() || ScenarioHelpers.isScenarioAsTestAndNotRoot(getTest())); } - public Enumeration children() { + public Enumeration children() { Vector elements = new Vector(); Vector tests = null; if (isJTestContainer()) { diff --git a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/AssetNode.java b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/AssetNode.java index ec8b88e8..401f54f8 100644 --- a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/AssetNode.java +++ b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/AssetNode.java @@ -88,7 +88,7 @@ public AssetNode(AssetNode parent, Object userObject) { public AssetNode(){ isSelected = false; if (children == null) { - children = new Vector(); + children = new Vector(); } } @@ -246,7 +246,7 @@ protected void initChildren(Object[] child) throws Exception { } } if("true".equals(JSystemProperties.getInstance().getPreferenceOrDefault(FrameworkOptions.SORT_ASSETS_TREE))){ - Collections.sort(children); + Collections.sort(children, null); } } diff --git a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/TestCaseNode.java b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/TestCaseNode.java index 60b22736..74ffff8f 100644 --- a/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/TestCaseNode.java +++ b/jsystem-core-projects/jsystemApp/src/main/java/jsystem/treeui/tree/TestCaseNode.java @@ -36,7 +36,7 @@ public TestCaseNode(AssetNode parent, Class userObject) throws Exception { createJUnit4TestNodes(userObject); } if("true".equals(JSystemProperties.getInstance().getPreferenceOrDefault(FrameworkOptions.SORT_ASSETS_TREE))){ - Collections.sort(children); + Collections.sort(children, null); } } diff --git a/jsystem-core-projects/jsystemCore/pom.xml b/jsystem-core-projects/jsystemCore/pom.xml index b2050501..e66636ec 100644 --- a/jsystem-core-projects/jsystemCore/pom.xml +++ b/jsystem-core-projects/jsystemCore/pom.xml @@ -74,6 +74,32 @@ xml-apis xml-apis + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + javax.xml.bind + jaxb-api + 2.3.1 + + + org.glassfish.jaxb + jaxb-runtime + 2.3.1 + @@ -84,4 +110,4 @@ run - \ No newline at end of file + diff --git a/jsystem-core-projects/jsystemCore/src/main/java/jsystem/extensions/report/junit/JUnitReporter.java b/jsystem-core-projects/jsystemCore/src/main/java/jsystem/extensions/report/junit/JUnitReporter.java index 5311e896..1384e8de 100644 --- a/jsystem-core-projects/jsystemCore/src/main/java/jsystem/extensions/report/junit/JUnitReporter.java +++ b/jsystem-core-projects/jsystemCore/src/main/java/jsystem/extensions/report/junit/JUnitReporter.java @@ -134,7 +134,7 @@ private static FailureOrError buildFailureOrError(Throwable throwable) { } /** - * Exports the model to XML. The file will be copies to the JSystem root + * Exports the model to XML. The file will be copied to the JSystem root * directory. */ public void toXml() { diff --git a/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/Encryptor.java b/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/Encryptor.java index ae79afb8..bc0b11a0 100644 --- a/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/Encryptor.java +++ b/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/Encryptor.java @@ -3,6 +3,7 @@ */ package jsystem.utils; +import java.util.Base64; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; @@ -48,7 +49,7 @@ public static String encrypt(String str) throws Exception { byte[] enc = ecipher.doFinal(utf8); // Encode bytes to base64 to get a string - return (new sun.misc.BASE64Encoder().encode(enc))+ENCRYPTION_TERMINATING_STRING; + return Base64.getEncoder().encode(enc)+ENCRYPTION_TERMINATING_STRING; } /** @@ -70,7 +71,7 @@ public static String decrypt(String str) throws Exception { ecipher.init(Cipher.ENCRYPT_MODE, key); dcipher.init(Cipher.DECRYPT_MODE, key); // Decode base64 to get bytes - byte[] dec = new sun.misc.BASE64Decoder().decodeBuffer(str); + byte[] dec = Base64.getDecoder().decode(str); // Decrypt byte[] utf8 = dcipher.doFinal(dec); diff --git a/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/MailUtil.java b/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/MailUtil.java index 760be81e..a4345c14 100644 --- a/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/MailUtil.java +++ b/jsystem-core-projects/jsystemCore/src/main/java/jsystem/utils/MailUtil.java @@ -4,7 +4,7 @@ package jsystem.utils; import java.io.File; -import java.security.Security; + import java.util.ArrayList; import java.util.Properties; @@ -169,8 +169,6 @@ public void sendMail(String title,String msgContent) throws Exception { props.put("mail.smtp.socketFactory.fallback", "false"); } - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - props.put("mail.smtp.host", smtpHostName); props.put("mail.debug", isDebug + ""); diff --git a/jsystem-core-projects/pom.xml b/jsystem-core-projects/pom.xml index 4a9c317e..e1249592 100644 --- a/jsystem-core-projects/pom.xml +++ b/jsystem-core-projects/pom.xml @@ -20,5 +20,31 @@ jsystemAgent jsystemApp - - \ No newline at end of file + + + com.fasterxml.jackson.core + jackson-core + 2.15.2 + + + com.fasterxml.jackson.core + jackson-databind + 2.15.2 + + + com.fasterxml.jackson.core + jackson-annotations + 2.15.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.15.2 + + + javax.xml.bind + jaxb-api + 2.3.1 + + + diff --git a/jsystem-miscellaneous/jsystem-maven-plugin/pom.xml b/jsystem-miscellaneous/jsystem-maven-plugin/pom.xml index fd4cb8fd..1dcc3258 100644 --- a/jsystem-miscellaneous/jsystem-maven-plugin/pom.xml +++ b/jsystem-miscellaneous/jsystem-maven-plugin/pom.xml @@ -60,6 +60,22 @@ 2.0.2 provided + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + diff --git a/jsystem-miscellaneous/jsystem-maven-plugin/src/main/java/org/jsystemtest/plugin/SurefireReporter.java b/jsystem-miscellaneous/jsystem-maven-plugin/src/main/java/org/jsystemtest/plugin/SurefireReporter.java index 63c7840d..31c67d3a 100644 --- a/jsystem-miscellaneous/jsystem-maven-plugin/src/main/java/org/jsystemtest/plugin/SurefireReporter.java +++ b/jsystem-miscellaneous/jsystem-maven-plugin/src/main/java/org/jsystemtest/plugin/SurefireReporter.java @@ -2,7 +2,7 @@ import java.io.File; import java.io.IOException; -import java.io.StringWriter; + import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; @@ -11,12 +11,12 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; import jsystem.extensions.report.xml.XmlReporter; import jsystem.framework.report.ExtendTestListener; @@ -146,12 +146,10 @@ private static FailureOrError buildFailureOrError(Throwable throwable) { public void toXml() { testSuite.setTime(getTimeDeltaInSec(testSuiteStart)); try { - JAXBContext context = JAXBContext.newInstance(testSuite.getClass()); - Marshaller marshaller = context.createMarshaller(); - StringWriter sw = new StringWriter(); - marshaller.marshal(testSuite, sw); - FileUtils.write(logFolderName + File.separator + logFileName, sw.toString()); - FileUtils.write(logFileName, sw.toString()); + XmlMapper xmlMapper = new XmlMapper(); + String xmlString = xmlMapper.writeValueAsString(testSuite); + FileUtils.write(logFolderName + File.separator + logFileName, xmlString); + FileUtils.write(logFileName, xmlString); } catch (Exception e) { log.log(Level.SEVERE, "Failed to export report to XML", e); } @@ -182,7 +180,7 @@ static class TestCase { private FailureOrError error; - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public String getName() { return name; } @@ -191,7 +189,7 @@ public void setName(String name) { this.name = name; } - @XmlAttribute(name = "classname") + @JacksonXmlProperty(isAttribute = true, localName = "classname") public String getClassName() { return className; } @@ -200,7 +198,7 @@ public void setClassName(String className) { this.className = className; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public float getTime() { return time; } @@ -209,7 +207,7 @@ public void setTime(float time) { this.time = time; } - @XmlElement + @JsonProperty public FailureOrError getFailure() { return failure; } @@ -218,7 +216,7 @@ public void setFailure(FailureOrError failure) { this.failure = failure; } - @XmlElement + @JsonProperty public FailureOrError getError() { return error; } @@ -229,7 +227,7 @@ public void setError(FailureOrError error) { } - @XmlRootElement(name = "testsuite") + @JacksonXmlRootElement(localName = "testsuite") static class TestSuite { private int errors; @@ -244,7 +242,8 @@ static class TestSuite { private String timeStamp; - @XmlElement(name = "testcase") + @JacksonXmlElementWrapper(useWrapping = false) + @JsonProperty("testcase") protected List testCaseList = new ArrayList(); public TestCase getLastTestCase() { @@ -264,7 +263,7 @@ public void addTestCase(TestCase testCase) { testCaseList.add(testCase); } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public int getErrors() { return errors; } @@ -273,7 +272,7 @@ public void addError() { errors++; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public int getFailures() { return failures; } @@ -282,7 +281,7 @@ public void setFailures(int failures) { this.failures = failures; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public String getHostName() { return hostName; } @@ -291,7 +290,7 @@ public void setHostName(String hostName) { this.hostName = hostName; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public String getName() { return name; } @@ -300,12 +299,12 @@ public void setName(String name) { this.name = name; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public String getTimeStamp() { return timeStamp; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public float getTime() { return time; } @@ -318,7 +317,7 @@ public void setTimeStamp(String timeStamp) { this.timeStamp = timeStamp; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public int getTests() { return testCaseList.size(); } @@ -330,7 +329,7 @@ static class FailureOrError { private String message; private String type; - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public String getMessage() { return message; } @@ -339,7 +338,7 @@ public void setMessage(String message) { this.message = message; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true) public String getType() { return type; } @@ -348,7 +347,7 @@ public void setType(String type) { this.type = type; } - @XmlValue + @JacksonXmlText public String getValue() { return value; } diff --git a/jsystem-parent/pom.xml b/jsystem-parent/pom.xml index 9b4e5b80..af6573e0 100644 --- a/jsystem-parent/pom.xml +++ b/jsystem-parent/pom.xml @@ -29,8 +29,8 @@ UTF-8 dir https://maven.top-q.co.il - 1.8 - 1.8 + 17 + 17 @@ -46,7 +46,6 @@ junit 4.13.1 - javax.mail mail @@ -209,6 +208,31 @@ xml-apis 1.4.01 + + com.fasterxml.jackson.core + jackson-core + 2.15.2 + + + com.fasterxml.jackson.core + jackson-databind + 2.15.2 + + + com.fasterxml.jackson.core + jackson-annotations + 2.15.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.15.2 + + + javax.xml.bind + jaxb-api + 2.3.1 +