From 633f8db93033b0fbe32c2adadfd8f254a0b1c21d Mon Sep 17 00:00:00 2001 From: Mike Saravayskiy Date: Mon, 11 Jan 2016 14:17:56 +0300 Subject: [PATCH 1/6] Added empty wrappers, realised that api does not support what i need, going there --- .../plugins/testlink/result/BuildWrapper.java | 9 +++++++++ .../testlink/result/TestPlanWrapper.java | 20 +++++++++++++++++++ .../plugins/testlink/util/TestLinkHelper.java | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 src/main/java/hudson/plugins/testlink/result/BuildWrapper.java create mode 100644 src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java diff --git a/src/main/java/hudson/plugins/testlink/result/BuildWrapper.java b/src/main/java/hudson/plugins/testlink/result/BuildWrapper.java new file mode 100644 index 0000000..4433814 --- /dev/null +++ b/src/main/java/hudson/plugins/testlink/result/BuildWrapper.java @@ -0,0 +1,9 @@ +package hudson.plugins.testlink.result; + +import java.io.Serializable; + +/** + * Created by saravm1 on 11.01.2016. + */ +public class BuildWrapper implements Serializable { +} diff --git a/src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java b/src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java new file mode 100644 index 0000000..cf986ab --- /dev/null +++ b/src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java @@ -0,0 +1,20 @@ +package hudson.plugins.testlink.result; + +import br.eti.kinoshita.testlinkjavaapi.model.CustomField; +import br.eti.kinoshita.testlinkjavaapi.model.TestPlan; +import sun.reflect.generics.reflectiveObjects.NotImplementedException; + +import java.io.Serializable; +import java.util.List; + +/** + * Created by saravm1 on 11.01.2016. + */ +public class TestPlanWrapper implements Serializable{ + + private TestPlan testplan; + + public List getCustomFields(){ + throw new NotImplementedException(); + } +} diff --git a/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java b/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java index 8385642..035c069 100644 --- a/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java +++ b/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java @@ -52,6 +52,8 @@ public final class TestLinkHelper { // Environment Variables names. private static final String TESTLINK_TESTCASE_PREFIX = "TESTLINK_TESTCASE_"; + private static final String TESTLINK_TESTPLAN_PREFIX = "TESTLINK_TESTPLAN_"; + private static final String TESTLINK_BUILD_PREFIX = "TESTLINK_BUILD_"; private static final String TESTLINK_TESTCASE_STEP_PREFIX = "TESTLINK_TESTCASE_STEP_"; private static final String TESTLINK_TESTCASE_ID_ENVVAR = "TESTLINK_TESTCASE_ID"; private static final String TESTLINK_TESTCASE_NAME_ENVVAR = "TESTLINK_TESTCASE_NAME"; From 0de8b42f5be7d3e3c04046a6ca1dade4353dad62 Mon Sep 17 00:00:00 2001 From: Mike Saravayskiy Date: Wed, 13 Jan 2016 15:04:19 +0300 Subject: [PATCH 2/6] Added support for Testplan custom fields accessible during iterative build steps --- pom.xml | 9 +++- .../testlink/AbstractTestLinkBuilder.java | 38 ++++++++++++++-- .../plugins/testlink/TestLinkBuilder.java | 34 ++++++++------ .../hudson/plugins/testlink/TestLinkSite.java | 14 +++++- .../plugins/testlink/result/BuildWrapper.java | 9 ---- .../testlink/result/TestPlanWrapper.java | 20 --------- .../plugins/testlink/util/TestLinkHelper.java | 45 +++++++++++++++++-- .../testlink/TestLinkBuilder/config.jelly | 6 ++- .../TestLinkBuilder/config.properties | 1 + 9 files changed, 123 insertions(+), 53 deletions(-) delete mode 100644 src/main/java/hudson/plugins/testlink/result/BuildWrapper.java delete mode 100644 src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java diff --git a/pom.xml b/pom.xml index 24dc4bf..f6f71cd 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ testlink Jenkins TestLink Plugin - 3.12-SNAPSHOT + 3.13-SNAPSHOT hpi This plug-in integrates Jenkins to TestLink @@ -271,7 +271,7 @@ br.eti.kinoshita testlink-java-api - 1.9.7-0 + 1.9.13-3-SNAPSHOT org.mockito @@ -287,6 +287,11 @@ + + in-project + In Project Repo + file://${project.basedir}/libs + repo.jenkins-ci.org http://repo.jenkins-ci.org/public/ diff --git a/src/main/java/hudson/plugins/testlink/AbstractTestLinkBuilder.java b/src/main/java/hudson/plugins/testlink/AbstractTestLinkBuilder.java index 347a556..da96a96 100644 --- a/src/main/java/hudson/plugins/testlink/AbstractTestLinkBuilder.java +++ b/src/main/java/hudson/plugins/testlink/AbstractTestLinkBuilder.java @@ -77,6 +77,11 @@ public class AbstractTestLinkBuilder extends Builder { */ protected final String customFields; + /** + * Comma separated list of custom fields to download from TestLink. + */ + protected final String testPlanCustomFields; + /** * List of build steps that are executed only once per job execution. */ @@ -138,7 +143,7 @@ public class AbstractTestLinkBuilder extends Builder { * Create a AbstractTestLinkBuilder. */ public AbstractTestLinkBuilder(String testLinkName, String testProjectName, String testPlanName, - String platformName, String buildName, String customFields, List singleBuildSteps, + String platformName, String buildName, String customFields, String testPlanCustomFields, List singleBuildSteps, List beforeIteratingAllTestCasesBuildSteps, List iterativeBuildSteps, List afterIteratingAllTestCasesBuildSteps, Boolean transactional, Boolean failedTestsMarkBuildAsFailure, Boolean failIfNoResults, Boolean failOnNotRun, @@ -150,6 +155,7 @@ public AbstractTestLinkBuilder(String testLinkName, String testProjectName, Stri this.platformName = platformName; this.buildName = buildName; this.customFields = customFields; + this.testPlanCustomFields = testPlanCustomFields; this.singleBuildSteps = singleBuildSteps; this.beforeIteratingAllTestCasesBuildSteps = beforeIteratingAllTestCasesBuildSteps; this.iterativeBuildSteps = iterativeBuildSteps; @@ -182,13 +188,13 @@ public AbstractTestLinkBuilder(String testLinkName, String testProjectName, Stri * @deprecated */ public AbstractTestLinkBuilder(String testLinkName, String testProjectName, String testPlanName, - String platformName, String buildName, String customFields, Boolean executionStatusNotRun, + String platformName, String buildName, String customFields, String testPlanCustomFields, Boolean executionStatusNotRun, Boolean executionStatusPassed, Boolean executionStatusFailed, Boolean executionStatusBlocked, List singleBuildSteps, List beforeIteratingAllTestCasesBuildSteps, List iterativeBuildSteps, List afterIteratingAllTestCasesBuildSteps, Boolean transactional, Boolean failedTestsMarkBuildAsFailure, Boolean failIfNoResults, Boolean failOnNotRun, List resultSeekers) { - this(testLinkName, testProjectName, testPlanName, platformName, buildName, customFields, singleBuildSteps, + this(testLinkName, testProjectName, testPlanName, platformName, buildName, customFields, testPlanCustomFields, singleBuildSteps, beforeIteratingAllTestCasesBuildSteps, iterativeBuildSteps, afterIteratingAllTestCasesBuildSteps, transactional, failedTestsMarkBuildAsFailure, failIfNoResults, failOnNotRun, resultSeekers); } @@ -230,6 +236,10 @@ public String getCustomFields() { return this.customFields; } + public String getTestPlanCustomFields(){ + return this.testPlanCustomFields; + } + /** * @deprecated */ @@ -361,4 +371,26 @@ protected String[] createArrayOfCustomFieldsNames(final VariableResolver return customFieldNamesArray; } + + protected String[] createArrayOfTestPlanCustomFieldsNames(final VariableResolver variableResolver, + final EnvVars envVars){ + String[] customFieldNamesArray = new String[0]; + String customFields = expandVariable(variableResolver, envVars, this.getTestPlanCustomFields()); + + if (StringUtils.isNotBlank(customFields)) { + StringTokenizer tokenizer = new StringTokenizer(customFields, COMMA); + if (tokenizer.countTokens() > 0) { + customFieldNamesArray = new String[tokenizer.countTokens()]; + int index = 0; + while (tokenizer.hasMoreTokens()) { + String customFieldName = tokenizer.nextToken(); + customFieldName = customFieldName.trim(); + customFieldNamesArray[index] = customFieldName; + index = index + 1; + } + } + } + + return customFieldNamesArray; + } } diff --git a/src/main/java/hudson/plugins/testlink/TestLinkBuilder.java b/src/main/java/hudson/plugins/testlink/TestLinkBuilder.java index 204fda2..31da11f 100644 --- a/src/main/java/hudson/plugins/testlink/TestLinkBuilder.java +++ b/src/main/java/hudson/plugins/testlink/TestLinkBuilder.java @@ -82,7 +82,7 @@ public class TestLinkBuilder extends AbstractTestLinkBuilder { * @deprecated */ public TestLinkBuilder(String testLinkName, String testProjectName, - String testPlanName, String buildName, String customFields, + String testPlanName, String buildName, String customFields, String testPlanCustomFields, Boolean executionStatusNotRun, Boolean executionStatusPassed, Boolean executionStatusFailed, Boolean executionStatusBlocked, List singleBuildSteps, @@ -92,7 +92,7 @@ public TestLinkBuilder(String testLinkName, String testProjectName, Boolean transactional, Boolean failedTestsMarkBuildAsFailure, Boolean failIfNoResults, List resultSeekers) { super(testLinkName, testProjectName, testPlanName, buildName, - null, customFields, executionStatusNotRun, executionStatusPassed, + null, customFields, testPlanCustomFields, executionStatusNotRun, executionStatusPassed, executionStatusFailed, executionStatusBlocked, singleBuildSteps, beforeIteratingAllTestCasesBuildSteps, iterativeBuildSteps, afterIteratingAllTestCasesBuildSteps, transactional, @@ -104,7 +104,7 @@ public TestLinkBuilder(String testLinkName, String testProjectName, * @deprecated */ public TestLinkBuilder(String testLinkName, String testProjectName, - String testPlanName, String buildName, String customFields, + String testPlanName, String buildName, String customFields, String testPlanCustomFields, Boolean executionStatusNotRun, Boolean executionStatusPassed, Boolean executionStatusFailed, Boolean executionStatusBlocked, List singleBuildSteps, @@ -114,7 +114,7 @@ public TestLinkBuilder(String testLinkName, String testProjectName, Boolean transactional, Boolean failedTestsMarkBuildAsFailure, Boolean failIfNoResults, Boolean failOnNotRun, List resultSeekers) { super(testLinkName, testProjectName, testPlanName, buildName, null, - customFields, executionStatusNotRun, executionStatusPassed, + customFields, testPlanCustomFields, executionStatusNotRun, executionStatusPassed, executionStatusFailed, executionStatusBlocked, singleBuildSteps, beforeIteratingAllTestCasesBuildSteps, iterativeBuildSteps, afterIteratingAllTestCasesBuildSteps, transactional, @@ -123,7 +123,7 @@ public TestLinkBuilder(String testLinkName, String testProjectName, @DataBoundConstructor public TestLinkBuilder(String testLinkName, String testProjectName, - String testPlanName, String platformName, String buildName, String customFields, + String testPlanName, String platformName, String buildName, String customFields, String testPlanCustomFields, Boolean executionStatusNotRun, Boolean executionStatusPassed, Boolean executionStatusFailed, Boolean executionStatusBlocked, List singleBuildSteps, @@ -133,7 +133,7 @@ public TestLinkBuilder(String testLinkName, String testProjectName, Boolean transactional, Boolean failedTestsMarkBuildAsFailure, Boolean failIfNoResults, Boolean failOnNotRun, List resultSeekers) { super(testLinkName, testProjectName, testPlanName, platformName, buildName, - customFields, singleBuildSteps, beforeIteratingAllTestCasesBuildSteps, iterativeBuildSteps, + customFields, testPlanCustomFields, singleBuildSteps, beforeIteratingAllTestCasesBuildSteps, iterativeBuildSteps, afterIteratingAllTestCasesBuildSteps, transactional, failedTestsMarkBuildAsFailure, failIfNoResults, failOnNotRun, resultSeekers); } @@ -163,6 +163,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, final TestCaseWrapper[] automatedTestCases; final String testLinkUrl = installation.getUrl(); final String testLinkDevKey = installation.getDevKey(); + TestPlan testPlan; listener.getLogger().println(Messages.TestLinkBuilder_UsedTLURL(testLinkUrl)); try { @@ -188,9 +189,13 @@ public boolean perform(AbstractBuild build, Launcher launcher, if (StringUtils.isNotBlank(platformName) && testLinkSite.getPlatform() == null) listener.getLogger().println(Messages.TestLinkBuilder_PlatformNotFound(platformName)); - final String[] customFieldsNames = this.createArrayOfCustomFieldsNames(build.getBuildVariableResolver(), build.getEnvironment(listener)); + final String[] testCaseCustomFieldsNames = this.createArrayOfCustomFieldsNames(build.getBuildVariableResolver(), build.getEnvironment(listener)); // Array of automated test cases - TestCase[] testCases = testLinkSite.getAutomatedTestCases(customFieldsNames); + TestCase[] testCases = testLinkSite.getAutomatedTestCases(testCaseCustomFieldsNames); + + final String[] testPlanCustomFieldsNames = this.createArrayOfTestPlanCustomFieldsNames(build.getBuildVariableResolver(), build.getEnvironment(listener)); + + testPlan = testLinkSite.getTestPlanWithCustomFields(testPlanCustomFieldsNames); // Transforms test cases into test case wrappers automatedTestCases = this.transform(testCases); @@ -219,10 +224,10 @@ public boolean perform(AbstractBuild build, Launcher launcher, } listener.getLogger().println(Messages.TestLinkBuilder_ExecutingSingleBuildSteps()); - this.executeSingleBuildSteps(automatedTestCases.length, testLinkSite, build, launcher, listener); + this.executeSingleBuildSteps(automatedTestCases.length, testPlan, testLinkSite, build, launcher, listener); listener.getLogger().println(Messages.TestLinkBuilder_ExecutingIterativeBuildSteps()); - this.executeIterativeBuildSteps(automatedTestCases, testLinkSite, build, launcher, listener); + this.executeIterativeBuildSteps(automatedTestCases, testPlan, testLinkSite, build, launcher, listener); // Here we search for test results. The return if a wrapped Test Case // that @@ -308,7 +313,7 @@ public TestLinkSite getTestLinkSite(String testLinkUrl, String testLinkDevKey, final TestProject testProject = api.getTestProjectByName(testProjectName); final TestPlan testPlan = api.getTestPlanByName(testPlanName, testProjectName); - + Platform platform = null; if (StringUtils.isNotBlank(platformName)){ final Platform platforms[] = api.getProjectPlatforms(testProject.getId()); @@ -335,7 +340,7 @@ public TestLinkSite getTestLinkSite(String testLinkUrl, String testLinkDevKey, * @throws IOException * @throws InterruptedException */ - protected void executeSingleBuildSteps(int numberOfTests, TestLinkSite testLinkSite, AbstractBuild build, + protected void executeSingleBuildSteps(int numberOfTests, TestPlan testPlan, TestLinkSite testLinkSite, AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException { if (singleBuildSteps != null) { @@ -343,7 +348,7 @@ protected void executeSingleBuildSteps(int numberOfTests, TestLinkSite testLinkS final EnvVars iterativeEnvVars = TestLinkHelper.buildTestCaseEnvVars( numberOfTests, testLinkSite.getTestProject(), - testLinkSite.getTestPlan(), + testPlan, testLinkSite.getBuild(), listener); build.addAction(new EnvironmentContributingAction() { @@ -385,6 +390,7 @@ public String getDisplayName() { * @throws IOException */ protected void executeIterativeBuildSteps(TestCaseWrapper[] automatedTestCases, + TestPlan testPlan, TestLinkSite testLinkSite, AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException { @@ -405,7 +411,7 @@ protected void executeIterativeBuildSteps(TestCaseWrapper[] automatedTestCases, if (iterativeBuildSteps != null) { final EnvVars iterativeEnvVars = TestLinkHelper.buildTestCaseEnvVars(automatedTestCase, testLinkSite.getTestProject(), - testLinkSite.getTestPlan(), + testPlan, testLinkSite.getBuild(), listener); build.addAction(new EnvironmentContributingAction() { diff --git a/src/main/java/hudson/plugins/testlink/TestLinkSite.java b/src/main/java/hudson/plugins/testlink/TestLinkSite.java index a73d998..342f251 100644 --- a/src/main/java/hudson/plugins/testlink/TestLinkSite.java +++ b/src/main/java/hudson/plugins/testlink/TestLinkSite.java @@ -169,7 +169,19 @@ public TestCase[] getAutomatedTestCases(String[] customFieldsNames) { return filteredTestcases.toArray(new TestCase[filteredTestcases.size()]); } - + + public TestPlan getTestPlanWithCustomFields(String[] customFieldNames){ + TestPlan testPlan = getTestPlan(); + for(String customFieldName: customFieldNames){ + final CustomField customField = this.api.getTestPlanCustomFieldDesignValue(testPlan.getId(), + getTestProject().getId(), + customFieldName, + ResponseDetails.FULL); + testPlan.getCustomFields().add(customField); + } + return testPlan; + } + /** * Updates the test cases status in TestLink (note and status) and * uploads any existing attachments. diff --git a/src/main/java/hudson/plugins/testlink/result/BuildWrapper.java b/src/main/java/hudson/plugins/testlink/result/BuildWrapper.java deleted file mode 100644 index 4433814..0000000 --- a/src/main/java/hudson/plugins/testlink/result/BuildWrapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package hudson.plugins.testlink.result; - -import java.io.Serializable; - -/** - * Created by saravm1 on 11.01.2016. - */ -public class BuildWrapper implements Serializable { -} diff --git a/src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java b/src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java deleted file mode 100644 index cf986ab..0000000 --- a/src/main/java/hudson/plugins/testlink/result/TestPlanWrapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package hudson.plugins.testlink.result; - -import br.eti.kinoshita.testlinkjavaapi.model.CustomField; -import br.eti.kinoshita.testlinkjavaapi.model.TestPlan; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; - -import java.io.Serializable; -import java.util.List; - -/** - * Created by saravm1 on 11.01.2016. - */ -public class TestPlanWrapper implements Serializable{ - - private TestPlan testplan; - - public List getCustomFields(){ - throw new NotImplementedException(); - } -} diff --git a/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java b/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java index 035c069..a7279e2 100644 --- a/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java +++ b/src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java @@ -183,11 +183,17 @@ public static Map createTestLinkEnvironmentVariables(TestCaseWra testLinkEnvVar.put( TESTLINK_TESTPLAN_NAME_ENVVAR, StringUtils.defaultIfEmpty(testPlan.getName(), "")); testLinkEnvVar.put( TESTLINK_TESTPROJECT_NAME_ENVVAR, StringUtils.defaultIfEmpty(testProject.getName(), "")); - List customFields = testCase.getCustomFields(); - for (CustomField customField : customFields) { + List testCaseCustomFields = testCase.getCustomFields(); + for (CustomField customField : testCaseCustomFields) { addCustomFieldEnvironmentVariableName( customField, testLinkEnvVar ); } + List testPlanCustomFields = testPlan.getCustomFields(); + + for(CustomField customField: testPlanCustomFields){ + addTestPlanCustomFieldEnvironmentVariableName(customField, testLinkEnvVar); + } + List steps = testCase.getSteps(); testLinkEnvVar.put(TESTLINK_TESTCASE_STEP_PREFIX + "TOTAL", Integer.toString(steps.size())); for (TestCaseStep step : steps) { @@ -273,7 +279,40 @@ public static void addCustomFieldEnvironmentVariableName(CustomField customField } } } - + + public static void addTestPlanCustomFieldEnvironmentVariableName(CustomField customField, Map testLinkEnvVar){ + String customFieldName = customField.getName(); + String customFieldValue = customField.getValue(); + + customFieldName = customFieldName.toUpperCase(); // uppercase + customFieldName = customFieldName.trim(); // trim + customFieldName = TESTLINK_TESTPLAN_PREFIX + customFieldName; // add prefix + customFieldName = customFieldName.replaceAll( "\\s+", "_" ); // replace white spaces + + testLinkEnvVar.put(customFieldName, customFieldValue); + + if (StringUtils.isNotBlank( customFieldValue )) { + StringTokenizer tokenizer = new StringTokenizer(customFieldValue, ","); + if (tokenizer.countTokens() > 1) { + int index = 0; + while (tokenizer.hasMoreTokens()) { + String token = tokenizer.nextToken(); + token = token.trim(); + + customFieldName = customField.getName(); + customFieldName = customFieldName.toUpperCase(); // uppercase + customFieldName = customFieldName.trim(); // trim + + String tokenName = TESTLINK_TESTPLAN_PREFIX + customFieldName + "_" + index; // add prefix + tokenName = tokenName.replaceAll( "\\s+", "_" ); // replace white spaces + + testLinkEnvVar.put(tokenName, token); + ++index; + } + } + } + } + /** * Creates EnvVars for a TestLink Test Case. * diff --git a/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.jelly b/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.jelly index 3546a65..bca4008 100644 --- a/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.jelly +++ b/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.jelly @@ -28,7 +28,11 @@ - + + + + + diff --git a/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.properties b/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.properties index 6b58666..d5b9d21 100644 --- a/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.properties +++ b/src/main/resources/hudson/plugins/testlink/TestLinkBuilder/config.properties @@ -4,6 +4,7 @@ Test\ Plan\ Name=Test Plan Name Platform\ Name=Platform Name Build\ Name=Build Name Custom\ Fields=Custom Fields +Test\ Plan\ Custom\ Fields=Test Plan Custom Fields Key\ Custom\ Field=Key Custom Field Execution\ Status=Execution Status Not\ Run=Not Run From 125c35edc4543a5ba1ba43a828484af7f9d3211a Mon Sep 17 00:00:00 2001 From: Mike Saravayskiy Date: Thu, 14 Apr 2016 13:09:37 +0300 Subject: [PATCH 3/6] updated testlink-java-api version to new mvn repo release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f6f71cd..cc3728d 100644 --- a/pom.xml +++ b/pom.xml @@ -271,7 +271,7 @@ br.eti.kinoshita testlink-java-api - 1.9.13-3-SNAPSHOT + 1.9.14-0 org.mockito From f025a6d6d6174f3bd9bebab5a6f25bc8ab83cd03 Mon Sep 17 00:00:00 2001 From: Mike Saravayskiy Date: Thu, 14 Apr 2016 13:11:28 +0300 Subject: [PATCH 4/6] removed local repo reference --- pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pom.xml b/pom.xml index cc3728d..ba9170c 100644 --- a/pom.xml +++ b/pom.xml @@ -287,11 +287,6 @@ - - in-project - In Project Repo - file://${project.basedir}/libs - repo.jenkins-ci.org http://repo.jenkins-ci.org/public/ From 09892421d6cd0876e4541de82c8b822ebd8ef7d4 Mon Sep 17 00:00:00 2001 From: Mike Saravayskiy Date: Thu, 14 Apr 2016 14:01:09 +0300 Subject: [PATCH 5/6] changed lib version after fix --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d166401..ebf3548 100644 --- a/pom.xml +++ b/pom.xml @@ -271,7 +271,7 @@ br.eti.kinoshita testlink-java-api - 1.9.14-0-SNAPSHOT + 1.9.14-0 org.hamcrest From fb3ce3caeae59d8b45d92a9362428621e3fcea50 Mon Sep 17 00:00:00 2001 From: Mike Saravayskiy Date: Thu, 14 Apr 2016 14:20:24 +0300 Subject: [PATCH 6/6] fixed tests considering new TestLinkBuilder constructor param (debatable move, might have created additional constructor, but I think it is unnecessary ) --- .../java/hudson/plugins/testlink/TestTestLinkBuilder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/hudson/plugins/testlink/TestTestLinkBuilder.java b/src/test/java/hudson/plugins/testlink/TestTestLinkBuilder.java index a404413..0393d1f 100644 --- a/src/test/java/hudson/plugins/testlink/TestTestLinkBuilder.java +++ b/src/test/java/hudson/plugins/testlink/TestTestLinkBuilder.java @@ -60,7 +60,7 @@ public class TestTestLinkBuilder { @Before public void setUp() throws Exception { builder = new TestLinkBuilder("No testlink", "No project", "No plan", "No platform", "No build", - "class, time, sample-job-$BUILD_ID", Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, null, + "class, time, sample-job-$BUILD_ID", "host, user",Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, null, null, null, null, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, null); } @@ -129,7 +129,7 @@ public void testGetters() { List singleBuildSteps = new ArrayList(); singleBuildSteps.add(shell); - builder = new TestLinkBuilder("No testlink", "No project", "No plan", "No platform", "No build", "class, time", + builder = new TestLinkBuilder("No testlink", "No project", "No plan", "No platform", "No build", "class, time", "host, user", Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, singleBuildSteps, null, null, null, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, null); @@ -160,6 +160,9 @@ public void testGetters() { assertNotNull(builder.getCustomFields()); assertEquals(builder.getCustomFields(), "class, time"); + assertNotNull(builder.getTestPlanCustomFields()); + assertEquals(builder.getTestPlanCustomFields(), "host, user"); + assertFalse(builder.getTransactional()); assertFalse(builder.getFailIfNoResults()); assertFalse(builder.getFailOnNotRun());