From d9bef97f30eed33c71bb7f6b70fa44c706f3167c Mon Sep 17 00:00:00 2001 From: NShitrit Date: Thu, 9 Dec 2021 15:48:53 +0200 Subject: [PATCH] defect #1446091: use common XML mapper output factory that will be common for all Team city CI version, upgrade to latest SDK version --- build/pom.xml | 2 +- plugin/pom.xml | 4 ++-- .../plugins/jetbrains/teamcity/OctaneTeamCityPlugin.java | 6 ++++-- .../jetbrains/teamcity/TeamCityPluginServicesImpl.java | 2 +- .../testrunner/TeamCityTestsToRunConverterBuilder.java | 4 +++- pom.xml | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build/pom.xml b/build/pom.xml index 4e17fac..1ae9260 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -5,7 +5,7 @@ teamcity-ci-plugin-suite com.hpe.adm.octane.ciplugins - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT teamcity-ci-plugin-build diff --git a/plugin/pom.xml b/plugin/pom.xml index 800fbbf..7c0a917 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -22,7 +22,7 @@ teamcity-ci-plugin-suite com.hpe.adm.octane.ciplugins - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT @@ -89,7 +89,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.13 + 2.7.1.33 javax.servlet diff --git a/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/OctaneTeamCityPlugin.java b/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/OctaneTeamCityPlugin.java index 9058d69..6e0c31e 100644 --- a/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/OctaneTeamCityPlugin.java +++ b/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/OctaneTeamCityPlugin.java @@ -20,6 +20,8 @@ * Created by lazara on 23/12/2015. */ +import com.ctc.wstx.stax.WstxInputFactory; +import com.ctc.wstx.stax.WstxOutputFactory; import com.hp.octane.integrations.OctaneConfiguration; import com.hp.octane.integrations.OctaneSDK; import com.hp.octane.integrations.dto.DTOFactory; @@ -75,8 +77,8 @@ private void initPlugin() throws Exception { buildServer.registerExtension(ServerExtension.class, PLUGIN_NAME, this); SDKBasedLoggerProvider.configure(TeamCityPluginServicesImpl.getAllowedOctaneStorage(buildServerEx)); - //remove prefix zdef from attribures , for example zdef-322307361:started="1618753398313" - DTOFactory.getInstance().getXMLMapper().getFactory().getXMLOutputFactory().setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, false); + //Common Xml mapper factory that used on recent Team city versions + DTOFactory.getInstance().initXmlMapper(new WstxInputFactory(),new WstxOutputFactory()); logger.info(""); logger.info("**********************************************************************"); diff --git a/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/TeamCityPluginServicesImpl.java b/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/TeamCityPluginServicesImpl.java index 081c83c..fbf78f3 100644 --- a/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/TeamCityPluginServicesImpl.java +++ b/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/TeamCityPluginServicesImpl.java @@ -268,7 +268,7 @@ private InputStream tryHandleExternalTestResults(SBuildType buildType, SBuild bu } - GherkinUtils.aggregateGherkinFilesToMqmResultFile(files, mqmFilePath, jobId, buildId); + GherkinUtils.aggregateGherkinFilesToMqmResultFile(files, mqmFilePath, jobId, buildId, DTOFactory.getInstance()); final InputStream targetStream = new DataInputStream(new FileInputStream(mqmFilePath)); return targetStream; } else { diff --git a/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/testrunner/TeamCityTestsToRunConverterBuilder.java b/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/testrunner/TeamCityTestsToRunConverterBuilder.java index 0aed7b3..14b3cb0 100644 --- a/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/testrunner/TeamCityTestsToRunConverterBuilder.java +++ b/plugin/src/main/java/com/hp/octane/plugins/jetbrains/teamcity/testrunner/TeamCityTestsToRunConverterBuilder.java @@ -4,6 +4,8 @@ import com.hp.octane.integrations.executor.TestsToRunConvertersFactory; import com.hp.octane.integrations.executor.TestsToRunFramework; +import java.util.HashMap; + public class TeamCityTestsToRunConverterBuilder { public final static String TESTS_TO_RUN_PARAMETER = "testsToRun"; public final static String TESTING_FRAMEWORK_PARAMETER = "Testing_framework"; @@ -18,6 +20,6 @@ public TeamCityTestsToRunConverterBuilder(){ } public TestsToRunConverterResult convert(String rawTests, String executingDirectory){ - return TestsToRunConvertersFactory.createConverter(testsToRunFramework).convert(rawTests, executingDirectory); + return TestsToRunConvertersFactory.createConverter(testsToRunFramework).convert(rawTests, executingDirectory,new HashMap<>()); } } diff --git a/pom.xml b/pom.xml index 7d6a926..cbe3f38 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.hpe.adm.octane.ciplugins teamcity-ci-plugin-suite - 1.4.0-SNAPSHOT + 1.4.1-SNAPSHOT pom ALM Octane teamcity plugin suite