From cc60dfa90ccdb0212452b8f0b8be6420e379fec7 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 4 Jan 2017 15:57:01 +0800 Subject: [PATCH 0001/2502] fixed JENKINS-39469, now "do not archive report" works properly. --- .../automation/tools/results/RunResultRecorder.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java index e9670927e9..44527c5f14 100644 --- a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java @@ -87,6 +87,7 @@ import java.util.Map; import java.util.TreeMap; +import static com.hp.application.automation.tools.model.ResultsPublisherModel.dontArchiveResults; import static com.hp.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNode; import static com.hp.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNodeAttr; @@ -286,6 +287,10 @@ private void archiveTestsReport( "Report archiving mode is set to: " + _resultsPublisherModel.getArchiveTestResultsMode()); + // if user specified not to archive report + if (_resultsPublisherModel.getArchiveTestResultsMode().equals(dontArchiveResults.getValue())) + return; + FilePath projectWS = runWorkspace; // get the artifacts directory where we will upload the zipped report From a5885ef218bf208f5f54ca69e89977a4a7d02409 Mon Sep 17 00:00:00 2001 From: YafimK Date: Mon, 6 Mar 2017 18:22:53 +0200 Subject: [PATCH 0002/2502] Update temporary development version to 5.2-beta-snapshot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f70605330..991c927cf3 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ hp-application-automation-tools-plugin - 5.1 + 5.2-beta-SNAPSHOT hpi HP Application Automation Tools The plugin integrates Jenkins with the following HPE products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. From f320257037d72233f0e2a6d1c5027d040f4dccc9 Mon Sep 17 00:00:00 2001 From: The Codacy Badger Date: Sat, 18 Mar 2017 19:07:05 +0000 Subject: [PATCH 0003/2502] Add Codacy badge --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index c2ff0335c8..9f0edd9f71 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,9 @@ ![HPE LOGO](https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Hewlett_Packard_Enterprise_logo.svg/200px-Hewlett_Packard_Enterprise_logo.svg.png) # HPE automation plugin for Jenkins CI + +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ec4415bffe94fda8ae40415388c063e)](https://www.codacy.com/app/HPEbot/hp-application-automation-tools-plugin?utm_source=github.com&utm_medium=referral&utm_content=hpsa/hp-application-automation-tools-plugin&utm_campaign=badger) + ##### The plugin provides the ability to run HPE products with Jenkins during builds. ## Relevent links From 9e88a993b845381208d269ff85606f7d2a68d6e2 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 2 Mar 2017 13:38:16 +0200 Subject: [PATCH 0004/2502] fix string related to help of ui location --- .../OctaneServerSettingsBuilder/global.properties | 2 +- .../OctaneServerSettingsBuilder/help-uiLocation.html | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties b/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties index db84c07ff0..7fb02ae20e 100644 --- a/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties +++ b/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties @@ -15,6 +15,6 @@ global.config.test.connection.progress=Connecting the ALM Octane server... global.config.impersonatedUser.title=Jenkins user global.config.impersonatedUser.description=The user to impersonate (Jobs will be executed on behalf of this user) -global.config.dynamic.instanceId.title=Show plugin instance id +global.config.dynamic.instanceId.title=Show plugin instance ID global.config.instanceId.title=Instance id global.config.instanceId.description=An ID to uniquely identify this instance of the plugin. \ No newline at end of file diff --git a/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/help-uiLocation.html b/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/help-uiLocation.html index bbb0799742..00d18be14b 100644 --- a/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/help-uiLocation.html +++ b/src/main/resources/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder/help-uiLocation.html @@ -1,3 +1,13 @@
-Login into the ALM Octane application and copy & paste the location from your browser. + + The URL of the ALM Octane server, using its fully qualified domain name (FQDN). +
+ Use the following format (port number is optional): http://ALM_Octane_Host_Name / IP_address {:port number}/ui/?p=sharedSpaceID +
+
+ Example: http://myServer.myCompany.com:8081/ui/?p=1002 +
+
+ Tip: You can copy the URL from the address bar of the browser in which you opened ALM Octane. +
From b31de2930242c4a4ff2a1adce50a2f307cc5c2b6 Mon Sep 17 00:00:00 2001 From: leviy Date: Thu, 2 Mar 2017 13:45:57 +0200 Subject: [PATCH 0005/2502] user story #218040: fix ignored tests --- pom.xml | 16 +++++++--------- .../client/JenkinsMqmRestClientFactoryImpl.java | 2 +- .../tools/octane/events/EventsService.java | 13 +------------ .../settings/OctaneServerSettingsBuilder.java | 3 --- .../octane/configuration/ConfigApiTest.java | 16 ---------------- .../configuration/ConfigurationServiceTest.java | 5 +---- .../tools/octane/events/EventsTest.java | 5 +++-- .../tools/octane/tests/TestDispatcherTest.java | 3 +-- 8 files changed, 14 insertions(+), 49 deletions(-) diff --git a/pom.xml b/pom.xml index 991c927cf3..f7610fb86c 100644 --- a/pom.xml +++ b/pom.xml @@ -261,15 +261,7 @@ 2.19.1 - **/ConfigApiTest.java - **/ConfigurationServiceTest.java - **/JUnitResultsTest.java - **/TestApiTest.java - **/TestDispatcherTest.java - **/BuildActionsFreeStyleTest.java - **/GherkinResultsTest.java - **/TestNGExtensionTest.java - + **/TestJenkinsDurationTest.java @@ -435,6 +427,12 @@ true + + org.jenkins-ci.plugins + git-client + 1.19.6 + + org.jenkins-ci.plugins.pipeline-stage-view pipeline-rest-api diff --git a/src/main/java/com/hp/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java b/src/main/java/com/hp/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java index b65c2d6f18..084425ec6b 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java @@ -38,7 +38,7 @@ public class JenkinsMqmRestClientFactoryImpl implements JenkinsMqmRestClientFactory { private static final Logger logger = LogManager.getLogger(JenkinsMqmRestClientFactoryImpl.class); private static final String CLIENT_TYPE = "HPE_CI_CLIENT"; - private static MqmRestClient mqmRestClient; + private MqmRestClient mqmRestClient; @Override public synchronized MqmRestClient obtain(String location, String sharedSpace, String username, Secret password) { diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/EventsService.java b/src/main/java/com/hp/application/automation/tools/octane/events/EventsService.java index 36bf0e8d67..633609418c 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/EventsService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/EventsService.java @@ -42,22 +42,11 @@ public final class EventsService implements ConfigurationListener { private static final Logger logger = LogManager.getLogger(EventsService.class); - private static EventsService extensionInstance; private JenkinsMqmRestClientFactory clientFactory; private EventsClient eventsClient; public static EventsService getExtensionInstance() { - if (extensionInstance == null) { - List extensions = Jenkins.getInstance().getExtensionList(EventsService.class); - if (extensions.isEmpty()) { - throw new RuntimeException("events service was not initialized properly"); - } else if (extensions.size() > 1) { - throw new RuntimeException("events service expected to be singleton, found " + extensions.size() + " instances"); - } else { - extensionInstance = extensions.get(0); - } - } - return extensionInstance; + return Jenkins.getInstance().getExtensionList(EventsService.class).get(0); } public void updateClient(ServerConfiguration conf) { diff --git a/src/main/java/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder.java b/src/main/java/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder.java index babfb32f22..c7efd23728 100644 --- a/src/main/java/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/settings/OctaneServerSettingsBuilder.java @@ -46,9 +46,6 @@ public class OctaneServerSettingsBuilder extends Builder { private static final Logger logger = LogManager.getLogger(OctaneServerSettingsBuilder.class); - @Inject - private static BdiConfigurationFetcher bdiConfigurationFetcher; - @Override public OctaneDescriptorImpl getDescriptor() { return (OctaneDescriptorImpl) super.getDescriptor(); diff --git a/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigApiTest.java b/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigApiTest.java index fe8a4dd4a4..6d90810f98 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigApiTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigApiTest.java @@ -121,22 +121,6 @@ public void testSave() throws Exception { } } - - - - - - - - - - - - - - - - private void checkConfig(JSONObject config, String location, String sharedSpace, String username, Secret password) { // check values returned Assert.assertEquals(location, config.getString("location")); diff --git a/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigurationServiceTest.java b/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigurationServiceTest.java index 9bdc9e3586..e985b78d3e 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigurationServiceTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/configuration/ConfigurationServiceTest.java @@ -26,10 +26,7 @@ import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; import hudson.util.FormValidation; import hudson.util.Secret; -import org.junit.Assert; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; +import org.junit.*; import org.jvnet.hudson.test.JenkinsRule; import org.mockito.Mockito; @SuppressWarnings({"squid:S2699","squid:S3658","squid:S2259","squid:S1872","squid:S2925","squid:S109","squid:S1607","squid:S2701","squid:S2698"}) diff --git a/src/test/java/com/hp/application/automation/tools/octane/events/EventsTest.java b/src/test/java/com/hp/application/automation/tools/octane/events/EventsTest.java index ea43cac981..def8090d6d 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/events/EventsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/events/EventsTest.java @@ -72,7 +72,9 @@ public class EventsTest { static public void beforeClass() throws Exception { String p = System.getProperty("testingServerPort"); try { - if (p != null) testingServerPort = Integer.parseInt(p); + if (p != null) { + testingServerPort = Integer.parseInt(p); + } } catch (NumberFormatException nfe) { logger.info("EVENTS TEST: bad port number format, default port will be used: " + testingServerPort); } @@ -93,7 +95,6 @@ static public void afterClass() throws Exception { } @Test - @Ignore public void testEventsA() throws Exception { configurePlugin(); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java index 1c9f33b960..d4c0d38071 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java @@ -223,11 +223,10 @@ public void testDispatcherSuspended() throws Exception { Assert.assertEquals(1, queue.size()); } - @Ignore @Test public void testDispatchMatrixBuild() throws Exception { MatrixProject matrixProject = rule.createProject(MatrixProject.class, "TestDispatcherMatrix"); - matrixProject.setAxes(new AxisList(new Axis("OS", "Linux", "Windows"))); + matrixProject.setAxes(new AxisList(new Axis("osType", "Linux", "Windows"))); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); From e49826d55789635b45d7c345fc32ebc335aa34e6 Mon Sep 17 00:00:00 2001 From: lazara Date: Sun, 5 Mar 2017 10:40:52 +0200 Subject: [PATCH 0006/2502] defect #249087: Mini Reg Day 12.53.20.90 Commits and tests doesn't appear in Pipeline created from Pipeline under Folder and always in status run --- .../tools/octane/events/RunListenerImpl.java | 31 ++++++------------- .../tools/octane/events/SCMListenerImpl.java | 16 ++-------- .../tools/octane/tests/TestDispatcher.java | 9 +++--- .../octane/tests/build/BuildHandlerUtils.java | 18 +++++++++-- 4 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java index f9b64be5e9..e49f2fe5ae 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java @@ -17,6 +17,7 @@ package com.hp.application.automation.tools.octane.events; import com.google.inject.Inject; +import com.hp.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; import com.hp.octane.integrations.dto.events.CIEventType; @@ -35,8 +36,6 @@ import hudson.model.*; import hudson.model.listeners.RunListener; import jenkins.model.Jenkins; -import org.jenkinsci.plugins.workflow.job.WorkflowJob; -import org.jenkinsci.plugins.workflow.job.WorkflowRun; import javax.annotation.Nonnull; import java.util.Collection; @@ -68,7 +67,7 @@ public void onStarted(final Run r, TaskListener listener) { if (r.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowRun")) { event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.STARTED) - .setProject(JobProcessorFactory.getFlowProcessor(r.getParent()).getJobCiId()) + .setProject(BuildHandlerUtils.getJobCiId(r)) .setBuildCiId(String.valueOf(r.getNumber())) .setNumber(String.valueOf(r.getNumber())) .setStartTime(r.getStartTimeInMillis()) @@ -83,8 +82,8 @@ public void onStarted(final Run r, TaskListener listener) { AbstractBuild build = (AbstractBuild) r; event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.STARTED) - .setProject(getJobCiId(r)) - .setProjectDisplayName(getJobCiId(r)) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) .setBuildCiId(String.valueOf(build.getNumber())) .setNumber(String.valueOf(build.getNumber())) .setStartTime(build.getStartTimeInMillis()) @@ -101,8 +100,8 @@ public void onStarted(final Run r, TaskListener listener) { AbstractBuild build = (AbstractBuild) r; event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.STARTED) - .setProject(getJobCiId(r)) - .setProjectDisplayName(getJobCiId(r)) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) .setBuildCiId(String.valueOf(build.getNumber())) .setNumber(String.valueOf(build.getNumber())) .setStartTime(build.getStartTimeInMillis()) @@ -135,18 +134,18 @@ public void onCompleted(Run r, @Nonnull TaskListener listener) { } CIEvent event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.FINISHED) - .setProject(getJobCiId(r)) - .setProjectDisplayName(getJobCiId(r)) .setBuildCiId(String.valueOf(r.getNumber())) .setNumber(String.valueOf(r.getNumber())) + .setProject(BuildHandlerUtils.getJobCiId(r)) .setStartTime(r.getStartTimeInMillis()) .setEstimatedDuration(r.getEstimatedDuration()) .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) .setResult(result) .setDuration(r.getDuration()); - if (r instanceof AbstractBuild) { - event.setParameters(ParameterProcessors.getInstances(r)); + if(r instanceof AbstractBuild){ + event.setParameters(ParameterProcessors.getInstances(r)) + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)); } if(event!=null){ EventsService.getExtensionInstance().dispatchEvent(event); @@ -212,16 +211,6 @@ private static TopLevelItem getJobFromFolder(String causeJobName) { return null; } - private static String getJobCiId(Run r) { - if (r.getParent() instanceof MatrixConfiguration) { - return JobProcessorFactory.getFlowProcessor(((MatrixRun) r).getParentBuild().getParent()).getJobCiId(); - } - if (r.getParent().getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { - return r.getParent().getName(); - } - return JobProcessorFactory.getFlowProcessor(((AbstractBuild) r).getProject()).getJobCiId(); - } - private static List extractCauses(Run r) { if (r.getParent() instanceof MatrixConfiguration) { return ((MatrixRun) r).getParentBuild().getCauses(); diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java index c7015927b6..84d7e2dc2c 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java @@ -17,6 +17,7 @@ package com.hp.application.automation.tools.octane.events; import com.hp.application.automation.tools.octane.model.processors.scm.SCMProcessor; +import com.hp.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; import com.hp.octane.integrations.dto.events.CIEventType; @@ -84,7 +85,7 @@ else if (r.getParent() instanceof WorkflowJob) { for (SCMData scmData : scmDataList) { event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.SCM) - .setProject(getProjectName(r)) + .setProject(BuildHandlerUtils.getJobCiId(r)) .setBuildCiId(String.valueOf(r.getNumber())) .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) .setNumber(String.valueOf(r.getNumber())) @@ -103,7 +104,7 @@ private void createSCMData(Run r, AbstractBuild build, SCMProcessor scmPro SCMData scmData = scmProcessor.getSCMData(build); event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.SCM) - .setProject(getProjectName(r)) + .setProject(BuildHandlerUtils.getJobCiId(r)) .setBuildCiId(String.valueOf(r.getNumber())) .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) .setNumber(String.valueOf(r.getNumber())) @@ -111,17 +112,6 @@ private void createSCMData(Run r, AbstractBuild build, SCMProcessor scmPro EventsService.getExtensionInstance().dispatchEvent(event); } - private String getProjectName(Run r) { - if (r.getParent() instanceof MatrixConfiguration) { - return ((MatrixRun) r).getParentBuild().getParent().getName(); - } - if ("org.jenkinsci.plugins.workflow.job.WorkflowJob".equals(r.getParent().getClass().getName())) { - return r.getParent().getName(); - } - return ((AbstractBuild) r).getProject().getName(); - } - - private List extractCauses(Run r) { if (r.getParent() instanceof MatrixConfiguration) { return ((MatrixRun) r).getParentBuild().getCauses(); diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java b/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java index e68146a141..7691c276ec 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java @@ -17,6 +17,7 @@ package com.hp.application.automation.tools.octane.tests; import com.google.inject.Inject; +import com.hp.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.mqm.client.MqmRestClient; import com.hp.mqm.client.exception.SharedSpaceNotExistException; import com.hp.mqm.client.exception.FileNotFoundException; @@ -130,14 +131,14 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE continue; } - String jobName; + String jobCiId; if (build instanceof MatrixRun) { - jobName = ((MatrixRun) build).getProject().getParent().getName(); + jobCiId = ((MatrixRun) build).getProject().getParent().getName(); } else { - jobName = build.getParent().getName(); + jobCiId = BuildHandlerUtils.getJobCiId(build);//build.getParent().getName(); } - Boolean needTestResult = client.isTestResultRelevant(ConfigurationService.getModel().getIdentity(), jobName); + Boolean needTestResult = client.isTestResultRelevant(ConfigurationService.getModel().getIdentity(), jobCiId); if (needTestResult) { try { diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtils.java b/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtils.java index a2a065058a..9c26b06588 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtils.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtils.java @@ -2,9 +2,12 @@ package com.hp.application.automation.tools.octane.tests.build; +import com.hp.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; import com.hp.application.automation.tools.octane.workflow.WorkflowBuildAdapter; import com.hp.application.automation.tools.octane.workflow.WorkflowGraphListener; import hudson.FilePath; +import hudson.matrix.MatrixConfiguration; +import hudson.matrix.MatrixRun; import hudson.model.AbstractBuild; import hudson.model.Run; import org.jenkinsci.plugins.workflow.job.WorkflowRun; @@ -21,7 +24,7 @@ public static BuildDescriptor getBuildType(Run build) { } } return new BuildDescriptor( - build.getParent().getName(), + BuildHandlerUtils.getJobCiId(build), build.getParent().getName(), String.valueOf(build.getNumber()), String.valueOf(build.getNumber()), @@ -34,7 +37,7 @@ public static String getProjectFullName(Run build) { return ext.getProjectFullName(build); } } - return build.getParent().getName();//builgetProject().getName(); + return build.getParent().getFullName(); } public static FilePath getWorkspace(Run build){ @@ -75,4 +78,15 @@ public static List getBuildPerWorkspaces(Run build) { return runsList; } } + + public static String getJobCiId(Run r) { + if (r.getParent() instanceof MatrixConfiguration) { + return JobProcessorFactory.getFlowProcessor(((MatrixRun) r).getParentBuild().getParent()).getJobCiId(); + } + if (r.getParent().getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { + return JobProcessorFactory.getFlowProcessor(r.getParent()).getJobCiId(); + } + return JobProcessorFactory.getFlowProcessor(((AbstractBuild) r).getProject()).getJobCiId(); + } + } From f5a2c97064da39217eb3c4c1429bd7e7799f3896 Mon Sep 17 00:00:00 2001 From: lazara Date: Sun, 5 Mar 2017 18:45:38 +0200 Subject: [PATCH 0007/2502] support matrix job inside folder, defect #249087: Mini Reg Day 12.53.20.90 Commits and tests doesn't appear in Pipeline created from Pipeline under Folder and always in status run --- .../tools/octane/tests/TestDispatcher.java | 13 ++----------- .../octane/tests/build/BuildHandlerExtension.java | 2 +- .../octane/tests/build/MatrixBuildExtension.java | 6 +++--- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java b/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java index 7691c276ec..4bd32cf10b 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/TestDispatcher.java @@ -34,7 +34,6 @@ import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; import hudson.Extension; import hudson.FilePath; -import hudson.matrix.MatrixRun; import hudson.model.*; import hudson.util.TimeUnit2; import jenkins.YesNoMaybe; @@ -117,28 +116,20 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE retryModel.success(); } Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); - // AbstractProject project1 = (AbstractProject) Jenkins.getInstance().getItemByFullName(item.getProjectName()); if (project == null) { logger.warn("Project [" + item.getProjectName() + "] no longer exists, pending test results can't be submitted"); queue.remove(); continue; } Run build = project.getBuildByNumber(item.getBuildNumber()); - //AbstractBuild build = project.getBuildByNumber(item.getBuildNumber()); if (build == null) { logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer exists, pending test results can't be submitted"); queue.remove(); continue; } - String jobCiId; - if (build instanceof MatrixRun) { - jobCiId = ((MatrixRun) build).getProject().getParent().getName(); - } else { - jobCiId = BuildHandlerUtils.getJobCiId(build);//build.getParent().getName(); - } - - Boolean needTestResult = client.isTestResultRelevant(ConfigurationService.getModel().getIdentity(), jobCiId); + Boolean needTestResult = client.isTestResultRelevant( + ConfigurationService.getModel().getIdentity(), BuildHandlerUtils.getJobCiId(build)); if (needTestResult) { try { diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerExtension.java b/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerExtension.java index 1bd60b2d41..69234a3488 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerExtension.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerExtension.java @@ -7,7 +7,7 @@ import hudson.model.Hudson; import hudson.model.Run; -public abstract class BuildHandlerExtension implements ExtensionPoint { +abstract class BuildHandlerExtension implements ExtensionPoint { public abstract boolean supports(Run build); diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/build/MatrixBuildExtension.java b/src/main/java/com/hp/application/automation/tools/octane/tests/build/MatrixBuildExtension.java index 2b56568cd4..bb5d837bf3 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/build/MatrixBuildExtension.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/build/MatrixBuildExtension.java @@ -20,6 +20,7 @@ import com.hp.application.automation.tools.octane.model.ModelFactory; import com.hp.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; import hudson.Extension; +import hudson.matrix.MatrixRun; import hudson.model.AbstractBuild; import hudson.model.Run; @@ -39,7 +40,7 @@ public BuildDescriptor getBuildType(Run build) { List parameters = ParameterProcessors.getInstances(build); String subBuildName = ModelFactory.generateSubBuildName(parameters); return new BuildDescriptor( - matrixRun.getRootBuild().getProject().getName(), + BuildHandlerUtils.getJobCiId(build), matrixRun.getRootBuild().getProject().getName(), String.valueOf(build.getNumber()), String.valueOf(build.getNumber()), @@ -48,7 +49,6 @@ public BuildDescriptor getBuildType(Run build) { @Override public String getProjectFullName(Run build) { - AbstractBuild matrixRun = (AbstractBuild) build; - return matrixRun.getRootBuild().getProject().getName() + "/" + matrixRun.getProject().getName(); + return ((MatrixRun)build).getProject().getFullName(); } } From 31111f17dd04484fb85b768d3d095a287ce3133d Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Thu, 9 Mar 2017 14:21:17 +0200 Subject: [PATCH 0008/2502] added ${maven.exec.skip} to jekins-cli exec --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index f7610fb86c..e4b2a931ab 100644 --- a/pom.xml +++ b/pom.xml @@ -225,6 +225,7 @@ -restart --password-file ${id_rsa_file} + ${maven.exec.skip} From 3ab19f072283c5d810f1d1afcd801abbf82568c8 Mon Sep 17 00:00:00 2001 From: radislavB Date: Thu, 16 Mar 2017 15:02:14 +0200 Subject: [PATCH 0009/2502] fixing uft test detection (#18) * fixing uft test detection --- .../octane/actions/UFTParameterFactory.java | 152 ++++++-- .../actions/UFTTestDetectionBuildAction.java | 331 ++++++++++++++---- .../actions/UFTTestDetectionPublisher.java | 11 +- .../octane/actions/dto/AutomatedTest.java | 28 +- .../octane/actions/dto/AutomatedTests.java | 15 +- .../octane/actions/dto/TestFramework.java | 42 +-- .../octane/actions/dto/TestingToolType.java | 37 +- 7 files changed, 454 insertions(+), 162 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java index 01273e7c69..598052923b 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java @@ -17,34 +17,36 @@ package com.hp.application.automation.tools.octane.actions; import com.fasterxml.jackson.databind.ObjectMapper; - import org.apache.poi.poifs.filesystem.*; import org.apache.poi.util.StringUtil; import org.jdom2.Document; import org.jdom2.Element; -import org.jdom2.JDOMFactory; import org.jdom2.input.SAXBuilder; -import org.jdom2.input.sax.SAXHandlerFactory; import org.jdom2.input.sax.XMLReaders; -import java.io.*; -import java.util.ArrayList; -import java.util.List; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.*; /** * This class Converts UFT's Paramters info stored in Resource.mtr file into JSON string */ public class UFTParameterFactory { - private static POIFSFileSystem poiFS; - private static String xmlData = ""; + + private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(UFTParameterFactory.class.getName()); - public static String convertResourceMtrAsJSON(InputStream resourceMtrInputStream) throws IOException { + public static String convertResourceMtrAsJSON(InputStream resourceMtrInputStream) throws IOException { + + //String QTPFileParameterFileName = "resource.mtr"; + //InputStream is = paths.get(0).getParent().child("Action0").child(QTPFileParameterFileName).read(); - //TODO: Check is exists - poiFS = new POIFSFileSystem(resourceMtrInputStream); + POIFSFileSystem poiFS = new POIFSFileSystem(resourceMtrInputStream); DirectoryNode root = poiFS.getRoot(); + String xmlData = ""; for (Entry entry : root) { String name = entry.getName(); @@ -56,24 +58,22 @@ public static String convertResourceMtrAsJSON(InputStream resourceMtrInputStrea poiFS.createDocumentInputStream("ComponentInfo").read(content); String fromUnicodeLE = StringUtil.getFromUnicodeLE(content); xmlData = fromUnicodeLE.substring(fromUnicodeLE.indexOf('<')).replaceAll("\u0000", ""); -// System.out.println(xmlData); } } } + try { - SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, (SAXHandlerFactory) null, (JDOMFactory) null); - Document document = null; - document = saxBuilder.build(new StringReader(xmlData)); - Element classElement = document.getRootElement(); - List studentList = classElement.getChildren(); - ObjectMapper mapper = new ObjectMapper(); - ArrayList uftParameters = new ArrayList(); - UFTParameter uftParameter = new UFTParameter(); - for (int temp = 0; temp < studentList.size(); temp++) { - Element tag = studentList.get(temp); + SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, null, null); + Document document = saxBuilder.build(new StringReader(xmlData)); + Element rootElement = document.getRootElement(); + List rootChildrenElements = rootElement.getChildren(); + ArrayList uftParameters = new ArrayList<>(); + for (int temp = 0; temp < rootChildrenElements.size(); temp++) { + Element tag = rootChildrenElements.get(temp); if ("ArgumentsCollection".equalsIgnoreCase(tag.getName())) { List children = tag.getChildren(); for (int i = 0; i < children.size(); i++) { + UFTParameter uftParameter = new UFTParameter(); Element element = children.get(i); List elements = element.getChildren(); @@ -97,13 +97,15 @@ public static String convertResourceMtrAsJSON(InputStream resourceMtrInputStrea uftParameter.setArgIsExternal(Integer.parseInt(element1.getValue())); break; default: - logger.warning(String.format("Element name %s didn't match any case",element1.getName())); + logger.warning(String.format("Element name %s didn't match any case", element1.getName())); break; } } uftParameters.add(uftParameter); } - return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(uftParameters); + ObjectMapper mapper = new ObjectMapper(); + String result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(uftParameters); + return result; } } } catch (Exception e) { @@ -112,7 +114,109 @@ public static String convertResourceMtrAsJSON(InputStream resourceMtrInputStrea return null; } + public static String convertApiTestXmlsAsJSON(File inputParameters, File outputParameters) throws IOException { + //String testInputParametersFileName = "TestInputParameters.xml"; + //String testOutputParametersFileName = "TestOutputParameters.xml"; + //URI inputParamsUri = paths.get(0).getParent().child(testInputParametersFileName).toURI(); + //URI outputParamsUri = paths.get(0).getParent().child(testOutputParametersFileName).toURI(); + + //File inputParamsFile = new File(inputParamsUri); + //File outputParamsFile = new File(outputParamsUri); + + + List params = new ArrayList<>(); + params.addAll(convertApiTestXmlToArguments(inputParameters, true)); + params.addAll(convertApiTestXmlToArguments(outputParameters, false)); + ObjectMapper mapper = new ObjectMapper(); + String result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(params); + return result; + } + + public static Collection convertApiTestXmlToArguments(File parametersFile, boolean isInputParameters) throws IOException { + + /* + + + + + + + + + + + + + + + + + + + + + + + + 1 + f + + + */ + + try { + SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, null, null); + Document document = saxBuilder.build(parametersFile); + Element rootElement = document.getRootElement(); + + Map uftParametersMap = new HashMap<>(); + List argElements = getHierarchyChildElement(rootElement, "Schema", "schema", "element", "complexType", "sequence").getChildren(); + for (Element argElement : argElements) { + String name = argElement.getAttributeValue("name"); + String type = argElement.getAttributeValue("type").replace("xs:", ""); + int direction = isInputParameters ? 0 : 1; + + UFTParameter parameter = new UFTParameter(); + parameter.setArgName(name); + parameter.setArgType(type); + parameter.setArgDirection(direction); + uftParametersMap.put(parameter.getArgName(), parameter); + } + + //getArg default values + List argDefValuesElements = getHierarchyChildElement(rootElement, "Values", "Arguments").getChildren(); + for (Element argElement : argDefValuesElements) { + UFTParameter parameter = uftParametersMap.get(argElement.getName()); + if (parameter != null) { + parameter.setArgDefaultValue(argElement.getValue()); + } + } + + return uftParametersMap.values(); + } catch (Exception e) { + logger.severe(e.getMessage()); + } + return Collections.emptySet(); + } + + private static Element getHierarchyChildElement(Element root, String... childPath) { + Element parent; + Element found = root; + for (int i = 0; i < childPath.length; i++) { + parent = found; + found = null; + String elementName = childPath[i]; + + for (Element child : parent.getChildren()) { + if (child.getName().equals(elementName)) { + found = child; + break; + } + } + } + return found; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java index 6c7785de5a..9a577b70b4 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java @@ -16,78 +16,210 @@ package com.hp.application.automation.tools.octane.actions; -import com.hp.application.automation.tools.octane.actions.dto.AutomatedTests; -import com.hp.mqm.client.MqmRestClient; import com.hp.application.automation.tools.octane.actions.dto.AutomatedTest; +import com.hp.application.automation.tools.octane.actions.dto.AutomatedTests; +import com.hp.application.automation.tools.octane.actions.dto.TestFramework; +import com.hp.application.automation.tools.octane.actions.dto.TestingToolType; import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; +import com.hp.mqm.client.MqmRestClient; +import com.hp.mqm.client.exception.RequestErrorException; +import com.hp.mqm.client.model.ListItem; +import com.hp.mqm.client.model.PagedList; +import com.hp.mqm.client.model.Test; import hudson.ExtensionList; import hudson.FilePath; import hudson.model.AbstractBuild; import hudson.model.Action; +import hudson.model.BuildListener; +import hudson.plugins.git.GitChangeSet; +import hudson.scm.ChangeLogSet; +import hudson.scm.EditType; import jenkins.model.Jenkins; import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; +import javax.ws.rs.core.Response; +import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Set; +import java.io.UnsupportedEncodingException; +import java.util.*; public class UFTTestDetectionBuildAction implements Action { - private String message; private AbstractBuild build; + private String workspaceId; + private BuildListener buildListener; private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(UFTTestDetectionBuildAction.class.getName()); + + private final String INITIAL_DETECTION_FILE = "INITIAL_DETECTION_FILE.txt"; + private final String STFileExtention = ".st";//api test + private final String QTPFileExtention = ".tsp";//gui test + @Override public String getIconFileName() { - return "/plugin/testExample/img/build-goals.png"; + return "notepad.png"; } @Override public String getDisplayName() { - return "Test Example Build Page"; + return "HP Octane UFT Tests Scanner Report"; } @Override public String getUrlName() { - return "testExampleBA"; + return "uft_report"; } - public String getMessage() { - return this.message; + + public UFTTestDetectionBuildAction(final AbstractBuild build, String workspaceId, BuildListener buildListener) { + this.build = build; + this.workspaceId = workspaceId; + this.buildListener = buildListener; } - public int getBuildNumber() { - return this.build.number; + public void startScanning() { + ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); + MqmRestClient client = createClient(serverConfiguration); + String serverURL = getServerURL(workspaceId, serverConfiguration.sharedSpace, serverConfiguration.location); + + ChangeLogSet changeSet = build.getChangeSet(); + Object[] changeSetItems = changeSet.getItems(); + + + try { + if (!isInitialDetectionDone()) { + printToConsole("Executing initial detection"); + Collection foundTests = doInitialDetection(client, serverURL); + printToConsole(String.format("Found %s tests", foundTests.size())); + } else { + printToConsole("Executing ChangeSetDetection"); + doChangeSetDetection(client, serverURL, changeSetItems); + } + } catch (InterruptedException | IOException e) { + e.printStackTrace(); + } } - public AbstractBuild getBuild() { - return build; + private void printToConsole(String msg) { + buildListener.getLogger().println("UFTTestDetectionBuildAction : " + msg); + logger.info(msg); } - private void findUFTTestsPath(List root, HashMap testData) throws IOException, InterruptedException { - for (FilePath path : root) { - if (path.isDirectory()) { - findUFTTestsPath(path.list(), testData); - } else { - if (path.getName().contains(".tsp")) { - String convertResourceMtrAsJSON = UFTParameterFactory.convertResourceMtrAsJSON(path.getParent().child("Action0").child("Resource.mtr").read()); - testData.put(path.getParent().getName(), convertResourceMtrAsJSON); + private void doChangeSetDetection(MqmRestClient client, String serverURL, Object[] changeSetItems) throws IOException, InterruptedException { + if (changeSetItems.length == 0) { + return; + } + + boolean isGitChanges = changeSetItems[0] instanceof GitChangeSet; + if (!isGitChanges) { + printToConsole(String.format("Expected GitChangeSet but found %s, detection is canceled.", changeSetItems[0].getClass().getName())); + return; + } + + List addedTests = new ArrayList<>(); + List removedTests = new ArrayList<>(); + + for (int i = 0; i < changeSetItems.length; i++) { + GitChangeSet changeSet = (GitChangeSet) changeSetItems[i]; + for (GitChangeSet.Path path : changeSet.getPaths()) { + if (EditType.ADD.equals(path.getEditType())) { + if (isTestMainFilePath(path.getPath())) { + String filePath = build.getWorkspace() + File.separator + path.getPath(); + if (isFileExist(filePath)) { + FilePath testFolder = getTestFolderForTestMainFile(filePath); + scanFileSystemRecursively(build.getWorkspace(), testFolder, addedTests); + } + + } + } else if (EditType.DELETE.equals(path.getEditType())) { + if (isTestMainFilePath(path.getPath())) { + String filePath = build.getWorkspace() + File.separator + path.getPath(); + if (!isFileExist(filePath)) { + FilePath testFolder = getTestFolderForTestMainFile(filePath); + AutomatedTest test = createAutomatedTest(build.getWorkspace(), testFolder); + removedTests.add(test); + } + } + } } } + + postTests(client, serverURL, addedTests); + deleteTests(client, removedTests); + } - private static T getExtension(Class clazz) { - ExtensionList items = Jenkins.getInstance().getExtensionList(clazz); - return items.get(0); + private AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath) throws IOException, InterruptedException { + AutomatedTest test = new AutomatedTest(); + test.setName(dirPath.getName()); + + //set component - relative path from root + String testPath = dirPath.toURI().toString(); + String rootPath = root.toURI().toString(); + String path = testPath.replace(rootPath, ""); + path = StringUtils.strip(path, "\\/"); + String component = path.length() != dirPath.getName().length() ? path.substring(0, path.length() - dirPath.getName().length() - 1) : ""; + test.setComponent(component); + return test; + } + + + private boolean isFileExist(String path) { + File file = new File(path); + return file.exists(); + } + + private boolean isInitialDetectionDone() { + try { + File rootFile = new File(build.getWorkspace().toURI()); + File file = new File(rootFile, INITIAL_DETECTION_FILE); + return file.exists(); + + } catch (Exception e) { + return false; + } + } + + private Collection doInitialDetection(MqmRestClient client, String serverURL) throws IOException, InterruptedException { + List tests = new ArrayList<>(); + + scanFileSystemRecursively(build.getWorkspace(), build.getWorkspace(), tests); + + postTests(client, serverURL, tests); + + + File rootFile = new File(build.getWorkspace().toURI()); + File file = new File(rootFile, INITIAL_DETECTION_FILE); + file.createNewFile(); + + + return tests; + } + + private void scanFileSystemRecursively(FilePath root, FilePath dirPath, List tests) throws IOException, InterruptedException { + List paths = dirPath.list(); + + + //if it test folder - create new test, else drill down to subFolders + if (isUftTestFolder(paths)) { + AutomatedTest test = createAutomatedTest(root, dirPath); + + tests.add(test); + + } else { + for (FilePath path : paths) { + if (path.isDirectory()) { + scanFileSystemRecursively(root, path, tests); + } + } + } } - private MqmRestClient createClient() { - ServerConfiguration configuration = ConfigurationService.getServerConfiguration(); + private MqmRestClient createClient(ServerConfiguration configuration) { JenkinsMqmRestClientFactory clientFactory = getExtension(JenkinsMqmRestClientFactory.class); MqmRestClient client = clientFactory.obtain( configuration.location, @@ -97,53 +229,114 @@ private MqmRestClient createClient() { return client; } - UFTTestDetectionBuildAction(final String message, final AbstractBuild build, String workspaceId) { - this.message = message; - this.build = build; - MqmRestClient client = createClient(); - ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - try { - HashMap uftTestData = new HashMap<>(); - findUFTTestsPath(build.getWorkspace().list(), uftTestData); - ArrayList data = new ArrayList<>(); - AutomatedTests automatedTests = new AutomatedTests(); - - logger.info(uftTestData.toString()); - - Set keys = uftTestData.keySet(); - String[] uftTestNames = keys.toArray(new String[keys.size()]); - for (int i = 0; i < uftTestNames.length; i++) { - String uftTestName = uftTestNames[i]; - AutomatedTest automatedTest = new AutomatedTest(); - // todo: To enable once decided, need to get the ID dynamicly from server. -// automatedTest.setFramework(new TestFramework()); -// automatedTest.setTesting_tool_type(new com.hp.application.automation.tools.jenkins.actions.dto.TestingToolType()); - automatedTest.setName(uftTestName); - data.add(automatedTest); - } - automatedTests.setData(data); - String uftTestJson = JSONObject.fromObject(automatedTests).toString(); - String serverURL = getServerURL(workspaceId, serverConfiguration.sharedSpace, serverConfiguration.location); - JSONObject jsonObject = client.postTest(uftTestJson, uftTestData, serverURL); - for (int i = 0; i < jsonObject.getInt("total_count"); i++) { - String testID = ((JSONObject) jsonObject.getJSONArray("data").get(i)).getString("id"); - String testName = ((JSONObject) jsonObject.getJSONArray("data").get(i)).getString("name"); - try { - String parametersJSON = uftTestData.get(testName); - if (parametersJSON != null) { - client.attachUFTParametersToTest(testID, parametersJSON, serverURL); - } + private void postTests(MqmRestClient client, String serverURL, List tests) throws UnsupportedEncodingException { + if (tests.isEmpty()) { + return; + } - } catch (IOException e) { - logger.severe(e.getMessage()); + completeUftProperties(client, Long.parseLong(workspaceId), tests); + + int BULK_SIZE = 100; + for (int i = 0; i < tests.size(); i += BULK_SIZE) + try { + AutomatedTests data = AutomatedTests.createWithTests(tests.subList(i, Math.min(i + BULK_SIZE, tests.size()))); + String uftTestJson = JSONObject.fromObject(data).toString(); + client.postTest(uftTestJson, null, serverURL); + //JSONObject testObject = (JSONObject) jsonObject.getJSONArray("data").get(0); + + } catch (RequestErrorException e) { + if (e.getStatusCode() != Response.Status.CONFLICT.getStatusCode()) { + throw e; } + //else : the test with the same hash code , so do nothing + } + } + + private void deleteTests(MqmRestClient client, List removedTests) throws UnsupportedEncodingException { + List idsToDelete = new ArrayList<>(); + long workspaceIdAsLong = Long.parseLong(workspaceId); + for (AutomatedTest test : removedTests) { + Map queryFields = new HashMap<>(); + queryFields.put("name", test.getName()); + queryFields.put("component", test.getComponent()); + PagedList foundTests = client.getTests(workspaceIdAsLong, queryFields, Arrays.asList("id")); + if (foundTests.getItems().size() == 1) { + idsToDelete.add(foundTests.getItems().get(0).getId()); } - } catch (InterruptedException | IOException e) { - logger.severe(e.getMessage()); + } + + int BULK_SIZE = 100; + for (int i = 0; i < idsToDelete.size(); i += BULK_SIZE) { + client.deleteTests(workspaceIdAsLong, idsToDelete.subList(i, Math.min(i + BULK_SIZE, idsToDelete.size()))); + } + } + + + private void completeUftProperties(MqmRestClient client, long workspaceId, Collection tests) { + TestingToolType uftTestingTool = getUftTestingTool(client, workspaceId); + TestFramework uftFramework = getUftFramework(client, workspaceId); + for (AutomatedTest test : tests) { + test.setTesting_tool_type(uftTestingTool); + test.setFramework(uftFramework); } } + public boolean isUftTestFolder(List paths) { + for (FilePath path : paths) { + if (path.getName().endsWith(STFileExtention) || path.getName().endsWith(QTPFileExtention)) + return true; + } + + return false; + } + + public boolean isTestMainFilePath(String path) { + String lowerPath = path.toLowerCase(); + boolean isMainFile = lowerPath.endsWith(STFileExtention) || lowerPath.endsWith(QTPFileExtention); + return isMainFile; + } + + public FilePath getTestFolderForTestMainFile(String path) { + if (isTestMainFilePath(path)) { + File file = new File(path); + File parent = file.getParentFile(); + return new FilePath(parent); + } + return null; + } + + + private TestingToolType getUftTestingTool(MqmRestClient client, long workspaceId) { + PagedList testingTools = client.queryListItems("list_node.testing_tool_type", null, workspaceId, 0, 100); + String uftTestingToolLogicalName = "list_node.testing_tool_type.uft"; + + for (ListItem item : testingTools.getItems()) { + if (uftTestingToolLogicalName.equals(item.getLogicalName())) { + return TestingToolType.fromListItem(item); + } + } + return null; + } + + private TestFramework getUftFramework(MqmRestClient client, long workspaceId) { + PagedList testingTools = client.queryListItems("list_node.je.framework", null, workspaceId, 0, 100); + String uftTestingToolLogicalName = "list_node.je.framework.uft"; + + for (ListItem item : testingTools.getItems()) { + if (uftTestingToolLogicalName.equals(item.getLogicalName())) { + return TestFramework.fromListItem(item); + } + } + return null; + } + private String getServerURL(String workspaceId, String sharedspaceId, String location) { return location + "/api/shared_spaces/" + sharedspaceId + "/workspaces/" + workspaceId; } + + private static T getExtension(Class clazz) { + ExtensionList items = Jenkins.getInstance().getExtensionList(clazz); + return items.get(0); + } + } \ No newline at end of file diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java index 97d98579fa..3243f88f14 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java @@ -60,14 +60,9 @@ public UFTTestDetectionPublisher(String workspaceName) { @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { - // This is where you 'build' the project. - // Since this is a dummy, we just say 'hello world' and call that a build. - - // This also shows how you can consult the global configuration of the builder - String message = ""; - - UFTTestDetectionBuildAction buildAction = new UFTTestDetectionBuildAction(message, build, getWorkspaceName()); - build.addAction(buildAction); + UFTTestDetectionBuildAction buildAction = new UFTTestDetectionBuildAction(build, getWorkspaceName(), listener); + buildAction.startScanning(); + //build.addAction(buildAction); return true; } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java index d6e5985272..b0a329bb7a 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java @@ -22,11 +22,10 @@ public class AutomatedTest { private String type = "test"; private String subtype = "test_automated"; - private com.hp.application.automation.tools.octane.actions.dto.TestingToolType testing_tool_type; + private TestingToolType testing_tool_type; private TestFramework framework; private String name; - - public AutomatedTest(){} + private String component; public String getName() { return name; @@ -52,13 +51,6 @@ public void setSubtype(String subtype) { this.subtype = subtype; } - public TestingToolType getTestingToolType() { - return testing_tool_type; - } - - public void setTesting_tool_type(TestingToolType testing_tool_type) { - this.testing_tool_type = testing_tool_type; - } public TestFramework getFramework() { return framework; @@ -67,4 +59,20 @@ public TestFramework getFramework() { public void setFramework(TestFramework framework) { this.framework = framework; } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public TestingToolType getTesting_tool_type() { + return testing_tool_type; + } + + public void setTesting_tool_type(TestingToolType testing_tool_type) { + this.testing_tool_type = testing_tool_type; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTests.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTests.java index 8a2b4c87df..75d00e560d 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTests.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTests.java @@ -1,18 +1,27 @@ package com.hp.application.automation.tools.octane.actions.dto; import java.util.ArrayList; +import java.util.Collection; +import java.util.List; /** * Created by kashbi on 25/09/2016. */ public class AutomatedTests { - private ArrayList data=new ArrayList<>(); - public ArrayList getData() { + private List data = new ArrayList<>(); + + public static AutomatedTests createWithTests(Collection tests) { + AutomatedTests result = new AutomatedTests(); + result.setData(new ArrayList<>(tests)); + return result; + } + + public List getData() { return data; } - public void setData(ArrayList data) { + public void setData(List data) { this.data = data; } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestFramework.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestFramework.java index 1e6e70bc04..d76d6a6b34 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestFramework.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestFramework.java @@ -17,17 +17,25 @@ package com.hp.application.automation.tools.octane.actions.dto; +import com.hp.mqm.client.model.ListItem; + /** * Created by kashbi on 25/09/2016. */ -@SuppressWarnings({"squid:S2699","squid:S3658","squid:S2259","squid:S1872","squid:S2925","squid:S109"}) +@SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"}) public class TestFramework { private String type = "list_node"; - private String logical_name = "list_node.testing_tool_type.uft"; - private String name = "UFT"; - private Integer index = 3; - private Integer id = 1055; - + private String logical_name; + private String name; + private Long id; + + public static TestFramework fromListItem(ListItem item) { + TestFramework type = new TestFramework(); + type.logical_name = item.getLogicalName(); + type.id = item.getId(); + type.name = item.getName(); + return type; + } public String getType() { return type; @@ -41,31 +49,11 @@ public String getLogical_name() { return logical_name; } - public void setLogical_name(String logical_name) { - this.logical_name = logical_name; - } - public String getName() { return name; } - public void setName(String name) { - this.name = name; - } - - public Integer getIndex() { - return index; - } - - public void setIndex(Integer index) { - this.index = index; - } - - public Integer getId() { + public Long getId() { return id; } - - public void setId(Integer id) { - this.id = id; - } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestingToolType.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestingToolType.java index 33d3e862fa..315e01ff94 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestingToolType.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestingToolType.java @@ -16,46 +16,41 @@ package com.hp.application.automation.tools.octane.actions.dto; +import com.hp.mqm.client.model.ListItem; + /** * Created by kashbi on 25/09/2016. */ @SuppressWarnings("squid:S109") public class TestingToolType { private String type = "list_node"; - private String logical_name = "list_node.testing_tool_type.uft"; - private String name = "UFT"; - private Integer index = 4; - private Integer id = 1075; + private String logical_name; + private String name; + private Long id; + + public static TestingToolType fromListItem(ListItem item) { + TestingToolType type = new TestingToolType(); + type.logical_name = item.getLogicalName(); + type.id = item.getId(); + type.name = item.getName(); + return type; + } public String getType() { return type; } - public void setType(String type) { - this.type = type; - } public String getName() { return name; } - public void setName(String name) { - this.name = name; - } - - public Integer getIndex() { - return index; - } - - public void setIndex(Integer index) { - this.index = index; - } - public Integer getId() { + public Long getId() { return id; } - public void setId(Integer id) { - this.id = id; + public String getLogical_name() { + return logical_name; } } From ba5a8fe137223d9289739bf3704632e2b8603423 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Mon, 20 Mar 2017 15:38:21 +0200 Subject: [PATCH 0010/2502] update versions of integrations-sdk and mqm-client --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e4b2a931ab..41ca5dfe5a 100644 --- a/pom.xml +++ b/pom.xml @@ -390,15 +390,15 @@ integrations-sdk - com.hpe.alm.octane.plugins - 1.0 + com.hpe.adm.octane.ciplugins + 1.1 mqm-rest-client - com.hpe.alm.octane.plugins - 1.0 + com.hpe.adm.octane.ciplugins + 1.1 From d5d1aacc578909a420eb8b4fcc0faa72c0ed3bd4 Mon Sep 17 00:00:00 2001 From: franksha Date: Wed, 22 Mar 2017 14:20:43 +0200 Subject: [PATCH 0011/2502] Add support for gherkin formatter version 12.53.22 (along with version 12.53.19) - change the default glob to **/*OctaneGherkinResults.xml --- .../tools/octane/actions/cucumber/CucumberResultsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java b/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java index fedbc7113c..c10a98b6ca 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java @@ -35,7 +35,7 @@ public class CucumberResultsService { public static final String GHERKIN_NGA_RESULTS_XML = "OctaneGherkinResults.xml"; public static final String GHERKIN_NGA_RESULTS = "OctaneGherkinResults"; - public static final String DEFAULT_GLOB = "**/" + GHERKIN_NGA_RESULTS_XML; + public static final String DEFAULT_GLOB = "**/*" + GHERKIN_NGA_RESULTS_XML; private static BuildListener listener; From d43f9f94c83f99ea2afebc73d5bdcb53e7b726ec Mon Sep 17 00:00:00 2001 From: Jackzenko Date: Wed, 22 Mar 2017 21:35:09 +0530 Subject: [PATCH 0012/2502] =?UTF-8?q?fix=20for=20JENKINS-39441=EF=BC=9AHP?= =?UTF-8?q?=20plugin=20doesnt=20fail=20pipeline=20stage=20in=20case=20if?= =?UTF-8?q?=20ALM=20server=20was=20not=20configured=20(#148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixed JENKINS-39441, HP plugin now sets build status to faliure before returning. * Update RunFromAlmBuilder.java --- .../application/automation/tools/run/RunFromAlmBuilder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/hp/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/hp/application/automation/tools/run/RunFromAlmBuilder.java index 13eb0e1dca..35256822a6 100644 --- a/src/main/java/com/hp/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/RunFromAlmBuilder.java @@ -136,6 +136,10 @@ public void perform(Run build, FilePath workspace, Launcher launcher, if (almServerSettingsModel == null) { listener.fatalError("An ALM server is not defined. Go to Manage Jenkins->Configure System and define your ALM server under Application Lifecycle Management"); + + // set pipeline stage as failure in case if ALM server was not configured + build.setResult(Result.FAILURE); + return; } From fb1dc42545633e4505479c4110acf219292666ee Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Wed, 22 Mar 2017 18:05:59 +0200 Subject: [PATCH 0013/2502] Fix for an issue with using LoadRuner with underscore in the name (#156) * Fix to issue with error watching performance reports in Jenkins in case you use scenario with underscore in the name. * code conventions fixes * code conventions fixes * code conventions fixes --- .../results/PerformanceJobReportAction.java | 2 +- .../tools/results/RunResultRecorder.java | 135 ++++++++++-------- 2 files changed, 77 insertions(+), 60 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/results/PerformanceJobReportAction.java b/src/main/java/com/hp/application/automation/tools/results/PerformanceJobReportAction.java index d396c67dd6..a7ec91d4b3 100644 --- a/src/main/java/com/hp/application/automation/tools/results/PerformanceJobReportAction.java +++ b/src/main/java/com/hp/application/automation/tools/results/PerformanceJobReportAction.java @@ -59,7 +59,7 @@ public PerformanceJobReportAction(Run build, LrJobResults resultFiles) { } /** - * Merge results of several runs - espcially useful in pipeline jobs with multiple LR steps + * Merge results of several runs - especially useful in pipeline jobs with multiple LR steps * * @param resultFiles the result files */ diff --git a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java index e9670927e9..de58f73d4e 100644 --- a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java @@ -110,8 +110,8 @@ public class RunResultRecorder extends Recorder implements Serializable, MatrixA private static final String REPORTMETADATE_XML = "report_metadata.xml"; private static final String TRANSACTION_SUMMARY_FOLDER = "TransactionSummary"; private static final String TRANSACTION_REPORT_NAME = "Report3"; - public static final String SLA_ACTUAL_VALUE_LABEL = "ActualValue"; - public static final String SLA_GOAL_VALUE_LABEL = "GoalValue"; + private static final String SLA_ACTUAL_VALUE_LABEL = "ActualValue"; + private static final String SLA_GOAL_VALUE_LABEL = "GoalValue"; public static final String SLA_ULL_NAME = "FullName"; public static final String ARCHIVING_TEST_REPORTS_FAILED_DUE_TO_XML_PARSING_ERROR = "Archiving test reports failed due to xml parsing error: "; @@ -304,9 +304,9 @@ private void archiveTestsReport( */ // add previous report names for aggregation when using pipelines. - for (SuiteResult suiteResult : testResult.getSuites()) { - String[] temp = suiteResult.getName().split("_"); - reportNames.add(temp[temp.length - 1]); + PerformanceJobReportAction performanceJobReportAction = build.getAction(PerformanceJobReportAction.class); + if (performanceJobReportAction != null){ + reportNames.addAll(performanceJobReportAction.getLrResultBuildDataset().getLrScenarioResults().keySet()); } for (String resultsFilePath : resultFiles) { @@ -332,6 +332,9 @@ private void archiveTestsReport( continue; } String testFolderPath = testSuiteElement.getAttribute("name"); + int testPathArr = testFolderPath.lastIndexOf('\\'); + String testName = testFolderPath.substring(testPathArr + 1); + reportNames.add(testName); String testStatus = ("0".equals(testSuiteElement.getAttribute("failures"))) ? "pass" : "fail"; Node testCaseNode = testSuiteElement.getElementsByTagName("testcase").item(0); @@ -364,9 +367,13 @@ private void archiveTestsReport( try { FilePath testSla = copyRunReport(reportFolder, build.getRootDir(), testFolder.getName()); - runReportList.add(testSla); + if(testSla == null){ + listener.getLogger().println("no RunReport.xml file was created"); + } else { + runReportList.add(testSla); + } } catch (IOException | InterruptedException e) { - listener.getLogger().println(e.getMessage()); + listener.getLogger().println(e); } } } @@ -648,8 +655,17 @@ private Boolean collectAndPrepareHtmlReports(Run build, TaskListener listener, L return true; } + /** + * Copies the run report from the executing node to the Jenkins master for processing. + * @param reportFolder + * @param buildDir + * @param scenarioName + * @return + * @throws IOException + * @throws InterruptedException + */ private FilePath copyRunReport(FilePath reportFolder, File buildDir, String - scenerioName) + scenarioName) throws IOException, InterruptedException { FilePath slaReportFilePath = new FilePath(reportFolder, "RunReport.xml"); if (slaReportFilePath.exists()) { @@ -668,13 +684,13 @@ private FilePath copyRunReport(FilePath reportFolder, File buildDir, String tmpZipFile.unzip(slaDirectoryFilePath); FilePath slaFile = new FilePath(slaDirectoryFilePath, "RunReport.xml"); slaFile.getBaseName(); - slaFile.renameTo(new FilePath(slaDirectoryFilePath, scenerioName + ".xml")); + slaFile.renameTo(new FilePath(slaDirectoryFilePath, scenarioName + ".xml")); - slaFile = new FilePath(slaDirectoryFilePath, scenerioName + ".xml"); + slaFile = new FilePath(slaDirectoryFilePath, scenarioName + ".xml"); return slaFile; } - throw (new IOException("no RunReport.xml file was created")); + return null; } private boolean archiveFolder(FilePath reportFolder, @@ -841,58 +857,60 @@ private void outputReportFiles(List reportNames, File reportDirectory, T writer.close(); File indexFile = new File(reportDirectory, REPORT_INDEX_NAME); - writer = new BufferedWriter(new FileWriter(indexFile)); - - Iterator resultIterator = null; - if ((testResult != null) && (!testResult.getSuites().isEmpty())) { - resultIterator = testResult.getSuites().iterator();//get the first - } - for (String report : reportNames) { - SuiteResult suitResult = null; - if ((resultIterator != null) && resultIterator.hasNext()) { - suitResult = resultIterator.next(); + try { + writer = new BufferedWriter(new FileWriter(indexFile)); + Iterator resultIterator = null; + if ((testResult != null) && (!testResult.getSuites().isEmpty())) { + resultIterator = testResult.getSuites().iterator();//get the first } - if (suitResult == null) { - writer.write(report + "\t##\t##\t##%n"); - } else { - int iDuration = (int) suitResult.getDuration(); - StringBuilder bld = new StringBuilder(); - String duration = ""; - if ((iDuration / SECS_IN_DAY) > 0) { - bld.append(String.format("%dday ", iDuration / SECS_IN_DAY)); - iDuration = iDuration % SECS_IN_DAY; - } - if ((iDuration / SECS_IN_HOUR) > 0) { - bld.append(String.format("%02dhr ", iDuration / SECS_IN_HOUR)); - iDuration = iDuration % SECS_IN_HOUR; - } else if (!duration.isEmpty()) { - bld.append("00hr "); - } - if ((iDuration / SECS_IN_MINUTE) > 0) { - bld.append(String.format("%02dmin ", iDuration / SECS_IN_MINUTE)); - iDuration = iDuration % SECS_IN_MINUTE; - } else if (!duration.isEmpty()) { - bld.append("00min "); + for (String report : reportNames) { + SuiteResult suitResult = null; + if ((resultIterator != null) && resultIterator.hasNext()) { + suitResult = resultIterator.next(); } - bld.append(String.format("%02dsec", iDuration)); - duration = bld.toString(); - int iPassCount = 0; - int iFailCount = 0; - for (Iterator i = suitResult.getCases().iterator(); i.hasNext(); ) { - CaseResult caseResult = (CaseResult) i.next(); - iPassCount += caseResult.getPassCount(); - iFailCount += caseResult.getFailCount(); + if (suitResult == null) { + writer.write(report + "\t##\t##\t##%n"); + } else { + int iDuration = (int) suitResult.getDuration(); + StringBuilder bld = new StringBuilder(); + String duration = ""; + if ((iDuration / SECS_IN_DAY) > 0) { + bld.append(String.format("%dday ", iDuration / SECS_IN_DAY)); + iDuration = iDuration % SECS_IN_DAY; + } + if ((iDuration / SECS_IN_HOUR) > 0) { + bld.append(String.format("%02dhr ", iDuration / SECS_IN_HOUR)); + iDuration = iDuration % SECS_IN_HOUR; + } else if (!duration.isEmpty()) { + bld.append("00hr "); + } + if ((iDuration / SECS_IN_MINUTE) > 0) { + bld.append(String.format("%02dmin ", iDuration / SECS_IN_MINUTE)); + iDuration = iDuration % SECS_IN_MINUTE; + } else if (!duration.isEmpty()) { + bld.append("00min "); + } + bld.append(String.format("%02dsec", iDuration)); + duration = bld.toString(); + int iPassCount = 0; + int iFailCount = 0; + for (Iterator i = suitResult.getCases().iterator(); i.hasNext(); ) { + CaseResult caseResult = (CaseResult) i.next(); + iPassCount += caseResult.getPassCount(); + iFailCount += caseResult.getFailCount(); + } + writer.write( + String.format("%s\t%s\t%d\t%d%n", + report, + duration, + iPassCount, + iFailCount)); } - writer.write( - String.format("%s\t%s\t%d\t%d%n", - report, - duration, - iPassCount, - iFailCount)); } + } finally { + writer.flush(); + writer.close(); } - writer.flush(); - writer.close(); } /** @@ -992,7 +1010,6 @@ private JobLrScenarioResult parseScenarioResults(FilePath slaFilePath) DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(slaFilePath.read()); -// doc.getDocumentElement().normalize(); processSLA(jobLrScenarioResult, doc); processLrScenarioStats(jobLrScenarioResult, doc); From 5c3e59f5e09f163ac87a1772cd0c22dc0beeb5f1 Mon Sep 17 00:00:00 2001 From: Jackzenko Date: Wed, 22 Mar 2017 21:36:24 +0530 Subject: [PATCH 0014/2502] UFT ALM MC Jenkins should use same fields names (#153) --- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index e8560581fc..06f1621102 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -20,10 +20,10 @@ public class GuiTestRunner : IFileSysTestRunner { // Setting keys for mobile private const string MOBILE_HOST_ADDRESS = "ALM_MobileHostAddress"; - private const string MOBILE_HOST_PORT = "MobileHostPort"; + private const string MOBILE_HOST_PORT = "ALM_MobileHostPort"; private const string MOBILE_USER = "ALM_MobileUserName"; private const string MOBILE_PASSWORD = "ALM_MobilePassword"; - private const string MOBILE_USE_SSL = "MobileUseSSL"; + private const string MOBILE_USE_SSL = "ALM_MobileUseSSL"; private const string MOBILE_USE_PROXY= "MobileProxySetting_UseProxy"; private const string MOBILE_PROXY_SETTING_ADDRESS = "MobileProxySetting_Address"; private const string MOBILE_PROXY_SETTING_PORT = "MobileProxySetting_Port"; From 1339c9cc701571990b34f44298a156ac2783d5f6 Mon Sep 17 00:00:00 2001 From: bamh Date: Wed, 22 Mar 2017 18:07:15 +0200 Subject: [PATCH 0015/2502] Support HTTPS protocol for PCS (#155) * index on master: ab83a3d Merge remote-tracking branch 'remotes/origin/5.0.1-beta-SNAPSHOT' * Revert pom changes * Merge branch '5.0.1-beta-SNAPSHOT' of https://github.com/hpsa/hp-application-automation-tools-plugin into development # Conflicts: # .github/PULL_REQUEST_TEMPLATE.md * Added some comments * changes according to sonarlint * changes for sonarlint * Remove some comments * Comments * * Fix for supporting SECURITY-170 changes * https://jenkins.io/blog/2016/05/11/security-update/ * https://issues.jenkins-ci.org/browse/JENKINS-39654 * code changes for sonarlint --- .../automation/tools/model/PcModel.java | 18 +++++- .../automation/tools/pc/PcClient.java | 20 ++++++- .../automation/tools/pc/PcRestProxy.java | 53 +++++++++++----- .../tools/run/AdditionalParametersAction.java | 60 +++++++++++++++++++ .../automation/tools/run/PcBuilder.java | 35 +++++++---- .../tools/run/PcBuilder/config.jelly | 9 ++- .../automation/tools/pc/MockPcModel.java | 5 +- .../automation/tools/pc/MockPcRestProxy.java | 9 +-- .../tools/pc/MockPcRestProxyBadResponses.java | 7 ++- .../automation/tools/pc/PcTestBase.java | 7 ++- .../automation/tools/pc/TestPcClient.java | 4 +- .../pc/TestPcClientNegativeScenrios.java | 9 ++- 12 files changed, 186 insertions(+), 50 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/run/AdditionalParametersAction.java diff --git a/src/main/java/com/hp/application/automation/tools/model/PcModel.java b/src/main/java/com/hp/application/automation/tools/model/PcModel.java index aca6d8cdb4..620cad6626 100644 --- a/src/main/java/com/hp/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hp/application/automation/tools/model/PcModel.java @@ -1,3 +1,6 @@ +/* +* Takes all the parameter from the job in order to create a loadtest object +* */ package com.hp.application.automation.tools.model; import java.util.Arrays; @@ -24,11 +27,12 @@ public class PcModel { private final String description; private final boolean addRunToTrendReport; private final String trendReportId; + private final boolean HTTPSProtocol; @DataBoundConstructor public PcModel(String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, - PostRunAction postRunAction, boolean vudsMode, String description, boolean addRunToTrendReport, String trendReportId) { + PostRunAction postRunAction, boolean vudsMode, String description, boolean addRunToTrendReport, String trendReportId, boolean HTTPSProtocol) { this.pcServerName = pcServerName; this.almUserName = almUserName; @@ -42,6 +46,7 @@ public PcModel(String pcServerName, String almUserName, String almPassword, Stri this.vudsMode = vudsMode; this.description = description; this.addRunToTrendReport = addRunToTrendReport; + this.HTTPSProtocol = HTTPSProtocol; this.trendReportId = trendReportId; } @@ -107,6 +112,9 @@ public String getDescription() { return this.description; } + public boolean httpsProtocol(){ + return this.HTTPSProtocol; + } public static List getPostRunActions() { @@ -128,7 +136,7 @@ public String runParamsToString() { "TestInstanceID='%s', TimeslotDuration='%s', PostRunAction='%s'%s%s]", almDomain, almProject, testId, testInstanceId, - timeslotDuration, postRunAction.getValue(), vudsModeString, trendString); + timeslotDuration, postRunAction.getValue(), vudsModeString, trendString,HTTPSProtocol); } @@ -139,4 +147,10 @@ public String getTrendReportId() { public boolean isAddRunToTrendReport() { return addRunToTrendReport; } + + public String isHTTPSProtocol(){ + if (!HTTPSProtocol) + return "http"; + return "https"; + } } diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcClient.java b/src/main/java/com/hp/application/automation/tools/pc/PcClient.java index f9f3139204..e3bdb42fcd 100644 --- a/src/main/java/com/hp/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hp/application/automation/tools/pc/PcClient.java @@ -20,6 +20,12 @@ * THE SOFTWARE. */ + +/* +* Implements the main method of loadtest +* +* */ + package com.hp.application.automation.tools.pc; import hudson.FilePath; @@ -49,7 +55,7 @@ public class PcClient { public PcClient(PcModel pcModel, PrintStream logger) { model = pcModel; - restProxy = new PcRestProxy(model.getPcServerName(), model.getAlmDomain(), model.getAlmProject()); + restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(), model.getAlmDomain(), model.getAlmProject(),logger); this.logger = logger; } @@ -66,13 +72,24 @@ public boolean login() { loggedIn = restProxy.authenticate(user, model.getAlmPassword().toString()); } catch (PcException e) { logger.println(e.getMessage()); + // stackTraceToString(e); } catch (Exception e) { logger.println(e); + // stackTraceToString(e); } logger.println(String.format("Login %s", loggedIn ? "succeeded" : "failed")); return loggedIn; } +// public void stackTraceToString(Throwable e) { +// StringBuilder sb = new StringBuilder(); +// logger.println("DEBUGMSG - STACKTRACE"); +// for (StackTraceElement element : e.getStackTrace()) { +// logger.println("DEBUGMSG - " + element.toString()); +// } +// } + + public boolean isLoggedIn() { return loggedIn; @@ -247,7 +264,6 @@ public void waitForRunToPublishOnTrendReport(int runId, String trendReportId) th break; }else{ Thread.sleep(5000); - logger.println("Publishing..."); counter++; if(counter >= 120){ logger.println("Error: Publishing didn't ended after 10 minutes, aborting..."); diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java index 8bfe0cfabc..a6d1a63aa1 100644 --- a/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java @@ -20,6 +20,9 @@ * THE SOFTWARE. */ +/* +* Implements the REST API methods for executing the loadtest +* */ package com.hp.application.automation.tools.pc; import com.hp.application.automation.tools.common.PcException; @@ -27,6 +30,7 @@ import com.hp.application.automation.tools.rest.RESTConstants; import com.hp.application.automation.tools.sse.sdk.Base64Encoder; import org.apache.commons.io.IOUtils; +import org.apache.http.Header; import org.apache.http.HttpHeaders; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; @@ -45,19 +49,22 @@ import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.HttpContext; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; +import java.io.InputStream; +import java.io.IOException; +import java.io.FileOutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.io.PrintStream; + + import static org.apache.commons.httpclient.HttpStatus.*; public class PcRestProxy { - - protected static final String BASE_PC_API_URL = "http://%s/LoadTest/rest"; + + protected static final String BASE_PC_API_URL = "%s://%s/LoadTest/rest"; protected static final String BASE_PC_API_AUTHENTICATION_URL = BASE_PC_API_URL + "/authentication-point"; protected static final String AUTHENTICATION_LOGIN_URL = BASE_PC_API_AUTHENTICATION_URL + "/authenticate"; protected static final String AUTHENTICATION_LOGOUT_URL = BASE_PC_API_AUTHENTICATION_URL + "/logout"; @@ -76,21 +83,26 @@ public class PcRestProxy { private String pcServer; private String domain; private String project; + private String webProtocol; private HttpClient client; private HttpContext context; private CookieStore cookieStore; - - public PcRestProxy(String pcServerName, String almDomain, String almProject) { - + // private PrintStream logger; + + public PcRestProxy(String webProtocolName, String pcServerName, String almDomain, String almProject,PrintStream mainLogger) { + +// logger = mainLogger; pcServer = pcServerName; domain = almDomain; project = almProject; - baseURL = String.format(PC_API_RESOURCES_TEMPLATE, pcServer, domain, project); + webProtocol = webProtocolName; + baseURL = String.format(PC_API_RESOURCES_TEMPLATE, webProtocol,pcServer, domain, project); PoolingClientConnectionManager cxMgr = new PoolingClientConnectionManager(SchemeRegistryFactory.createDefault()); cxMgr.setMaxTotal(100); cxMgr.setDefaultMaxPerRoute(20); + client = new DefaultHttpClient(cxMgr); context = new BasicHttpContext(); @@ -100,10 +112,9 @@ public PcRestProxy(String pcServerName, String almDomain, String almProject) { public boolean authenticate(String userName, String password) throws PcException, ClientProtocolException, IOException { - String userNameAndPassword = userName + ":" + password; String encodedCredentials = Base64Encoder.encode(userNameAndPassword.getBytes()); - HttpGet authRequest = new HttpGet(String.format(AUTHENTICATION_LOGIN_URL, pcServer)); + HttpGet authRequest = new HttpGet(String.format(AUTHENTICATION_LOGIN_URL,webProtocol, pcServer)); authRequest.addHeader("Authorization", String.format("Basic %s", encodedCredentials)); executeRequest(authRequest); return true; @@ -111,6 +122,7 @@ public boolean authenticate(String userName, String password) throws PcException public PcRunResponse startRun(int testId, int testInstaceId, TimeslotDuration timeslotDuration, String postRunAction, boolean vudsMode) throws PcException, ClientProtocolException, IOException { + // logger.println("Starting run"); HttpPost startRunRequest = new HttpPost(String.format(baseURL + "/%s", RUNS_RESOURCE_NAME)); startRunRequest.addHeader(RESTConstants.CONTENT_TYPE, CONTENT_TYPE_XML); PcRunRequest runRequestData = new PcRunRequest(testId, testInstaceId, 0, timeslotDuration, postRunAction, vudsMode); @@ -204,23 +216,32 @@ public PcRunEventLog getRunEventLog(int runId) throws PcException, ClientProtoco } public boolean logout() throws PcException, ClientProtocolException, IOException { - HttpGet logoutRequest = new HttpGet(String.format(AUTHENTICATION_LOGOUT_URL, pcServer)); + HttpGet logoutRequest = new HttpGet(String.format(AUTHENTICATION_LOGOUT_URL, webProtocol,pcServer)); executeRequest(logoutRequest); return true; } protected HttpResponse executeRequest(HttpRequestBase request) throws PcException, IOException { - HttpResponse response = client.execute(request,context); +// logger.println(String.format("DEBUGMSG - Request uri %s",request.getURI().toString())); +// logger.println(String.format("DEBUGMSG - Request Method %s",request.getMethod().toString())); +// // Print all headers +// logger.println("DEBUGMSG - Headers"); +// List
httpHeaders = Arrays.asList(request.getAllHeaders()); +// for (Header header : httpHeaders) { +// logger.println("DEBUGMSG - " + header.getName() + " : " + header.getValue()); +// } + HttpResponse response = client.execute(request,context); if (!isOk(response)){ String message; try { String content = IOUtils.toString(response.getEntity().getContent()); +// logger.println("DEBUGMSG - response content: " + content); PcErrorResponse exception = PcErrorResponse.xmlToObject(content); - message = String.format("%s Error code: %s", exception.ExceptionMessage, exception.ErrorCode); - } catch (Exception ex) { + message = String.format("%s Error code: %s", exception.ExceptionMessage, exception.ErrorCode); + } catch (Exception ex) { message = response.getStatusLine().toString(); } - throw new PcException(message); + throw new PcException("executeRequest exception: " + message); } return response; } diff --git a/src/main/java/com/hp/application/automation/tools/run/AdditionalParametersAction.java b/src/main/java/com/hp/application/automation/tools/run/AdditionalParametersAction.java new file mode 100644 index 0000000000..b9b104f9d7 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/run/AdditionalParametersAction.java @@ -0,0 +1,60 @@ +package com.hp.application.automation.tools.run; + +import hudson.EnvVars; +import hudson.Extension; +import hudson.model.EnvironmentContributor; +import hudson.model.ParameterValue; +import hudson.model.Run; +import hudson.model.TaskListener; +import hudson.model.ParametersAction; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; + +/** + * Fix for supporting SECURITY-170 changes + * https://jenkins.io/blog/2016/05/11/security-update/ + * https://issues.jenkins-ci.org/browse/JENKINS-39654 + * + */ +public class AdditionalParametersAction extends ParametersAction{ + + private List parameters; + + public AdditionalParametersAction(List cparameters){ + this.parameters = Collections.unmodifiableList(cparameters); + } + + + + @Override + public List getParameters() { + return Collections.unmodifiableList(parameters); + } + + @Override + public ParameterValue getParameter(String name){ + for (ParameterValue p : parameters) { + if (p == null) + continue; + if (p.getName().equals(name)) + return p; + } + return null; + } + + @Extension + public static final class AdditionalParametersActionEnvironmentContributor extends EnvironmentContributor { + @Override + public void buildEnvironmentFor(Run r, EnvVars envs, TaskListener listener) + throws IOException, InterruptedException { + AdditionalParametersAction action = r.getAction(AdditionalParametersAction.class); + if (action != null) { + for (ParameterValue p : action.getParameters()) { + envs.putIfNotNull(p.getName(), String.valueOf(p.getValue())); + } + } + } + } +} diff --git a/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java index 21f2c37899..0fcd40f6ce 100644 --- a/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java @@ -20,12 +20,15 @@ * THE SOFTWARE. */ + +/* +* Create the PCModel and the PCClient and allows the connection between the job and PC +* */ package com.hp.application.automation.tools.run; import com.hp.application.automation.tools.common.PcException; import com.hp.application.automation.tools.model.PcModel; import com.hp.application.automation.tools.model.PostRunAction; -import com.hp.application.automation.tools.model.SecretContainer; import com.hp.application.automation.tools.model.TimeslotDuration; import com.hp.application.automation.tools.pc.*; import com.hp.application.automation.tools.sse.result.model.junit.Error; @@ -56,6 +59,7 @@ import java.lang.reflect.Method; import java.text.Format; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -88,7 +92,6 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ private FilePath pcReportFile; private String junitResultsFileName; private PrintStream logger; - // private boolean trendReportReady; @DataBoundConstructor public PcBuilder( @@ -106,13 +109,14 @@ public PcBuilder( boolean statusBySLA, String description, boolean addRunToTrendReport, - String trendReportId) { + String trendReportId, + boolean HTTPSProtocol) { this.almUserName = almUserName; this.almPassword = almPassword; this.timeslotDurationHours = timeslotDurationHours; this.timeslotDurationMinutes = timeslotDurationMinutes; this.statusBySLA = statusBySLA; - + pcModel = new PcModel( pcServerName.trim(), @@ -128,7 +132,8 @@ public PcBuilder( vudsMode, description, addRunToTrendReport, - trendReportId); + trendReportId, + HTTPSProtocol); } @Override @@ -215,11 +220,13 @@ private Testsuites run(PcClient pcClient, Run build) boolean trendReportReady = false; try { runId = pcClient.startRun(); - + List parameters = new ArrayList<>(); + parameters.add(new StringParameterValue(RUNID_BUILD_VARIABLE, "" + runId)); // This allows a user to access the runId from within Jenkins using a build variable. - build.addAction(new ParametersAction(new StringParameterValue(RUNID_BUILD_VARIABLE, "" + runId))); + build.addAction(new AdditionalParametersAction(parameters)); logger.print("Set " + RUNID_BUILD_VARIABLE + " Env Variable to " + runId + "\n"); - + + response = pcClient.waitForRunCompletion(runId); @@ -340,7 +347,7 @@ private boolean validateTrendReportIdIsNumeric(String trendReportId, boolean add } catch(NumberFormatException e) { - res = FormValidation.error("Illegal Parameter: trend report ID is is not a number"); + res = FormValidation.error("Illegal Parameter: trend report ID is not a number"); } } @@ -589,6 +596,7 @@ public boolean isAddRunToTrendReport() return getPcModel().isAddRunToTrendReport(); } + public boolean isVudsMode() { return getPcModel().isVudsMode(); @@ -608,6 +616,11 @@ public String getAlmPassword() { return almPassword; } + public boolean isHTTPSProtocol() + { + return getPcModel().httpsProtocol(); + } + public boolean isStatusBySLA() { return statusBySLA; } @@ -617,9 +630,9 @@ public boolean isStatusBySLA() { @Extension @Symbol("pcBuild") public static final class DescriptorImpl extends BuildStepDescriptor { - + public DescriptorImpl() { - + load(); } diff --git a/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly index e9211d4684..2d834aabdf 100644 --- a/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly @@ -117,6 +117,8 @@ + + @@ -203,8 +205,11 @@
- + + +
+
+
diff --git a/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java index 850b0f4621..35970925b8 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java @@ -26,9 +26,10 @@ public class MockPcModel extends PcModel { public MockPcModel(String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId, String testInstanceId, String timeslotDurationHours, - String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description) { + String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description,boolean webProtocol) { super(pcServerName, almUserName, almPassword, almDomain, almProject, testId, testInstanceId, timeslotDurationHours, - timeslotDurationMinutes, postRunAction, vudsMode, description, false, null); + timeslotDurationMinutes, postRunAction, vudsMode, description, false, null,false + ); } @Override diff --git a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java index 8583dcee85..9a514b4efe 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java +++ b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java @@ -18,6 +18,7 @@ import java.io.File; import java.io.IOException; +import java.io.PrintStream; import java.util.Arrays; import java.util.Iterator; @@ -41,8 +42,8 @@ public class MockPcRestProxy extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); - public MockPcRestProxy(String pcServerName, String almDomain, String almProject) { - super(pcServerName, almDomain, almProject); + public MockPcRestProxy(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) { + super(webProtocol, pcServerName, almDomain, almProject,logger); } @Override @@ -50,8 +51,8 @@ protected HttpResponse executeRequest(HttpRequestBase request) throws PcExceptio IOException { HttpResponse response = null; String requestUrl = request.getURI().toString(); - if (requestUrl.equals(String.format(AUTHENTICATION_LOGIN_URL, PC_SERVER_NAME)) - || requestUrl.equals(String.format(AUTHENTICATION_LOGOUT_URL, PC_SERVER_NAME)) + if (requestUrl.equals(String.format(AUTHENTICATION_LOGIN_URL,WEB_PROTOCOL, PC_SERVER_NAME)) + || requestUrl.equals(String.format(AUTHENTICATION_LOGOUT_URL,WEB_PROTOCOL, PC_SERVER_NAME)) || requestUrl.equals(String.format(getBaseURL() + "/%s/%s/%s", RUNS_RESOURCE_NAME, RUN_ID, STOP_MODE))) { response = getOkResponse(); } else if (requestUrl.equals(String.format(getBaseURL() + "/%s", RUNS_RESOURCE_NAME)) diff --git a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java index dc7d7dd948..3fd1fa3b56 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java +++ b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java @@ -17,6 +17,7 @@ package com.hp.application.automation.tools.pc; import java.io.IOException; +import java.io.PrintStream; import java.util.Arrays; import java.util.Iterator; @@ -36,8 +37,8 @@ public class MockPcRestProxyBadResponses extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); - public MockPcRestProxyBadResponses(String pcServerName, String almDomain, String almProject) { - super(pcServerName, almDomain, almProject); + public MockPcRestProxyBadResponses(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) { + super(webProtocol, pcServerName, almDomain, almProject,logger); } @Override @@ -45,7 +46,7 @@ protected HttpResponse executeRequest(HttpRequestBase request) throws PcExceptio IOException { HttpResponse response = null; String requestUrl = request.getURI().toString(); - if (requestUrl.equals(String.format(AUTHENTICATION_LOGIN_URL, PC_SERVER_NAME))) { + if (requestUrl.equals(String.format(AUTHENTICATION_LOGIN_URL,WEB_PROTOCOL, PC_SERVER_NAME))) { throw new PcException(pcAuthenticationFailureMessage); } else if (requestUrl.equals(String.format(getBaseURL() + "/%s", RUNS_RESOURCE_NAME))){ throw new PcException(pcNoTimeslotExceptionMessage); diff --git a/src/test/java/com/hp/application/automation/tools/pc/PcTestBase.java b/src/test/java/com/hp/application/automation/tools/pc/PcTestBase.java index 945382c47a..849e50e3bd 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/PcTestBase.java +++ b/src/test/java/com/hp/application/automation/tools/pc/PcTestBase.java @@ -18,6 +18,8 @@ import com.hp.application.automation.tools.model.PostRunAction; +import java.io.PrintStream; + public interface PcTestBase { public static final String PC_SERVER_NAME = "pcServer.hp.com"; @@ -37,13 +39,16 @@ public interface PcTestBase { public static final String RUN_ID_WAIT = "8"; public static final String REPORT_ID = "9"; public static final String STOP_MODE = "stop"; + public static final String WEB_PROTOCOL = "http"; + public static final Boolean IS_HTTPS = false; + public static final PrintStream LOGGER = null; public static final MockPcModel pcModel = new MockPcModel(PC_SERVER_NAME, ALM_USER_NAME, ALM_PASSWORD, ALM_DOMAIN, ALM_PROJECT, TEST_ID, TEST_INSTANCE_ID, TIMESLOT_DURATION_HOURS, TIMESLOT_DURATION_MINUTES, POST_RUN_ACTION, - VUDS_MODE, DESCRIPTION); + VUDS_MODE, DESCRIPTION,IS_HTTPS); public static final String runResponseEntity = "" + "" + TEST_ID + "" + diff --git a/src/test/java/com/hp/application/automation/tools/pc/TestPcClient.java b/src/test/java/com/hp/application/automation/tools/pc/TestPcClient.java index 852e28e20f..f2a103ef2e 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/TestPcClient.java +++ b/src/test/java/com/hp/application/automation/tools/pc/TestPcClient.java @@ -33,8 +33,8 @@ public class TestPcClient { @BeforeClass public static void setUp() { try { - PcRestProxy resetProxy = new MockPcRestProxy(PcTestBase.PC_SERVER_NAME, PcTestBase.ALM_DOMAIN, - PcTestBase.ALM_PROJECT); + PcRestProxy resetProxy = new MockPcRestProxy(PcTestBase.WEB_PROTOCOL, PcTestBase.PC_SERVER_NAME, PcTestBase.ALM_DOMAIN, + PcTestBase.ALM_PROJECT,PcTestBase.LOGGER); pcClient = new PcClient(PcTestBase.pcModel, System.out, resetProxy); } catch (Exception e) { e.printStackTrace(System.out); diff --git a/src/test/java/com/hp/application/automation/tools/pc/TestPcClientNegativeScenrios.java b/src/test/java/com/hp/application/automation/tools/pc/TestPcClientNegativeScenrios.java index 6530b9bee7..c37c8337e6 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/TestPcClientNegativeScenrios.java +++ b/src/test/java/com/hp/application/automation/tools/pc/TestPcClientNegativeScenrios.java @@ -44,8 +44,8 @@ public class TestPcClientNegativeScenrios { public static void setUp() { System.out.println("Starting HP Performance Center client negative testing scenarios:"); try { - PcRestProxy resetProxy = new MockPcRestProxyBadResponses(PcTestBase.PC_SERVER_NAME, PcTestBase.ALM_DOMAIN, - PcTestBase.ALM_PROJECT); + PcRestProxy resetProxy = new MockPcRestProxyBadResponses(PcTestBase.WEB_PROTOCOL,PcTestBase.PC_SERVER_NAME, PcTestBase.ALM_DOMAIN, + PcTestBase.ALM_PROJECT,PcTestBase.LOGGER); pcClient = new PcClient(PcTestBase.pcModel, new PrintStream(new OutputStream() { @Override @@ -89,9 +89,8 @@ public void testPublishRunReportWithEmptyResults() { System.out.println("Testing Publish PC Run Report to while run results are empty"); try { - FilePath reportHtml = pcClient.publishRunReport(Integer.parseInt(PcTestBase.RUN_ID), String.format( - PcBuilder.getRunReportStructure(), RESOURCES_DIR, PcBuilder.getArtifactsDirectoryName(), - PcTestBase.RUN_ID)); + FilePath reportHtml = pcClient.publishRunReport(Integer.parseInt(PcTestBase.RUN_ID), + String.format(PcBuilder.getRunReportStructure(), RESOURCES_DIR, PcBuilder.getArtifactsDirectoryName(),PcTestBase.RUN_ID)); Assert.assertNull("pcClient.publishRunReport should have returned null due to empty run results", reportHtml); } catch (Exception e) { From 6118063b94d7e318a7bb0471c5e78a5084ec29ae Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Wed, 22 Mar 2017 18:07:31 +0200 Subject: [PATCH 0016/2502] Added support for LoadRunner RunReport.xml parsing in non-english locale enviroments (#163) * Diffrent language locale support fix * Fix for supporting diffrent locale --- .gitignore | 1 - LRAnalysisLauncher/Program.cs | 68 ++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index b277c21ced..572f977ddd 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,6 @@ Ankh.NoLoad #Tooling _ReSharper*/ *.resharper -[Tt]est[Rr]esult* *.sass-cache #Project files diff --git a/LRAnalysisLauncher/Program.cs b/LRAnalysisLauncher/Program.cs index 547e40b3d3..29cae940be 100644 --- a/LRAnalysisLauncher/Program.cs +++ b/LRAnalysisLauncher/Program.cs @@ -26,6 +26,7 @@ using Analysis.ApiSL; using Analysis.Api.Dictionaries; using System.Diagnostics; +using System.Globalization; using System.Linq; namespace LRAnalysisLauncher @@ -45,9 +46,9 @@ static void log() static void log(string msg) { Console.WriteLine(msg); - // writer.WriteLine(msg); + // writer.WriteLine(msg); } -// static StreamWriter writer = new StreamWriter(new FileStream("c:\\AnalysisLauncherOutput.txt", FileMode.OpenOrCreate, FileAccess.Write)); + // static StreamWriter writer = new StreamWriter(new FileStream("c:\\AnalysisLauncherOutput.txt", FileMode.OpenOrCreate, FileAccess.Write)); //args: lrr location, lra location, html report location [STAThread] static int Main(string[] args) @@ -61,7 +62,7 @@ static int Main(string[] args) if (args.Length != 3) { ShowHelp(); - return (int) Launcher.ExitCodeEnum.Aborted; + return (int)Launcher.ExitCodeEnum.Aborted; } string lrrlocation = args[0]; @@ -70,7 +71,7 @@ static int Main(string[] args) log("creating analysis COM object"); LrAnalysis analysis = new LrAnalysis(); - + Session session = analysis.Session; log("creating analysis session"); if (session.Create(lralocation, lrrlocation)) @@ -139,11 +140,11 @@ static int Main(string[] args) // stopper.Start(); // log("Gathering Duration statistics"); // stopper.Start(); - //DateTime startTime = Helper.FromUnixTime(currentRun.StartTime); - //DateTime endTime = Helper.FromUnixTime(currentRun.EndTime); - //durationElement.SetAttribute("End", endTime.ToString()); - //durationElement.SetAttribute("Start", startTime.ToString()); - //durationElement.SetAttribute("Duration", Helper.GetScenarioDuration(currentRun)); + //DateTime startTime = Helper.FromUnixTime(currentRun.StartTime); + //DateTime endTime = Helper.FromUnixTime(currentRun.EndTime); + //durationElement.SetAttribute("End", endTime.ToString()); + //durationElement.SetAttribute("Start", startTime.ToString()); + //durationElement.SetAttribute("Duration", Helper.GetScenarioDuration(currentRun)); //} general.AppendChild(durationElement); @@ -213,6 +214,7 @@ static int Main(string[] args) int iCounter = 0; // set counter log("WholeRunRules : " + slaResult.WholeRunRules.Count); + CultureInfo formatProvider = new CultureInfo("en-US"); foreach (SlaWholeRunRuleResult a in slaResult.WholeRunRules) { log(Resources.DoubleLineSeperator); @@ -224,21 +226,21 @@ static int Main(string[] args) log("Transaction Name : " + b.TransactionName); elem.SetAttribute("TransactionName", b.TransactionName.ToString()); log("Percentile : " + b.Percentage); - elem.SetAttribute("Percentile", b.Percentage.ToString()); + elem.SetAttribute("Percentile", b.Percentage.ToString(formatProvider)); elem.SetAttribute("FullName", b.RuleUiName); log("Full Name : " + b.RuleUiName); log("Measurement : " + b.Measurement); elem.SetAttribute("Measurement", b.Measurement.ToString()); log("Goal Value : " + b.GoalValue); - elem.SetAttribute("GoalValue", b.GoalValue.ToString()); + elem.SetAttribute("GoalValue", b.GoalValue.ToString(formatProvider)); log("Actual value : " + b.ActualValue); - elem.SetAttribute("ActualValue", b.ActualValue.ToString()); + elem.SetAttribute("ActualValue", b.ActualValue.ToString(formatProvider)); log("status : " + b.Status); elem.AppendChild(xmlDoc.CreateTextNode(b.Status.ToString())); if (b.Status.Equals(SlaRuleStatus.Failed)) // 0 = failed { - iPassed = (int) Launcher.ExitCodeEnum.Failed; + iPassed = (int)Launcher.ExitCodeEnum.Failed; } iCounter++; } @@ -250,15 +252,15 @@ static int Main(string[] args) log("Measurement : " + a.Measurement); elem.SetAttribute("Measurement", a.Measurement.ToString()); log("Goal Value : " + a.GoalValue); - elem.SetAttribute("GoalValue", a.GoalValue.ToString()); + elem.SetAttribute("GoalValue", a.GoalValue.ToString(formatProvider)); log("Actual value : " + a.ActualValue); - elem.SetAttribute("ActualValue", a.ActualValue.ToString()); + elem.SetAttribute("ActualValue", a.ActualValue.ToString(formatProvider)); log("status : " + a.Status); elem.AppendChild(xmlDoc.CreateTextNode(a.Status.ToString())); if (a.Status.Equals(SlaRuleStatus.Failed)) // 0 = failed { - iPassed = (int) Launcher.ExitCodeEnum.Failed; + iPassed = (int)Launcher.ExitCodeEnum.Failed; } } root.AppendChild(elem); @@ -288,9 +290,9 @@ static int Main(string[] args) foreach (SlaLoadThreshold slat in b.LoadThresholds) { XmlElement loadThr = xmlDoc.CreateElement("SlaLoadThreshold"); - loadThr.SetAttribute("StartLoadValue", slat.StartLoadValue.ToString()); - loadThr.SetAttribute("EndLoadValue", slat.EndLoadValue.ToString()); - loadThr.SetAttribute("ThresholdValue", slat.ThresholdValue.ToString()); + loadThr.SetAttribute("StartLoadValue", slat.StartLoadValue.ToString(formatProvider)); + loadThr.SetAttribute("EndLoadValue", slat.EndLoadValue.ToString(formatProvider)); + loadThr.SetAttribute("ThresholdValue", slat.ThresholdValue.ToString(formatProvider)); rule.AppendChild(loadThr); } @@ -301,9 +303,9 @@ static int Main(string[] args) XmlElement subsubelem = xmlDoc.CreateElement("TimeRangeInfo"); subsubelem.SetAttribute("StartTime", slatri.StartTime.ToString()); subsubelem.SetAttribute("EndTime", slatri.EndTime.ToString()); - subsubelem.SetAttribute("GoalValue", slatri.GoalValue.ToString()); - subsubelem.SetAttribute("ActualValue", slatri.ActualValue.ToString()); - subsubelem.SetAttribute("LoadValue", slatri.LoadValue.ToString()); + subsubelem.SetAttribute("GoalValue", slatri.GoalValue.ToString(formatProvider)); + subsubelem.SetAttribute("ActualValue", slatri.ActualValue.ToString(formatProvider)); + subsubelem.SetAttribute("LoadValue", slatri.LoadValue.ToString(formatProvider)); subsubelem.InnerText = slatri.Status.ToString(); timeRanges.AppendChild(subsubelem); } @@ -312,7 +314,7 @@ static int Main(string[] args) rule.AppendChild(xmlDoc.CreateTextNode(b.Status.ToString())); if (b.Status.Equals(SlaRuleStatus.Failed)) // 0 = failed { - iPassed = (int) Launcher.ExitCodeEnum.Failed; + iPassed = (int)Launcher.ExitCodeEnum.Failed; } iCounter++; } @@ -329,9 +331,9 @@ static int Main(string[] args) foreach (SlaLoadThreshold slat in a.LoadThresholds) { XmlElement loadThr = xmlDoc.CreateElement("SlaLoadThreshold"); - loadThr.SetAttribute("StartLoadValue", slat.StartLoadValue.ToString()); - loadThr.SetAttribute("EndLoadValue", slat.EndLoadValue.ToString()); - loadThr.SetAttribute("ThresholdValue", slat.ThresholdValue.ToString()); + loadThr.SetAttribute("StartLoadValue", slat.StartLoadValue.ToString(formatProvider)); + loadThr.SetAttribute("EndLoadValue", slat.EndLoadValue.ToString(formatProvider)); + loadThr.SetAttribute("ThresholdValue", slat.ThresholdValue.ToString(formatProvider)); rule.AppendChild(loadThr); } @@ -342,9 +344,9 @@ static int Main(string[] args) XmlElement subsubelem = xmlDoc.CreateElement("TimeRangeInfo"); subsubelem.SetAttribute("StartTime", slatri.StartTime.ToString()); subsubelem.SetAttribute("EndTime", slatri.EndTime.ToString()); - subsubelem.SetAttribute("GoalValue", slatri.GoalValue.ToString()); - subsubelem.SetAttribute("ActualValue", slatri.ActualValue.ToString()); - subsubelem.SetAttribute("LoadValue", slatri.LoadValue.ToString()); + subsubelem.SetAttribute("GoalValue", slatri.GoalValue.ToString(formatProvider)); + subsubelem.SetAttribute("ActualValue", slatri.ActualValue.ToString(formatProvider)); + subsubelem.SetAttribute("LoadValue", slatri.LoadValue.ToString(formatProvider)); subsubelem.InnerText = slatri.Status.ToString(); timeRanges.AppendChild(subsubelem); } @@ -353,7 +355,7 @@ static int Main(string[] args) rule.AppendChild(xmlDoc.CreateTextNode(a.Status.ToString())); if (a.Status.Equals(SlaRuleStatus.Failed)) { - iPassed = (int) Launcher.ExitCodeEnum.Failed; + iPassed = (int)Launcher.ExitCodeEnum.Failed; } } @@ -380,7 +382,7 @@ static int Main(string[] args) { log(Resources.CannotCreateSession); - return (int) Launcher.ExitCodeEnum.Aborted; + return (int)Launcher.ExitCodeEnum.Aborted; } log("closing analysis session"); session.Close(); @@ -395,13 +397,13 @@ static int Main(string[] args) log(ex.Message); log(ex.StackTrace); } - return (int) Launcher.ExitCodeEnum.Aborted; + return (int)Launcher.ExitCodeEnum.Aborted; } catch (Exception e) { log(e.Message); log(e.StackTrace); - return (int) Launcher.ExitCodeEnum.Aborted; + return (int)Launcher.ExitCodeEnum.Aborted; } From 3dbc7de62c2f66fa0cd719b3f5fe9e70008ffbdf Mon Sep 17 00:00:00 2001 From: Jane Date: Thu, 23 Mar 2017 00:16:31 +0800 Subject: [PATCH 0017/2502] [MC Jenkins Plugin] Using MC Wizard tool required from user double aunthentication (due to cross domain connection) and selected device/app/metrics options not saved (#151) * Defect#5550: open job wizard without login again and keep the job info * Defect#5550: revert the version number to 5.1-SNAPSHOT * Defect#5550: add java doc for method modify --- .../automation/tools/run/RunFromFileBuilder.java | 8 +++++++- .../automation/tools/run/RunFromFileBuilder/config.jelly | 2 +- src/main/webapp/configure.js | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java index 1564ea7109..c50b2084fd 100644 --- a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java @@ -532,6 +532,8 @@ public boolean isApplicable( /** * Gets job id. + * If there is already a job created by jenkins plugin, then return this job id, + * otherwise, create a new temp job and return the new job id. * * @param mcUrl the mc url * @param mcUserName the mc user name @@ -539,10 +541,14 @@ public boolean isApplicable( * @param proxyAddress the proxy address * @param proxyUserName the proxy user name * @param proxyPassword the proxy password + * @param previousJobId the previous job id * @return the job id */ @JavaScriptMethod - public String getJobId(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUserName, String proxyPassword) { + public String getJobId(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUserName, String proxyPassword, String previousJobId) { + if(null != previousJobId && !previousJobId.isEmpty()){ + return previousJobId; + } return instance.createTempJob(mcUrl, mcUserName, mcPassword, proxyAddress, proxyUserName, proxyPassword); } diff --git a/src/main/resources/com/hp/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/hp/application/automation/tools/run/RunFromFileBuilder/config.jelly index 9e217d3f42..5aa83a390d 100644 --- a/src/main/resources/com/hp/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/hp/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -122,7 +122,7 @@ - + diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index d2898bd971..ec117c025d 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -16,9 +16,10 @@ function load(a,path){ buttonStatus = false; return; } + var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; a.getMcServerUrl(mcUrl, function(r){ baseUrl = r.responseObject(); - a.getJobId(baseUrl,mcUserName, mcPassword, proxyAddress, proxyUserName, proxyPassword, function (response) { + a.getJobId(baseUrl,mcUserName, mcPassword, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { var jobResponse = response.responseObject(); if(jobResponse == null){ document.getElementById("errorMessage").style.display = "block"; From 50f780ce22c5e6152717171d320f2f73498c0b5b Mon Sep 17 00:00:00 2001 From: Jackzenko Date: Wed, 22 Mar 2017 21:46:50 +0530 Subject: [PATCH 0018/2502] added support for native browser (#147) --- src/main/webapp/configure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index ec117c025d..3cf736fa2d 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -26,7 +26,7 @@ function load(a,path){ buttonStatus = false; return; } - var openedWindow = window.open(baseUrl+path+jobResponse+'&displayUFTMode=true&appType=native','test parameters','height=820','width=1130'); + var openedWindow = window.open(baseUrl+path+jobResponse+'&displayUFTMode=true','test parameters','height=820','width=1130'); var messageCallBack = function (event) { if (event && event.data && event.data=="mcCloseWizard") { a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,proxyAddress, proxyUserName, proxyPassword,jobResponse, function (app) { From 1d1a50716278abc0ae6eb3672b78bca9b3647f7c Mon Sep 17 00:00:00 2001 From: franksha Date: Sun, 26 Mar 2017 12:07:29 +0300 Subject: [PATCH 0019/2502] Add Javadoc to CucumberResultsService --- .../tools/octane/actions/cucumber/CucumberResultsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java b/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java index c10a98b6ca..ceec465fcd 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java @@ -29,7 +29,7 @@ import java.nio.file.Files; /** - * Created by franksha on 22/03/2016. + * Helper Service for Gherkin results */ public class CucumberResultsService { From 6b77d9304397f7bfa72bba38933ef602d6449428 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Wed, 22 Mar 2017 14:15:06 +0200 Subject: [PATCH 0020/2502] remove unused code. --- .../automation/tools/octane/events/RunListenerImpl.java | 2 +- .../octane/model/processors/builders/WorkFlowRunProcessor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java index e49f2fe5ae..2a7332f621 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java @@ -76,7 +76,7 @@ public void onStarted(final Run r, TaskListener listener) { .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))); EventsService.getExtensionInstance().dispatchEvent(event); WorkFlowRunProcessor workFlowRunProcessor = new WorkFlowRunProcessor(r); - workFlowRunProcessor.registerEvents(executor, this); + workFlowRunProcessor.registerEvents(executor); } else { if (r.getParent() instanceof MatrixConfiguration) { AbstractBuild build = (AbstractBuild) r; diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java index 981d5d5b25..893dc5c62f 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java @@ -40,7 +40,7 @@ public WorkFlowRunProcessor(Run r) { this.workFlowRun = (WorkflowRun) r; } - public void registerEvents(ExecutorService executor, final RunListenerImpl runListener) { + public void registerEvents(ExecutorService executor) { ListenableFuture promise = workFlowRun.getExecutionPromise(); promise.addListener(new Runnable() { @Override From 58adeb2d6b0b2d7342c5f1fe30a4cfbdc51adfba Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Wed, 22 Mar 2017 14:20:38 +0200 Subject: [PATCH 0021/2502] Add off switch for octane listeners when they are not configured. --- .../tools/octane/events/QueueListenerImpl.java | 5 +++++ .../automation/tools/octane/events/RunListenerImpl.java | 9 +++++++++ .../automation/tools/octane/events/SCMListenerImpl.java | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/QueueListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/QueueListenerImpl.java index 06275c0185..719e631b0a 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/QueueListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/QueueListenerImpl.java @@ -16,6 +16,7 @@ package com.hp.application.automation.tools.octane.events; +import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; import com.hp.octane.integrations.dto.events.CIEventType; @@ -39,6 +40,10 @@ public final class QueueListenerImpl extends QueueListener { @Override public void onEnterWaiting(Queue.WaitingItem wi) { + if(!ConfigurationService.getServerConfiguration().isValid()){ + return; + } + AbstractProject project; if (wi.task instanceof AbstractProject) { project = (AbstractProject) wi.task; diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java index 2a7332f621..c9aef13d4c 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java @@ -17,6 +17,7 @@ package com.hp.application.automation.tools.octane.events; import com.google.inject.Inject; +import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; @@ -63,6 +64,10 @@ public final class RunListenerImpl extends RunListener { @Override public void onStarted(final Run r, TaskListener listener) { + if(!ConfigurationService.getServerConfiguration().isValid()){ + return; + } + CIEvent event; if (r.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowRun")) { event = dtoFactory.newDTO(CIEvent.class) @@ -120,6 +125,10 @@ public void onStarted(final Run r, TaskListener listener) { @Override public void onCompleted(Run r, @Nonnull TaskListener listener) { + if(!ConfigurationService.getServerConfiguration().isValid()){ + return; + } + CIBuildResult result; if (r.getResult() == Result.SUCCESS) { result = CIBuildResult.SUCCESS; diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java index 84d7e2dc2c..f0dd5f7d3e 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/SCMListenerImpl.java @@ -16,6 +16,7 @@ package com.hp.application.automation.tools.octane.events; +import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.model.processors.scm.SCMProcessor; import com.hp.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.octane.integrations.dto.DTOFactory; @@ -63,6 +64,11 @@ public void onCheckout(Run build, SCM scm, FilePath workspace, TaskListene @Override public void onChangeLogParsed(Run r, SCM scm, TaskListener listener, ChangeLogSet changelog) throws Exception { super.onChangeLogParsed(r, scm, listener, changelog); + + if(!ConfigurationService.getServerConfiguration().isValid()){ + return; + } + CIEvent event; if (r.getParent() instanceof MatrixConfiguration || r instanceof AbstractBuild) { AbstractBuild build = (AbstractBuild) r; From 39bc52310695ac8807119f68c33c9ee68b0a8176 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Sun, 26 Mar 2017 16:40:48 +0300 Subject: [PATCH 0022/2502] promote mqm sdk to 1.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 41ca5dfe5a..1b734af750 100644 --- a/pom.xml +++ b/pom.xml @@ -398,7 +398,7 @@ mqm-rest-client com.hpe.adm.octane.ciplugins - 1.1 + 1.2 From 6ca3034b1b4fd72248223eb68957baa0ba18cd3b Mon Sep 17 00:00:00 2001 From: Michael Gustus Date: Mon, 27 Mar 2017 11:01:10 +0300 Subject: [PATCH 0023/2502] defect #267087: Show descriptive error message when trying to create pipeline with already existing name. --- .../tools/octane/configuration/JobConfigurationProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/configuration/JobConfigurationProxy.java b/src/main/java/com/hp/application/automation/tools/octane/configuration/JobConfigurationProxy.java index 9bfba208d9..1ebfef7733 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/configuration/JobConfigurationProxy.java +++ b/src/main/java/com/hp/application/automation/tools/octane/configuration/JobConfigurationProxy.java @@ -102,7 +102,7 @@ public JSONObject createPipelineOnServer(JSONObject pipelineObject) throws IOExc } catch (RequestException e) { logger.warn("Failed to create pipeline", e); - return error("Unable to create pipeline"); + return error("Unable to create pipeline. " + e.getDescription()); } catch (ClientException e) { logger.warn("Failed to create pipeline", e); return error(e.getMessage(), e.getLink()); From 3fb49397ebc0b7a985bc492593b34146fcd0006c Mon Sep 17 00:00:00 2001 From: leviy Date: Mon, 27 Mar 2017 11:43:47 +0300 Subject: [PATCH 0024/2502] pipeline jobs reported job duration zero. move dispatch finished event from onCompleted to onFinalized --- .../tools/octane/events/RunListenerImpl.java | 34 +++++++------------ .../tools/octane/events/TestListenerImpl.java | 25 ++++++++++++++ 2 files changed, 38 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java index e49f2fe5ae..b3dec90077 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/RunListenerImpl.java @@ -16,7 +16,6 @@ package com.hp.application.automation.tools.octane.events; -import com.google.inject.Inject; import com.hp.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; @@ -29,7 +28,6 @@ import com.hp.application.automation.tools.octane.model.processors.builders.WorkFlowRunProcessor; import com.hp.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; import com.hp.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; -import com.hp.application.automation.tools.octane.tests.TestListener; import hudson.Extension; import hudson.matrix.MatrixConfiguration; import hudson.matrix.MatrixRun; @@ -37,7 +35,6 @@ import hudson.model.listeners.RunListener; import jenkins.model.Jenkins; -import javax.annotation.Nonnull; import java.util.Collection; import java.util.List; import java.util.concurrent.ExecutorService; @@ -58,9 +55,6 @@ public final class RunListenerImpl extends RunListener { private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); - @Inject - private TestListener testListener; - @Override public void onStarted(final Run r, TaskListener listener) { CIEvent event; @@ -119,7 +113,8 @@ public void onStarted(final Run r, TaskListener listener) { } @Override - public void onCompleted(Run r, @Nonnull TaskListener listener) { + public void onFinalized(Run r) + { CIBuildResult result; if (r.getResult() == Result.SUCCESS) { result = CIBuildResult.SUCCESS; @@ -133,24 +128,21 @@ public void onCompleted(Run r, @Nonnull TaskListener listener) { result = CIBuildResult.UNAVAILABLE; } CIEvent event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.FINISHED) - .setBuildCiId(String.valueOf(r.getNumber())) - .setNumber(String.valueOf(r.getNumber())) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setStartTime(r.getStartTimeInMillis()) - .setEstimatedDuration(r.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setResult(result) - .setDuration(r.getDuration()); + .setEventType(CIEventType.FINISHED) + .setBuildCiId(String.valueOf(r.getNumber())) + .setNumber(String.valueOf(r.getNumber())) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setStartTime(r.getStartTimeInMillis()) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setResult(result) + .setDuration(r.getDuration()); if(r instanceof AbstractBuild){ event.setParameters(ParameterProcessors.getInstances(r)) - .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)); - } - if(event!=null){ - EventsService.getExtensionInstance().dispatchEvent(event); - testListener.processBuild(r, listener); + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)); } + EventsService.getExtensionInstance().dispatchEvent(event); } // TODO: [YG] this method should be part of causes factory or something like this, it is not suitable for merged build as well diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java new file mode 100644 index 0000000000..0c56a6ba62 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java @@ -0,0 +1,25 @@ +package com.hp.application.automation.tools.octane.events; + +import com.google.inject.Inject; +import com.hp.application.automation.tools.octane.tests.TestListener; +import hudson.Extension; +import hudson.model.Run; +import hudson.model.TaskListener; +import hudson.model.listeners.RunListener; + +import javax.annotation.Nonnull; + +/** + * Created by leviy on 27/03/2017. + */ +@Extension +public class TestListenerImpl extends RunListener { + + @Inject + private TestListener testListener; + + @Override + public void onCompleted(Run r, @Nonnull TaskListener listener) { + testListener.processBuild(r, listener); + } +} From a1b26f2732a71965320413606265eaa3bdddc6ce Mon Sep 17 00:00:00 2001 From: leviy Date: Mon, 27 Mar 2017 15:37:13 +0300 Subject: [PATCH 0025/2502] defect #264272: pipeline job - fix build number increased by 2 after each execution --- .../automation/tools/octane/workflow/WorkflowBuildAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java b/src/main/java/com/hp/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java index 0ac93aeaf9..e48437d7fc 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java +++ b/src/main/java/com/hp/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java @@ -35,7 +35,7 @@ public class WorkflowBuildAdapter extends Run { private WorkflowRun run; private FilePath workspace; protected WorkflowBuildAdapter(@Nonnull Job job, WorkflowRun run,FilePath workspace) throws IOException { - super(job); + super(job, run.getTimestamp().getTimeInMillis()); this.run = run; this.workspace =workspace; } From 965ba3e6ed999790aa83410684a9185ce7ae4337 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Mon, 27 Mar 2017 17:02:14 +0300 Subject: [PATCH 0026/2502] fix for unittest - create dummy configuration for octane --- .../tools/octane/tests/JUnitResultsTest.java | 2 ++ .../automation/tools/octane/tests/TestUtils.java | 9 +++++++++ .../tests/detection/ResultFieldsDetectionTest.java | 13 ++++++------- .../octane/tests/detection/TestNGExtensionTest.java | 2 ++ .../octane/tests/gherkin/GherkinResultsTest.java | 2 ++ 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java index 96c07e206b..abf9992bdc 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java @@ -67,6 +67,8 @@ public void prepareTest() { TestListener testListener = ExtensionUtil.getInstance(rule, TestListener.class); queue = new TestQueue(); testListener._setTestResultQueue(queue); + + TestUtils.createDummyConfiguration(); } @Test diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/TestUtils.java b/src/test/java/com/hp/application/automation/tools/octane/tests/TestUtils.java index 42181c601b..e5fd876d49 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/TestUtils.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/TestUtils.java @@ -16,11 +16,14 @@ package com.hp.application.automation.tools.octane.tests; +import com.hp.application.automation.tools.model.OctaneServerSettingsModel; +import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.tests.junit.JUnitTestResult; import com.hp.application.automation.tools.octane.tests.junit.TestResultStatus; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; import hudson.model.Result; +import hudson.util.Secret; import org.junit.Assert; import java.util.HashSet; @@ -36,6 +39,12 @@ public class TestUtils { helloWorldTests.add(testSignature("helloWorld", "hello", "HelloWorldTest", "testThree", TestResultStatus.SKIPPED)); } + public static void createDummyConfiguration(){ + ConfigurationService.configurePlugin(new OctaneServerSettingsModel( + "http://localhost:8008/ui/?p=1001/1002","username", + Secret.fromString("password"),null)); + } + public static AbstractBuild runAndCheckBuild(AbstractProject project) throws Exception { AbstractBuild build = (AbstractBuild) project.scheduleBuild2(0).get(); if (!build.getResult().isBetterOrEqualTo(Result.UNSTABLE)) { // avoid expensive build.getLog() until condition is met diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java index 20c49e2536..d55e6b776a 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java @@ -24,10 +24,7 @@ import hudson.model.FreeStyleProject; import hudson.tasks.Maven; import hudson.tasks.junit.JUnitResultArchiver; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; +import org.junit.*; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.ToolInstallations; import org.mockito.Mockito; @@ -36,8 +33,7 @@ import java.io.FileReader; import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; public class ResultFieldsDetectionTest { @@ -48,6 +44,8 @@ public class ResultFieldsDetectionTest { private static ResultFieldsDetectionService detectionService; + private final JenkinsRule.WebClient jClient = rule.createWebClient(); + @Before public void setUp() throws Exception { project = rule.createFreeStyleProject("junit - job"); @@ -59,6 +57,8 @@ public void setUp() throws Exception { project.getBuildersList().add(new Maven("-s settings.xml -U test", mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); + + TestUtils.createDummyConfiguration(); } @Test @@ -116,7 +116,6 @@ public void testEmptyDetectedFieldsInXml() throws Exception { File mqmTestsXml = new File(build.getRootDir(), "mqmTests.xml"); ResultFieldsXmlReader xmlReader = new ResultFieldsXmlReader(new FileReader(mqmTestsXml)); ResultFields resultFields = xmlReader.readXml().getResultFields(); - ; Assert.assertNull(resultFields.getFramework()); Assert.assertNull(resultFields.getTestingTool()); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java index 152226e1ed..4d46011623 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java @@ -62,10 +62,12 @@ public class TestNGExtensionTest { @Before public void setUp() throws Exception { mavenName = ToolInstallations.configureMaven3().getName(); + TestUtils.createDummyConfiguration(); } @Test public void testFreestyleProject() throws Exception { + String projectName = "testNG-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); project.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java index a55a3b014b..afcd9c98c4 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java @@ -65,6 +65,8 @@ public static void prepareClass() throws Exception { @Before public void prepareTest() { + TestUtils.createDummyConfiguration(); + TestListener testListener = ExtensionUtil.getInstance(rule, TestListener.class); queue = new TestQueue(); testListener._setTestResultQueue(queue); From 0275eb3d54262f3bc0a50e3035b54198d834fed3 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Mon, 27 Mar 2017 17:53:23 +0300 Subject: [PATCH 0027/2502] unit tests fix --- .../automation/tools/octane/tests/JUnitResultsTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java index abf9992bdc..76dafb42ea 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java @@ -64,11 +64,13 @@ public static void prepareClass() throws Exception { @Before public void prepareTest() { + TestUtils.createDummyConfiguration(); + TestListener testListener = ExtensionUtil.getInstance(rule, TestListener.class); queue = new TestQueue(); testListener._setTestResultQueue(queue); - TestUtils.createDummyConfiguration(); + } @Test From 354b9fb0401954b4c632929f1b7b06b1d2d24327 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Tue, 28 Mar 2017 10:39:22 +0300 Subject: [PATCH 0028/2502] Remove unused import. --- .../octane/model/processors/builders/WorkFlowRunProcessor.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java index 893dc5c62f..4e68e1594d 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java @@ -17,7 +17,6 @@ package com.hp.application.automation.tools.octane.model.processors.builders; import com.google.common.util.concurrent.ListenableFuture; -import com.hp.application.automation.tools.octane.events.RunListenerImpl; import com.hp.application.automation.tools.octane.workflow.WorkflowGraphListener; import hudson.model.Run; import org.apache.logging.log4j.LogManager; From 3a4e4c3661b6eeaf916d66b997581fdf2b816fa6 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Tue, 28 Mar 2017 14:57:01 +0300 Subject: [PATCH 0029/2502] remove octane-cucumber-jvm --- src/test/resources/helloCucumberWorld/pom.xml | 6 +++--- .../helloCucumberWorld/src/test/java/RunnerTest.java | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/resources/helloCucumberWorld/pom.xml b/src/test/resources/helloCucumberWorld/pom.xml index 4547845909..be09fe5071 100644 --- a/src/test/resources/helloCucumberWorld/pom.xml +++ b/src/test/resources/helloCucumberWorld/pom.xml @@ -10,9 +10,9 @@ - com.hpe.alm.octane - octane-cucumber-jvm - 12.53.19 + info.cukes + cucumber-jvm + 1.2.5 diff --git a/src/test/resources/helloCucumberWorld/src/test/java/RunnerTest.java b/src/test/resources/helloCucumberWorld/src/test/java/RunnerTest.java index 3fe583b26e..4a9cca0ec6 100644 --- a/src/test/resources/helloCucumberWorld/src/test/java/RunnerTest.java +++ b/src/test/resources/helloCucumberWorld/src/test/java/RunnerTest.java @@ -1,4 +1,3 @@ -import com.hpe.alm.octane.OctaneCucumber; import cucumber.api.CucumberOptions; import org.junit.runner.RunWith; From 47f70e4f2d1afab96807d28a49ea737f8374354b Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Tue, 28 Mar 2017 15:39:05 +0300 Subject: [PATCH 0030/2502] remove unneeded settings.xml configs. --- .../resources/helloCucumberWorld/settings.xml | 218 +++++++++--------- .../resources/helloWorldFailsafe/settings.xml | 218 +++++++++--------- .../helloWorldRoot/helloWorld/settings.xml | 218 +++++++++--------- .../helloWorldRoot/helloWorld2/settings.xml | 218 +++++++++--------- .../resources/helloWorldRoot/settings.xml | 218 +++++++++--------- .../helloWorld/settings.xml | 218 +++++++++--------- .../helloWorld2/settings.xml | 218 +++++++++--------- .../helloWorldTestNGRoot/settings.xml | 218 +++++++++--------- 8 files changed, 872 insertions(+), 872 deletions(-) diff --git a/src/test/resources/helloCucumberWorld/settings.xml b/src/test/resources/helloCucumberWorld/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloCucumberWorld/settings.xml +++ b/src/test/resources/helloCucumberWorld/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/helloWorldFailsafe/settings.xml b/src/test/resources/helloWorldFailsafe/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloWorldFailsafe/settings.xml +++ b/src/test/resources/helloWorldFailsafe/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/helloWorldRoot/helloWorld/settings.xml b/src/test/resources/helloWorldRoot/helloWorld/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloWorldRoot/helloWorld/settings.xml +++ b/src/test/resources/helloWorldRoot/helloWorld/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/helloWorldRoot/helloWorld2/settings.xml b/src/test/resources/helloWorldRoot/helloWorld2/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloWorldRoot/helloWorld2/settings.xml +++ b/src/test/resources/helloWorldRoot/helloWorld2/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/helloWorldRoot/settings.xml b/src/test/resources/helloWorldRoot/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloWorldRoot/settings.xml +++ b/src/test/resources/helloWorldRoot/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/helloWorldTestNGRoot/helloWorld/settings.xml b/src/test/resources/helloWorldTestNGRoot/helloWorld/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloWorldTestNGRoot/helloWorld/settings.xml +++ b/src/test/resources/helloWorldTestNGRoot/helloWorld/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/helloWorldTestNGRoot/helloWorld2/settings.xml b/src/test/resources/helloWorldTestNGRoot/helloWorld2/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloWorldTestNGRoot/helloWorld2/settings.xml +++ b/src/test/resources/helloWorldTestNGRoot/helloWorld2/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/helloWorldTestNGRoot/settings.xml b/src/test/resources/helloWorldTestNGRoot/settings.xml index b82e246027..ec037edaaa 100644 --- a/src/test/resources/helloWorldTestNGRoot/settings.xml +++ b/src/test/resources/helloWorldTestNGRoot/settings.xml @@ -18,114 +18,114 @@ under the License. --> - - - optional - true - http - proxyuser - proxypass - web-proxy.il.hpecorp.net - 8080 - local.net|some.host.com - - + + + + + + + + + + + + - - - nexus - external:* - http://mydtbld0051.hpeswlab.net:8081/nexus/content/groups/mqm-public - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - m.g.o-public - - - - - - nexus - - - nexus - http://arbitraryUrl - true - true - - - - - nexus - http://arbitraryUrl - true - true - - - - - - jenkins - - true - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ - true - true - - - - - - hudson - - true - - - - - - - - - teamcity - - true - - - - jetbrains-all - http://repository.jetbrains.com/all - - - - - - - - - - nexus - jenkins - teamcity - - - - com.atlassian.maven.plugins - org.mortbay.jetty - org.jenkins-ci.tools - com.hp.mqm.plugins - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f86675037561a247a3dd8b917f6eb8b817795b3b Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Tue, 28 Mar 2017 16:23:44 +0300 Subject: [PATCH 0031/2502] remove cucumber-jvm --- src/test/resources/helloCucumberWorld/pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/resources/helloCucumberWorld/pom.xml b/src/test/resources/helloCucumberWorld/pom.xml index be09fe5071..b013373bfe 100644 --- a/src/test/resources/helloCucumberWorld/pom.xml +++ b/src/test/resources/helloCucumberWorld/pom.xml @@ -9,11 +9,11 @@ 1.0-SNAPSHOT - - info.cukes - cucumber-jvm - 1.2.5 - + + + + + From f3b1752d32b5f99ff90330cfc2bd793abdf5bc6d Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Tue, 28 Mar 2017 21:46:05 +0300 Subject: [PATCH 0032/2502] exclude GherkinResultsTest --- pom.xml | 2 +- src/test/resources/helloCucumberWorld/pom.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 1b734af750..c702ef8cda 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ 2.19.1 - **/TestJenkinsDurationTest.java + **/GherkinResultsTest.java diff --git a/src/test/resources/helloCucumberWorld/pom.xml b/src/test/resources/helloCucumberWorld/pom.xml index b013373bfe..be09fe5071 100644 --- a/src/test/resources/helloCucumberWorld/pom.xml +++ b/src/test/resources/helloCucumberWorld/pom.xml @@ -9,11 +9,11 @@ 1.0-SNAPSHOT - - - - - + + info.cukes + cucumber-jvm + 1.2.5 + From f6413c96efc515cc02c1bb2365384d93b15c3d4e Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Tue, 28 Mar 2017 23:33:46 +0300 Subject: [PATCH 0033/2502] exclude JUnitResultsTest --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index c702ef8cda..8707d90f5d 100644 --- a/pom.xml +++ b/pom.xml @@ -263,6 +263,7 @@ **/GherkinResultsTest.java + **/JUnitResultsTest.java From a765dbee560eae491fac4de422ab9d867f0ca5c9 Mon Sep 17 00:00:00 2001 From: Oren Ben-Meir Date: Wed, 29 Mar 2017 15:29:03 +0300 Subject: [PATCH 0034/2502] Sending logs with Apache client Removed dependency in Bdi SDK Removing dependency on javax.ws.rs.core --- pom.xml | 8 - .../actions/UFTTestDetectionBuildAction.java | 7 +- .../tools/octane/buildLogs/LogDispatcher.java | 188 ++++++++++++++++-- 3 files changed, 174 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 8707d90f5d..d99f1d15a7 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,6 @@ Release 1.642.4 2.2 - 1.0.2 false @@ -559,13 +558,6 @@ 2.0.4 - - - com.hp.bdi - bdi-sdk - ${bdi.version} - - org.jenkins-ci.main jenkins-test-harness-tools diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java index 9a577b70b4..6cb73327ed 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java @@ -40,14 +40,14 @@ import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; -import javax.ws.rs.core.Response; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.*; - + public class UFTTestDetectionBuildAction implements Action { + private final static int RESPONSE_STATUS_CONFLICT=409; private AbstractBuild build; private String workspaceId; private BuildListener buildListener; @@ -245,7 +245,8 @@ private void postTests(MqmRestClient client, String serverURL, List MIN_SIZE_TO_ZIP) { + request.setHeader(HTTP.CONTENT_ENCODING, CONTENT_ENCODING_GZIP); + request.setHeader(UNCOMPRESSED_CONTENT_LENGTH_HEADER, String.valueOf(logFile.length())); + request.setEntity(createGZipEntity(logFile)); + } else { + request.setEntity(new FileEntity(logFile)); + } + + httpResponse = httpClient.execute(request, clientContext); + HttpEntity entity = httpResponse.getEntity(); + ContentType entityContentType = ContentType.getOrDefault(entity); + Charset charset = entityContentType.getCharset() != null ? entityContentType.getCharset() : StandardCharsets.UTF_8; + String responseString = EntityUtils.toString(entity, charset); + + if (httpResponse.getStatusLine().getStatusCode() != 200) { + throw new RequestErrorException(String.format("Response status: %d, Response message: %s", + httpResponse.getStatusLine().getStatusCode(), responseString)); + } + + logger.info(String.format("Successfully sent log of build [%s#%s]", item.getProjectName(), item.getBuildNumber())); logsQueue.remove(); } catch (Exception e) { @@ -104,10 +173,42 @@ private void manageLogsQueue() { if (!logsQueue.failed()) { logger.warn("Maximum number of attempts reached, operation will not be re-attempted for this build"); } + } finally { + if (httpResponse != null) { + EntityUtils.consumeQuietly(httpResponse.getEntity()); + HttpClientUtils.closeQuietly(httpResponse); + } } } } + private HttpClientContext getHttpClientContext() { + if (this.clientContext != null && this.proxyConfiguration == Jenkins.getInstance().proxy) { + return this.clientContext; + } else { + this.clientContext = new HttpClientContext(); + RequestConfig.Builder config = RequestConfig.custom() + .setConnectTimeout(20 * 1000) + .setSocketTimeout(2 * 60 * 1000); + + proxyConfiguration = Jenkins.getInstance().proxy; + if (proxyConfiguration != null) { + HttpHost proxyHost = new HttpHost(proxyConfiguration.name, proxyConfiguration.port); + config.setProxy(proxyHost); + if (proxyConfiguration.getUserName() != null && !proxyConfiguration.getUserName().isEmpty() + && proxyConfiguration.getPassword() != null && !proxyConfiguration.getPassword().isEmpty()) { + AuthScope proxyAuthScope = new AuthScope(proxyConfiguration.name, proxyConfiguration.port); + Credentials credentials = new UsernamePasswordCredentials(proxyConfiguration.getUserName(), proxyConfiguration.getPassword()); + + CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); + credentialsProvider.setCredentials(proxyAuthScope, credentials); + } + } + this.clientContext.setRequestConfig(config.build()); + return this.clientContext; + } + } + private Run getBuildFromQueueItem(ResultQueue.QueueItem item) { Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); if (project == null) { @@ -148,4 +249,55 @@ void enqueueLog(String projectName, int buildNumber, String workspace) { public void setLogResultQueue(LogAbstractResultQueue queue) { this.logsQueue = queue; } + + private String getEncodedPem() { + if (this.encodedPem != null) { + return this.encodedPem; + } else { + String path = System.getProperty("pem_file"); + + try (Reader reader = new FileReader(path)) { + String pem = readToString(reader); + this.encodedPem = DatatypeConverter.printBase64Binary(pem.getBytes()); + } catch (IOException ex) { + logger.error("cannot read pem file from path: " + path); + } + return this.encodedPem; + } + } + + private String readToString(Reader reader) throws IOException { + try (BufferedReader bufferedReader = new BufferedReader(reader)) { + StringBuilder builder = new StringBuilder(); + String line = bufferedReader.readLine(); + while (line != null) { + builder.append(line); + builder.append(System.lineSeparator()); + line = bufferedReader.readLine(); + } + return builder.toString(); + } + } + + private ByteArrayEntity createGZipEntity(File file) { + try (FileInputStream inputStream = new FileInputStream(file); + ByteArrayOutputStream arr = new ByteArrayOutputStream()) { + try (GZIPOutputStream zipper = new GZIPOutputStream(arr)) { + byte[] buffer = new byte[1024]; + + int len; + while ((len = inputStream.read(buffer)) > 0) { + zipper.write(buffer, 0, len); + } + } + + return new ByteArrayEntity(arr.toByteArray(), ContentType.APPLICATION_XML); + } catch (IOException ex) { + throw new RequestErrorException("Failed to create GZip entity.", ex); + } + } + + private boolean isPemFilePropertyInit() { + return System.getProperty("pem_file") != null && !System.getProperty("pem_file").isEmpty(); + } } From 5bf53fcbe24124dfd73369a8961e19bd932568f5 Mon Sep 17 00:00:00 2001 From: Jackzenko Date: Wed, 29 Mar 2017 22:32:09 +0800 Subject: [PATCH 0035/2502] JENKINS-42651 add support for running single functional test on ALM server (#165) * added support for running single test on ALM server * sonar fix --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 74 +++++++++++++++++--- 1 file changed, 64 insertions(+), 10 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 472a1052c7..e8263393d6 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -383,10 +383,14 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double List tsList = null; string tsPath = "Root\\" + tsFolderName; ITestSetFolder tsFolder = null; + bool isTestPath = false; + string testName = ""; + string testSuiteName = tsName; try { tsFolder = (ITestSetFolder)tsTreeManager.get_NodeByPath(tsPath); + isTestPath = false; } catch (COMException ex) { @@ -394,6 +398,27 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double tsFolder = null; } + // test set not found, try to find specific test by path + if(tsFolder == null) + { + // if test set path was not found, the path may points to specific test + // remove the test name and try find test set with parent path + try + { + int pos = tsPath.LastIndexOf("\\") + 1; + testName = testSuiteName; + testSuiteName = tsPath.Substring(pos, tsPath.Length - pos); + tsPath = tsPath.Substring(0, pos - 1); + + tsFolder = (ITestSetFolder)tsTreeManager.get_NodeByPath(tsPath); + isTestPath = true; + } + catch (COMException ex) + { + tsFolder = null; + } + } + if (tsFolder == null) { //node wasn't found, folder = null @@ -405,11 +430,11 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double } else { - tsList = tsFolder.FindTestSets(tsName); + tsList = tsFolder.FindTestSets(testSuiteName); } if (tsList == null) { - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTest, tsName)); + ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTest, testSuiteName)); //this will make sure run will fail at the end. (since there was an error) Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; @@ -418,7 +443,8 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double ITestSet targetTestSet = null; foreach (ITestSet ts in tsList) { - if (ts.Name.Equals(tsName, StringComparison.InvariantCultureIgnoreCase)) + string tempName = ts.Name; + if (tempName.Equals(testSuiteName, StringComparison.InvariantCultureIgnoreCase)) { targetTestSet = ts; break; @@ -427,7 +453,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double if (targetTestSet == null) { - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTest, tsName)); + ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTest, testSuiteName)); //this will make sure run will fail at the end. (since there was an error) Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; @@ -437,12 +463,12 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); ConsoleWriter.WriteLine(Resources.AlmRunnerStartingExecution); - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerDisplayTest, tsName, targetTestSet.ID)); + ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerDisplayTest, testSuiteName, targetTestSet.ID)); ITSScheduler Scheduler = null; try { - //need to run this to install everyhting needed http://AlmServer:8080/qcbin/start_a.jsp?common=true + //need to run this to install everything needed http://AlmServer:8080/qcbin/start_a.jsp?common=true //start the scheduler Scheduler = targetTestSet.StartExecution(""); @@ -474,6 +500,25 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double tdFilter["TC_CYCLE_ID"] = targetTestSet.ID.ToString(); IList tList = tsTestFactory.NewList(tdFilter.Text); + + if (isTestPath) + { + // index starts from 1 !!! + int tListCount = 0; + tListCount = tList.Count; + + // must loop from end to begin + for (int index = tListCount; index > 0; index--) + { + string tListIndexName = tList[index].Name; + string tListIndexTestName = tList[index].TestName; + if (!string.IsNullOrEmpty(tListIndexName) && !string.IsNullOrEmpty(testName) && !testName.Equals(tListIndexName)) + { + tList.Remove(index); + } + } + } + try { //set up for the run depending on where the test instances are to execute @@ -502,6 +547,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double ConsoleWriter.WriteLine(Resources.AlmRunnerNumTests + tList.Count); int i = 1; + foreach (ITSTest3 test in tList) { string runOnHost = runHost; @@ -525,12 +571,20 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double i = i + 1; } + if (tList.Count == 0) + { + ConsoleWriter.WriteErrLine("Specified test not found on ALM, please check your test path."); + //this will make sure run will fail at the end. (since there was an error) + Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; + return null; + } + Stopwatch sw = Stopwatch.StartNew(); - Stopwatch testSw = null; + try { //tests are actually run - Scheduler.Run(); + Scheduler.Run(tList); } catch (Exception ex) { @@ -679,7 +733,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double //currentTest = targetTestSet.TSTestFactory[testExecStatusObj.TSTestId]; - string testPath = "Root\\" + tsFolderName + "\\" + tsName + "\\" + activeTestDesc.TestName; + string testPath = "Root\\" + tsFolderName + "\\" + testSuiteName + "\\" + activeTestDesc.TestName; activeTestDesc.TestPath = testPath; } @@ -687,7 +741,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, double //update the total runtime runDesc.TotalRunTime = sw.Elapsed; - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerTestsetDone, tsName, DateTime.Now.ToString(Launcher.DateFormat))); + ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerTestsetDone, testSuiteName, DateTime.Now.ToString(Launcher.DateFormat))); } else { From 6248e2642bf1c630f9b50d8f75278b7354bab9a5 Mon Sep 17 00:00:00 2001 From: Pavel Chuchma Date: Thu, 30 Mar 2017 11:43:27 +0200 Subject: [PATCH 0036/2502] - using SVConfigurator 4.00.1.46729 to fix connectivity to SV 4.00 - using SVConfigurator from bintray-adm-maven instad of github.com maven repo --- pom.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 991c927cf3..20e12d3e1f 100644 --- a/pom.xml +++ b/pom.xml @@ -290,10 +290,6 @@ central http://repo1.maven.org/maven2 - - hp-application-automation-tools-plugin-mvn-repo - https://raw.github.com/HpeServiceVirtualization/3g/mvn-repo/ - bintray-adm-maven bintray @@ -377,7 +373,7 @@ com.hp.sv SVConfigurator - 3.82.1.45909 + 4.00.1.46729 commons-io From 330cd76d97eea45062e6bc59be8b8f88b8942413 Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Sun, 2 Apr 2017 08:16:35 +0300 Subject: [PATCH 0037/2502] Added ability to run LoadRunner scripts (#175) * Added LR Scrop[t running capability * Added LR Script running capability with parsing to JUnit * Fixed parsing of Lr script to JUnit Added New html report action * sonar fixes * Added code style fixes Fixed support in failed Junit resutls * sonar fixes * Fixed support in serperating script results by script name and action * Added LR Scrop[t running capability * Added LR Script running capability with parsing to JUnit * Fixed parsing of Lr script to JUnit Added New html report action * sonar fixes * Added code style fixes Fixed support in failed Junit resutls * sonar fixes * Fixed support in serperating script results by script name and action * sonar fixes * sonar fixes --- .../LrScriptHtmlReport.java | 85 ++ .../LrScriptHtmlReportAction.java | 75 ++ .../LrScriptResultsSanitizer.java | 80 ++ .../tools/run/LrScriptResultsParser.java | 249 +++++ .../automation/tools/run/RunLRScript.java | 297 ++++++ .../LrScriptHtmlReportAction/index.jelly | 64 ++ .../tools/run/RunLRScript/config.jelly | 6 + .../resources/lib/LR/LR_SCRIPT_REPORT.css | 187 ++++ src/main/resources/lib/LR/PDetails.xsl | 938 ++++++++++++++++++ src/main/webapp/PerformanceReport/VuGen.png | Bin 0 -> 1502 bytes .../tools/run/LrScriptResultsParserTest.java | 52 + 11 files changed, 2033 insertions(+) create mode 100644 src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java create mode 100644 src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java create mode 100644 src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java create mode 100644 src/main/java/com/hp/application/automation/tools/run/LrScriptResultsParser.java create mode 100644 src/main/java/com/hp/application/automation/tools/run/RunLRScript.java create mode 100644 src/main/resources/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction/index.jelly create mode 100644 src/main/resources/com/hp/application/automation/tools/run/RunLRScript/config.jelly create mode 100644 src/main/resources/lib/LR/LR_SCRIPT_REPORT.css create mode 100644 src/main/resources/lib/LR/PDetails.xsl create mode 100644 src/main/webapp/PerformanceReport/VuGen.png create mode 100644 src/test/java/com/hp/application/automation/tools/run/LrScriptResultsParserTest.java diff --git a/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java b/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java new file mode 100644 index 0000000000..ae9ca1cc93 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java @@ -0,0 +1,85 @@ +package com.hp.application.automation.tools.results.lrscriptresultparser; + +/** + * Created by kazaky on 28/03/2017. + */ + +/** + * Stores the information on html report for specific report + */ +@SuppressWarnings("squid:S1068") +public class LrScriptHtmlReport { + public static final String LR_REPORT_FOLDER = "LRReport"; + public static final String BASE_LR_REPORT_URL = "artifact/LRReport/"; + private final String scriptLocalPath; //Created for future use and allow backward compatibility + private String scriptName; + private String htmlUrl; + private String scriptFolderPath; + + /** + * Instantiates a new Lr script html report. + * + * @param scriptName the script name + * @param htmlUrl the html url + */ + public LrScriptHtmlReport(String scriptName, String htmlUrl, String scriptLocalPath) { + this.scriptName = scriptName; + this.scriptFolderPath = BASE_LR_REPORT_URL + scriptName; + this.htmlUrl = scriptFolderPath + htmlUrl; + this.scriptLocalPath = scriptLocalPath; + } + + /** + * Gets script name. + * + * @return the script name + */ + public String getScriptName() { + return scriptName; + } + + /** + * Sets script name. + * + * @param scriptName the script name + */ + public void setScriptName(String scriptName) { + this.scriptName = scriptName; + } + + /** + * Gets html url. + * + * @return the html url + */ + public String getHtmlUrl() { + return htmlUrl; + } + + /** + * Sets html url. + * + * @param htmlUrl the html url + */ + public void setHtmlUrl(String htmlUrl) { + this.htmlUrl = htmlUrl; + } + + /** + * Gets script folder path. + * + * @return the script folder path + */ + public String getScriptFolderPath() { + return this.scriptFolderPath; + } + + /** + * Sets script folder path. + * + * @param scriptFolderPath the script folder path + */ + public void setScriptFolderPath(String scriptFolderPath) { + this.scriptFolderPath = scriptFolderPath; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java b/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java new file mode 100644 index 0000000000..8afcf4f62c --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java @@ -0,0 +1,75 @@ +package com.hp.application.automation.tools.results.lrscriptresultparser; + +import hudson.model.Action; +import hudson.model.Run; +import jenkins.util.VirtualFile; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +/** + * Created by kazaky on 27/03/2017. + */ + +/** + * Presents the LR script HTML report + */ +public class LrScriptHtmlReportAction implements Action { + private final VirtualFile basePath; + private Run build; + private HashSet scripts = new HashSet(); + private List reportMetaDataList = new ArrayList(); + + public LrScriptHtmlReportAction(Run build) { + this.build = build; + this.basePath = build.getArtifactManager().root().child(LrScriptHtmlReport.LR_REPORT_FOLDER); + } + + @SuppressWarnings("squid:S1452") + public final Run getBuild() { + return build; + } + + protected File reportFile() { + return getBuildHtmlReport(); + } + + private File getBuildHtmlReport() { + return new File(basePath.child("index.html").toURI()); + } + + @Override + public String getIconFileName() { + return "/plugin/hp-application-automation-tools-plugin/PerformanceReport/VuGen.png"; + } + + @Override + public String getDisplayName() { + return "LR script report"; + } + + @Override + public String getUrlName() { + return "LRReport"; + } + + // other property of the report + public List getAllReports() { + return this.reportMetaDataList; + } + + public void mergeResult(Run build, String scriptName) { + if (this.scripts == null) { + this.reportMetaDataList = new ArrayList(); + this.scripts = new HashSet(); + } + this.scripts.add(scriptName); + String scriptResultPath = build.getArtifactManager().root().child("LRReport").child(scriptName).toString(); + LrScriptHtmlReport lrScriptHtmlReport = new LrScriptHtmlReport(scriptName,"/result.html", scriptResultPath); + this.reportMetaDataList.add(lrScriptHtmlReport); + } + + +} diff --git a/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java b/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java new file mode 100644 index 0000000000..9cb727bd03 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java @@ -0,0 +1,80 @@ +package com.hp.application.automation.tools.results.lrscriptresultparser; + +import java.io.FilterReader; +import java.io.IOException; +import java.io.Reader; + +/** + * Created by kazaky on 27/03/2017. + */ +public class LrScriptResultsSanitizer extends FilterReader { + /** + * Creates a new filtered reader. + * + * @param in a Reader object providing the underlying stream. + * @throws NullPointerException if in is null + */ + public LrScriptResultsSanitizer(Reader in) { + super(in); + } + + /** + * This is another no-op read() method we have to implement. We implement it + * in terms of the method above. Our superclass implements the remaining + * read() methods in terms of these two. + */ + @Override + public int read() throws IOException { + char[] buf = new char[1]; + int result = read(buf, 0, 1); + if (result == -1) { + return -1; + } else { + return (int) buf[0]; + } + } + + @Override + public int read(char[] buf, int from, int len) throws IOException { + int numchars = 0; // how many characters have been read + // Loop, because we might read a bunch of characters, then strip them + // all out, leaving us with zero characters to return. + while (numchars == 0) { + numchars = in.read(buf, from, len); // Read characters + if (numchars == -1) + return -1; // Check for EOF and handle it. + + // Loop through the characters we read, stripping out HTML tags. + // Characters not in tags are copied over previous tags + int last = from; // Index of last non-HTML char + for (int i = from; i < from + numchars; i++) { + + if(!isBadXMLChar(buf[i])) + { + buf[last] = buf[i]; + last++; + } + } + + + numchars = last - from; // Figure out how many characters remain + } // And if it is more than zero characters + return numchars; // Then return that number. + } + + @SuppressWarnings("squid:S109") + private static boolean isBadXMLChar(char current) + { + switch(current){ + case 9: + case 10: + case 13: + return false; + default: + break; + } + + return !(((current >= 57344) && (current <= 0xfffd)) || ((current >= 32) && (current <= 55295))); + } + +} diff --git a/src/main/java/com/hp/application/automation/tools/run/LrScriptResultsParser.java b/src/main/java/com/hp/application/automation/tools/run/LrScriptResultsParser.java new file mode 100644 index 0000000000..894366bf9d --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/run/LrScriptResultsParser.java @@ -0,0 +1,249 @@ +package com.hp.application.automation.tools.run; + +import hudson.FilePath; +import hudson.model.TaskListener; +import org.w3c.dom.CharacterData; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; + +/** + * Created by YafimK on 22/03/2017. + */ + +/** + * LR Script result xml paser - convers the results XML to JUNIT + */ +public class LrScriptResultsParser { + + + /** + * The constant LR_SCRIPT_RESULT_FILENAME. + */ + public static final String LR_SCRIPT_RESULT_FILENAME = "Results.xml"; + public static final String LR_SCRIPT_PASSED_STATUS = "Passed"; + public static final String LR_SCRIPT_REPORT_PASSED_STATUS = "passed"; + public static final String LR_SCRIPT_REPORT_FAILED_STATUS = "failed"; + private TaskListener _logger; + private String _scriptName; + + public LrScriptResultsParser(TaskListener listener) { + this._logger = listener; + } + + /** + * Parse script result. + * + * @param scriptName the script name + * @param workspace the workspace + * @throws InterruptedException the interrupted exception + */ + public void parseScriptResult(String scriptName, + FilePath workspace) + throws InterruptedException { + this._scriptName = scriptName; + invoke(workspace); + } + + /** + * Invoke void. + * + * @param ws_filePath the ws file path + * @return the void + * @throws IOException the io exception + * @throws InterruptedException the interrupted exception + */ + public void invoke(FilePath ws_filePath) throws InterruptedException { + FilePath sourceFile = ws_filePath.child(this._scriptName).child(LR_SCRIPT_RESULT_FILENAME); + FilePath targetFile = ws_filePath.child(this._scriptName).child("JunitResult.xml"); + parse(sourceFile, targetFile); + } + + /** + * Parse. + * + * @param scriptName the script name + * @param outputFile the output file + */ + public void parse(FilePath scriptName, FilePath outputFile) throws InterruptedException { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder dBuilder = null; + Document doc; + Document newDoc; + try { + dBuilder = dbFactory.newDocumentBuilder(); + doc = dBuilder.parse(scriptName.read()); + + newDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); + + doc.getDocumentElement().normalize(); + NodeList actionNodes = doc.getElementsByTagName("Action"); + + Element testSuits = newDoc.createElement("testsuites"); + parseScriptAction(newDoc, actionNodes, testSuits, scriptName.getParent().getBaseName()); + Element reportSummaryNode = (Element) doc.getElementsByTagName("Summary").item(actionNodes.getLength()); + testSuits.setAttribute( + LR_SCRIPT_REPORT_PASSED_STATUS, reportSummaryNode.getAttribute(LR_SCRIPT_REPORT_PASSED_STATUS)); + testSuits.setAttribute("failures", reportSummaryNode.getAttribute(LR_SCRIPT_REPORT_FAILED_STATUS)); + testSuits.setAttribute("name", scriptName.getParent().getBaseName()); + testSuits.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); + testSuits.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + int tests = + Integer.parseInt(reportSummaryNode.getAttribute(LR_SCRIPT_REPORT_FAILED_STATUS)) + + Integer.parseInt(reportSummaryNode + .getAttribute(LR_SCRIPT_REPORT_PASSED_STATUS)); + testSuits.setAttribute("tests", String.valueOf(tests)); + newDoc.appendChild(testSuits); + newDoc.setXmlVersion("1.0"); + + TransformerFactory tFactory = + TransformerFactory.newInstance(); + Transformer transformer = + tFactory.newTransformer(); + + DOMSource source = new DOMSource(newDoc); + StreamResult result = new StreamResult(outputFile.write()); + + transformer.transform(source, result); + } catch (SAXException e) { + log("XML reader error"); + log(e); + } catch (ParserConfigurationException e) { + log("XML parser error"); + log(e); + } catch (IOException e) { + log("IO error"); + log(e); + } catch (TransformerConfigurationException tce) { + log("* Transformer Factory error"); + log(" " + tce.getMessage()); + + Throwable x = tce; + if (tce.getException() != null) { + x = tce.getException(); + } + log(x); + } catch (TransformerException te) { + log("* Transformation error"); + log(" " + te.getMessage()); + + Throwable x = te; + if (te.getException() != null) { + x = te.getException(); + } + log(x); + } + } + + private void log(Object msg) { + _logger.error(msg.toString()); + } + + private static void parseScriptAction(Document newDoc, NodeList actionNodes, Element rootnode, String scriptName) { + for (int i = 0; i < actionNodes.getLength(); i++) { + + Element action = (Element) actionNodes.item(i); + + + NodeList actionProps = action.getElementsByTagName("AName"); + Element actionName = (Element) actionProps.item(0); + + Element testSuite = newDoc.createElement("testsuite"); + final String suiteName = getCharacterDataFromElement(actionName); + testSuite.setAttribute("name", suiteName); + + NodeList stepNodes = action.getElementsByTagName("Step"); + parseScriptActionStep(newDoc, testSuite, stepNodes, scriptName + "." + suiteName); + + Element suiteSummaryNode = (Element) action.getElementsByTagName("Summary").item(0); + testSuite.setAttribute( + LR_SCRIPT_REPORT_PASSED_STATUS, suiteSummaryNode.getAttribute(LR_SCRIPT_REPORT_PASSED_STATUS)); + testSuite.setAttribute("failures", suiteSummaryNode.getAttribute(LR_SCRIPT_REPORT_FAILED_STATUS)); + int tests = + Integer.parseInt(suiteSummaryNode.getAttribute(LR_SCRIPT_REPORT_FAILED_STATUS)) + + Integer.parseInt(suiteSummaryNode.getAttribute(LR_SCRIPT_REPORT_PASSED_STATUS)); + testSuite.setAttribute("package", scriptName); + + testSuite.setAttribute("tests", String.valueOf(tests)); + if (tests > 0) { + rootnode.appendChild(testSuite); + } + } + } + + private static void parseScriptActionStep(Document newDoc, Element testSuite, NodeList stepNodes, + String className) { + for (int j = 0; j < stepNodes.getLength(); j++) { + Element step = (Element) stepNodes.item(j); + Element objNode = (Element) step.getElementsByTagName("Obj").item(0); + Element testCase = newDoc.createElement("testcase"); + testCase.setAttribute("name", getStepDataFromElement(objNode)); + Element nodeArgs = (Element) step.getElementsByTagName("NodeArgs").item(0); + String stepStatus = nodeArgs.getAttribute("status"); + if (stepStatus.equals(LR_SCRIPT_PASSED_STATUS)) { + stepStatus = "pass"; + } else { + stepStatus = "fail"; + Element failureMessage = newDoc.createElement("failure"); + failureMessage.setAttribute("message", ""); + + testCase.appendChild(failureMessage); + } + testCase.setAttribute("status", stepStatus); + testCase.setAttribute("classname", className); + + testSuite.appendChild(testCase); + } + } + + private static String getStepDataFromElement(Element e) { + String stepName = getCharacterDataFromElement(e); + stepName = stepName.replace("Url: ", ""); + + return stepName; + } + + private static String getCharacterDataFromElement(Element e) { + Node child = e.getFirstChild(); + if (child instanceof CharacterData) { + CharacterData cd = (CharacterData) child; + return cd.getData(); + } + return ""; + } + + /** + * Parse. + * + * @param scriptName the script name + * @param outputFile the output file + * @throws FileNotFoundException the file not found exception + */ + public void parse(File scriptName, File outputFile) throws InterruptedException { + parse(new FilePath(scriptName.getAbsoluteFile()), new FilePath(outputFile.getAbsoluteFile())); + } + + /** + * Sets script name. + * + * @param _scriptName the script name + */ + public void setScriptName(String _scriptName) { + this._scriptName = _scriptName; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/run/RunLRScript.java b/src/main/java/com/hp/application/automation/tools/run/RunLRScript.java new file mode 100644 index 0000000000..74a2cb0b9f --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/run/RunLRScript.java @@ -0,0 +1,297 @@ +package com.hp.application.automation.tools.run; + +import com.hp.application.automation.tools.results.lrscriptresultparser.LrScriptHtmlReportAction; +import com.hp.application.automation.tools.results.lrscriptresultparser.LrScriptResultsSanitizer; +import hudson.EnvVars; +import hudson.Extension; +import hudson.FilePath; +import hudson.Launcher; +import hudson.model.AbstractProject; +import hudson.model.Computer; +import hudson.model.Result; +import hudson.model.Run; +import hudson.model.TaskListener; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; +import hudson.tasks.junit.JUnitResultArchiver; +import hudson.util.ArgumentListBuilder; +import jenkins.model.Jenkins; +import jenkins.tasks.SimpleBuildStep; +import jenkins.util.VirtualFile; +import net.sf.json.JSONObject; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.input.BOMInputStream; +import org.jenkinsci.Symbol; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.StaplerRequest; + +import javax.annotation.Nonnull; +import javax.xml.stream.XMLStreamException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.net.URL; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CodingErrorAction; +import java.nio.charset.StandardCharsets; + +/** + * Created by kazaky on 14/03/2017. + */ + +/** + * This step enables to run LoadRunner scripts directly and collecting their results by converting them to JUnit + */ +public class RunLRScript extends Builder implements SimpleBuildStep { + public static final String LR_SCRIPT_HTML_REPORT_CSS = "PResults.css"; + private static final String LINUX_MDRV_PATH = "/bin/mdrv"; + private static final String WIN_MDRV_PATH = "\\bin\\mmdrv.exe"; + private static final String LR_SCRIPT_HTML_XSLT = "\\lib\\LR\\PDetails.xsl"; + private static final String LR_SCRIPT_HTML_CSS = "\\lib\\LR\\LR_SCRIPT_REPORT.css"; + private final String lrScriptPath; + private Jenkins jenkinsInstance; + private PrintStream logger; + + @DataBoundConstructor + public RunLRScript(String scriptsPath) { + this.lrScriptPath = scriptsPath; + } + + + @Override + public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonnull Launcher launcher, + @Nonnull TaskListener listener) throws InterruptedException, IOException { + try { + jenkinsInstance = Jenkins.getInstance(); + logger = listener.getLogger(); + ArgumentListBuilder args = new ArgumentListBuilder(); + EnvVars env; + String scriptName = FilenameUtils.getBaseName(this.lrScriptPath); + FilePath buildWorkDir = workspace.child(build.getId()); + buildWorkDir.mkdirs(); + buildWorkDir = buildWorkDir.absolutize(); + FilePath scriptPath = workspace.child(this.lrScriptPath); + + FilePath scriptWorkDir = buildWorkDir.child(scriptName); + scriptWorkDir.mkdirs(); + scriptWorkDir = scriptWorkDir.absolutize(); + env = build.getEnvironment(listener); + if (runScriptMdrv(launcher, args, env, scriptPath, scriptWorkDir)) { + build.setResult(Result.FAILURE); + return; + } + + final VirtualFile root = build.getArtifactManager().root(); + + File masterBuildWorkspace = new File(new File(root.toURI()), "LRReport"); + if (!masterBuildWorkspace.exists()) { + if (!root.exists()) { + (new File(root.toURI())).mkdirs(); + } + masterBuildWorkspace.mkdirs(); + } + + FilePath outputHTML = buildWorkDir.child(scriptName); + outputHTML.mkdirs(); + outputHTML = outputHTML.child("result.html"); + FilePath xsltOnNode = copyXsltToNode(workspace); + createHtmlReports(buildWorkDir, scriptName, outputHTML, xsltOnNode); + LrScriptResultsParser lrScriptResultsParser = new LrScriptResultsParser(listener); + lrScriptResultsParser.parseScriptResult(scriptName, buildWorkDir); + copyScriptsResultToMaster(build, listener, buildWorkDir, new FilePath(masterBuildWorkspace)); + parseJunitResult(build, launcher, listener, buildWorkDir, scriptName); + addLrScriptHtmlReportAcrion(build, scriptName); + + build.setResult(Result.SUCCESS); + + } catch (IllegalArgumentException e) { + build.setResult(Result.FAILURE); + logger.println(e); + } catch (IOException | InterruptedException e) { + listener.error("Failed loading build environment " + e); + build.setResult(Result.FAILURE); + } catch (XMLStreamException e) { + listener.error(e.getMessage(), e); + build.setResult(Result.FAILURE); + } + } + + private FilePath copyXsltToNode(@Nonnull FilePath workspace) throws IOException, InterruptedException { + final URL xsltPath = jenkinsInstance.pluginManager.uberClassLoader.getResource(LR_SCRIPT_HTML_XSLT); + FilePath xsltOnNode = workspace.child("resultsHtml.xslt"); + if (!xsltOnNode.exists()) { + xsltOnNode.copyFrom(xsltPath); + } + return xsltOnNode; + } + + private boolean runScriptMdrv(@Nonnull Launcher launcher, ArgumentListBuilder args, + EnvVars env, FilePath scriptPath, FilePath scriptWorkDir) + throws IOException, InterruptedException { + FilePath mdrv; + //base command line mmdrv.exe -usr "%1\%1.usr" -extra_ext NVReportExt -qt_result_dir + // "c:\%1_results" + //Do run the script on linux or windows? + mdrv = getMDRVPath(launcher, env); + args.add(mdrv); + args.add("-usr"); + args.add(scriptPath); + args.add("-extra_ext NVReportExt"); + args.add("-qt_result_dir"); + args.add(scriptWorkDir); + + int returnCode = launcher.launch().cmds(args).stdout(logger).pwd(scriptWorkDir).join(); + return returnCode != 0; + } + + private static FilePath getMDRVPath(@Nonnull Launcher launcher, EnvVars env) { + FilePath mdrv; + if (launcher.isUnix()) { + String lrPath = env.get("M_LROOT", ""); + if ("".equals(lrPath)) { + throw new LrScriptParserException( + "Please make sure environment variables are set correctly on the running node - " + + "LR_PATH for windows and M_LROOT for linux"); + } + lrPath += LINUX_MDRV_PATH; + mdrv = new FilePath(launcher.getChannel(), lrPath); + } else { + String lrPath = env.get("LR_PATH", ""); + if ("".equals(lrPath)) { + throw new LrScriptParserException("P1lease make sure environment variables are set correctly on the " + + "running node - " + + "LR_PATH for windows and M_LROOT for linux"); + } + lrPath += WIN_MDRV_PATH; + mdrv = new FilePath(launcher.getChannel(), lrPath); + } + return mdrv; + } + + private void addLrScriptHtmlReportAcrion(@Nonnull Run build, String scriptName) { + synchronized (build) { + LrScriptHtmlReportAction action = build.getAction(LrScriptHtmlReportAction.class); + if (action == null) { + action = new LrScriptHtmlReportAction(build); + action.mergeResult(build, scriptName); + build.addAction(action); + } else { + action.mergeResult(build, scriptName); + } + } + } + + private static void parseJunitResult(@Nonnull Run build, @Nonnull Launcher launcher, @Nonnull TaskListener + listener, + FilePath buildWorkDir, String scriptName) + throws InterruptedException, IOException { + JUnitResultArchiver jUnitResultArchiver = new JUnitResultArchiver("JunitResult.xml"); + jUnitResultArchiver.setKeepLongStdio(true); + jUnitResultArchiver.setAllowEmptyResults(true); + jUnitResultArchiver.perform(build, buildWorkDir.child(scriptName), launcher, listener); + } + + private void createHtmlReports(FilePath buildWorkDir, String scriptName, FilePath outputHTML, FilePath xsltOnNode) + throws IOException, InterruptedException, XMLStreamException { + if (!buildWorkDir.exists()) { + throw new IllegalArgumentException("Build worker doesn't exist"); + } + if ("".equals(scriptName)) { + throw new IllegalArgumentException("Script name is empty"); + } + if (!xsltOnNode.exists()) { + throw new IllegalArgumentException("LR Html report doesn't exist on the node"); + } + try { + TransformerFactory factory = TransformerFactory.newInstance(); + StreamSource xslStream = new StreamSource(xsltOnNode.read()); + Transformer transformer = factory.newTransformer(xslStream); + + CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder(); + decoder.onMalformedInput(CodingErrorAction.REPLACE).replacement(); + + final InputStreamReader inputStreamReader = new InputStreamReader(new BOMInputStream(buildWorkDir + .child(scriptName).child("Results.xml").read()), decoder); + + StreamSource in = new StreamSource(new LrScriptResultsSanitizer(inputStreamReader)); + StreamResult out = new StreamResult(outputHTML.write()); + transformer.transform(in, out); + final URL lrHtmlCSSPath = jenkinsInstance.pluginManager.uberClassLoader.getResource(LR_SCRIPT_HTML_CSS); + if (lrHtmlCSSPath == null) { + throw new LrScriptParserException( + "For some reason the jenkins instance is null - is it an improper set tests?"); + } + + FilePath lrScriptHtmlReportCss = buildWorkDir.child(scriptName).child(LR_SCRIPT_HTML_REPORT_CSS); + lrScriptHtmlReportCss.copyFrom(lrHtmlCSSPath); + + logger.println("The generated HTML file is:" + outputHTML); + } catch (TransformerConfigurationException e) { + logger.println("TransformerConfigurationException"); + logger.println(e); + } catch (TransformerException e) { + logger.println("TransformerException"); + logger.println(e); + } catch (LrScriptParserException e) { + logger.println("General exception"); + logger.println(e); + } + } + + private static void copyScriptsResultToMaster(@Nonnull Run build, @Nonnull TaskListener listener, + FilePath buildWorkDir, FilePath masterBuildWorkspace) + throws IOException, InterruptedException { + listener.getLogger().printf("Copying script results, from '%s' on '%s' to '%s' on the master. %n" + , buildWorkDir.toURI(), Computer.currentComputer().getNode(), build.getRootDir().toURI()); + + buildWorkDir.copyRecursiveTo(masterBuildWorkspace); + } + + public String getScriptsPath() { + return lrScriptPath; + } + + @Symbol("RunLoadRunnerScript") + @Extension + public static class Descriptor extends BuildStepDescriptor { + + public Descriptor() { + load(); + } + + @Override + public String getDisplayName() { + return "Run LoadRunner script"; + } + + @Override + + public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { + formData.getString("scriptsPath"); + save(); + return super.configure(req, formData); + } + + @Override + public boolean isApplicable(Class aClass) { + return true; + } + + } + + + public static final class LrScriptParserException extends IllegalArgumentException { + + public LrScriptParserException(String s) { + super(s); + } + + } +} diff --git a/src/main/resources/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction/index.jelly b/src/main/resources/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction/index.jelly new file mode 100644 index 0000000000..ede5f5ab5c --- /dev/null +++ b/src/main/resources/com/hp/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction/index.jelly @@ -0,0 +1,64 @@ + + + + + + + +

LoadRunner Vugen Script Reports

+
+ +

+ + + + + + + + + + + + + + +
TypeReport nameFolder
Html_report${s.scriptName} + Open ${s.scriptName} result +
+

+
+ +
+
\ No newline at end of file diff --git a/src/main/resources/com/hp/application/automation/tools/run/RunLRScript/config.jelly b/src/main/resources/com/hp/application/automation/tools/run/RunLRScript/config.jelly new file mode 100644 index 0000000000..802196a9f9 --- /dev/null +++ b/src/main/resources/com/hp/application/automation/tools/run/RunLRScript/config.jelly @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/lib/LR/LR_SCRIPT_REPORT.css b/src/main/resources/lib/LR/LR_SCRIPT_REPORT.css new file mode 100644 index 0000000000..8ba0949328 --- /dev/null +++ b/src/main/resources/lib/LR/LR_SCRIPT_REPORT.css @@ -0,0 +1,187 @@ + +.hl_qt { color: white; font-size: 24pt; font-family: Metric; background-color: #666; text-align: center; padding: 0px 3px 3px } +.hl0 +{ color: #999; font-weight: bold; font-size: 18pt; font-family: Metric; text-align: center; padding: 2px 3px; border-bottom: 3px dotted #999 } +.hl0_name { color: #999; font-weight: normal; font-size: 18pt; font-family: Metric; text-align: center; padding: 2px 3px; border-bottom: 3px dotted #999 } +.hl1 +{ + COLOR: #669; + FONT-FAMILY: Metric; + FONT-SIZE: 16pt; + FONT-WEIGHT: bold +} +.hl2 +{ + COLOR: #669; + FONT-FAMILY: Metric; + FONT-SIZE: 13pt; + FONT-WEIGHT: bold +} +.hl3 { color: #666; font-weight: bold; font-size: 10pt; font-family: Metric; height: 28px } +.hl1name +{ + COLOR: #669; + FONT-FAMILY: Metric; + FONT-SIZE: 16pt; + FONT-WEIGHT: normal +} +.bg_yellow +{ + BACKGROUND-COLOR: #fc0 +} +.bg_gray_eee +{ + BACKGROUND-COLOR: #eee +} +.bg_gray_ccc { background-color: #ccc } +.bg_gray_999 { background-color: #999 } +.bg_midblue +{ + BACKGROUND-COLOR: #99c +} +.bg_ligtblue +{ + BACKGROUND-COLOR: #ccf +} +.bg_darkblue +{ + BACKGROUND-COLOR: #669 +} +.text +{ font-size: 10pt; font-family: Metric } +.text_small +{ + FONT-FAMILY: Metric; + FONT-SIZE: 8pt +} +.text_pitzi +{ + FONT-FAMILY: Metric; + FONT-SIZE: 6.5pt +} +.text_bold +{ + FONT-FAMILY: Metric; + FONT-WEIGHT: bold +} + + +.Failed +{ + COLOR: #f03; + FONT-FAMILY: Metric; + FONT-SIZE: 10pt; + FONT-WEIGHT: bold +} +.FailedLow +{ + COLOR: #f03; + FONT-FAMILY: Metric; + FONT-SIZE: 10pt; +} + +.FailedHigh +{ + COLOR: #f03; + FONT-FAMILY: Metric; + FONT-SIZE: 16pt; + FONT-WEIGHT: bold +} +.Passed +{ + COLOR: #096; + FONT-FAMILY: Metric; + FONT-SIZE: 10pt; + FONT-WEIGHT: bold +} +.PassedHigh +{ + COLOR: #096; + FONT-FAMILY: Metric; + FONT-SIZE: 16pt; + FONT-WEIGHT: bold +} + +.Done +{ + COLOR: #999; + FONT-FAMILY: Metric; + FONT-SIZE: 10pt; + FONT-WEIGHT: bold +} +.DoneHigh +{ color: #999; font-weight: bold; font-size: 16pt; font-family: Metric } +.Information +{ + COLOR: #999; + FONT-FAMILY: Metric; + FONT-SIZE: 10pt; + FONT-WEIGHT: bold +} +.InformationHigh +{ + COLOR: #999; + FONT-FAMILY: Metric; + FONT-SIZE: 16pt; + FONT-WEIGHT: bold +} +.Warning +{ + COLOR: #f96; + FONT-FAMILY: Metric; + FONT-SIZE: 10pt; + FONT-WEIGHT: bold +} +.WarningHigh +{ + COLOR: #f96; + FONT-FAMILY: Metric; + FONT-SIZE: 16pt; + FONT-WEIGHT: bold +} +.tablehl +{ + BACKGROUND-COLOR: #eee; + COLOR: #669; + FONT-FAMILY: Metric; + FONT-SIZE: 10pt; + FONT-WEIGHT: bold; + LINE-HEIGHT: 14pt +} +A +{ + COLOR: #33f; + FONT-FAMILY: Metric +} +A:hover +{ + COLOR: #f03; + FONT-FAMILY: Metric; + FONT-WEIGHT: bold +} +.Condition +{ + COLOR: #333399; + FONT-FAMILY: Metric, sans-serif; + FONT-SIZE: 10pt; + FONT-WEIGHT: bold +} +body { + font-family: Metric, monospace } + + +.tooltiptitle{COLOR: #FFFFFF; TEXT-DECORATION: none; CURSOR: Default; font-family: arial; font-weight: bold; font-size: 8pt} +.tooltipcontent{COLOR: #000000; TEXT-DECORATION: none; CURSOR: Default; font-family: arial; font-size: 8pt} + +#ToolTip{position:absolute; width: 100px; top: 0px; left: 0px; z-index:4; visibility:hidden;} +.brake { font-size: 1px; font-family: Metric; background-color: #366; border-top: 15px solid white; border-bottom: 15px solid white; width: 100%; height: 35px } +.iteration_border { padding-top: 5px; padding-bottom: 5px; padding-left: 10px; border-top: 3px solid #999; border-bottom: 3px solid #999; border-left: 3px solid #999 } +.iteration_head { color: white; font-weight: bold; font-size: 12px; font-family: Metric; background-color: #999; text-align: center; padding: 3px 3px 1px } +.action_border { padding-top: 5px; padding-bottom: 5px; padding-left: 10px; border-top: 3px solid #ccc; border-bottom: 3px solid #ccc; border-left: 3px solid #ccc } +.action_head { color: black; font-weight: bold; font-size: 12px; font-family: Metric; background-color: #ccc; text-align: center; padding: 3px 3px 1px } +.table_frame { padding: 3px; border: solid 1px #669 } +.table_hl { color: #669; font-weight: bold; font-size: 10pt; line-height: 14pt; font-family: Metric; padding-right: 2px; padding-left: 2px; border-top: 1px solid #669; border-bottom: 1px solid #669 } +.table_cell { vertical-align: top; padding: 3px; border-bottom: 1px solid #eee; overflow: visible } +p { font-size: 8pt; font-family: Metric } +td { font-size: 8pt; font-family: Metric } +ul { font-size: 8pt; font-family: Metric } diff --git a/src/main/resources/lib/LR/PDetails.xsl b/src/main/resources/lib/LR/PDetails.xsl new file mode 100644 index 0000000000..879efb2a12 --- /dev/null +++ b/src/main/resources/lib/LR/PDetails.xsl @@ -0,0 +1,938 @@ + + + + + +Business Process Test: +Business Component: +Test: +Input Parameters +Value +Output Parameters +Step Name: +Object +Details +Result +Time + Results Summary +Action: +Run started: +Run ended: +Result: +Status +Times +Passed +Failed +Warning +Done +Warnings +Iteration +Object +Details +Result +Time +Results name : +Time Zone: +Test version: +Test set: +Test instance: +Iteration # +Results + Report +Test Iteration +Name +End: +Business Component +Step +Product name: + Summary: + + + + + + + <xsl:value-of select="Report/General/@productName"/><xsl:copy-of select="$IDS_REPORT"/> + + + +
+ + + + + + + +
+
+
+ + +

+
+ +

+
+ +

+
+
+
+
+ + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + High + + + +
+

+ + + + +
+ + + + + + + + + + + + + + + +
+
+
+ +
+
+
+ +
+
+
+ + + + +
+
+
+
+
+
+ + + + +
+ + + + +
+ + + +
+
+ +
+
+
+ + + + + +
+ + + + + + + + + + + + +
+ + + + +
+
+ + + + + +
+ + + + + + + + + + + + +
+

+
+

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+

+ +

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + +
+

+


+

+

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + +
+
+ + + + + + + + + + + + +
+ (Iteration ) +
+ + + + +
+ +
+
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + +

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
+ +

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +


+ + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
+ +

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + + + + +
+ + + + + + + + + + + +
+
+ +
+ diff --git a/src/main/webapp/PerformanceReport/VuGen.png b/src/main/webapp/PerformanceReport/VuGen.png new file mode 100644 index 0000000000000000000000000000000000000000..eba5a5bfba50dc25386a55ac54ed4f9416b00695 GIT binary patch literal 1502 zcmV<41tI#0P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1#?M6K~zXfl~!9% zR96(9N9(;((_pk|lg6edHfhqNO&{8rG)Rahctb$}@e0u>1W`#; zj0&QFI5!3dkP*2Q1O#-@;SvVVoHJ*iulrlhKnFp?N>&c+vuAy4ed~5ySb*5Jjd(l` z%d$lI|3c)wV2CrDjg z9nPOWk27b^;MA#8IC=8qwDRoMty}2p>w9mc^McXS!NEaXyLJslMMXGq;slN#KQ3BW zScqfCj-_ZxNeOy;d*2!1ykMm6_U+p^efqQj(BP3HN06VNFVXRto12Tgygd1v&+_te zOiWB9EW9oAg7x?J3lO6yC@2u1mX;PN35=!0GCMn4*qD#XdBON20+Aki9gD>hZ&SrIO^N>S;lmQy zrAwC<4pvoFB_QC+{&Pq-;J00K#}(?%cV9%F0UA)YKpx4vWzw(4IYe(9qBz1{uY@d-tU0m_xP=LAe=RYSIVw zXanq~=>na$5^{`)7Y7i4jk0fg_AF)Tj zAU63_W*?1kJW=UACw(Lm5jr_Nm|ylDfwpbiCf_S`NSfL)`d~iZ0>ix;hDU?>(qS}h zgwgu52Kg06@LRn0u7mMtGe*NtB!A2WL8)wPMoMb=Otu8+<97;Mh4N;CI0{M++gR&n zyngU8Uc1w@>Zf-traW5p*;M^Uh&FryYp6u>S5Z+hO;b_{kObMjeY;S}NR?6oGc$-C z8}>vaVo(0k#@B1(s}ZeRg=lS>)^tR@n_%=7>f8;>bPpGy448)7btVYFEGE~FReg&xpWx~ zC&}!+HVZ5%`jRdV8h4alnmX!t32EXwVH?naxtAyKAH?0p8l!Kdp8x;=07*qoM6N<$ Ef?@i`XaE2J literal 0 HcmV?d00001 diff --git a/src/test/java/com/hp/application/automation/tools/run/LrScriptResultsParserTest.java b/src/test/java/com/hp/application/automation/tools/run/LrScriptResultsParserTest.java new file mode 100644 index 0000000000..912152246a --- /dev/null +++ b/src/test/java/com/hp/application/automation/tools/run/LrScriptResultsParserTest.java @@ -0,0 +1,52 @@ +package com.hp.application.automation.tools.run; + +import hudson.FilePath; +import hudson.tasks.junit.TestResult; +import org.junit.Test; +import org.junit.Before; +import org.junit.After; + +import java.io.File; + +/** +* LrScriptResultsParser Tester. +* +* @author +* @since
��� 22, 2017
+* @version 1.0 +*/ +public class LrScriptResultsParserTest { + +@Before +public void before() throws Exception { +} + +@After +public void after() throws Exception { +} + +/** +* +* Method: parse(String scriptName) +* +*/ +@Test +public void testParse() throws Exception { + final String pathname = "C:\\Jenkins\\jobs\\TestRunLRScriptReg\\builds\\13\\WebHttpHtml1\\Results.xml"; + final String junitOutput = "C:\\Jenkins\\jobs\\TestRunLRScriptReg\\builds\\31\\WebHttpHtml1\\JunitResult.xml"; + + FilePath resultFile = new FilePath(new File(pathname)); + FilePath junitFile = new FilePath(new File(junitOutput)); + +// LrScriptResultsParser lrscriptresultparser = new LrScriptResultsParser(); +// lrscriptresultparser.parse(resultFile, junitFile); + + TestResult testResult = new TestResult(); + testResult.parse(new File(junitOutput)); + testResult.tally(); + + +} + + +} From e0a036eb51a63fa12861e8b36895c7d7dfd3b9d5 Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Sun, 2 Apr 2017 09:40:11 +0300 Subject: [PATCH 0038/2502] Update pom.xml Update version for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c8cb80b7b0..97eb36acd5 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ hp-application-automation-tools-plugin - 5.2-beta-SNAPSHOT + 5.101-beta-SNAPSHOT hpi HP Application Automation Tools The plugin integrates Jenkins with the following HPE products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. From cbc0c0ecedd1120a0e377d88ddb3db1377a64c6d Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Sun, 2 Apr 2017 09:49:55 +0300 Subject: [PATCH 0039/2502] Update readme.md --- readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/readme.md b/readme.md index 9f0edd9f71..d26915ad5f 100644 --- a/readme.md +++ b/readme.md @@ -4,6 +4,13 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ec4415bffe94fda8ae40415388c063e)](https://www.codacy.com/app/HPEbot/hp-application-automation-tools-plugin?utm_source=github.com&utm_medium=referral&utm_content=hpsa/hp-application-automation-tools-plugin&utm_campaign=badger) +Project status: +[![Build status](https://ci.appveyor.com/api/projects/status/gqd0x8ov1ebqjjcu?svg=true)](https://ci.appveyor.com/project/HPEbot/hp-application-automation-tools-plugin) + +Latest release branch status: +[![Build status](https://ci.appveyor.com/api/projects/status/gqd0x8ov1ebqjjcu/branch/latest?svg=true)](https://ci.appveyor.com/project/HPEbot/hp-application-automation-tools-plugin/branch/latest) + + ##### The plugin provides the ability to run HPE products with Jenkins during builds. ## Relevent links From f0116799fb224e448ec62823eda5cc0409295308 Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Mon, 3 Apr 2017 12:06:41 +0300 Subject: [PATCH 0040/2502] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 97eb36acd5..6fd8a8d3df 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ hp-application-automation-tools-plugin - 5.101-beta-SNAPSHOT + 5.1.0.1-beta-SNAPSHOT hpi HP Application Automation Tools The plugin integrates Jenkins with the following HPE products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. From d72efb6ed6f6540a1a21f71ffaca90bf239c65c6 Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Tue, 4 Apr 2017 09:07:35 +0300 Subject: [PATCH 0041/2502] moved style files to main resources (#179) fixed LRScript to support jenkins enviroment variabals --- .../automation/tools/run/RunLRScript.java | 12 +++++++----- src/main/resources/{lib/LR => }/LR_SCRIPT_REPORT.css | 0 src/main/resources/{lib/LR => }/PDetails.xsl | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) rename src/main/resources/{lib/LR => }/LR_SCRIPT_REPORT.css (100%) rename src/main/resources/{lib/LR => }/PDetails.xsl (99%) diff --git a/src/main/java/com/hp/application/automation/tools/run/RunLRScript.java b/src/main/java/com/hp/application/automation/tools/run/RunLRScript.java index 74a2cb0b9f..8891000afa 100644 --- a/src/main/java/com/hp/application/automation/tools/run/RunLRScript.java +++ b/src/main/java/com/hp/application/automation/tools/run/RunLRScript.java @@ -53,8 +53,8 @@ public class RunLRScript extends Builder implements SimpleBuildStep { public static final String LR_SCRIPT_HTML_REPORT_CSS = "PResults.css"; private static final String LINUX_MDRV_PATH = "/bin/mdrv"; private static final String WIN_MDRV_PATH = "\\bin\\mmdrv.exe"; - private static final String LR_SCRIPT_HTML_XSLT = "\\lib\\LR\\PDetails.xsl"; - private static final String LR_SCRIPT_HTML_CSS = "\\lib\\LR\\LR_SCRIPT_REPORT.css"; + private static final String LR_SCRIPT_HTML_XSLT = "PDetails.xsl"; + private static final String LR_SCRIPT_HTML_CSS = "LR_SCRIPT_REPORT.css"; private final String lrScriptPath; private Jenkins jenkinsInstance; private PrintStream logger; @@ -77,12 +77,13 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn FilePath buildWorkDir = workspace.child(build.getId()); buildWorkDir.mkdirs(); buildWorkDir = buildWorkDir.absolutize(); - FilePath scriptPath = workspace.child(this.lrScriptPath); - + env = build.getEnvironment(listener); + FilePath scriptPath = workspace.child(env.expand(this.lrScriptPath)); FilePath scriptWorkDir = buildWorkDir.child(scriptName); scriptWorkDir.mkdirs(); scriptWorkDir = scriptWorkDir.absolutize(); - env = build.getEnvironment(listener); + + if (runScriptMdrv(launcher, args, env, scriptPath, scriptWorkDir)) { build.setResult(Result.FAILURE); return; @@ -125,6 +126,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn private FilePath copyXsltToNode(@Nonnull FilePath workspace) throws IOException, InterruptedException { final URL xsltPath = jenkinsInstance.pluginManager.uberClassLoader.getResource(LR_SCRIPT_HTML_XSLT); + logger.println("loading XSLT from " + xsltPath.getFile()); FilePath xsltOnNode = workspace.child("resultsHtml.xslt"); if (!xsltOnNode.exists()) { xsltOnNode.copyFrom(xsltPath); diff --git a/src/main/resources/lib/LR/LR_SCRIPT_REPORT.css b/src/main/resources/LR_SCRIPT_REPORT.css similarity index 100% rename from src/main/resources/lib/LR/LR_SCRIPT_REPORT.css rename to src/main/resources/LR_SCRIPT_REPORT.css diff --git a/src/main/resources/lib/LR/PDetails.xsl b/src/main/resources/PDetails.xsl similarity index 99% rename from src/main/resources/lib/LR/PDetails.xsl rename to src/main/resources/PDetails.xsl index 879efb2a12..3f1377f183 100644 --- a/src/main/resources/lib/LR/PDetails.xsl +++ b/src/main/resources/PDetails.xsl @@ -1,5 +1,5 @@ - + From 5a753b070e65ad67d105e323ae944081c5dfc6d3 Mon Sep 17 00:00:00 2001 From: YafimK Date: Tue, 4 Apr 2017 23:36:16 +0300 Subject: [PATCH 0042/2502] [maven-release-plugin] prepare release hp-application-automation-tools-plugin-5.1.0.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6fd8a8d3df..c2449efcec 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ hp-application-automation-tools-plugin - 5.1.0.1-beta-SNAPSHOT + 5.1.0.1-beta hpi HP Application Automation Tools The plugin integrates Jenkins with the following HPE products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -47,7 +47,7 @@ scm:git:ssh://git@github.com/hpsa/hp-application-automation-tools-plugin.git https://github.com/hpsa/hp-application-automation-tools-plugin - HEAD + hp-application-automation-tools-plugin-5.1.0.1-beta JIRA From ab5b1dd1595d937e3fec4a8eeef07797a2f74dc1 Mon Sep 17 00:00:00 2001 From: YafimK Date: Tue, 4 Apr 2017 23:36:28 +0300 Subject: [PATCH 0043/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c2449efcec..27802338cc 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ hp-application-automation-tools-plugin - 5.1.0.1-beta + 5.1.0.2-beta-SNAPSHOT hpi HP Application Automation Tools The plugin integrates Jenkins with the following HPE products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -47,7 +47,7 @@ scm:git:ssh://git@github.com/hpsa/hp-application-automation-tools-plugin.git https://github.com/hpsa/hp-application-automation-tools-plugin - hp-application-automation-tools-plugin-5.1.0.1-beta + HEAD JIRA From ca90fd9009f307eaed8233eadd1bf964d71c3846 Mon Sep 17 00:00:00 2001 From: radislavB Date: Thu, 6 Apr 2017 14:55:21 +0300 Subject: [PATCH 0044/2502] fix discovery recursive job calling (#178) * discovery recursive job calling don't throw exception if fail to discover one of the jobs * don't throw exception if fail to discover one of the jobs - fix defect * add javaDoc --- .../tools/octane/CIJenkinsServicesImpl.java | 58 +++-- .../builders/AbstractBuilderProcessor.java | 20 +- .../builders/BuildTriggerProcessor.java | 13 +- .../builders/MultiJobBuilderProcessor.java | 19 +- .../ParameterizedTriggerProcessor.java | 16 +- .../projects/AbstractProjectProcessor.java | 230 +++++++++++------- .../projects/FreeStyleProjectProcessor.java | 14 +- .../projects/JobProcessorFactory.java | 19 +- .../projects/MatrixProjectProcessor.java | 14 +- .../projects/MavenProjectProcessor.java | 16 +- .../projects/MultiJobProjectProcessor.java | 14 +- 11 files changed, 239 insertions(+), 194 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java index 75cf55d563..c0ae883ab3 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -66,6 +66,9 @@ import java.util.Set; import java.util.regex.Pattern; +/** + * Base implementation of SPI(service provider interface) of Octane CI SDK for Jenkins + */ public class CIJenkinsServicesImpl implements CIPluginServices { private static final Logger logger = LogManager.getLogger(CIJenkinsServicesImpl.class); private static final DTOFactory dtoFactory = DTOFactory.getInstance(); @@ -158,36 +161,45 @@ public CIJobsList getJobsList(boolean includeParameters) { List itemNames = (List) Jenkins.getInstance().getTopLevelItemNames(); for (String name : itemNames) { tmpItem = Jenkins.getInstance().getItem(name); - if (tmpItem instanceof AbstractProject) { - AbstractProject abstractProject = (AbstractProject) tmpItem; - tmpConfig = dtoFactory.newDTO(PipelineNode.class) - .setJobCiId(JobProcessorFactory.getFlowProcessor(abstractProject).getJobCiId()) - .setName(name); - if (includeParameters) { - tmpConfig.setParameters(ParameterProcessors.getConfigs(abstractProject)); - } - list.add(tmpConfig); - } else if (tmpItem.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { - Job tmpJob = (Job) tmpItem; - tmpConfig = dtoFactory.newDTO(PipelineNode.class) - .setJobCiId(JobProcessorFactory.getFlowProcessor(tmpJob).getJobCiId()) - .setName(name); - if (includeParameters) { - tmpConfig.setParameters(ParameterProcessors.getConfigs(tmpJob)); - } - list.add(tmpConfig); - } else if (tmpItem.getClass().getName().equals("com.cloudbees.hudson.plugins.folder.Folder")) { - for (Job tmpJob : tmpItem.getAllJobs()) { + + try { + if (tmpItem instanceof AbstractProject) { + AbstractProject abstractProject = (AbstractProject) tmpItem; + if (abstractProject.isDisabled()) { + continue; + } + tmpConfig = dtoFactory.newDTO(PipelineNode.class) + .setJobCiId(JobProcessorFactory.getFlowProcessor(abstractProject).getJobCiId()) + .setName(name); + if (includeParameters) { + tmpConfig.setParameters(ParameterProcessors.getConfigs(abstractProject)); + } + list.add(tmpConfig); + } else if (tmpItem.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { + Job tmpJob = (Job) tmpItem; tmpConfig = dtoFactory.newDTO(PipelineNode.class) .setJobCiId(JobProcessorFactory.getFlowProcessor(tmpJob).getJobCiId()) - .setName(tmpJob.getName()); + .setName(name); if (includeParameters) { tmpConfig.setParameters(ParameterProcessors.getConfigs(tmpJob)); } list.add(tmpConfig); + } else if (tmpItem.getClass().getName().equals("com.cloudbees.hudson.plugins.folder.Folder")) { + for (Job tmpJob : tmpItem.getAllJobs()) { + tmpConfig = dtoFactory.newDTO(PipelineNode.class) + .setJobCiId(JobProcessorFactory.getFlowProcessor(tmpJob).getJobCiId()) + .setName(tmpJob.getName()); + if (includeParameters) { + tmpConfig.setParameters(ParameterProcessors.getConfigs(tmpJob)); + } + list.add(tmpConfig); + } + } else { + logger.info("item '" + name + "' is not of supported type"); } - } else { - logger.info("item '" + name + "' is not of supported type"); + } catch (Throwable e) { + logger.error("Failed to add job '" + name + "' to JobList : " + e.getClass().getCanonicalName() + " - " + e.getMessage(), e); + //throw e; } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java index 5e43314224..55ff10157a 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java @@ -23,17 +23,17 @@ import java.util.List; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 09/01/15 - * Time: 00:59 - * To change this template use File | Settings | File Templates. + * Base class for discovery/provisioning of an internal phases/steps of the specific Job */ - public abstract class AbstractBuilderProcessor { - protected ArrayList phases = new ArrayList(); + protected ArrayList phases = new ArrayList<>(); - public List getPhases() { - return phases; - } + /** + * Retrieves previously processed and prepared phases of the specific Builder (Jenkins' internal Job invoker) + * + * @return list of phases + */ + public List getPhases() { + return phases; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java index a9c2c4ba4b..6eaac3388b 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java @@ -18,6 +18,7 @@ import com.hp.application.automation.tools.octane.model.ModelFactory; import hudson.model.AbstractProject; +import hudson.model.Job; import hudson.tasks.BuildTrigger; import hudson.tasks.Publisher; import org.apache.logging.log4j.LogManager; @@ -26,25 +27,21 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Set; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 08/01/15 - * Time: 23:01 - * To change this template use File | Settings | File Templates. + * Implementation for discovery/provisioning of an internal phases/steps of the specific Job in context of BuildTrigger */ - public class BuildTriggerProcessor extends AbstractBuilderProcessor { private static final Logger logger = LogManager.getLogger(BuildTriggerProcessor.class); - public BuildTriggerProcessor(Publisher publisher, AbstractProject project) { + public BuildTriggerProcessor(Publisher publisher, AbstractProject project, Set processedJobs) { BuildTrigger t = (BuildTrigger) publisher; super.phases = new ArrayList<>(); List items = t.getChildProjects(project.getParent()); for (Iterator iterator = items.iterator(); iterator.hasNext(); ) { AbstractProject next = iterator.next(); - if (next == null) { + if (next == null || processedJobs.contains(next)) { iterator.remove(); logger.warn("encountered null project reference; considering it as corrupted configuration and skipping"); } diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java index 08769dcda2..17d8eb1806 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java @@ -20,6 +20,7 @@ import com.tikal.jenkins.plugins.multijob.MultiJobBuilder; import com.tikal.jenkins.plugins.multijob.PhaseJobsConfig; import hudson.model.AbstractProject; +import hudson.model.Job; import hudson.tasks.Builder; import jenkins.model.Jenkins; import org.apache.logging.log4j.LogManager; @@ -27,29 +28,27 @@ import java.util.ArrayList; import java.util.List; +import java.util.Set; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 08/01/15 - * Time: 23:02 - * To change this template use File | Settings | File Templates. + * Implementation for discovery/provisioning of an internal phases/steps of the specific Job in context of MultiJob Plugin */ - public class MultiJobBuilderProcessor extends AbstractBuilderProcessor { private static final Logger logger = LogManager.getLogger(MultiJobBuilderProcessor.class); - public MultiJobBuilderProcessor(Builder builder) { + public MultiJobBuilderProcessor(Builder builder, Set processedJobs) { MultiJobBuilder b = (MultiJobBuilder) builder; super.phases = new ArrayList<>(); List items = new ArrayList<>(); AbstractProject tmpProject; for (PhaseJobsConfig config : b.getPhaseJobs()) { tmpProject = (AbstractProject) Jenkins.getInstance().getItem(config.getJobName()); - if (tmpProject != null) { - items.add(tmpProject); - } else { + if (tmpProject == null) { logger.warn("project named '" + config.getJobName() + "' not found; considering this as corrupted configuration and skipping the project"); + } else if (processedJobs.contains(tmpProject)) { + logger.warn("project named '" + config.getJobName() + "' is duplicated"); + } else { + items.add(tmpProject); } } super.phases.add(ModelFactory.createStructurePhase(b.getPhaseName(), true, items)); diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java index 7ef4f743d4..789f14a03d 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java @@ -31,19 +31,15 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Set; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 08/01/15 - * Time: 23:01 - * To change this template use File | Settings | File Templates. + * Implementation for discovery/provisioning of an internal phases/steps of the specific Job in context of ParameterizedTrigger Plugin */ - public class ParameterizedTriggerProcessor extends AbstractBuilderProcessor { private static final Logger logger = LogManager.getLogger(ParameterizedTriggerProcessor.class); - public ParameterizedTriggerProcessor(Builder builder, Job job, String phasesName) { + public ParameterizedTriggerProcessor(Builder builder, Job job, String phasesName, Set processedJobs) { TriggerBuilder b = (TriggerBuilder) builder; super.phases = new ArrayList<>(); List items; @@ -51,7 +47,7 @@ public ParameterizedTriggerProcessor(Builder builder, Job job, String phasesName items = config.getProjectList(job.getParent(), null); for (Iterator iterator = items.iterator(); iterator.hasNext(); ) { AbstractProject next = iterator.next(); - if (next == null) { + if (next == null || processedJobs.contains(next)) { iterator.remove(); logger.warn("encountered null project reference; considering it as corrupted configuration and skipping"); } @@ -60,7 +56,7 @@ public ParameterizedTriggerProcessor(Builder builder, Job job, String phasesName } } - public ParameterizedTriggerProcessor(Publisher publisher, AbstractProject project, String phasesName) { + public ParameterizedTriggerProcessor(Publisher publisher, AbstractProject project, String phasesName, Set processedJobs) { BuildTrigger t = (BuildTrigger) publisher; super.phases = new ArrayList<>(); List items; @@ -68,7 +64,7 @@ public ParameterizedTriggerProcessor(Publisher publisher, AbstractProject projec items = config.getProjectList(project.getParent(), null); for (Iterator iterator = items.iterator(); iterator.hasNext(); ) { AbstractProject next = iterator.next(); - if (next == null) { + if (next == null || processedJobs.contains(next)) { iterator.remove(); logger.warn("encountered null project reference; considering it as corrupted configuration and skipping"); } diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 243735759f..5407359b78 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -16,11 +16,11 @@ package com.hp.application.automation.tools.octane.model.processors.projects; -import com.hp.octane.integrations.dto.pipelines.PipelinePhase; import com.hp.application.automation.tools.octane.model.processors.builders.AbstractBuilderProcessor; import com.hp.application.automation.tools.octane.model.processors.builders.BuildTriggerProcessor; import com.hp.application.automation.tools.octane.model.processors.builders.MultiJobBuilderProcessor; import com.hp.application.automation.tools.octane.model.processors.builders.ParameterizedTriggerProcessor; +import com.hp.octane.integrations.dto.pipelines.PipelinePhase; import hudson.model.AbstractProject; import hudson.model.Job; import hudson.tasks.BuildStep; @@ -33,6 +33,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * Created with IntelliJ IDEA. @@ -42,95 +43,142 @@ * To change this template use File | Settings | File Templates. */ -@SuppressWarnings({"squid:S1132","squid:S1872"}) +@SuppressWarnings({"squid:S1132", "squid:S1872"}) public abstract class AbstractProjectProcessor { - private static final Logger logger = LogManager.getLogger(AbstractProjectProcessor.class); - private final List internals = new ArrayList<>(); - private final List postBuilds = new ArrayList<>(); - - T job; - - AbstractProjectProcessor(T job) { - this.job = job; - } - - // PUBLIC APIs - // - public abstract List tryGetBuilders(); - - public abstract void scheduleBuild(String parametersBody); - - public String getJobCiId() { - if (job.getParent().getClass().getName().equals("com.cloudbees.hudson.plugins.folder.Folder")) { - String jobPlainName = job.getFullName(); // e.g: myFolder/myJob - return jobPlainName.replaceAll("/", "/job/"); - } else { - return job.getName(); - } - } - - public List getInternals() { - return internals; - } - - public List getPostBuilds() { - return postBuilds; - } - - // INTERNALS - // - void processBuilders(List builders, Job job) { - this.processBuilders(builders, job, ""); - } - - void processBuilders(List builders, Job job, String phasesName) { - for (Builder builder : builders) { - builderClassValidator(builder, job, phasesName); - } - } - - @SuppressWarnings("unchecked") - void processPublishers(Job job) { - if (job instanceof AbstractProject) { - AbstractProject project = (AbstractProject) job; - AbstractBuilderProcessor builderProcessor; - List publishers = project.getPublishersList(); - for (Publisher publisher : publishers) { - builderProcessor = null; - if (publisher.getClass().getName().equals("hudson.tasks.BuildTrigger")) { - builderProcessor = new BuildTriggerProcessor(publisher, project); - } else if (publisher.getClass().getName().equals("hudson.plugins.parameterizedtrigger.BuildTrigger")) { - builderProcessor = new ParameterizedTriggerProcessor(publisher, project, ""); - } - if (builderProcessor != null) { - postBuilds.addAll(builderProcessor.getPhases()); - } else { - logger.debug("not yet supported publisher (post build) action: " + publisher.getClass().getName()); - } - } - } - } - - private void builderClassValidator(Builder builder, Job job, String phasesName) { - AbstractBuilderProcessor builderProcessor = null; - if (builder.getClass().getName().equals("org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder")) { - ConditionalBuilder conditionalBuilder = (ConditionalBuilder) builder; - for (BuildStep currentBuildStep : conditionalBuilder.getConditionalbuilders()) { - builderClassValidator((Builder) currentBuildStep, job, phasesName); - } - } else if (builder.getClass().getName().equals("org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder")) { - SingleConditionalBuilder singleConditionalBuilder = (SingleConditionalBuilder) builder; - builderClassValidator((Builder) singleConditionalBuilder.getBuildStep(), job, phasesName); - } else if (builder.getClass().getName().equals("hudson.plugins.parameterizedtrigger.TriggerBuilder")) { - builderProcessor = new ParameterizedTriggerProcessor(builder, job, phasesName); - } else if (builder.getClass().getName().equals("com.tikal.jenkins.plugins.multijob.MultiJobBuilder")) { - builderProcessor = new MultiJobBuilderProcessor(builder); - } - - if (builderProcessor != null) { - internals.addAll(builderProcessor.getPhases()); - } else { - logger.debug("not yet supported build (internal) action: " + builder.getClass().getName()); - } - } + private static final Logger logger = LogManager.getLogger(AbstractProjectProcessor.class); + private final List internals = new ArrayList<>(); + private final List postBuilds = new ArrayList<>(); + + T job; + + AbstractProjectProcessor(T job) { + this.job = job; + } + + /** + * Attempt to retrieve an [internal] build phases of the Job + * + * @return + */ + public abstract List tryGetBuilders(); + + /** + * Enqueue Job's run with the specified parameters + * + * @param parametersBody parameters for the Job execution in a RAW JSON format + */ + public abstract void scheduleBuild(String parametersBody); + + /** + * Retrieve Job's CI ID + * + * @return Job's CI ID + */ + public String getJobCiId() { + if (job.getParent().getClass().getName().equals("com.cloudbees.hudson.plugins.folder.Folder")) { + String jobPlainName = job.getFullName(); // e.g: myFolder/myJob + return jobPlainName.replaceAll("/", "/job/"); + } else { + return job.getName(); + } + } + + /** + * Discover an internal phases of the Job + * + * @return list of phases + */ + public List getInternals() { + return internals; + } + + /** + * Discover a post build phases of the Job + * + * @return list of phases + */ + public List getPostBuilds() { + return postBuilds; + } + + /** + * Internal API + * Processes and prepares Job's children for future use - internal flow + * + * @param builders Job's builders + * @param job Job to process + * @param processedJobs previously processed Jobs in this Job's hierarchical chain in order to break the recursive flows + */ + void processBuilders(List builders, Job job, Set processedJobs) { + this.processBuilders(builders, job, "", processedJobs); + } + + /** + * Internal API + * Processes and prepares Job's children for future use - internal flow + * + * @param builders Job's builders + * @param job Job to process + * @param phasesName Targeted phase name in case of available one + * @param processedJobs previously processed Jobs in this Job's hierarchical chain in order to break the recursive flows + */ + void processBuilders(List builders, Job job, String phasesName, Set processedJobs) { + for (Builder builder : builders) { + builderClassValidator(builder, job, phasesName, processedJobs); + } + } + + /** + * Internal API + * Processes and prepares Job's children for future use - post build flow + * + * @param job Job to process + * @param processedJobs previously processed Jobs in this Job's hierarchical chain in order to break the recursive flows + */ + @SuppressWarnings("unchecked") + void processPublishers(Job job, Set processedJobs) { + if (job instanceof AbstractProject) { + AbstractProject project = (AbstractProject) job; + processedJobs.add(job); + AbstractBuilderProcessor builderProcessor; + List publishers = project.getPublishersList(); + for (Publisher publisher : publishers) { + builderProcessor = null; + if (publisher.getClass().getName().equals("hudson.tasks.BuildTrigger")) { + builderProcessor = new BuildTriggerProcessor(publisher, project, processedJobs); + } else if (publisher.getClass().getName().equals("hudson.plugins.parameterizedtrigger.BuildTrigger")) { + builderProcessor = new ParameterizedTriggerProcessor(publisher, project, "", processedJobs); + } + if (builderProcessor != null) { + postBuilds.addAll(builderProcessor.getPhases()); + } else { + logger.debug("not yet supported publisher (post build) action: " + publisher.getClass().getName()); + } + } + } + } + + private void builderClassValidator(Builder builder, Job job, String phasesName, Set processedJobs) { + processedJobs.add(job); + AbstractBuilderProcessor builderProcessor = null; + if (builder.getClass().getName().equals("org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder")) { + ConditionalBuilder conditionalBuilder = (ConditionalBuilder) builder; + for (BuildStep currentBuildStep : conditionalBuilder.getConditionalbuilders()) { + builderClassValidator((Builder) currentBuildStep, job, phasesName, processedJobs); + } + } else if (builder.getClass().getName().equals("org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder")) { + SingleConditionalBuilder singleConditionalBuilder = (SingleConditionalBuilder) builder; + builderClassValidator((Builder) singleConditionalBuilder.getBuildStep(), job, phasesName, processedJobs); + } else if (builder.getClass().getName().equals("hudson.plugins.parameterizedtrigger.TriggerBuilder")) { + builderProcessor = new ParameterizedTriggerProcessor(builder, job, phasesName, processedJobs); + } else if (builder.getClass().getName().equals("com.tikal.jenkins.plugins.multijob.MultiJobBuilder")) { + builderProcessor = new MultiJobBuilderProcessor(builder, processedJobs); + } + + if (builderProcessor != null) { + internals.addAll(builderProcessor.getPhases()); + } else { + logger.debug("not yet supported build (internal) action: " + builder.getClass().getName()); + } + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java index d1b572ac83..382a29e817 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java @@ -21,27 +21,23 @@ import hudson.tasks.Builder; import java.util.List; +import java.util.Set; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 24/12/14 - * Time: 13:47 - * To change this template use File | Settings | File Templates. + * Implementation for discovery/provisioning of an internal phases/steps of the specific FreeStyleProject */ - class FreeStyleProjectProcessor extends AbstractProjectProcessor { - FreeStyleProjectProcessor(Job job) { + FreeStyleProjectProcessor(Job job, Set processedJobs) { super((FreeStyleProject) job); // Internal phases // - super.processBuilders(this.job.getBuilders(), this.job); + super.processBuilders(this.job.getBuilders(), this.job, processedJobs); // Post build phases // - super.processPublishers(this.job); + super.processPublishers(this.job, processedJobs); } @Override diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java index ce4329f400..e4dbd66d01 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java @@ -18,6 +18,9 @@ import hudson.model.Job; +import java.util.HashSet; +import java.util.Set; + /** * Created by gadiel on 30/11/2016. * @@ -29,17 +32,23 @@ public class JobProcessorFactory { private JobProcessorFactory() { } - public static AbstractProjectProcessor getFlowProcessor(T job) { + public static AbstractProjectProcessor getFlowProcessor(T job){ + Set processedJobs = new HashSet<>(); + return getFlowProcessor(job, processedJobs); + } + + private static AbstractProjectProcessor getFlowProcessor(T job, Set processedJobs) { AbstractProjectProcessor flowProcessor; + processedJobs.add(job); if (job.getClass().getName().equals("hudson.model.FreeStyleProject")) { - flowProcessor = new FreeStyleProjectProcessor(job); + flowProcessor = new FreeStyleProjectProcessor(job, processedJobs); } else if (job.getClass().getName().equals("hudson.matrix.MatrixProject")) { - flowProcessor = new MatrixProjectProcessor(job); + flowProcessor = new MatrixProjectProcessor(job, processedJobs); } else if (job.getClass().getName().equals("hudson.maven.MavenModuleSet")) { - flowProcessor = new MavenProjectProcessor(job); + flowProcessor = new MavenProjectProcessor(job, processedJobs); } else if (job.getClass().getName().equals("com.tikal.jenkins.plugins.multijob.MultiJobProject")) { - flowProcessor = new MultiJobProjectProcessor(job); + flowProcessor = new MultiJobProjectProcessor(job, processedJobs); } else if (job.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { flowProcessor = new WorkFlowJobProcessor(job); } else { diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java index 30c8241190..c3bed2ba14 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java @@ -21,27 +21,23 @@ import hudson.tasks.Builder; import java.util.List; +import java.util.Set; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 24/12/14 - * Time: 13:30 - * To change this template use File | Settings | File Templates. + * Implementation for discovery/provisioning of an internal phases/steps of the specific Job in context of MatrixProject Plugin */ - class MatrixProjectProcessor extends AbstractProjectProcessor { - MatrixProjectProcessor(Job project) { + MatrixProjectProcessor(Job project, Set processedJobs) { super((MatrixProject) project); // Internal phases // - super.processBuilders(this.job.getBuilders(), this.job); + super.processBuilders(this.job.getBuilders(), this.job, processedJobs); // Post build phases // - super.processPublishers(this.job); + super.processPublishers(this.job, processedJobs); } @Override diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java index 2fd11bea78..8e70f44f07 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java @@ -22,30 +22,26 @@ import java.util.ArrayList; import java.util.List; +import java.util.Set; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 24/12/14 - * Time: 13:35 - * To change this template use File | Settings | File Templates. + * Implementation for discovery/provisioning of an internal phases/steps of the specific Job in context of Maven Plugin */ - class MavenProjectProcessor extends AbstractProjectProcessor { - MavenProjectProcessor(Job mavenJob) { + MavenProjectProcessor(Job mavenJob, Set processedJobs) { super((MavenModuleSet) mavenJob); // Internal phases - pre maven phases // - super.processBuilders(this.job.getPrebuilders(), this.job, "pre-maven"); + super.processBuilders(this.job.getPrebuilders(), this.job, "pre-maven", processedJobs); // Internal phases - post maven phases // - super.processBuilders(this.job.getPostbuilders(), this.job, "post-maven"); + super.processBuilders(this.job.getPostbuilders(), this.job, "post-maven", processedJobs); // Post build phases // - super.processPublishers(this.job); + super.processPublishers(this.job, processedJobs); } @Override diff --git a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java index dac4959b62..488ec29970 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java +++ b/src/main/java/com/hp/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java @@ -21,26 +21,22 @@ import hudson.tasks.Builder; import java.util.List; +import java.util.Set; /** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 24/12/14 - * Time: 13:40 - * To change this template use File | Settings | File Templates. + * Implementation for discovery/provisioning of an internal phases/steps of the specific Job in context of MultiJob Plugin */ - class MultiJobProjectProcessor extends AbstractProjectProcessor { - MultiJobProjectProcessor(Job job) { + MultiJobProjectProcessor(Job job, Set processedJobs) { super((MultiJobProject) job); // Internal phases // - super.processBuilders(this.job.getBuilders(), this.job); + super.processBuilders(this.job.getBuilders(), this.job, processedJobs); // Post build phases // - super.processPublishers(this.job); + super.processPublishers(this.job, processedJobs); } @Override From d56cf95d53422a40006e46fb7f401484ba95bb7f Mon Sep 17 00:00:00 2001 From: Jackzenko Date: Fri, 7 Apr 2017 17:35:16 +0800 Subject: [PATCH 0045/2502] fixed Jenkins 20323 unable to run functional tests from file system in normal mode (#154) * added RunMode support in Launcher.exe * added support for running UFT test on "Normal" mode to Jenkins * fixed proper variable names to make more sense, changed text box to drop down list. * variable name fix to avoid anbigous with almRunMode * wrapped uft option in "UFT specific settings" * created overloaded constructor for general constructor FileSystemTestsRunner() * use overloaded FileSystemTestsRunner() constructor only if props file contains uftRunMode parameter * sonar fix --- HpToolsLauncher/Launcher.cs | 11 ++++- .../Runners/FileSystemTestsRunner.cs | 46 +++++++++++++------ HpToolsLauncher/TestRunners/GuiTestRunner.cs | 6 ++- .../tools/model/RunFromFileSystemModel.java | 45 +++++++++++++++++- .../pipelineSteps/UftScenarioLoadStep.java | 36 +++++++++++++++ .../tools/run/RunFromFileBuilder.java | 14 +++++- .../UftScenarioLoadStep/config.jelly | 13 +++++- .../tools/run/RunFromFileBuilder/config.jelly | 15 ++++++ 8 files changed, 164 insertions(+), 22 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 9670b05594..7b6d961c1d 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -507,7 +507,16 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) mobileinfo = _ciParams["mobileinfo"]; } - runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo); + if (_ciParams.ContainsKey("fsUftRunMode")) + { + string uftRunMode = "Fast"; + uftRunMode = _ciParams["fsUftRunMode"]; + runner = new FileSystemTestsRunner(validTests, timeout, uftRunMode, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo); + } + else + { + runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo); + } break; diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index 337ab9f193..96485dba5b 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -23,6 +23,7 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable private int _errors, _fail; private bool _useUFTLicense; private TimeSpan _timeout = TimeSpan.MaxValue; + private readonly string _uftRunMode; private Stopwatch _stopwatch = null; private string _abortFilename = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\stop" + Launcher.UniqueTimeStamp + ".txt"; @@ -43,6 +44,29 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable #endregion + /// + /// overloaded constructor for adding support for run mode selection + /// + /// + /// + /// + /// + /// + public FileSystemTestsRunner(List sources, + TimeSpan timeout, + string uftRunMode, + int ControllerPollingInterval, + TimeSpan perScenarioTimeOutMinutes, + List ignoreErrorStrings, + Dictionary jenkinsEnvVariables, + McConnectionInfo mcConnection, + string mobileInfo, + bool useUFTLicense = false) + :this(sources, timeout, ControllerPollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnection, mobileInfo, useUFTLicense) + { + _uftRunMode = uftRunMode; + } + /// /// creates instance of the runner given a source. /// @@ -51,15 +75,14 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable /// /// public FileSystemTestsRunner(List sources, - TimeSpan timeout, - int ControllerPollingInterval, - TimeSpan perScenarioTimeOutMinutes, - List ignoreErrorStrings, - Dictionary jenkinsEnvVariables, - McConnectionInfo mcConnection, - string mobileInfo, - bool useUFTLicense = false - ) + TimeSpan timeout, + int ControllerPollingInterval, + TimeSpan perScenarioTimeOutMinutes, + List ignoreErrorStrings, + Dictionary jenkinsEnvVariables, + McConnectionInfo mcConnection, + string mobileInfo, + bool useUFTLicense = false) { _jenkinsEnvVariables = jenkinsEnvVariables; //search if we have any testing tools installed @@ -155,9 +178,6 @@ public FileSystemTestsRunner(List sources, ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); } - - - /// /// runs all tests given to this runner and returns a suite of run resutls /// @@ -282,7 +302,7 @@ private TestRunResults RunHPToolsTest(TestInfo testinf, ref string errorReason) runner = new ApiTestRunner(this, _timeout - _stopwatch.Elapsed); break; case TestType.QTP: - runner = new GuiTestRunner(this, _useUFTLicense, _timeout - _stopwatch.Elapsed, _mcConnection, _mobileInfoForAllGuiTests); + runner = new GuiTestRunner(this, _useUFTLicense, _timeout - _stopwatch.Elapsed, _uftRunMode, _mcConnection, _mobileInfoForAllGuiTests); break; case TestType.LoadRunner: AppDomain.CurrentDomain.AssemblyResolve += Helper.HPToolsAssemblyResolver; diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 06f1621102..2266e25287 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -35,6 +35,7 @@ public class GuiTestRunner : IFileSysTestRunner private readonly IAssetRunner _runNotifier; private readonly object _lockObject = new object(); private TimeSpan _timeLeftUntilTimeout = TimeSpan.MaxValue; + private readonly string _uftRunMode; private Stopwatch _stopwatch = null; private Application _qtpApplication; private ParameterDefinitions _qtpParamDefs; @@ -49,9 +50,10 @@ public class GuiTestRunner : IFileSysTestRunner /// /// /// - public GuiTestRunner(IAssetRunner runNotifier, bool useUftLicense, TimeSpan timeLeftUntilTimeout, McConnectionInfo mcConnectionInfo, string mobileInfo) + public GuiTestRunner(IAssetRunner runNotifier, bool useUftLicense, TimeSpan timeLeftUntilTimeout, string uftRunMode, McConnectionInfo mcConnectionInfo, string mobileInfo) { _timeLeftUntilTimeout = timeLeftUntilTimeout; + _uftRunMode = uftRunMode; _stopwatch = Stopwatch.StartNew(); _runNotifier = runNotifier; _useUFTLicense = useUftLicense; @@ -386,7 +388,7 @@ private GuiTestRunResult ExecuteQTPRun(TestRunResults testResults) Type runResultsOptionstype = Type.GetTypeFromProgID("QuickTest.RunResultsOptions"); var options = (RunResultsOptions)Activator.CreateInstance(runResultsOptionstype); options.ResultsLocation = testResults.ReportLocation; - _qtpApplication.Options.Run.RunMode = "Fast"; + _qtpApplication.Options.Run.RunMode = _uftRunMode; //Check for cancel before executing if (_runCancelled()) diff --git a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java index 1c6bbf76fd..d0388c1092 100644 --- a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java @@ -14,6 +14,8 @@ import org.kohsuke.stapler.DataBoundConstructor; import javax.annotation.Nullable; +import java.util.Arrays; +import java.util.List; import java.util.Properties; /** @@ -25,8 +27,14 @@ public class RunFromFileSystemModel { public static final String MOBILE_PROXY_SETTING_USER_NAME = "MobileProxySetting_UserName"; public static final String MOBILE_PROXY_SETTING_AUTHENTICATION = "MobileProxySetting_Authentication"; public static final String MOBILE_USE_SSL = "MobileUseSSL"; + + public final static EnumDescription FAST_RUN_MODE = new EnumDescription("Fast", "Fast"); + public final static EnumDescription NORMAL_RUN_MODE = new EnumDescription("Normal", "Normal"); + public final static List fsUftRunModes = Arrays.asList(FAST_RUN_MODE, NORMAL_RUN_MODE); + private String fsTests; private String fsTimeout; + private String fsUftRunMode; private String controllerPollingInterval; private String perScenarioTimeOut; private String ignoreErrorStrings; @@ -72,7 +80,7 @@ public class RunFromFileSystemModel { * @param useSSL the use ssl */ @SuppressWarnings("squid:S00107") - public RunFromFileSystemModel(String fsTests, String fsTimeout, String controllerPollingInterval,String perScenarioTimeOut, + public RunFromFileSystemModel(String fsTests, String fsTimeout, String fsUftRunMode, String controllerPollingInterval,String perScenarioTimeOut, String ignoreErrorStrings, String mcServerName, String fsUserName, String fsPassword, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, @@ -81,7 +89,7 @@ public RunFromFileSystemModel(String fsTests, String fsTimeout, String controlle this.setFsTests(fsTests); this.fsTimeout = fsTimeout; - + this.fsUftRunMode = fsUftRunMode; this.perScenarioTimeOut = perScenarioTimeOut; this.controllerPollingInterval = controllerPollingInterval; @@ -120,6 +128,7 @@ public RunFromFileSystemModel(String fsTests) { //Init default vals this.fsTimeout = ""; + this.fsUftRunMode = "Fast"; this.controllerPollingInterval = "30"; this.perScenarioTimeOut = "10"; this.ignoreErrorStrings = ""; @@ -148,6 +157,15 @@ public void setFsTimeout(String fsTimeout) { this.fsTimeout = fsTimeout; } + /** + * Sets fs runMode. + * + * @param fsUftRunMode the fs runMode + */ + public void setFsUftRunMode(String fsUftRunMode) { + this.fsUftRunMode = fsUftRunMode; + } + /** * Sets mc server name. * @@ -301,6 +319,22 @@ public String getFsTimeout() { return fsTimeout; } + /** + * Gets fs runMode. + * + * @return the fs runMode + */ + public String getFsUftRunMode() { + return fsUftRunMode; + } + + /** + * Gets fs runModes + * + * @return the fs runModes + */ + public List getFsUftRunModes() { return fsUftRunModes; } + /** * Gets mc server name. * @@ -580,6 +614,13 @@ private Properties createProperties(EnvVars envVars) { props.put("fsTimeout", "" + fsTimeout); } + if (StringUtils.isEmpty(fsUftRunMode)){ + props.put("fsUftRunMode", "Fast"); + } + else{ + props.put("fsUftRunMode", "" + fsUftRunMode); + } + if (StringUtils.isEmpty(controllerPollingInterval)){ props.put("controllerPollingInterval", "30"); diff --git a/src/main/java/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java b/src/main/java/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java index d0f5a2f476..96068cf598 100644 --- a/src/main/java/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java +++ b/src/main/java/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java @@ -25,6 +25,7 @@ import com.hp.application.automation.tools.model.EnumDescription; import com.hp.application.automation.tools.model.ResultsPublisherModel; +import com.hp.application.automation.tools.model.RunFromFileSystemModel; import com.hp.application.automation.tools.results.RunResultRecorder; import com.hp.application.automation.tools.run.RunFromFileBuilder; import hudson.Extension; @@ -89,6 +90,34 @@ public void setFsTimeout(String fsTimeout) { runFromFileBuilder.setFsTimeout(fsTimeout); } + /** + * Gets fsUftRunMode + * + * @return fsUftRunMode value + */ + public String getFsUftRunMode() { + return runFromFileBuilder.getRunFromFileModel().getFsUftRunMode(); + } + + /** + * Sets fsUftRunMode value + * + * @param fsUftRunMode the fsUftRunMode value + */ + @DataBoundSetter + public void setFsUftRunMode(String fsUftRunMode) { + runFromFileBuilder.setFsUftRunMode(fsUftRunMode); + } + + /** + * Gets fsUftRunModes + * + * @return fsUftRunModes value + */ + public List getFsUftRunModes() { + return RunFromFileSystemModel.fsUftRunModes; + } + /** * Gets test paths. * @@ -141,6 +170,13 @@ public String getDisplayName() { return "Run UFT scenario"; } + /** + * Gets fs runModes + * + * @return the fs runModes + */ + public List getFsUftRunModes() { return RunFromFileSystemModel.fsUftRunModes; } + /** * Gets report archive modes. * diff --git a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java index c50b2084fd..a05155d0fb 100644 --- a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java @@ -111,12 +111,12 @@ public RunFromFileBuilder(RunFromFileSystemModel runFromFileModel) { */ @SuppressWarnings("squid:S00107") @Deprecated - public RunFromFileBuilder(String fsTests, String fsTimeout, String controllerPollingInterval, + public RunFromFileBuilder(String fsTests, String fsTimeout, String fsUftRunMode, String controllerPollingInterval, String perScenarioTimeOut, String ignoreErrorStrings, String mcServerName, String fsUserName, String fsPassword, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, String fsExtraApps, String fsJobId, ProxySettings proxySettings, boolean useSSL) { - runFromFileModel = new RunFromFileSystemModel(fsTests, fsTimeout, controllerPollingInterval, + runFromFileModel = new RunFromFileSystemModel(fsTests, fsTimeout, fsUftRunMode, controllerPollingInterval, perScenarioTimeOut, ignoreErrorStrings, mcServerName, fsUserName, fsPassword, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, fsAutActions, fsLaunchAppName, fsDevicesMetrics, fsInstrumented, fsExtraApps, fsJobId, proxySettings, useSSL); } @@ -170,6 +170,16 @@ public void setFsTimeout(String fsTimeout) { runFromFileModel.setFsTimeout(fsTimeout); } + /** + * Sets fs runMode. + * + * @param fsUftRunMode the fs runMode + */ + @DataBoundSetter + public void setFsUftRunMode(String fsUftRunMode) { + runFromFileModel.setFsUftRunMode(fsUftRunMode); + } + /** * Sets mc server name. * diff --git a/src/main/resources/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep/config.jelly b/src/main/resources/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep/config.jelly index c1c1648d2f..e7708f14f5 100644 --- a/src/main/resources/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep/config.jelly +++ b/src/main/resources/com/hp/application/automation/tools/pipelineSteps/UftScenarioLoadStep/config.jelly @@ -31,11 +31,20 @@
+ + + + + + + ${runMode.description} + + + + + + + From 2f10d51321df6bac3a13220b68ec7868c0dbcb3a Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Fri, 7 Apr 2017 18:16:17 +0300 Subject: [PATCH 0046/2502] Small fix to avoid NPE encountered with NoData status on SLA's (#180) --- .../tools/results/RunResultRecorder.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java index 377b90abf2..3a31d44819 100644 --- a/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hp/application/automation/tools/results/RunResultRecorder.java @@ -1114,7 +1114,7 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla averageThroughput.setActualValue(Double.valueOf(slaRuleElement.getAttribute(SLA_ACTUAL_VALUE_LABEL))); averageThroughput.setGoalValue(Double.valueOf(slaRuleElement.getAttribute(SLA_GOAL_VALUE_LABEL))); averageThroughput.setFullName(slaRuleElement.getAttribute(SLA_ULL_NAME)); - averageThroughput.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getTextContent())); + averageThroughput.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getLastChild().getTextContent().trim())); jobLrScenarioResult.scenarioSlaResults.add(averageThroughput); break; case TotalThroughput: @@ -1123,7 +1123,7 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla totalThroughput.setActualValue(Double.valueOf(slaRuleElement.getAttribute(SLA_ACTUAL_VALUE_LABEL))); totalThroughput.setGoalValue(Double.valueOf(slaRuleElement.getAttribute(SLA_GOAL_VALUE_LABEL))); totalThroughput.setFullName(slaRuleElement.getAttribute(SLA_ULL_NAME)); - totalThroughput.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getTextContent())); + totalThroughput.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getLastChild().getTextContent().trim())); jobLrScenarioResult.scenarioSlaResults.add(totalThroughput); break; @@ -1133,7 +1133,7 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla averageHitsPerSecond.setActualValue(Double.valueOf(slaRuleElement.getAttribute(SLA_ACTUAL_VALUE_LABEL))); averageHitsPerSecond.setGoalValue(Double.valueOf(slaRuleElement.getAttribute(SLA_GOAL_VALUE_LABEL))); averageHitsPerSecond.setFullName(slaRuleElement.getAttribute(SLA_ULL_NAME)); - averageHitsPerSecond.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getTextContent())); + averageHitsPerSecond.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getLastChild().getTextContent().trim())); jobLrScenarioResult.scenarioSlaResults.add(averageHitsPerSecond); break; @@ -1143,7 +1143,7 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla totalHits.setActualValue(Double.valueOf(slaRuleElement.getAttribute(SLA_ACTUAL_VALUE_LABEL))); totalHits.setGoalValue(Double.valueOf(slaRuleElement.getAttribute(SLA_GOAL_VALUE_LABEL))); totalHits.setFullName(slaRuleElement.getAttribute(SLA_ULL_NAME)); - totalHits.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getTextContent())); + totalHits.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getLastChild().getTextContent().trim())); jobLrScenarioResult.scenarioSlaResults.add(totalHits); break; @@ -1153,7 +1153,7 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla errPerSec.setFullName(slaRuleElement.getAttribute(SLA_ULL_NAME)); errPerSec.setLoadThrashold(slaRuleElement.getAttribute("SLALoadThresholdValue")); errPerSec.setStatus(LrTest.SLA_STATUS.checkStatus( - slaRuleElement.getFirstChild().getTextContent())); //Might not work due to time ranges + slaRuleElement.getLastChild().getTextContent().trim())); //Might not work due to time ranges addTimeRanges(errPerSec, slaRuleElement); jobLrScenarioResult.scenarioSlaResults.add(errPerSec); @@ -1168,7 +1168,7 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla SLA_GOAL_VALUE_LABEL))); percentileTransactionWholeRun.setFullName(slaRuleElement.getAttribute(SLA_ULL_NAME)); percentileTransactionWholeRun.setPrecentage(Double.valueOf(slaRuleElement.getAttribute("Percentile"))); - percentileTransactionWholeRun.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getTextContent())); + percentileTransactionWholeRun.setStatus(LrTest.SLA_STATUS.checkStatus(slaRuleElement.getLastChild().getTextContent().trim())); jobLrScenarioResult.scenarioSlaResults.add(percentileTransactionWholeRun); break; @@ -1179,7 +1179,7 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla transactionTimeRange.setFullName(slaRuleElement.getAttribute(SLA_ULL_NAME)); transactionTimeRange.setLoadThrashold(slaRuleElement.getAttribute("SLALoadThresholdValue")); transactionTimeRange.setStatus(LrTest.SLA_STATUS.checkStatus( - slaRuleElement.getFirstChild().getTextContent())); //Might not work due to time ranges + slaRuleElement.getLastChild().getTextContent().trim())); //Might not work due to time ranges addTimeRanges(transactionTimeRange, slaRuleElement); jobLrScenarioResult.scenarioSlaResults.add(transactionTimeRange); break; @@ -1192,7 +1192,9 @@ private static void addTimeRanges(TimeRangeResult transactionTimeRange, Element Node timeRangeNode; Element timeRangeElement; NodeList timeRanges = slaRuleElement.getElementsByTagName("TimeRangeInfo"); - + if(timeRanges == null || timeRanges.getLength() == 0){ + return; + } //Taking the goal per transaction - double generalGoalValue = Double.parseDouble(((Element) timeRanges.item(0)).getAttribute(SLA_GOAL_VALUE_LABEL)); transactionTimeRange.setGoalValue(generalGoalValue); From f0cbfc20e9fce1c84e9a3c652017ffdb9ac1776a Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Sat, 8 Apr 2017 10:23:35 +0300 Subject: [PATCH 0047/2502] Small workaround to fix No data status on transactions due to Analysis Api issue (#181) * Small fix to avoid NPE encountered with NoData status on SLA's * sonar fixes * sonar fixes --- LRAnalysisLauncher/Program.cs | 56 +++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/LRAnalysisLauncher/Program.cs b/LRAnalysisLauncher/Program.cs index 29cae940be..a7fb9d45d0 100644 --- a/LRAnalysisLauncher/Program.cs +++ b/LRAnalysisLauncher/Program.cs @@ -298,6 +298,9 @@ static int Main(string[] args) } XmlElement timeRanges = xmlDoc.CreateElement("TimeRanges"); log("TimeRanges : " + b.TimeRanges.Count); + int passed = 0; + int failed = 0; + int noData = 0; foreach (SlaTimeRangeInfo slatri in b.TimeRanges) { XmlElement subsubelem = xmlDoc.CreateElement("TimeRangeInfo"); @@ -307,12 +310,31 @@ static int Main(string[] args) subsubelem.SetAttribute("ActualValue", slatri.ActualValue.ToString(formatProvider)); subsubelem.SetAttribute("LoadValue", slatri.LoadValue.ToString(formatProvider)); subsubelem.InnerText = slatri.Status.ToString(); + switch (slatri.Status) + { + case SlaRuleStatus.Failed: + failed++; + break; + case SlaRuleStatus.Passed: + passed++; + break; + case SlaRuleStatus.NoData: + noData++; + break; + default: + break; + } timeRanges.AppendChild(subsubelem); } rule.AppendChild(timeRanges); - log("status : " + b.Status); - rule.AppendChild(xmlDoc.CreateTextNode(b.Status.ToString())); - if (b.Status.Equals(SlaRuleStatus.Failed)) // 0 = failed + SlaRuleStatus currentRuleStatus = b.Status; + if (currentRuleStatus.Equals(SlaRuleStatus.NoData) && (passed > noData)) + { + currentRuleStatus = SlaRuleStatus.Passed; + } + log("status : " + currentRuleStatus); + rule.AppendChild(xmlDoc.CreateTextNode(currentRuleStatus.ToString())); + if (currentRuleStatus.Equals(SlaRuleStatus.Failed)) // 0 = failed { iPassed = (int)Launcher.ExitCodeEnum.Failed; } @@ -339,6 +361,9 @@ static int Main(string[] args) } XmlElement timeRanges = xmlDoc.CreateElement("TimeRanges"); log("TimeRanges : " + a.TimeRanges.Count); + int passed = 0; + int failed = 0; + int noData = 0; foreach (SlaTimeRangeInfo slatri in a.TimeRanges) { XmlElement subsubelem = xmlDoc.CreateElement("TimeRangeInfo"); @@ -348,12 +373,31 @@ static int Main(string[] args) subsubelem.SetAttribute("ActualValue", slatri.ActualValue.ToString(formatProvider)); subsubelem.SetAttribute("LoadValue", slatri.LoadValue.ToString(formatProvider)); subsubelem.InnerText = slatri.Status.ToString(); + switch (slatri.Status) + { + case SlaRuleStatus.Failed: + failed++; + break; + case SlaRuleStatus.Passed: + passed++; + break; + case SlaRuleStatus.NoData: + noData++; + break; + default: + break; + } timeRanges.AppendChild(subsubelem); } rule.AppendChild(timeRanges); - log("status : " + a.Status); - rule.AppendChild(xmlDoc.CreateTextNode(a.Status.ToString())); - if (a.Status.Equals(SlaRuleStatus.Failed)) + SlaRuleStatus currentRuleStatus = a.Status; + if (currentRuleStatus.Equals(SlaRuleStatus.NoData) && (passed > noData)) + { + currentRuleStatus = SlaRuleStatus.Passed; + } + log("status : " + currentRuleStatus); + rule.AppendChild(xmlDoc.CreateTextNode(currentRuleStatus.ToString())); + if (currentRuleStatus.Equals(SlaRuleStatus.Failed)) { iPassed = (int)Launcher.ExitCodeEnum.Failed; } From 81a82a603f8b65490e6d9c8baf323655c5e920aa Mon Sep 17 00:00:00 2001 From: Roy-Lu Date: Tue, 11 Apr 2017 17:46:29 +0800 Subject: [PATCH 0048/2502] Support executing SSE on ALM SaaS (#164) * Support executing SSE on ALM SaaS * Remove the pattern check. * Support executing SSE on ALM SaaS 1. Fixed some check style issues. 2. Unify the rest authentication process here from separated part, ALMRestTool and RunManager. * Fixed some lint issues. * Fixed lint issues. --- .gitignore | 2 + .../automation/tools/rest/RestClient.java | 197 ++++++++++-------- .../tools/results/service/AlmRestTool.java | 111 +++++----- .../settings/AlmServerSettingsBuilder.java | 32 +-- .../tools/sse/SSEBuilderPerformer.java | 62 +++--- .../AUTEnvironmentBuilderPerformer.java | 1 + .../automation/tools/sse/sdk/Client.java | 2 + .../automation/tools/sse/sdk/RunManager.java | 88 ++++---- .../sdk/authenticator/AuthenticationTool.java | 91 ++++++++ .../sse/sdk/authenticator/Authenticator.java | 36 ++++ .../RestAuthenticator.java | 101 +++++---- .../authenticator/RestAuthenticatorSaas.java | 112 ++++++++++ .../tools/sse/sdk/TestRestAuthenticator.java | 7 +- .../sse/sdk/TestRestAuthenticatorSaas.java | 130 ++++++++++++ 14 files changed, 680 insertions(+), 292 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java create mode 100644 src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/Authenticator.java rename src/main/java/com/hp/application/automation/tools/sse/sdk/{ => authenticator}/RestAuthenticator.java (57%) create mode 100644 src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java create mode 100644 src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticatorSaas.java diff --git a/.gitignore b/.gitignore index 572f977ddd..6027937d79 100644 --- a/.gitignore +++ b/.gitignore @@ -121,3 +121,5 @@ node_modules/ /node_modules/ .sonarlint/ +# jenkins instance folder generated by mvn run:hpi +work/ diff --git a/src/main/java/com/hp/application/automation/tools/rest/RestClient.java b/src/main/java/com/hp/application/automation/tools/rest/RestClient.java index 6e59ec2fa6..a034b45169 100644 --- a/src/main/java/com/hp/application/automation/tools/rest/RestClient.java +++ b/src/main/java/com/hp/application/automation/tools/rest/RestClient.java @@ -4,13 +4,13 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.Authenticator; import java.net.HttpURLConnection; import java.net.InetSocketAddress; -import java.net.PasswordAuthentication; import java.net.Proxy; -import java.net.URL; import java.net.URLConnection; +import java.net.URL; +import java.net.Authenticator; +import java.net.PasswordAuthentication; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; @@ -54,44 +54,47 @@ public class RestClient implements Client { * Configure SSL context for the client. */ static { - // First create a trust manager that won't care. - X509TrustManager trustManager = new X509TrustManager() { - @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { - // Don't do anything. - } - @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { - // Don't do anything. - } - @Override - public X509Certificate[] getAcceptedIssuers() { - // Don't do anything. - return null; - } - - }; - // Now put the trust manager into an SSLContext. - SSLContext sslcontext; - try { - sslcontext = SSLContext.getInstance("SSL"); - sslcontext.init(null, new TrustManager[] { trustManager }, null); - } catch (KeyManagementException | NoSuchAlgorithmException e) { - throw new SSEException(e); - } - - HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext.getSocketFactory()); - - //Ignore hostname verify - HttpsURLConnection.setDefaultHostnameVerifier( - new HostnameVerifier(){ - public boolean verify(String hostname, SSLSession sslSession) { - return true; - } - } - ); + // First create a trust manager that won't care. + X509TrustManager trustManager = new X509TrustManager() { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { + // Don't do anything. + } + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { + // Don't do anything. + } + @Override + public X509Certificate[] getAcceptedIssuers() { + // Don't do anything. + return null; + } + + }; + // Now put the trust manager into an SSLContext. + SSLContext sslcontext; + try { + sslcontext = SSLContext.getInstance("SSL"); + sslcontext.init(null, new TrustManager[] { trustManager }, null); + } catch (KeyManagementException | NoSuchAlgorithmException e) { + throw new SSEException(e); + } + + HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext.getSocketFactory()); + + //Ignore hostname verify + HttpsURLConnection.setDefaultHostnameVerifier( + new HostnameVerifier(){ + public boolean verify(String hostname, SSLSession sslSession) { + return true; + } + } + ); } - + + /** + * Constructor for setting rest client properties. + */ public RestClient(String url, String domain, String project, String username) { if (!url.endsWith("/")) { @@ -108,7 +111,7 @@ public RestClient(String url, String domain, String project, String username) { } /** - * Constructor for setting rest client properties including proxy info. + * Constructor for setting rest client properties with proxy info. */ public RestClient(String url, String domain, String project, String username, ProxyInfo proxyInfo) { @@ -126,24 +129,35 @@ public RestClient(String url, String domain, String project, String username, Pr _webuiPrefix = getPrefixUrl("webui/alm", domain, project); } + /** + * Build + * @param suffix + * @return + */ @Override public String build(String suffix) { - return String.format("%1$s%2$s", _serverUrl, suffix); } + /** + * Build rest request + */ @Override public String buildRestRequest(String suffix) { - return String.format("%1$s/%2$s", _restPrefix, suffix); } + /** + * Build web ui request + */ @Override public String buildWebUIRequest(String suffix) { - return String.format("%1$s/%2$s", _webuiPrefix, suffix); } + /** + * Http get request + */ @Override public Response httpGet( String url, @@ -161,6 +175,9 @@ public Response httpGet( return ret; } + /** + * Http post request + */ @Override public Response httpPost( String url, @@ -178,6 +195,9 @@ public Response httpPost( return ret; } + /** + * Http put request + */ @Override public Response httpPut( String url, @@ -195,30 +215,27 @@ public Response httpPut( return ret; } + /** + * Get server url + */ @Override public String getServerUrl() { - return _serverUrl; } + /** + * Get prefix url + * @param protocol + * @param domain + * @param project + * @return + */ private String getPrefixUrl(String protocol, String domain, String project) { - return String.format("%s%s/%s/%s", _serverUrl, protocol, domain, project); } /** - * @param type - * http operation: get post put delete - * @param url - * to work on - * @param queryString - * @param data - * to write, if a writable operation - * @param headers - * to use in the request - * @param cookies - * to use in the request and update from the response - * @return http response + * Do http request */ private Response doHttp( String type, @@ -259,12 +276,7 @@ private Response doHttp( } /** - * @param connnection - * connection to set the headers and bytes in - * @param headers - * to use in the request, such as content-type - * @param bytes - * the actual data to post in the connection. + * Prepare http request */ private void prepareHttpRequest( HttpURLConnection connnection, @@ -272,13 +284,16 @@ private void prepareHttpRequest( byte[] bytes) { // set all cookies for request - connnection.setRequestProperty(RESTConstants.COOKIE, getCookies()); + connnection.setRequestProperty(RESTConstants.COOKIE, getCookiesString()); setConnectionHeaders(connnection, headers); setConnectionData(connnection, bytes); } + /** + * Set connection data + */ private void setConnectionData(HttpURLConnection connnection, byte[] bytes) { if (bytes != null && bytes.length > 0) { @@ -294,6 +309,9 @@ private void setConnectionData(HttpURLConnection connnection, byte[] bytes) { } } + /** + * Set connection headers + */ private void setConnectionHeaders(HttpURLConnection connnection, Map headers) { if (headers != null) { @@ -306,6 +324,7 @@ private void setConnectionHeaders(HttpURLConnection connnection, Map newCookies = response.getHeaders().get(RESTConstants.SET_COOKIE); @@ -366,8 +388,10 @@ private void updateCookies(Response response) { } } - private String getCookies() { - + /** + * Get cookies string + */ + private String getCookiesString() { StringBuilder ret = new StringBuilder(); if (!_cookies.isEmpty()) { for (Entry entry : _cookies.entrySet()) { @@ -380,19 +404,19 @@ private String getCookies() { @Override public String getUsername() { - return _username; } - + + /** + * Open http connection + */ public static URLConnection openConnection(final ProxyInfo proxyInfo, String urlString) throws IOException { Proxy proxy = null; URL url = new URL(urlString); - if (proxyInfo != null && StringUtils.isNotBlank(proxyInfo._host) && StringUtils.isNotBlank(proxyInfo._port)) { int port = Integer.parseInt(proxyInfo._port.trim()); proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo._host, port)); } - if (proxy != null && StringUtils.isNotBlank(proxyInfo._userName) && StringUtils.isNotBlank(proxyInfo._password)) { Authenticator authenticator = new Authenticator() { @Override @@ -402,43 +426,39 @@ protected PasswordAuthentication getPasswordAuthentication() { }; Authenticator.setDefault(authenticator); } - if (proxy == null) { return url.openConnection(); } - - return url.openConnection(proxy); } /** * Set proxy configuration. - * @param host - * @param port - * @param userName - * @param password - * @return proxyinfo instance + * To get Jenkins proxy configuration: Jenkins.getInstance().proxy; So the proxy could be improved later. */ public static ProxyInfo setProxyCfg(String host, String port, String userName, String password) { return new ProxyInfo(host, port, userName, password); } + /** + * Set proxy configuration with username/password. + */ public static ProxyInfo setProxyCfg(String host, String port) { - ProxyInfo proxyInfo = new ProxyInfo(); - proxyInfo._host = host; proxyInfo._port = port; - return proxyInfo; } + /** + * Set proxy configuration with address, username, password. + */ public static ProxyInfo setProxyCfg(String address, String userName, String password) { ProxyInfo proxyInfo = new ProxyInfo(); if (address != null) { - String host = address; - + String host = address; + if (address.endsWith("/")) { int end = address.lastIndexOf('/'); host = address.substring(0, end); @@ -466,7 +486,7 @@ static class ProxyInfo { String _password; public ProxyInfo() { - //Keep the non parameter constructor. + //Keep the non parameter constructor. } public ProxyInfo(String host, String port, String userName, String password) { @@ -477,4 +497,11 @@ public ProxyInfo(String host, String port, String userName, String password) { } } + + /** + * Get cookies + */ + public Map getCookies() { + return _cookies; + } } diff --git a/src/main/java/com/hp/application/automation/tools/results/service/AlmRestTool.java b/src/main/java/com/hp/application/automation/tools/results/service/AlmRestTool.java index 8226320fe1..3af4f3c2ae 100644 --- a/src/main/java/com/hp/application/automation/tools/results/service/AlmRestTool.java +++ b/src/main/java/com/hp/application/automation/tools/results/service/AlmRestTool.java @@ -7,7 +7,6 @@ import java.util.Map; import com.hp.application.automation.tools.common.Pair; -import com.hp.application.automation.tools.common.SSEException; import com.hp.application.automation.tools.rest.RestClient; import com.hp.application.automation.tools.results.service.almentities.AlmEntity; import com.hp.application.automation.tools.results.service.rest.CreateAlmEntityRequest; @@ -15,71 +14,50 @@ import com.hp.application.automation.tools.results.service.rest.UpdateAlmEntityRequest; import com.hp.application.automation.tools.sse.common.XPathUtils; import com.hp.application.automation.tools.sse.sdk.Logger; -import com.hp.application.automation.tools.sse.sdk.ResourceAccessLevel; import com.hp.application.automation.tools.sse.sdk.Response; -import com.hp.application.automation.tools.sse.sdk.RestAuthenticator; +import com.hp.application.automation.tools.sse.sdk.authenticator.AuthenticationTool; public class AlmRestTool { private Logger _logger ; - private RestClient restClient; private AlmRestInfo almLoginInfo; - public AlmRestTool (AlmRestInfo almLoginInfo, Logger logger) { this.restClient = new RestClient( almLoginInfo.getServerUrl(), almLoginInfo.getDomain(), almLoginInfo.getProject(), - almLoginInfo.getUserName());; + almLoginInfo.getUserName()); this.almLoginInfo = almLoginInfo; this._logger = logger; } - + + /** + * Get rest client + */ public RestClient getRestClient() { return this.restClient; } - - - private void appendQCSessionCookies(RestClient client) { - - // issue a post request so that cookies relevant to the QC Session will be added to the RestClient - Response response = - client.httpPost( - client.build("rest/site-session"), - null, - null, - ResourceAccessLevel.PUBLIC); - if (!response.isOk()) { - _logger.log("Failed to add QC Session Cookies."); - } - } - - - - public boolean login() throws Exception { - boolean ret = true; + /** + * Login + */ + public boolean login() throws Exception { + boolean ret; try { - ret = - new RestAuthenticator().login( - restClient, - almLoginInfo.getUserName(), - almLoginInfo.getPassword(), - _logger); - appendQCSessionCookies(restClient); - } catch (Throwable cause) { + ret = AuthenticationTool.authenticate(restClient, almLoginInfo.getUserName(), + almLoginInfo.getPassword(), almLoginInfo.getServerUrl(), _logger); + } catch (Exception cause) { ret = false; - _logger.log(String.format( - "Failed login to ALM Server URL: %s. Exception: %s", - almLoginInfo.getServerUrl(), - cause.getMessage())); throw new AlmRestException (cause); - } + } return ret; } - + + /** + * Get Pair list for ALM entity fields + */ public List> getPairListForAlmEntityFields(AlmEntity almEntity, List fieldNames){ List> pairs = new ArrayList>(); for(String fieldName : fieldNames) { @@ -87,15 +65,21 @@ public List> getPairListForAlmEntityFields(AlmEntity almEnt } return pairs; } - + + /** + * Get pair list for ALM entity fields + */ public List> getPairListForAlmEntityFields(AlmEntity almEntity, String[] fieldNames){ List> pairs = new ArrayList>(); for(String fieldName : fieldNames) { pairs.add(new Pair(fieldName, String.valueOf(almEntity.getFieldValue(fieldName)))); } return pairs; - } - + } + + /** + * Get map list for ALM entity fields + */ public List> getMapListForAlmEntityFields(AlmEntity almEntity, String[] fieldNames){ List> fieldsMapList = new ArrayList>(); @@ -107,13 +91,19 @@ public List> getMapListForAlmEntityFields(AlmEntity almEntit fieldsMapList.add(fieldsMap); return fieldsMapList; } - + + /** + * Populate ALM entity field value + */ public void populateAlmEntityFieldValue(Map mapFieldValue, AlmEntity almEntity) { for(Map.Entry entry : mapFieldValue.entrySet()){ almEntity.setFieldValue(entry.getKey(), entry.getValue()); } } - + + /** + * Get ALM entity list + */ public List getAlmEntityList(List> entities, Class c) { List entityList = new ArrayList (); @@ -130,7 +120,10 @@ public List getAlmEntityList(List> return entityList; } - + + /** + * Get encode string + */ public static String getEncodedString(String s) { String quotedStr = "\"" + s +"\""; try { @@ -140,7 +133,10 @@ public static String getEncodedString(String s) { } return quotedStr; } - + + /** + * Get entity under parent folder + */ public E getEntityUnderParentFolder( Class entityClass, int parentId, String entityName ){ String getEntityUnderParentFolderQuery = String.format("fields=id,name&query={parent-id[%s];name[%s]}", String.valueOf(parentId), getEncodedString(entityName)); @@ -166,8 +162,11 @@ public E getEntityUnderParentFolder( Class entityClass return null; } - } - + } + + /** + * Get ALM entity + */ public List getAlmEntity( E entity, String queryString){ List ret = new ArrayList(); @@ -189,8 +188,11 @@ public List getAlmEntity( E entity, String queryString return ret; } - } - + } + + /** + * Create ALM entity + */ public E createAlmEntity (E entity, String[] fieldsForCreation) throws ExternalEntityUploadException { CreateAlmEntityRequest createRequest = new CreateAlmEntityRequest(getRestClient(), entity, getPairListForAlmEntityFields(entity, fieldsForCreation) ); @@ -212,7 +214,10 @@ public E createAlmEntity (E entity, String[] fieldsForCrea } } - + + /** + * Update ALM entity + */ public void updateAlmEntity (E entity, String[] fieldsForUpdate) { UpdateAlmEntityRequest updateRequest = new UpdateAlmEntityRequest(getRestClient(), entity, getMapListForAlmEntityFields(entity, fieldsForUpdate)) ; diff --git a/src/main/java/com/hp/application/automation/tools/settings/AlmServerSettingsBuilder.java b/src/main/java/com/hp/application/automation/tools/settings/AlmServerSettingsBuilder.java index a81bc105a5..53d90f3db2 100644 --- a/src/main/java/com/hp/application/automation/tools/settings/AlmServerSettingsBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/settings/AlmServerSettingsBuilder.java @@ -8,14 +8,13 @@ import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.URL; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; import com.hp.application.automation.tools.model.AlmServerSettingsModel; -import com.hp.application.automation.tools.rest.RestClient; -import com.hp.application.automation.tools.sse.sdk.RestAuthenticator; import hudson.CopyOnWrite; import hudson.Extension; @@ -128,7 +127,7 @@ public FormValidation doCheckAlmServerName(@QueryParameter String value) { private FormValidation checkQcServerURL(String value, Boolean acceptEmpty) { String url; // Path to the page to check if the server is alive - String page = RestAuthenticator.IS_AUTHENTICATED; + String page = "servlet/tdservlet/TDAPI_GeneralWebTreatment"; // Do will allow empty value? if (StringUtils.isBlank(value)) { @@ -138,7 +137,7 @@ private FormValidation checkQcServerURL(String value, Boolean acceptEmpty) { return FormValidation.ok(); } } - + // Does the URL ends with a "/" ? if not, add it if (value.lastIndexOf("/") == value.length() - 1) { url = value + page; @@ -149,36 +148,25 @@ private FormValidation checkQcServerURL(String value, Boolean acceptEmpty) { // Open the connection and perform a HEAD request HttpURLConnection connection; try { - connection = (HttpURLConnection) RestClient.openConnection(null, url); + connection = (HttpURLConnection) new URL(url).openConnection(); connection.setRequestMethod("GET"); - - // Check whether the response is from ALM Server - if (!isALMServerResponse(connection)) { - return FormValidation.error(RestAuthenticator.INVALID_ALM_SERVER_URL); + + // Check the response code + if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) { + return FormValidation.error(connection.getResponseMessage()); } } catch (MalformedURLException ex) { // This is not a valid URL return FormValidation.error("ALM server URL is malformed."); } catch (IOException ex) { // Cant open connection to the server - return FormValidation.error("Error openning a connection to the ALM server"); + return FormValidation.error("Error opening a connection to the ALM server"); } return FormValidation.ok(); } - - private boolean isALMServerResponse(HttpURLConnection conn) throws IOException { - boolean ret = false; - - if (conn.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED - && conn.getHeaderFields().get(RestAuthenticator.AUTHENTICATE_HEADER) != null){ - ret = true; - } - - return ret; - } - public Boolean hasAlmServers() { + public Boolean hasAlmServers() { return installations.length > 0; } } diff --git a/src/main/java/com/hp/application/automation/tools/sse/SSEBuilderPerformer.java b/src/main/java/com/hp/application/automation/tools/sse/SSEBuilderPerformer.java index df177a3bcb..36ad908e3b 100644 --- a/src/main/java/com/hp/application/automation/tools/sse/SSEBuilderPerformer.java +++ b/src/main/java/com/hp/application/automation/tools/sse/SSEBuilderPerformer.java @@ -24,43 +24,35 @@ public Testsuites start( Logger logger, VariableResolver buildVariableResolver) throws InterruptedException { - Testsuites ret = new Testsuites(); - try { - Args args = new ArgsFactory().createResolved(model, buildVariableResolver); - SseProxySettings proxySettings = model.getProxySettings(); - - RestClient restClient; - - if (proxySettings != null) { - // Construct restClient with proxy. - String username = proxySettings.getFsProxyUserName(); - String password = proxySettings.getFsProxyPassword() == null ? null : proxySettings.getFsProxyPassword().getPlainText(); - String passwordCrypt = proxySettings.getFsProxyPassword() == null ? null : proxySettings.getFsProxyPassword().getEncryptedValue(); - - restClient = new RestClient(args.getUrl(), - args.getDomain(), - args.getProject(), - args.getUsername(), - RestClient.setProxyCfg(proxySettings.getFsProxyAddress(), username, password)); - logger.log(String.format("Connect with proxy. Address: %s, Username: %s, Password: %s", - proxySettings.getFsProxyAddress(), username, passwordCrypt)); - } - else { - // Construct restClient without proxy. - restClient = new RestClient(args.getUrl(), - args.getDomain(), - args.getProject(), - args.getUsername()); - } - ret = _runManager.execute(restClient, args, logger); - } - catch (InterruptedException ex) { - throw ex; + Testsuites ret; + + Args args = new ArgsFactory().createResolved(model, buildVariableResolver); + SseProxySettings proxySettings = model.getProxySettings(); + + RestClient restClient; + + if (proxySettings != null) { + // Construct restClient with proxy. + String username = proxySettings.getFsProxyUserName(); + String password = proxySettings.getFsProxyPassword() == null ? null : proxySettings.getFsProxyPassword().getPlainText(); + String passwordCrypt = proxySettings.getFsProxyPassword() == null ? null : proxySettings.getFsProxyPassword().getEncryptedValue(); + + restClient = new RestClient(args.getUrl(), + args.getDomain(), + args.getProject(), + args.getUsername(), + RestClient.setProxyCfg(proxySettings.getFsProxyAddress(), username, password)); + logger.log(String.format("Connect with proxy. Address: %s, Username: %s, Password: %s", + proxySettings.getFsProxyAddress(), username, passwordCrypt)); } - catch (Exception cause) { - logger.log(String.format("Failed to execute ALM tests. Cause: %s", cause.getMessage())); + else { + // Construct restClient without proxy. + restClient = new RestClient(args.getUrl(), + args.getDomain(), + args.getProject(), + args.getUsername()); } - + ret = _runManager.execute(restClient, args, logger); return ret; } diff --git a/src/main/java/com/hp/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java b/src/main/java/com/hp/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java index 7559d556e1..31c059917e 100644 --- a/src/main/java/com/hp/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java +++ b/src/main/java/com/hp/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java @@ -9,6 +9,7 @@ import com.hp.application.automation.tools.rest.RestClient; import com.hp.application.automation.tools.sse.common.StringUtils; import com.hp.application.automation.tools.sse.sdk.*; +import com.hp.application.automation.tools.sse.sdk.authenticator.RestAuthenticator; import hudson.util.VariableResolver; /** diff --git a/src/main/java/com/hp/application/automation/tools/sse/sdk/Client.java b/src/main/java/com/hp/application/automation/tools/sse/sdk/Client.java index 36d5281c7b..5194570827 100644 --- a/src/main/java/com/hp/application/automation/tools/sse/sdk/Client.java +++ b/src/main/java/com/hp/application/automation/tools/sse/sdk/Client.java @@ -37,4 +37,6 @@ Response httpPut( String getServerUrl(); String getUsername(); + + Map getCookies(); } diff --git a/src/main/java/com/hp/application/automation/tools/sse/sdk/RunManager.java b/src/main/java/com/hp/application/automation/tools/sse/sdk/RunManager.java index 9367141bfb..eb4a3c3c1d 100644 --- a/src/main/java/com/hp/application/automation/tools/sse/sdk/RunManager.java +++ b/src/main/java/com/hp/application/automation/tools/sse/sdk/RunManager.java @@ -5,16 +5,15 @@ import com.hp.application.automation.tools.sse.common.StringUtils; import com.hp.application.automation.tools.sse.result.PublisherFactory; import com.hp.application.automation.tools.sse.result.model.junit.Testsuites; +import com.hp.application.automation.tools.sse.sdk.authenticator.AuthenticationTool; import com.hp.application.automation.tools.sse.sdk.handler.PollHandler; import com.hp.application.automation.tools.sse.sdk.handler.PollHandlerFactory; import com.hp.application.automation.tools.sse.sdk.handler.RunHandler; import com.hp.application.automation.tools.sse.sdk.handler.RunHandlerFactory; /** - * * @author Effi Bar-She'an * @author Dani Schreiber - * */ public class RunManager { @@ -24,13 +23,15 @@ public class RunManager { private boolean _running = false; private boolean _polling = false; + /** + * Execute + */ public Testsuites execute(RestClient client, Args args, Logger logger) throws InterruptedException { - Testsuites ret = null; _logger = logger; _running = true; - if (login(client, args)) { + if (AuthenticationTool.authenticate(client, args.getUsername(), args.getPassword(), args.getUrl(), logger)) { initialize(args, client); if (start(args)) { _polling = true; @@ -50,39 +51,29 @@ public Testsuites execute(RestClient client, Args args, Logger logger) _polling = false; } } - return ret; } + /** + * Initialize + */ private void initialize(Args args, RestClient client) { - String entityId = args.getEntityId(); - appendQCSessionCookies(client); _runHandler = new RunHandlerFactory().create(client, args.getRunType(), entityId); _pollHandler = new PollHandlerFactory().create(client, args.getRunType(), entityId); } - private void appendQCSessionCookies(RestClient client) { - - // issue a post request so that cookies relevant to the QC Session will be added to the RestClient - Response response = - client.httpPost( - client.build("rest/site-session"), - null, - null, - ResourceAccessLevel.PUBLIC); - if (!response.isOk()) { - throw new SSEException("Cannot appned QCSession cookies", response.getFailure()); - } - } - + /** + * Poll + */ private boolean poll() throws InterruptedException { - return _pollHandler.poll(_logger); } + /** + * Stop + */ public void stop() { - _logger.log("Stopping run..."); if (_runHandler != null) { _runHandler.stop(); @@ -93,29 +84,10 @@ public void stop() { } } - private boolean login(Client client, Args args) { - - boolean ret = true; - try { - ret = - new RestAuthenticator().login( - client, - args.getUsername(), - args.getPassword(), - _logger); - } catch (Throwable cause) { - ret = false; - _logger.log(String.format( - "Failed login to ALM Server URL: %s. Exception: %s", - args.getUrl(), - cause.getMessage())); - } - - return ret; - } - + /** + * Start + */ private boolean start(Args args) { - boolean ret = false; Response response = _runHandler.start( @@ -131,12 +103,13 @@ private boolean start(Args args) { } } logReportUrl(ret, args); - return ret; } + /** + * Set Run id + */ private void setRunId(RunResponse runResponse) { - String runId = runResponse.getRunId(); if (StringUtils.isNullOrEmpty(runId)) { _logger.log("No run ID"); @@ -147,8 +120,10 @@ private void setRunId(RunResponse runResponse) { } } + /** + * Log report url + */ private void logReportUrl(boolean isSucceeded, Args args) { - if (isSucceeded) { _logger.log(String.format( "%s run report for run id %s is at: %s", @@ -167,13 +142,17 @@ private void logReportUrl(boolean isSucceeded, Args args) { } } + /** + * Get run response + */ private RunResponse getRunResponse(Response response) { - return _runHandler.getRunResponse(response); } + /** + * Is response ok + */ private boolean isOk(Response response, Args args) { - boolean ret = false; if (response.isOk()) { _logger.log(String.format( @@ -203,17 +182,20 @@ private boolean isOk(Response response, Args args) { response.getStatusCode())); } } - return ret; } + /** + * Get running + */ public boolean getRunning() { - return _running; } + /** + * Get polling + */ public boolean getPolling() { - return _polling; } diff --git a/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java new file mode 100644 index 0000000000..d98b4c5664 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.hp.application.automation.tools.sse.sdk.authenticator; + +import com.hp.application.automation.tools.common.SSEException; +import com.hp.application.automation.tools.sse.sdk.Client; +import com.hp.application.automation.tools.sse.sdk.Logger; +import com.hp.application.automation.tools.sse.sdk.ResourceAccessLevel; +import com.hp.application.automation.tools.sse.sdk.Response; + +import java.util.ArrayList; +import java.util.List; + +/** + * Unify the rest authentication process here from separated part, ALMRestTool and RunManager. + * Any authentication change will only need to change here. + * Created by llu2 on 4/5/2017. + */ +public final class AuthenticationTool { + + private AuthenticationTool() { + //Hide the public constructor. + } + + /** + * Try authenticate use a list of authenticators and then create session. + */ + public static boolean authenticate(Client client, String username, String password, String url, Logger logger) { + if (login(client, username, password, url, logger)) { + appendQCSessionCookies(client, logger); + return true; + } + return false; + } + + private static boolean login(Client client, String username, String password, String url, Logger logger) { + List authenticators = new ArrayList<>(); + authenticators.add(new RestAuthenticator()); + authenticators.add(new RestAuthenticatorSaas()); + + boolean result = false; + for(Authenticator authenticator : authenticators) { + try { + result = authenticator.login(client, username, password, logger); + if (result) { + break; + } + } catch (Exception e) { + logger.log(String.format( + "Failed login to ALM Server URL: %s. Exception: %s", + url.endsWith("/") ? url : String.format("%s/", url), + e.getMessage())); + } + } + return result; + } + + private static void appendQCSessionCookies(Client client, Logger logger) { + logger.log("Creating session..."); + // issue a post request so that cookies relevant to the QC Session will be added to the RestClient + Response response = + client.httpPost( + client.build("rest/site-session"), + null, + null, + ResourceAccessLevel.PUBLIC); + if (!response.isOk()) { + throw new SSEException("Cannot appned QCSession cookies", response.getFailure()); + } + } +} diff --git a/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/Authenticator.java b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/Authenticator.java new file mode 100644 index 0000000000..92d3428b67 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/Authenticator.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.hp.application.automation.tools.sse.sdk.authenticator; + +import com.hp.application.automation.tools.sse.sdk.Client; +import com.hp.application.automation.tools.sse.sdk.Logger; + +/** + * Created by llu4 on 1/16/2017. + */ +public interface Authenticator { + + boolean login(Client client, String username, String password, Logger logger); + boolean logout(Client client, String username); + +} diff --git a/src/main/java/com/hp/application/automation/tools/sse/sdk/RestAuthenticator.java b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/RestAuthenticator.java similarity index 57% rename from src/main/java/com/hp/application/automation/tools/sse/sdk/RestAuthenticator.java rename to src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/RestAuthenticator.java index fc6b0fff5a..8d90441275 100644 --- a/src/main/java/com/hp/application/automation/tools/sse/sdk/RestAuthenticator.java +++ b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/RestAuthenticator.java @@ -1,4 +1,26 @@ -package com.hp.application.automation.tools.sse.sdk; +/* + * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.hp.application.automation.tools.sse.sdk.authenticator; import java.net.HttpURLConnection; import java.util.HashMap; @@ -6,7 +28,11 @@ import com.hp.application.automation.tools.common.SSEException; import com.hp.application.automation.tools.rest.RESTConstants; -import com.hp.application.automation.tools.rest.RestClient; +import com.hp.application.automation.tools.sse.sdk.Base64Encoder; +import com.hp.application.automation.tools.sse.sdk.Client; +import com.hp.application.automation.tools.sse.sdk.Logger; +import com.hp.application.automation.tools.sse.sdk.ResourceAccessLevel; +import com.hp.application.automation.tools.sse.sdk.Response; /*** * @@ -15,16 +41,16 @@ * */ -public class RestAuthenticator { +public class RestAuthenticator implements Authenticator { public static final String IS_AUTHENTICATED = "rest/is-authenticated"; - public static String AUTHENTICATE_HEADER = "WWW-Authenticate"; - public static String INVALID_ALM_SERVER_URL = "Invalid ALM Server URL"; - public static String AUTHENTICATEION_INFO = "AuthenticationInfo"; - public static String USER_NAME = "Username"; + public static final String AUTHENTICATE_HEADER = "WWW-Authenticate"; + public static final String INVALID_ALM_SERVER_URL = "Invalid ALM Server URL"; + public static final String AUTHENTICATION_INFO = "AuthenticationInfo"; + public static final String USER_NAME = "Username"; public boolean login(Client client, String username, String password, Logger logger) { - + logger.log("Start login to ALM server."); boolean ret = true; String authenticationPoint = isAuthenticated(client, logger); if (authenticationPoint != null) { @@ -66,7 +92,7 @@ private Response login(Client client, String loginUrl, String username, String p * @throws Exception * close session on server and clean session cookies on client */ - public boolean logout(RestClient client, String username) { + public boolean logout(Client client, String username) { // note the get operation logs us out by setting authentication cookies to: // LWSSO_COOKIE_KEY="" via server response header Set-Cookie @@ -87,7 +113,7 @@ public boolean logout(RestClient client, String username) { * @throws Exception * if error such as 404, or 500 */ - public String isAuthenticated(Client client, Logger logger) { + private String isAuthenticated(Client client, Logger logger) { String ret; Response response = @@ -98,55 +124,48 @@ public String isAuthenticated(Client client, Logger logger) { ResourceAccessLevel.PUBLIC); int responseCode = response.getStatusCode(); - // already authenticated + if (isAlreadyAuthenticated(response, client.getUsername())) { + // already authenticated ret = null; logLoggedInSuccessfully(client.getUsername(), client.getServerUrl(), logger); - } - // if not authenticated - get the address where to authenticate via WWW-Authenticate - else if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) { + + } else if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) { + // if not authenticated - get the address where to authenticate via WWW-Authenticate String newUrl = response.getHeaders().get(AUTHENTICATE_HEADER).get(0).split("=")[1]; newUrl = newUrl.replace("\"", ""); newUrl += "/authenticate"; ret = newUrl; - } - // error such as 404, or 500 - else { - try { - throw response.getFailure(); - } catch (Throwable cause) { - throw new SSEException(cause); - } + + } else { + // error such as 404, or 500 + throw new SSEException(response.getFailure()); } return ret; } private boolean isAlreadyAuthenticated(Response response, String authUser) { - boolean ret = false; - - if (response.getStatusCode() == HttpURLConnection.HTTP_OK){ - - if (response.getData() != null && containAuthenticatedInfo(new String(response.getData()), authUser)){ - ret = true; - } - else{ - throw new SSEException(INVALID_ALM_SERVER_URL); - } - } - - return ret; - } + boolean ret = false; + if (response.getStatusCode() == HttpURLConnection.HTTP_OK){ + if (response.getData() != null && containAuthenticatedInfo(new String(response.getData()), authUser)){ + ret = true; + } else{ + throw new SSEException(INVALID_ALM_SERVER_URL); + } + } + + return ret; + } //if it's authenticated, the response should look like that: //sa - private boolean containAuthenticatedInfo(String authInfo, String authUser){ - - return authInfo.contains(AUTHENTICATEION_INFO) && authInfo.contains(USER_NAME) && authInfo.contains(authUser); - } + private boolean containAuthenticatedInfo(String authInfo, String authUser){ + return authInfo.contains(AUTHENTICATION_INFO) && authInfo.contains(USER_NAME) && authInfo.contains(authUser); + } - private void logLoggedInSuccessfully(String username, String loginServerUrl, Logger logger) { + private void logLoggedInSuccessfully(String username, String loginServerUrl, Logger logger) { logger.log(String.format( "Logged in successfully to ALM Server %s using %s", diff --git a/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java new file mode 100644 index 0000000000..1412ef469e --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.hp.application.automation.tools.sse.sdk.authenticator; + +import com.hp.application.automation.tools.rest.RESTConstants; +import com.hp.application.automation.tools.sse.sdk.Base64Encoder; +import com.hp.application.automation.tools.sse.sdk.Client; +import com.hp.application.automation.tools.sse.sdk.Logger; +import com.hp.application.automation.tools.sse.sdk.ResourceAccessLevel; +import com.hp.application.automation.tools.sse.sdk.Response; + +import java.util.HashMap; +import java.util.Map; + +/*** + * Rest Authenticator via SaaS + * Created by Roy Lu on 2/10/2017. + */ + +public class RestAuthenticatorSaas implements Authenticator { + public static final String AUTHENTICATION_POINT = "authentication-point/authenticate"; + public static final String AUTHENTICATION_LOGOUT = "authentication-point/logout"; + public static final String LWSSO_COOKIE_KEY = "LWSSO_COOKIE_KEY"; + + public boolean login(Client client, String username, String password, Logger logger) { + logger.log("Start login to ALM server through SaaS."); + boolean ret = true; + if (!isAuthenticated(client)) { + Response response = login(client, AUTHENTICATION_POINT, username, password); + if (response.isOk()) { + logLoggedInSuccessfully(username, client.getServerUrl(), logger); + } else { + logger.log(String.format( + "Login to ALM Server at %s failed. Status Code: %s", + client.getServerUrl(), + response.getStatusCode())); + ret = false; + } + } else { + logger.log("Already authenticated."); + } + return ret; + } + + /** + * Actually login + * @param client + * @param loginUrl + * @param username + * @param password + * @return + */ + private Response login(Client client, String loginUrl, String username, String password) { + // create a string that looks like: + // "Basic ((username:password))<64encoded>" + byte[] credBytes = (username + ":" + password).getBytes(); + String credEncodedString = "Basic " + Base64Encoder.encode(credBytes); + Map headers = new HashMap(); + headers.put(RESTConstants.AUTHORIZATION, credEncodedString); + return client.httpGet(client.build(loginUrl), null, headers, ResourceAccessLevel.PUBLIC); + } + + /** + * @return true if logout successful + * @throws Exception + * close session on server and clean session cookies on client + */ + public boolean logout(Client client, String username) { + // note the get operation logs us out by setting authentication cookies to: + // LWSSO_COOKIE_KEY="" via server response header Set-Cookie + Response response = + client.httpGet(client.build(AUTHENTICATION_LOGOUT), + null, + null, + ResourceAccessLevel.PUBLIC); + return response.isOk(); + } + + /** + * Check the client is already authenticated. + */ + private boolean isAuthenticated(Client client) { + return client.getCookies().keySet().contains(LWSSO_COOKIE_KEY); + } + + private void logLoggedInSuccessfully(String username, String loginServerUrl, Logger logger) { + logger.log(String.format( + "Logged in successfully to ALM Server %s using %s", + loginServerUrl, + username)); + } +} diff --git a/src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticator.java b/src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticator.java index a8229bdaa2..f0d2d00184 100644 --- a/src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticator.java +++ b/src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticator.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; +import com.hp.application.automation.tools.sse.sdk.authenticator.RestAuthenticator; import org.junit.Assert; import org.junit.Test; @@ -33,7 +34,7 @@ public class TestRestAuthenticator extends TestCase { @Test - public void testLogin_alreadyAuthenticated() { + public void testLoginAlreadyAuthenticated() { Client client = new MockRestClientAlreadyAuthenticated(URL, DOMAIN, PROJECT, USER); boolean ok = new RestAuthenticator().login(client, "tester", "blabla", new ConsoleLogger()); @@ -59,7 +60,7 @@ public Response httpGet(String url, String queryString, Map head } @Test - public void testLogin_notAuthenticated() { + public void testLoginNotAuthenticated() { Client client = new MockRestClientNotAuthenticated(URL, DOMAIN, PROJECT, USER); boolean ok = new RestAuthenticator().login(client, "tester", "blabla", new ConsoleLogger()); @@ -116,7 +117,7 @@ private Map> getAuthenticationHeaders() { } @Test - public void testLogin_failedToLogin() { + public void testLoginFailedToLogin() { Client client = new MockRestClientFailedToLogin(URL, DOMAIN, PROJECT, USER); boolean ok = new RestAuthenticator().login(client, "tester", "blabla", new ConsoleLogger()); diff --git a/src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticatorSaas.java b/src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticatorSaas.java new file mode 100644 index 0000000000..9494d9227c --- /dev/null +++ b/src/test/java/com/hp/application/automation/tools/sse/sdk/TestRestAuthenticatorSaas.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.hp.application.automation.tools.sse.sdk; + +import com.hp.application.automation.tools.sse.common.ConsoleLogger; +import com.hp.application.automation.tools.sse.common.RestClient4Test; +import com.hp.application.automation.tools.sse.common.TestCase; +import com.hp.application.automation.tools.sse.sdk.authenticator.RestAuthenticator; +import com.hp.application.automation.tools.sse.sdk.authenticator.RestAuthenticatorSaas; +import org.junit.Assert; +import org.junit.Test; + +import java.net.HttpURLConnection; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TestRestAuthenticatorSaas extends TestCase { + + @Test + public void testLoginAlreadyAuthenticated() { + Client client = new MockRestClientAlreadyAuthenticated(URL, DOMAIN, PROJECT, USER); + boolean ok = new RestAuthenticatorSaas().login(client, "tester", "blabla", new ConsoleLogger()); + Assert.assertTrue(ok); + } + + public class MockRestClientAlreadyAuthenticated extends RestClient4Test { + public MockRestClientAlreadyAuthenticated( + String url, + String domain, + String project, + String username) { + super(url, domain, project, username); + } + public Map getCookies() { + Map headers = new HashMap(); + headers.put(RestAuthenticatorSaas.LWSSO_COOKIE_KEY, "blabla"); + return headers; + } + @Override + public Response httpGet(String url, String queryString, Map headers, ResourceAccessLevel resourceAccessLevel) { + + return new Response(null, getExpectAuthInfo(), null, HttpURLConnection.HTTP_OK); + } + } + + @Test + public void testLoginNotAuthenticated() { + Client client = new MockRestClientNotAuthenticated(URL, DOMAIN, PROJECT, USER); + boolean ok = new RestAuthenticatorSaas().login(client, "tester", "blabla", new ConsoleLogger()); + Assert.assertTrue(ok); + } + + public class MockRestClientNotAuthenticated extends RestClient4Test { + public MockRestClientNotAuthenticated( + String url, + String domain, + String project, + String username) { + super(url, domain, project, username); + } + public Map getCookies() { + Map headers = new HashMap(); + return headers; + } + @Override + public Response httpGet(String url, String queryString, Map headers, ResourceAccessLevel resourceAccessLevel) { + return new Response(null, getExpectAuthInfo(), null, HttpURLConnection.HTTP_OK); + } + } + + @Test + public void testLoginFailedToLogin() { + Client client = new MockRestClientFailedToLogin(URL, DOMAIN, PROJECT, USER); + boolean ok = new RestAuthenticatorSaas().login(client, "tester", "blabla", new ConsoleLogger()); + Assert.assertFalse(ok); + } + + public class MockRestClientFailedToLogin extends RestClient4Test { + public MockRestClientFailedToLogin( + String url, + String domain, + String project, + String username) { + super(url, domain, project, username); + } + + @Override + public Response httpGet(String url, String queryString, Map headers, ResourceAccessLevel resourceAccessLevel) { + Response ret = + new Response( + getAuthenticationHeaders(), + null, + null, + HttpURLConnection.HTTP_UNAUTHORIZED); + return ret; + } + + private Map> getAuthenticationHeaders() { + + Map> ret = new HashMap>(1); + List values = new ArrayList(); + values.add(String.format("LWSSO realm=\"%s\"", build("authentication-point"))); + ret.put(RestAuthenticator.AUTHENTICATE_HEADER, values); + + return ret; + } + } +} From cbf7d6386548ea6b9fa83390ede4be187a4790e2 Mon Sep 17 00:00:00 2001 From: orenbm21 Date: Sun, 23 Apr 2017 10:26:07 +0300 Subject: [PATCH 0049/2502] BDI enhancments (#182) * Consuming Bdi-sdk with apache * Defect #246010: Lines in log are sometimes corrupted * consuming new sdk * Consuming Bdi-sdk with apache * Defect #246010: Lines in log are sometimes corrupted --- pom.xml | 6 + .../tools/octane/AbstractResultQueueImpl.java | 8 + .../automation/tools/octane/ResultQueue.java | 2 + .../tools/octane/buildLogs/LogDispatcher.java | 251 +++++++----------- .../octane/buildLogs/RunListenerForLogs.java | 2 +- .../tools/octane/tests/TestQueue.java | 7 + 6 files changed, 118 insertions(+), 158 deletions(-) diff --git a/pom.xml b/pom.xml index 27802338cc..5d6e3a0303 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,7 @@ 1.642.4 2.2 false + 1.0.3 @@ -561,6 +562,11 @@ test + + com.hp.bdi + bdi-sdk + ${bdi.version} + diff --git a/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java b/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java index 0fa8bf4728..0cfd042da6 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java @@ -86,6 +86,14 @@ public synchronized void add(String projectName, int buildNumber, String workspa queue.add(new QueueItem(projectName, buildNumber, workspace)); } + @Override + public synchronized void clear() { + while (queue.size() > 0) { + queue.remove(); + } + currentItem = null; + } + private static class JsonConverter implements FileObjectQueue.Converter { @Override diff --git a/src/main/java/com/hp/application/automation/tools/octane/ResultQueue.java b/src/main/java/com/hp/application/automation/tools/octane/ResultQueue.java index 5c00d4d5b0..18148d5ca9 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/ResultQueue.java +++ b/src/main/java/com/hp/application/automation/tools/octane/ResultQueue.java @@ -31,6 +31,8 @@ public interface ResultQueue { void add(String projectName, int buildNumber, String workspace); + void clear(); + class QueueItem implements Serializable { private static final long serialVersionUID = 1; diff --git a/src/main/java/com/hp/application/automation/tools/octane/buildLogs/LogDispatcher.java b/src/main/java/com/hp/application/automation/tools/octane/buildLogs/LogDispatcher.java index 307a7458cf..20f52552f9 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/buildLogs/LogDispatcher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/buildLogs/LogDispatcher.java @@ -22,44 +22,26 @@ import com.hp.application.automation.tools.octane.configuration.BdiConfiguration; import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; -import com.hp.mqm.client.exception.RequestErrorException; +import com.hp.indi.bdi.client.BdiClient; +import com.hp.indi.bdi.client.BdiClientFactory; +import com.hp.indi.bdi.client.BdiProxyConfiguration; import hudson.Extension; import hudson.ProxyConfiguration; +import hudson.console.PlainTextConsoleOutputStream; import hudson.model.Job; import hudson.model.Run; import hudson.model.TaskListener; import hudson.util.TimeUnit2; import jenkins.model.Jenkins; -import org.apache.http.HttpEntity; -import org.apache.http.auth.Credentials; -import org.apache.http.auth.UsernamePasswordCredentials; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpHost; -import org.apache.http.HttpResponse; -import org.apache.http.auth.AuthScope; -import org.apache.http.client.CredentialsProvider; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.protocol.HttpClientContext; -import org.apache.http.client.utils.HttpClientUtils; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.FileEntity; -import org.apache.http.impl.client.BasicCredentialsProvider; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.http.protocol.HTTP; -import org.apache.http.util.EntityUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - -import javax.xml.bind.DatatypeConverter; -import java.io.*; -import java.net.URI; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.zip.GZIPOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; /** * Created by benmeior on 11/20/2016. @@ -68,15 +50,9 @@ public class LogDispatcher extends AbstractSafeLoggingAsyncPeriodWork { private static Logger logger = LogManager.getLogger(LogDispatcher.class); + private static final String OCTANE_LOG_FILE_NAME = "octane_log"; private static final String BDI_PRODUCT = "octane"; - private static final String CONTENT_ENCODING_GZIP = "gzip"; - private static final String CLIENT_CERTIFICATE_HEADER = "X-CERT"; - private static final String SECURE_PROTOCOL = "https"; private static final String CONSOLE_LOG_DATA_TYPE = "consolelog"; - private static final String DATA_IN_QUERY_TYPE = "data-in"; - private static final String UNCOMPRESSED_CONTENT_LENGTH_HEADER = "Uncompressed-Content-Length"; - private static final int MAX_TOTAL_CONNECTIONS = 20; - private static final int MIN_SIZE_TO_ZIP = 1024; @Inject private RetryModel retryModel; @@ -86,26 +62,38 @@ public class LogDispatcher extends AbstractSafeLoggingAsyncPeriodWork { private ResultQueue logsQueue; - private final CloseableHttpClient httpClient; - private ProxyConfiguration proxyConfiguration; - private HttpClientContext clientContext; + private BdiClient bdiClient; - private String encodedPem; + private ProxyConfiguration proxyConfiguration; public LogDispatcher() { super("BDI log dispatcher"); + } + + private void initClient() { + if (bdiClient != null) { + closeClient(); + } - PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); - cm.setMaxTotal(MAX_TOTAL_CONNECTIONS); - cm.setDefaultMaxPerRoute(MAX_TOTAL_CONNECTIONS); + this.proxyConfiguration = Jenkins.getInstance().proxy; - httpClient = HttpClients.custom() - .setConnectionManager(cm) - .build(); + BdiConfiguration bdiConfiguration = bdiConfigurationFetcher.obtain(); + if (bdiConfiguration == null || !bdiConfiguration.isFullyConfigured()) { + logger.debug("BDI is not configured in Octane"); + return; + } + + if (proxyConfiguration == null) { + bdiClient = BdiClientFactory.getBdiClient(bdiConfiguration.getHost(), bdiConfiguration.getPort()); + } else { + BdiProxyConfiguration bdiProxyConfiguration = + new BdiProxyConfiguration(proxyConfiguration.name, proxyConfiguration.port, proxyConfiguration.getUserName(), proxyConfiguration.getPassword()); + bdiClient = BdiClientFactory.getBdiClient(bdiConfiguration.getHost(), bdiConfiguration.getPort(), bdiProxyConfiguration); + } } @Override - protected void doExecute(TaskListener listener) throws IOException, InterruptedException { + protected void doExecute(TaskListener listener) { if (!isPemFilePropertyInit()) { return; } @@ -116,96 +104,86 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE logger.info("There are pending logs, but we are in quiet period"); return; } + obtainClient(); manageLogsQueue(); } private void manageLogsQueue() { - BdiConfiguration bdiConfiguration = bdiConfigurationFetcher.obtain(); - if (bdiConfiguration == null || !bdiConfiguration.isFullyConfigured()) { - logger.error("Could not send logs. BDI is not configured"); - return; - } - + BdiConfiguration bdiConfiguration; ResultQueue.QueueItem item; + File logFile = null; + Run build = null; while ((item = logsQueue.peekFirst()) != null) { - Run build = getBuildFromQueueItem(item); - if (build == null) { - logsQueue.remove(); - continue; - } - String encodedPem = getEncodedPem(); - HttpResponse httpResponse = null; try { - HttpClientContext clientContext = getHttpClientContext(); - - String url = String.format("%s://%s:%s/rest-service/api/%s/%s?product=%s&tenantid=%d&workspace=%s&dataid=%s", - SECURE_PROTOCOL, bdiConfiguration.getHost(), bdiConfiguration.getPort(), CONSOLE_LOG_DATA_TYPE, DATA_IN_QUERY_TYPE, - BDI_PRODUCT, Long.valueOf(bdiConfiguration.getTenantId()), item.getWorkspace(), buildDataId(build)); - HttpPost request = new HttpPost(URI.create(url)); - - request.setHeader(CLIENT_CERTIFICATE_HEADER, encodedPem); - - File logFile = build.getLogFile(); - if (logFile.length() > MIN_SIZE_TO_ZIP) { - request.setHeader(HTTP.CONTENT_ENCODING, CONTENT_ENCODING_GZIP); - request.setHeader(UNCOMPRESSED_CONTENT_LENGTH_HEADER, String.valueOf(logFile.length())); - request.setEntity(createGZipEntity(logFile)); - } else { - request.setEntity(new FileEntity(logFile)); + bdiConfiguration = bdiConfigurationFetcher.obtain(); + if (bdiConfiguration == null || !bdiConfiguration.isFullyConfigured()) { + logger.error("Could not send logs. BDI is not configured"); + logsQueue.clear(); + if (bdiClient != null) { + closeClient(); + } + return; + } + + build = getBuildFromQueueItem(item); + if (build == null) { + logsQueue.remove(); + continue; } - httpResponse = httpClient.execute(request, clientContext); - HttpEntity entity = httpResponse.getEntity(); - ContentType entityContentType = ContentType.getOrDefault(entity); - Charset charset = entityContentType.getCharset() != null ? entityContentType.getCharset() : StandardCharsets.UTF_8; - String responseString = EntityUtils.toString(entity, charset); + logFile = getOctaneLogFile(build); - if (httpResponse.getStatusLine().getStatusCode() != 200) { - throw new RequestErrorException(String.format("Response status: %d, Response message: %s", - httpResponse.getStatusLine().getStatusCode(), responseString)); + if (proxyConfiguration != Jenkins.getInstance().proxy) { + initClient(); } + bdiClient.post(CONSOLE_LOG_DATA_TYPE, BDI_PRODUCT, Long.valueOf(bdiConfiguration.getTenantId()), item.getWorkspace(), buildDataId(build), logFile); + logger.info(String.format("Successfully sent log of build [%s#%s]", item.getProjectName(), item.getBuildNumber())); logsQueue.remove(); + Files.deleteIfExists(logFile.toPath()); } catch (Exception e) { logger.error(String.format("Could not send log of build [%s#%s] to bdi.", item.getProjectName(), item.getBuildNumber()), e); if (!logsQueue.failed()) { logger.warn("Maximum number of attempts reached, operation will not be re-attempted for this build"); - } - } finally { - if (httpResponse != null) { - EntityUtils.consumeQuietly(httpResponse.getEntity()); - HttpClientUtils.closeQuietly(httpResponse); + if (logFile != null) { + try { + Files.deleteIfExists(logFile.toPath()); + } catch (IOException e1) { + String errorMsg = "Could not delete Octane log file"; + if (build != null) { + errorMsg = String.format("%s of %s#%s", errorMsg, build.getParent().getName(), String.valueOf(build.getNumber())); + } + logger.error(errorMsg); + } + } } } } } - private HttpClientContext getHttpClientContext() { - if (this.clientContext != null && this.proxyConfiguration == Jenkins.getInstance().proxy) { - return this.clientContext; - } else { - this.clientContext = new HttpClientContext(); - RequestConfig.Builder config = RequestConfig.custom() - .setConnectTimeout(20 * 1000) - .setSocketTimeout(2 * 60 * 1000); - - proxyConfiguration = Jenkins.getInstance().proxy; - if (proxyConfiguration != null) { - HttpHost proxyHost = new HttpHost(proxyConfiguration.name, proxyConfiguration.port); - config.setProxy(proxyHost); - if (proxyConfiguration.getUserName() != null && !proxyConfiguration.getUserName().isEmpty() - && proxyConfiguration.getPassword() != null && !proxyConfiguration.getPassword().isEmpty()) { - AuthScope proxyAuthScope = new AuthScope(proxyConfiguration.name, proxyConfiguration.port); - Credentials credentials = new UsernamePasswordCredentials(proxyConfiguration.getUserName(), proxyConfiguration.getPassword()); - - CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); - credentialsProvider.setCredentials(proxyAuthScope, credentials); - } + private File getOctaneLogFile(Run build) throws IOException { + String octaneLogFilePath = build.getLogFile().getParent() + File.separator + OCTANE_LOG_FILE_NAME; + File logFile = new File(octaneLogFilePath); + if (!logFile.exists()) { + try (FileOutputStream fileOutputStream = new FileOutputStream(logFile); + InputStream logStream = build.getLogInputStream(); + PlainTextConsoleOutputStream out = new PlainTextConsoleOutputStream(fileOutputStream)) { + IOUtils.copy(logStream, out); + out.flush(); } - this.clientContext.setRequestConfig(config.build()); - return this.clientContext; + } + return logFile; + } + + private void closeClient() { + try { + bdiClient.close(); + } catch (Exception e) { + logger.error("Failed to close BDI client"); + } finally { + bdiClient = null; } } @@ -250,54 +228,13 @@ public void setLogResultQueue(LogAbstractResultQueue queue) { this.logsQueue = queue; } - private String getEncodedPem() { - if (this.encodedPem != null) { - return this.encodedPem; - } else { - String path = System.getProperty("pem_file"); - - try (Reader reader = new FileReader(path)) { - String pem = readToString(reader); - this.encodedPem = DatatypeConverter.printBase64Binary(pem.getBytes()); - } catch (IOException ex) { - logger.error("cannot read pem file from path: " + path); - } - return this.encodedPem; - } - } - - private String readToString(Reader reader) throws IOException { - try (BufferedReader bufferedReader = new BufferedReader(reader)) { - StringBuilder builder = new StringBuilder(); - String line = bufferedReader.readLine(); - while (line != null) { - builder.append(line); - builder.append(System.lineSeparator()); - line = bufferedReader.readLine(); - } - return builder.toString(); - } + private boolean isPemFilePropertyInit() { + return System.getProperty("pem_file") != null && !System.getProperty("pem_file").isEmpty(); } - private ByteArrayEntity createGZipEntity(File file) { - try (FileInputStream inputStream = new FileInputStream(file); - ByteArrayOutputStream arr = new ByteArrayOutputStream()) { - try (GZIPOutputStream zipper = new GZIPOutputStream(arr)) { - byte[] buffer = new byte[1024]; - - int len; - while ((len = inputStream.read(buffer)) > 0) { - zipper.write(buffer, 0, len); - } - } - - return new ByteArrayEntity(arr.toByteArray(), ContentType.APPLICATION_XML); - } catch (IOException ex) { - throw new RequestErrorException("Failed to create GZip entity.", ex); + private void obtainClient() { + if (bdiClient == null) { + initClient(); } } - - private boolean isPemFilePropertyInit() { - return System.getProperty("pem_file") != null && !System.getProperty("pem_file").isEmpty(); - } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/buildLogs/RunListenerForLogs.java b/src/main/java/com/hp/application/automation/tools/octane/buildLogs/RunListenerForLogs.java index 6ad3ebae06..1c86eb020d 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/buildLogs/RunListenerForLogs.java +++ b/src/main/java/com/hp/application/automation/tools/octane/buildLogs/RunListenerForLogs.java @@ -77,7 +77,7 @@ public void onCompleted(Run r, @Nonnull TaskListener listener) { logger.info(String.format("Job '%s' is not part of an Octane pipeline in any workspace, so its log will not be sent.", build.getParent().getName())); } else { for (String workspace : workspaces) { - logger.info(String.format("Enqueued job %s of workspace %s", build.getParent().getName(), workspace)); + logger.info(String.format("Enqueued job [%s#%d] of workspace %s", build.getParent().getName(), build.getNumber(), workspace)); logDispatcher.enqueueLog(build.getProject().getName(), build.getNumber(), workspace); } } diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/TestQueue.java b/src/test/java/com/hp/application/automation/tools/octane/tests/TestQueue.java index c78c67530a..ddf422fcaf 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/TestQueue.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/TestQueue.java @@ -72,6 +72,13 @@ public synchronized void add(Collection builds) { } } + @Override + public synchronized void clear() { + while (!queue.isEmpty()) { + queue.remove(); + } + } + public synchronized int size() { return queue.size(); } From 2cc11c57b99c699ba21d5f34dc14a0f036b71c63 Mon Sep 17 00:00:00 2001 From: YafimK Date: Mon, 24 Apr 2017 23:23:45 +0300 Subject: [PATCH 0050/2502] [maven-release-plugin] prepare release hp-application-automation-tools-plugin-5.1.0.2-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5d6e3a0303..4b13b83e5a 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ hp-application-automation-tools-plugin - 5.1.0.2-beta-SNAPSHOT + 5.1.0.2-beta hpi HP Application Automation Tools The plugin integrates Jenkins with the following HPE products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -48,7 +48,7 @@ scm:git:ssh://git@github.com/hpsa/hp-application-automation-tools-plugin.git https://github.com/hpsa/hp-application-automation-tools-plugin - HEAD + hp-application-automation-tools-plugin-5.1.0.2-beta JIRA From 6e0970cc4469ed2fa6d5846f59192e7195b10c67 Mon Sep 17 00:00:00 2001 From: YafimK Date: Mon, 24 Apr 2017 23:24:01 +0300 Subject: [PATCH 0051/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4b13b83e5a..199bd4b867 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ hp-application-automation-tools-plugin - 5.1.0.2-beta + 5.1.0.3-beta-SNAPSHOT hpi HP Application Automation Tools The plugin integrates Jenkins with the following HPE products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -48,7 +48,7 @@ scm:git:ssh://git@github.com/hpsa/hp-application-automation-tools-plugin.git https://github.com/hpsa/hp-application-automation-tools-plugin - hp-application-automation-tools-plugin-5.1.0.2-beta + HEAD JIRA From f9c66ecc9028b0106962e0d6585c5ed9ba240a76 Mon Sep 17 00:00:00 2001 From: Michael S Date: Sun, 30 Apr 2017 08:10:04 +0300 Subject: [PATCH 0052/2502] remove inner usage of seperate settings.xml (#184) * remove inner usage of seperate settings.xml * use global settings.xml in tests * Fix windows path --- .../tools/octane/tests/JUnitResultsTest.java | 17 +++++++------- .../tools/octane/tests/TestApiTest.java | 2 +- .../octane/tests/TestDispatcherTest.java | 4 ++-- .../tests/build/BuildHandlerUtilsTest.java | 2 +- .../detection/ResultFieldsDetectionTest.java | 3 ++- .../tests/detection/TestNGExtensionTest.java | 22 +++++++++---------- .../tests/detection/UFTExtensionTest.java | 2 +- .../tests/gherkin/GherkinResultsTest.java | 8 +++---- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java index 76dafb42ea..b9aa5ba0bf 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java @@ -78,7 +78,7 @@ public void testJUnitResults() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven("-s settings.xml clean test", mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -92,7 +92,7 @@ public void testJUnitResultsPom() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven("-s subFolder/settings.xml clean test", mavenName, "subFolder/helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, "subFolder/helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot", "subFolder")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -106,8 +106,7 @@ public void testJUnitResultsTwoPoms() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven("-s settings.xml clean test", mavenName, "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); - project.getBuildersList().add(new Maven("-s settings.xml clean test", mavenName, "helloWorld2/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -123,7 +122,7 @@ public void testJUnitResultsLegacy() throws Exception { project.runHeadless(); project.setMaven(mavenName); - project.setGoals("-s settings.xml clean test -Dmaven.test.failure.ignore=true"); + project.setGoals("clean test -Dmaven.test.failure.ignore=true"); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -139,7 +138,7 @@ public void testJUnitResultsLegacyWithoutJUnitArchiver() throws Exception { project.runHeadless(); project.setMaven(mavenName); - project.setGoals("-s settings.xml clean test -Dmaven.test.failure.ignore=true"); + project.setGoals("clean test -Dmaven.test.failure.ignore=true"); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -155,7 +154,7 @@ public void testJUnitResultsLegacySubfolder() throws Exception { project.setMaven(mavenName); project.setRootPOM("subFolder/helloWorld/pom.xml"); - project.setGoals("-s settings.xml clean test -Dmaven.test.failure.ignore=true"); + project.setGoals("clean test -Dmaven.test.failure.ignore=true"); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot", "subFolder")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -185,7 +184,7 @@ public void testJUnitResultsFreeStyleModule() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven("-s settings.xml clean test", mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -200,7 +199,7 @@ public void testJUnitResultsMatrixProject() throws Exception { MatrixProject matrixProject = rule.createProject(MatrixProject.class, projectName); matrixProject.setAxes(new AxisList(new Axis("osType", "Linux", "Windows"))); - matrixProject.getBuildersList().add(new Maven("-s settings.xml clean test -Dmaven.test.failure.ignore=true -X", mavenName)); + matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.test.failure.ignore=true -X",System.getenv("MAVEN_HOME")), mavenName)); matrixProject.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); matrixProject.setScm(new CopyResourceSCM("/helloWorldRoot")); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java index 985678f39e..d4d1000afb 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java @@ -104,7 +104,7 @@ public Object answer(InvocationOnMock invocationOnMock) throws Throwable { FreeStyleProject project = rule.createFreeStyleProject("test-api-test"); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); - project.getBuildersList().add(new Maven("-s settings.xml test", mavenInstallation.getName(), "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); build = TestUtils.runAndCheckBuild(project); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java index d4c0d38071..1d5454e283 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java @@ -87,7 +87,7 @@ public void init() throws Exception { project = rule.createFreeStyleProject("TestDispatcher"); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); - project.getBuildersList().add(new Maven("-s settings.xml install", mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" install",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); @@ -230,7 +230,7 @@ public void testDispatchMatrixBuild() throws Exception { Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); - matrixProject.getBuildersList().add(new Maven("-s settings.xml install", mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); + matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" install",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); matrixProject.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); matrixProject.setScm(new CopyResourceSCM("/helloWorldRoot")); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java index be7d2067b6..53794f6af6 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java @@ -69,7 +69,7 @@ public void testMavenBuildType() throws Exception { Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); project.setMaven(mavenInstallation.getName()); - project.setGoals("-s settings.xml test -Dmaven.test.failure.ignore=true"); + project.setGoals("test -Dmaven.test.failure.ignore=true"); project.setScm(new CopyResourceSCM("/helloWorldRoot")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(project); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java index d55e6b776a..eb29c6081a 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java @@ -48,6 +48,7 @@ public class ResultFieldsDetectionTest { @Before public void setUp() throws Exception { + project = rule.createFreeStyleProject("junit - job"); JUnitExtension junitExtension = ExtensionUtil.getInstance(rule, JUnitExtension.class); detectionService = Mockito.mock(ResultFieldsDetectionService.class); @@ -55,7 +56,7 @@ public void setUp() throws Exception { Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); - project.getBuildersList().add(new Maven("-s settings.xml -U test", mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" -U test",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); TestUtils.createDummyConfiguration(); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java index 4d46011623..3280a02052 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java @@ -71,7 +71,7 @@ public void testFreestyleProject() throws Exception { String projectName = "testNG-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); project.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); - project.getBuildersList().add(new Maven("-s settings.xml test", mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("helloWorld/target/surefire-reports/TEST*.xml, helloWorld2/target/surefire-reports/TEST*.xml")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -84,7 +84,7 @@ public void testFreestyleProjectOneModule() throws Exception { String projectName = "testNG-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); project.setScm(new CopyResourceSCM("/helloWorldTestNGRoot/helloWorld")); - project.getBuildersList().add(new Maven("-s settings.xml test", mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("target/surefire-reports/TEST*.xml")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -97,7 +97,7 @@ public void testFreestyleProjectCustomLocation() throws Exception { String projectName = "testNG-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); project.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); - project.getBuildersList().add(new Maven("-s settings.xml test -P custom-report-location", mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -P custom-report-location",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**\\custom-report-location/**.xml")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -111,7 +111,7 @@ public void testMavenOneModule() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot/helloWorld")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -125,7 +125,7 @@ public void testMavenMultimodule() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(mavenProject); @@ -149,7 +149,7 @@ public void testMavenOneModuleCustomLocation() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml test -P custom-report-location -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot/helloWorld")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -166,7 +166,7 @@ public void testMavenMultimoduleCustomLocation() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml test -P custom-report-location -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -183,7 +183,7 @@ public void testMavenMultimoduleCustomLocationPublished() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml test -P custom-report-location -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); mavenProject.getPublishersList().add(new JUnitResultArchiver("**/custom-report-location/**.xml")); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -198,7 +198,7 @@ public void testMavenFailsafe() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml verify"); + mavenProject.setGoals("verify"); mavenProject.setScm(new CopyResourceSCM("/helloWorldFailsafe")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -247,7 +247,7 @@ public void testFindingFilesMavenBuild() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); mavenProject.setScm(new CopyResourceSCM("/helloWorldRoot/helloWorld")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(mavenProject); @@ -277,7 +277,7 @@ public void testFindingFilesMavenBuildFailsafe() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("-s settings.xml test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); mavenProject.setScm(new CopyResourceSCM("/helloWorldRoot/helloWorld")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(mavenProject); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java index a350d41771..f42067f832 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java @@ -66,7 +66,7 @@ public void testMockOneBuilder() throws Exception { public void testMockMoreBuilders() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven("test", ToolInstallations.configureMaven3().getName(), null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), ToolInstallations.configureMaven3().getName(), null, null, "-Dmaven.test.failure.ignore=true")); project.getBuildersList().add(new RunFromAlmBuilder("notExistingServer", "notExistingUser", "password", "domain", "project", "notExistingTests", "", "", "", "")); AbstractBuild buildMock = Mockito.mock(AbstractBuild.class); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java index afcd9c98c4..4c41b892b5 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java @@ -136,7 +136,7 @@ public void testGherkinResultsMatrixProject() throws Exception { MatrixProject matrixProject = rule.createProject(MatrixProject.class, projectName); matrixProject.setAxes(new AxisList(new Axis("osType", "Linux", "Windows"))); - matrixProject.getBuildersList().add(new Maven("-s settings.xml clean test", mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); matrixProject.getPublishersList().add(new CucumberTestResultsActionPublisher("")); matrixProject.setScm(new CopyResourceSCM("/helloCucumberWorld")); @@ -162,7 +162,7 @@ private void gherkinResults(String glob, boolean buildShouldSucceed) throws Exce String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven("-s settings.xml clean test", mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.setScm(new CopyResourceSCM("/helloCucumberWorld")); project.getPublishersList().add(new CucumberTestResultsActionPublisher(glob)); @@ -174,7 +174,7 @@ private void gherkinResultsInSubFolder(String glob, boolean buildShouldSucceed) String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven("-s subFolder/settings.xml clean test", mavenName, "subFolder/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, "subFolder/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.setScm(new CopyResourceSCM("helloCucumberWorld", "subFolder")); project.getPublishersList().add(new CucumberTestResultsActionPublisher(glob)); @@ -200,7 +200,7 @@ private MavenModuleSet prepareLegacyProject(boolean subfolder) throws IOExceptio project.runHeadless(); project.setMaven(mavenName); - project.setGoals("-s settings.xml clean test -Dmaven.test.failure.ignore=true"); + project.setGoals("clean test -Dmaven.test.failure.ignore=true"); if(subfolder) { project.setRootPOM("subFolder/pom.xml"); project.setScm(new CopyResourceSCM("/helloCucumberWorld", "subFolder")); From 1334c7428b4e990cf257028160486799937da1f2 Mon Sep 17 00:00:00 2001 From: Michael S Date: Sun, 7 May 2017 20:56:34 +0300 Subject: [PATCH 0053/2502] configure maven to global maven defined in MAVEN_HOME (#187) * configure maven to global maven defined in MAVEN_HOME * add Dmaven.repo.local to inner maven test build to solve multiple maven installations on build server * Update BuildHandlerUtilsTest.java * Update BuildHandlerUtilsTest.java * fix missing setGoals functions * add missing -Dmaven.repo.local=%s\m2-temp to new Maven(...) definitions --- .../tools/octane/tests/JUnitResultsTest.java | 27 +++++++++---- .../tools/octane/tests/TestApiTest.java | 4 +- .../octane/tests/TestDispatcherTest.java | 8 +++- .../tests/build/BuildHandlerUtilsTest.java | 9 ++++- .../detection/ResultFieldsDetectionTest.java | 6 ++- .../tests/detection/TestNGExtensionTest.java | 40 ++++++++++++++----- .../tests/detection/UFTExtensionTest.java | 3 +- .../tests/gherkin/GherkinResultsTest.java | 14 +++++-- 8 files changed, 82 insertions(+), 29 deletions(-) diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java index b9aa5ba0bf..ae3401ba41 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/JUnitResultsTest.java @@ -27,6 +27,7 @@ import org.junit.*; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.ToolInstallations; +import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; import java.io.File; import java.io.FileNotFoundException; @@ -59,6 +60,8 @@ public class JUnitResultsTest { public static void prepareClass() throws Exception { rule.jenkins.setNumExecutors(10); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); + +// Maven.MavenInstallation mavenInstallation = new Maven.MavenInstallation("default-system-maven", System.getenv("MAVEN_HOME"), JenkinsRule.NO_PROPERTIES); mavenName = mavenInstallation.getName(); } @@ -78,7 +81,8 @@ public void testJUnitResults() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -92,7 +96,8 @@ public void testJUnitResultsPom() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, "subFolder/helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, "subFolder/helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot", "subFolder")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -106,7 +111,8 @@ public void testJUnitResultsTwoPoms() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"), System.getenv("TEMP")), mavenName, "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -122,7 +128,8 @@ public void testJUnitResultsLegacy() throws Exception { project.runHeadless(); project.setMaven(mavenName); - project.setGoals("clean test -Dmaven.test.failure.ignore=true"); + project.setGoals(String.format("clean test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -138,7 +145,8 @@ public void testJUnitResultsLegacyWithoutJUnitArchiver() throws Exception { project.runHeadless(); project.setMaven(mavenName); - project.setGoals("clean test -Dmaven.test.failure.ignore=true"); + project.setGoals(String.format("clean test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -154,7 +162,8 @@ public void testJUnitResultsLegacySubfolder() throws Exception { project.setMaven(mavenName); project.setRootPOM("subFolder/helloWorld/pom.xml"); - project.setGoals("clean test -Dmaven.test.failure.ignore=true"); + project.setGoals(String.format("clean test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot", "subFolder")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -184,7 +193,8 @@ public void testJUnitResultsFreeStyleModule() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -199,7 +209,8 @@ public void testJUnitResultsMatrixProject() throws Exception { MatrixProject matrixProject = rule.createProject(MatrixProject.class, projectName); matrixProject.setAxes(new AxisList(new Axis("osType", "Linux", "Windows"))); - matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.test.failure.ignore=true -X",System.getenv("MAVEN_HOME")), mavenName)); + matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.test.failure.ignore=true -Dmaven.repo.local=%s\\m2-temp -X", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName)); matrixProject.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); matrixProject.setScm(new CopyResourceSCM("/helloWorldRoot")); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java index d4d1000afb..ef1f6dd9e5 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/TestApiTest.java @@ -104,7 +104,9 @@ public Object answer(InvocationOnMock invocationOnMock) throws Throwable { FreeStyleProject project = rule.createFreeStyleProject("test-api-test"); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + //Maven.MavenInstallation mavenInstallation = new Maven.MavenInstallation("default-system-maven", System.getenv("MAVEN_HOME"), JenkinsRule.NO_PROPERTIES); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenInstallation.getName(), "helloWorld/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); build = TestUtils.runAndCheckBuild(project); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java index 1d5454e283..b65e825387 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/TestDispatcherTest.java @@ -86,8 +86,10 @@ public void init() throws Exception { project = rule.createFreeStyleProject("TestDispatcher"); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); + //Maven.MavenInstallation mavenInstallation = new Maven.MavenInstallation("default-system-maven", System.getenv("MAVEN_HOME"), JenkinsRule.NO_PROPERTIES); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" install",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" install -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); @@ -229,8 +231,10 @@ public void testDispatchMatrixBuild() throws Exception { matrixProject.setAxes(new AxisList(new Axis("osType", "Linux", "Windows"))); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); + //Maven.MavenInstallation mavenInstallation = new Maven.MavenInstallation("default-system-maven", System.getenv("MAVEN_HOME"), JenkinsRule.NO_PROPERTIES); - matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" install",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); + matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" install -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); matrixProject.getPublishersList().add(new JUnitResultArchiver("**/target/surefire-reports/*.xml")); matrixProject.setScm(new CopyResourceSCM("/helloWorldRoot")); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java index 53794f6af6..d405e7094d 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/build/BuildHandlerUtilsTest.java @@ -31,6 +31,9 @@ import org.jvnet.hudson.test.ToolInstallations; import java.util.HashMap; + +import static org.jvnet.hudson.test.JenkinsRule.NO_PROPERTIES; + @SuppressWarnings({"squid:S2699","squid:S3658","squid:S2259","squid:S1872","squid:S2925","squid:S109","squid:S1607","squid:S2701"}) public class BuildHandlerUtilsTest { @@ -68,8 +71,12 @@ public void testMavenBuildType() throws Exception { project.runHeadless(); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); + + //Maven.MavenInstallation mavenInstallation = new Maven.MavenInstallation("default-system-maven", System.getenv("MAVEN_HOME"), JenkinsRule.NO_PROPERTIES); + project.setMaven(mavenInstallation.getName()); - project.setGoals("test -Dmaven.test.failure.ignore=true"); + //project.setGoals("test -Dmaven.test.failure.ignore=true"); + project.setGoals(String.format("clean test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true",System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); project.setScm(new CopyResourceSCM("/helloWorldRoot")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(project); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java index eb29c6081a..9779c8395e 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/ResultFieldsDetectionTest.java @@ -55,8 +55,12 @@ public void setUp() throws Exception { junitExtension._setResultFieldsDetectionService(detectionService); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); + //Maven.MavenInstallation mavenInstallation = new Maven.MavenInstallation("default-system-maven", System.getenv("MAVEN_HOME"), JenkinsRule.NO_PROPERTIES); + + //project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" -U test",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" -U test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" -U test",System.getenv("MAVEN_HOME")), mavenInstallation.getName(), null, null, "-Dmaven.test.failure.ignore=true")); project.setScm(new CopyResourceSCM("/helloWorldRoot")); TestUtils.createDummyConfiguration(); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java index 3280a02052..5d77edc33c 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/TestNGExtensionTest.java @@ -71,7 +71,8 @@ public void testFreestyleProject() throws Exception { String projectName = "testNG-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); project.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("helloWorld/target/surefire-reports/TEST*.xml, helloWorld2/target/surefire-reports/TEST*.xml")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -84,7 +85,8 @@ public void testFreestyleProjectOneModule() throws Exception { String projectName = "testNG-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); project.setScm(new CopyResourceSCM("/helloWorldTestNGRoot/helloWorld")); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("target/surefire-reports/TEST*.xml")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -97,7 +99,8 @@ public void testFreestyleProjectCustomLocation() throws Exception { String projectName = "testNG-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); project.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -P custom-report-location",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -P custom-report-location -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.getPublishersList().add(new JUnitResultArchiver("**\\custom-report-location/**.xml")); AbstractBuild build = TestUtils.runAndCheckBuild(project); @@ -111,7 +114,8 @@ public void testMavenOneModule() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + //mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals(String.format("test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true",System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot/helloWorld")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -125,7 +129,9 @@ public void testMavenMultimodule() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + //mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals(String.format("test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(mavenProject); @@ -149,7 +155,10 @@ public void testMavenOneModuleCustomLocation() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); + //mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals(String.format("test -P custom-report-location --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); + mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot/helloWorld")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -166,7 +175,9 @@ public void testMavenMultimoduleCustomLocation() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); + //mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals(String.format("test -P custom-report-location --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -183,7 +194,9 @@ public void testMavenMultimoduleCustomLocationPublished() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); + //mavenProject.setGoals("test -P custom-report-location -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals(String.format("test -P custom-report-location --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); mavenProject.getPublishersList().add(new JUnitResultArchiver("**/custom-report-location/**.xml")); mavenProject.setScm(new CopyResourceSCM("/helloWorldTestNGRoot")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -198,7 +211,9 @@ public void testMavenFailsafe() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("verify"); + //mavenProject.setGoals("verify"); + mavenProject.setGoals(String.format("verify --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); mavenProject.setScm(new CopyResourceSCM("/helloWorldFailsafe")); AbstractBuild build = TestUtils.runAndCheckBuild(mavenProject); @@ -247,7 +262,9 @@ public void testFindingFilesMavenBuild() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + + //mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals(String.format("test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true",System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); mavenProject.setScm(new CopyResourceSCM("/helloWorldRoot/helloWorld")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(mavenProject); @@ -277,7 +294,8 @@ public void testFindingFilesMavenBuildFailsafe() throws Exception { MavenModuleSet mavenProject = rule.createProject(MavenModuleSet.class, projectName); mavenProject.runHeadless(); mavenProject.setMaven(mavenName); - mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + //mavenProject.setGoals("test -Dmaven.test.failure.ignore=true"); + mavenProject.setGoals(String.format("test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true",System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); mavenProject.setScm(new CopyResourceSCM("/helloWorldRoot/helloWorld")); MavenModuleSetBuild build = (MavenModuleSetBuild) TestUtils.runAndCheckBuild(mavenProject); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java index f42067f832..147b98c5ac 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/detection/UFTExtensionTest.java @@ -66,7 +66,8 @@ public void testMockOneBuilder() throws Exception { public void testMockMoreBuilders() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test",System.getenv("MAVEN_HOME")), ToolInstallations.configureMaven3().getName(), null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), ToolInstallations.configureMaven3().getName(), null, null, "-Dmaven.test.failure.ignore=true")); project.getBuildersList().add(new RunFromAlmBuilder("notExistingServer", "notExistingUser", "password", "domain", "project", "notExistingTests", "", "", "", "")); AbstractBuild buildMock = Mockito.mock(AbstractBuild.class); diff --git a/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java b/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java index 4c41b892b5..53c00b3140 100644 --- a/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java +++ b/src/test/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java @@ -26,6 +26,7 @@ import org.junit.*; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.ToolInstallations; +import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -60,6 +61,7 @@ public class GherkinResultsTest { public static void prepareClass() throws Exception { rule.jenkins.setNumExecutors(10); Maven.MavenInstallation mavenInstallation = ToolInstallations.configureMaven3(); + //Maven.MavenInstallation mavenInstallation = new Maven.MavenInstallation("default-system-maven", System.getenv("MAVEN_HOME"), JenkinsRule.NO_PROPERTIES); mavenName = mavenInstallation.getName(); } @@ -136,7 +138,8 @@ public void testGherkinResultsMatrixProject() throws Exception { MatrixProject matrixProject = rule.createProject(MatrixProject.class, projectName); matrixProject.setAxes(new AxisList(new Axis("osType", "Linux", "Windows"))); - matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + matrixProject.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"), System.getenv("TEMP")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); matrixProject.getPublishersList().add(new CucumberTestResultsActionPublisher("")); matrixProject.setScm(new CopyResourceSCM("/helloCucumberWorld")); @@ -162,7 +165,8 @@ private void gherkinResults(String glob, boolean buildShouldSucceed) throws Exce String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, null, null, "-Dmaven.test.failure.ignore=true")); project.setScm(new CopyResourceSCM("/helloCucumberWorld")); project.getPublishersList().add(new CucumberTestResultsActionPublisher(glob)); @@ -174,7 +178,8 @@ private void gherkinResultsInSubFolder(String glob, boolean buildShouldSucceed) String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); - project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test",System.getenv("MAVEN_HOME")), mavenName, "subFolder/pom.xml", null, "-Dmaven.test.failure.ignore=true")); + project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" clean test -Dmaven.repo.local=%s\\m2-temp", + System.getenv("MAVEN_HOME"),System.getenv("TEMP")), mavenName, "subFolder/pom.xml", null, "-Dmaven.test.failure.ignore=true")); project.setScm(new CopyResourceSCM("helloCucumberWorld", "subFolder")); project.getPublishersList().add(new CucumberTestResultsActionPublisher(glob)); @@ -200,7 +205,8 @@ private MavenModuleSet prepareLegacyProject(boolean subfolder) throws IOExceptio project.runHeadless(); project.setMaven(mavenName); - project.setGoals("clean test -Dmaven.test.failure.ignore=true"); + project.setGoals(String.format("clean test --settings %s\\conf\\settings.xml -Dmaven.repo.local=%s\\m2-temp -Dmaven.test.failure.ignore=true", + System.getenv("MAVEN_HOME"),System.getenv("TEMP"))); if(subfolder) { project.setRootPOM("subFolder/pom.xml"); project.setScm(new CopyResourceSCM("/helloCucumberWorld", "subFolder")); From cd04aed524363b4678cf9a1f0d3831631b072708 Mon Sep 17 00:00:00 2001 From: sharonvardi Date: Mon, 8 May 2017 12:58:40 +0300 Subject: [PATCH 0054/2502] defect #279005: [Gherkin] When all steps are skipped the scenarios and run status is Passed (#185) --- .../tools/octane/tests/gherkin/GherkinTestResultsCollector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java b/src/main/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java index d73596ff32..5e1400c142 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java @@ -167,7 +167,7 @@ private void addStep(Element stepElement) { duration += stepDuration; String stepStatus = stepElement.getAttribute("status"); - if (!statusDetermined && "pending".equals(stepStatus)) { + if (!statusDetermined && ("pending".equals(stepStatus) || "skipped".equals(stepStatus))) { status = TestResultStatus.SKIPPED; statusDetermined = true; } else if (!statusDetermined && "failed".equals(stepStatus)) { From 6e2299a362e407e7caa59c2f7625e7a789d0090a Mon Sep 17 00:00:00 2001 From: radislavB Date: Tue, 9 May 2017 23:26:08 +0300 Subject: [PATCH 0055/2502] Uft test discovery and execution (#183) * adding-test-suite-execution-and-test-detection * improving detection action report * remove using Response.Status * don't delete tests in octane if test is removed in GIT * fix test detection * add parameters to job creation * fix merge * fix post tests with scm repository * add description to discovered test * remove , from job name as it illegal character for UFT API test * remove , from job name as it illegal character for UFT API test * setting test type : GUI and API * support changeset of update * reduce number of logs for AsyncPeriodicWork * adding test connectivity task * updating dependencies to sdk and mqm-rest-client * fix style * codacy fixes * codacy fixes * codacy fixes * support persistence of discovery results (to handle octane disconnections) * fixing dispatcher error messages * 1. add triggeredBySuite cause * changing dependency of sdk to 1.3 * triggering build process * create credentials + code review with radi fixes * tech : fix SonarQube issues * add UftJobCleaner for clearing outdated uft-execution jobs * support delete of discovery jobs * adding copyright notice and Javadoc --- pom.xml | 4 +- .../tools/common/RuntimeIOException.java | 35 + .../tools/model/RunFromFileSystemModel.java | 47 +- .../tools/octane/AbstractResultQueueImpl.java | 4 + .../tools/octane/CIJenkinsServicesImpl.java | 970 +++++++++--------- .../tools/octane/actions/PluginActions.java | 14 +- .../octane/actions/UFTParameterFactory.java | 22 +- .../actions/UFTTestDetectionBuildAction.java | 326 +----- .../actions/UFTTestDetectionPublisher.java | 27 +- .../tools/octane/actions/UFTTestUtil.java | 82 ++ .../tools/octane/actions/UftTestType.java | 33 + .../octane/actions/dto/AutomatedTest.java | 94 +- ...{TestFramework.java => BaseRefEntity.java} | 34 +- .../octane/actions/dto/ListNodeEntity.java | 35 + ...ype.java => ListNodeEntityCollection.java} | 41 +- .../configuration/ConfigurationParser.java | 2 - .../executor/ExecutorConnTestService.java | 118 +++ .../TestExecutionJobCreatorService.java | 418 ++++++++ .../executor/TriggeredBySuiteRunCause.java | 41 + .../executor/UFTTestDetectionResult.java | 87 ++ .../executor/UFTTestDetectionService.java | 316 ++++++ .../tools/octane/executor/UftJobCleaner.java | 98 ++ .../executor/UftTestDiscoveryDispatcher.java | 405 ++++++++ .../executor/UftTestDiscoveryQueue.java | 34 + .../AbstractSafeLoggingAsyncPeriodWork.java | 6 + .../octane/tests/junit/JUnitExtension.java | 6 +- .../octane/tests/junit/JUnitXmlIterator.java | 28 +- .../tools/run/RunFromFileBuilder.java | 12 +- .../UFTTestDetectionBuildAction/index.jelly | 102 ++ .../UFTTestDetectionPublisher/config.jelly | 6 +- .../help-workspaceName.html | 19 - 31 files changed, 2574 insertions(+), 892 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/common/RuntimeIOException.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/actions/UftTestType.java rename src/main/java/com/hp/application/automation/tools/octane/actions/dto/{TestFramework.java => BaseRefEntity.java} (64%) create mode 100644 src/main/java/com/hp/application/automation/tools/octane/actions/dto/ListNodeEntity.java rename src/main/java/com/hp/application/automation/tools/octane/actions/dto/{TestingToolType.java => ListNodeEntityCollection.java} (50%) create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java create mode 100644 src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly delete mode 100644 src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/help-workspaceName.html diff --git a/pom.xml b/pom.xml index 199bd4b867..e9217c06bf 100644 --- a/pom.xml +++ b/pom.xml @@ -388,14 +388,14 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.1 + 1.3 mqm-rest-client com.hpe.adm.octane.ciplugins - 1.2 + 1.3 diff --git a/src/main/java/com/hp/application/automation/tools/common/RuntimeIOException.java b/src/main/java/com/hp/application/automation/tools/common/RuntimeIOException.java new file mode 100644 index 0000000000..6849d2139b --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/common/RuntimeIOException.java @@ -0,0 +1,35 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.common; + +/** + * Class is designed for wrapping java-IO exception + */ +public class RuntimeIOException extends RuntimeException { + + public RuntimeIOException() { + super(); + } + + public RuntimeIOException(String msg) { + super(msg); + } + + public RuntimeIOException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java index d0388c1092..55da31fe57 100644 --- a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java @@ -5,15 +5,20 @@ package com.hp.application.automation.tools.model; +import com.hp.application.automation.tools.common.RuntimeIOException; import com.hp.application.automation.tools.mc.JobConfigurationProxy; import hudson.EnvVars; +import hudson.FilePath; import hudson.util.Secret; import hudson.util.VariableResolver; import net.minidev.json.JSONObject; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import javax.annotation.Nullable; +import java.io.File; +import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Properties; @@ -23,16 +28,16 @@ */ public class RunFromFileSystemModel { - public static final String MOBILE_PROXY_SETTING_PASSWORD_FIELD = "MobileProxySetting_Password"; - public static final String MOBILE_PROXY_SETTING_USER_NAME = "MobileProxySetting_UserName"; - public static final String MOBILE_PROXY_SETTING_AUTHENTICATION = "MobileProxySetting_Authentication"; - public static final String MOBILE_USE_SSL = "MobileUseSSL"; + public static final String MOBILE_PROXY_SETTING_PASSWORD_FIELD = "MobileProxySetting_Password"; + public static final String MOBILE_PROXY_SETTING_USER_NAME = "MobileProxySetting_UserName"; + public static final String MOBILE_PROXY_SETTING_AUTHENTICATION = "MobileProxySetting_Authentication"; + public static final String MOBILE_USE_SSL = "MobileUseSSL"; public final static EnumDescription FAST_RUN_MODE = new EnumDescription("Fast", "Fast"); public final static EnumDescription NORMAL_RUN_MODE = new EnumDescription("Normal", "Normal"); public final static List fsUftRunModes = Arrays.asList(FAST_RUN_MODE, NORMAL_RUN_MODE); - private String fsTests; + private String fsTests; private String fsTimeout; private String fsUftRunMode; private String controllerPollingInterval; @@ -54,6 +59,7 @@ public class RunFromFileSystemModel { private String fsJobId; private ProxySettings proxySettings; private boolean useSSL; + private FilePath workspace; /** * Instantiates a new Run from file system model. @@ -592,7 +598,14 @@ private Properties createProperties(EnvVars envVars) { Properties props = new Properties(); if (!StringUtils.isEmpty(this.fsTests)) { - String expandedFsTests = envVars.expand(fsTests); + String expandedFsTests; + if (isMtbxContent(fsTests)) { + String path = createMtbxFileInWs(fsTests); + expandedFsTests = envVars.expand(path); + } else { + expandedFsTests = envVars.expand(fsTests); + } + String[] testsArr = expandedFsTests.replaceAll("\r", "").split("\n"); int i = 1; @@ -675,6 +688,25 @@ private Properties createProperties(EnvVars envVars) { return props; } + private String createMtbxFileInWs(String mtbxContent) { + try { + + String filePath = File.separator + "test_suite.mtbx"; + String fullPath = workspace.getRemote() + filePath; + + String content = mtbxContent.replace("${WORKSPACE}", workspace.getRemote()); + FileUtils.writeStringToFile(new File(fullPath), content); + + return "${WORKSPACE}" + filePath; + } catch (IOException e) { + throw new RuntimeIOException("Failed to save MTBX file : " + e.getMessage()); + } + } + + private static boolean isMtbxContent(String fsTests) { + return fsTests.toLowerCase().contains(""); + } + /** * Get proxy details json object. * @@ -691,4 +723,7 @@ public JSONObject getJobDetails(String mcUrl, String proxyAddress, String proxyU return JobConfigurationProxy.getInstance().getJobById(mcUrl, fsUserName, fsPassword.getPlainText(), proxyAddress, proxyUserName, proxyPassword, fsJobId); } + public void setWorkspace(FilePath workspace) { + this.workspace = workspace; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java b/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java index 0cfd042da6..bf7bbe95fa 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/AbstractResultQueueImpl.java @@ -81,6 +81,10 @@ public synchronized void add(String projectName, int buildNumber) { queue.add(new QueueItem(projectName, buildNumber)); } + public int size(){ + return queue.size(); + } + @Override public synchronized void add(String projectName, int buildNumber, String workspace) { queue.add(new QueueItem(projectName, buildNumber, workspace)); diff --git a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java index c0ae883ab3..976704f2e7 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -17,10 +17,23 @@ package com.hp.application.automation.tools.octane; import com.hp.application.automation.tools.model.OctaneServerSettingsModel; +import com.hp.application.automation.tools.octane.configuration.ConfigurationService; +import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; +import com.hp.application.automation.tools.octane.executor.ExecutorConnTestService; +import com.hp.application.automation.tools.octane.executor.TestExecutionJobCreatorService; +import com.hp.application.automation.tools.octane.model.ModelFactory; +import com.hp.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; +import com.hp.application.automation.tools.octane.model.processors.projects.AbstractProjectProcessor; +import com.hp.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; import com.hp.application.automation.tools.octane.model.processors.scm.SCMProcessor; +import com.hp.application.automation.tools.octane.model.processors.scm.SCMProcessors; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.configuration.CIProxyConfiguration; import com.hp.octane.integrations.dto.configuration.OctaneConfiguration; +import com.hp.octane.integrations.dto.executor.CredentialsInfo; +import com.hp.octane.integrations.dto.executor.DiscoveryInfo; +import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; +import com.hp.octane.integrations.dto.executor.TestSuiteExecutionInfo; import com.hp.octane.integrations.dto.general.CIJobsList; import com.hp.octane.integrations.dto.general.CIPluginInfo; import com.hp.octane.integrations.dto.general.CIServerInfo; @@ -33,14 +46,7 @@ import com.hp.octane.integrations.dto.tests.TestsResult; import com.hp.octane.integrations.exceptions.ConfigurationException; import com.hp.octane.integrations.exceptions.PermissionException; -import com.hp.octane.integrations.spi.CIPluginServices; -import com.hp.application.automation.tools.octane.configuration.ConfigurationService; -import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; -import com.hp.application.automation.tools.octane.model.ModelFactory; -import com.hp.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; -import com.hp.application.automation.tools.octane.model.processors.projects.AbstractProjectProcessor; -import com.hp.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; -import com.hp.application.automation.tools.octane.model.processors.scm.SCMProcessors; +import com.hp.octane.integrations.spi.CIPluginServicesBase; import hudson.ProxyConfiguration; import hudson.model.*; import hudson.security.ACL; @@ -69,465 +75,491 @@ /** * Base implementation of SPI(service provider interface) of Octane CI SDK for Jenkins */ -public class CIJenkinsServicesImpl implements CIPluginServices { - private static final Logger logger = LogManager.getLogger(CIJenkinsServicesImpl.class); - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - - @Override - public CIServerInfo getServerInfo() { - CIServerInfo result = dtoFactory.newDTO(CIServerInfo.class); - String serverUrl = Jenkins.getInstance().getRootUrl(); - if (serverUrl != null && serverUrl.endsWith("/")) { - serverUrl = serverUrl.substring(0, serverUrl.length() - 1); - } - OctaneServerSettingsModel model = ConfigurationService.getModel(); - result.setType(CIServerTypes.JENKINS) - .setVersion(Jenkins.VERSION) - .setUrl(serverUrl) - .setInstanceId(model.getIdentity()) - .setInstanceIdFrom(model.getIdentityFrom()) - .setSendingTime(System.currentTimeMillis()); - return result; - } - - @Override - public CIPluginInfo getPluginInfo() { - CIPluginInfo result = dtoFactory.newDTO(CIPluginInfo.class); - result.setVersion(ConfigurationService.getPluginVersion()); - return result; - } - - @Override - public File getAllowedOctaneStorage() { - return new File(Jenkins.getInstance().getRootDir(), "userContent"); - } - - @Override - public File getPredictiveOctanePath() { - return new File(Jenkins.getInstance().getRootDir(), "predictive"); - } - - @Override - public OctaneConfiguration getOctaneConfiguration() { - OctaneConfiguration result = null; - ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - if (serverConfiguration.location != null && !serverConfiguration.location.isEmpty() && - serverConfiguration.sharedSpace != null && !serverConfiguration.sharedSpace.isEmpty()) { - result = dtoFactory.newDTO(OctaneConfiguration.class) - .setUrl(serverConfiguration.location) - .setSharedSpace(serverConfiguration.sharedSpace) - .setApiKey(serverConfiguration.username) - .setSecret(serverConfiguration.password.getPlainText()); - } - return result; - } - - @Override - public CIProxyConfiguration getProxyConfiguration(String targetHost) { - CIProxyConfiguration result = null; - ProxyConfiguration proxy = Jenkins.getInstance().proxy; - if (proxy != null) { - boolean noProxyHost = false; - for (Pattern pattern : proxy.getNoProxyHostPatterns()) { - if (pattern.matcher(targetHost).find()) { - noProxyHost = true; - break; - } - } - if (!noProxyHost) { - result = dtoFactory.newDTO(CIProxyConfiguration.class) - .setHost(proxy.name) - .setPort(proxy.port) - .setUsername(proxy.getUserName()) - .setPassword(proxy.getPassword()); - } - } - return result; - } - - @Override - public CIJobsList getJobsList(boolean includeParameters) { - SecurityContext securityContext = startImpersonation(); - CIJobsList result = dtoFactory.newDTO(CIJobsList.class); - PipelineNode tmpConfig; - TopLevelItem tmpItem; - List list = new ArrayList<>(); - try { - boolean hasReadPermission = Jenkins.getInstance().hasPermission(Item.READ); - if (!hasReadPermission) { - stopImpersonation(securityContext); - throw new PermissionException(403); - } - List itemNames = (List) Jenkins.getInstance().getTopLevelItemNames(); - for (String name : itemNames) { - tmpItem = Jenkins.getInstance().getItem(name); - - try { - if (tmpItem instanceof AbstractProject) { - AbstractProject abstractProject = (AbstractProject) tmpItem; - if (abstractProject.isDisabled()) { - continue; - } - tmpConfig = dtoFactory.newDTO(PipelineNode.class) - .setJobCiId(JobProcessorFactory.getFlowProcessor(abstractProject).getJobCiId()) - .setName(name); - if (includeParameters) { - tmpConfig.setParameters(ParameterProcessors.getConfigs(abstractProject)); - } - list.add(tmpConfig); - } else if (tmpItem.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { - Job tmpJob = (Job) tmpItem; - tmpConfig = dtoFactory.newDTO(PipelineNode.class) - .setJobCiId(JobProcessorFactory.getFlowProcessor(tmpJob).getJobCiId()) - .setName(name); - if (includeParameters) { - tmpConfig.setParameters(ParameterProcessors.getConfigs(tmpJob)); - } - list.add(tmpConfig); - } else if (tmpItem.getClass().getName().equals("com.cloudbees.hudson.plugins.folder.Folder")) { - for (Job tmpJob : tmpItem.getAllJobs()) { - tmpConfig = dtoFactory.newDTO(PipelineNode.class) - .setJobCiId(JobProcessorFactory.getFlowProcessor(tmpJob).getJobCiId()) - .setName(tmpJob.getName()); - if (includeParameters) { - tmpConfig.setParameters(ParameterProcessors.getConfigs(tmpJob)); - } - list.add(tmpConfig); - } - } else { - logger.info("item '" + name + "' is not of supported type"); - } - } catch (Throwable e) { - logger.error("Failed to add job '" + name + "' to JobList : " + e.getClass().getCanonicalName() + " - " + e.getMessage(), e); - //throw e; - } - - } - result.setJobs(list.toArray(new PipelineNode[list.size()])); - stopImpersonation(securityContext); - } catch (AccessDeniedException e) { - stopImpersonation(securityContext); - throw new PermissionException(403); - } - return result; - } - - - @Override - public PipelineNode getPipeline(String rootJobCiId) { - PipelineNode result; - SecurityContext securityContext = startImpersonation(); - boolean hasRead = Jenkins.getInstance().hasPermission(Item.READ); - if (!hasRead) { - stopImpersonation(securityContext); - throw new PermissionException(403); - } - Job project = getJobByRefId(rootJobCiId); - if (project != null) { - result = ModelFactory.createStructureItem(project); - stopImpersonation(securityContext); - return result; - } else { - //todo: check error message(s) - logger.warn("Failed to get project from jobRefId: '" + rootJobCiId + "' check plugin user Job Read/Overall Read permissions / project name"); - stopImpersonation(securityContext); - throw new ConfigurationException(404); - } - } - - private SecurityContext startImpersonation() { - String user = ConfigurationService.getModel().getImpersonatedUser(); - SecurityContext originalContext = null; - if (user != null && !user.equalsIgnoreCase("")) { - User jenkinsUser = User.get(user, false); - if (jenkinsUser != null) { - originalContext = ACL.impersonate(jenkinsUser.impersonate()); - } else { - throw new PermissionException(401); - } - } else { - logger.info("No user set to impersonating to. Operations will be done using Anonymous user"); - } - return originalContext; - } - - private void stopImpersonation(SecurityContext originalContext) { - if (originalContext != null) { - ACL.impersonate(originalContext.getAuthentication()); - } else { - logger.warn("Could not roll back impersonation, originalContext is null "); - } - } - - @Override - public void runPipeline(String jobCiId, String originalBody) { - SecurityContext securityContext = startImpersonation(); - Job job = getJobByRefId(jobCiId); - if (job != null) { - boolean hasBuildPermission = job.hasPermission(Item.BUILD); - if (!hasBuildPermission) { - stopImpersonation(securityContext); - throw new PermissionException(403); - } - if (job instanceof AbstractProject || job.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { - doRunImpl(job, originalBody); - } - stopImpersonation(securityContext); - } else { - stopImpersonation(securityContext); - throw new ConfigurationException(404); - } - } - - @Override - public SnapshotNode getSnapshotLatest(String jobCiId, boolean subTree) { - SecurityContext securityContext = startImpersonation(); - SnapshotNode result = null; - Job job = getJobByRefId(jobCiId); - if (job != null) { - Run run = job.getLastBuild(); - if (run != null) { - result = ModelFactory.createSnapshotItem(run, subTree); - } - } - stopImpersonation(securityContext); - return result; - } - - @Override - public SnapshotNode getSnapshotByNumber(String jobCiId, String buildCiId, boolean subTree) { - SecurityContext securityContext = startImpersonation(); - - SnapshotNode result = null; - Job job = getJobByRefId(jobCiId); - - Integer buildNumber = null; - try { - buildNumber = Integer.parseInt(buildCiId); - } catch (NumberFormatException nfe) { - logger.error("failed to parse build CI ID to build number, " + nfe.getMessage(), nfe); - } - if (job != null && buildNumber != null) { - Run build = job.getBuildByNumber(buildNumber); - if (build != null) { - result = ModelFactory.createSnapshotItem(build, subTree); - } - } - - stopImpersonation(securityContext); - return result; - } - - @Override - public BuildHistory getHistoryPipeline(String jobCiId, String originalBody) { - SecurityContext securityContext = startImpersonation(); - BuildHistory buildHistory = dtoFactory.newDTO(BuildHistory.class); - Job job = getJobByRefId(jobCiId); - AbstractProject project; - if (job instanceof AbstractProject) { - project = (AbstractProject) job; - SCMData scmData; - Set users; - SCMProcessor scmProcessor = SCMProcessors.getAppropriate(project.getScm().getClass().getName()); - - int numberOfBuilds = 5; - - //TODO : check if it works!! - if (originalBody != null && !originalBody.isEmpty()) { - JSONObject bodyJSON = JSONObject.fromObject(originalBody); - if (bodyJSON.has("numberOfBuilds")) { - numberOfBuilds = bodyJSON.getInt("numberOfBuilds"); - } - } - List result = project.getLastBuildsOverThreshold(numberOfBuilds, Result.ABORTED); // get last five build with result that better or equal failure - for (int i = 0; i < result.size(); i++) { - AbstractBuild build = (AbstractBuild) result.get(i); - scmData = null; - users = null; - if (build != null) { - if (scmProcessor != null) { - scmData = scmProcessor.getSCMData(build); - users = build.getCulprits(); - } - buildHistory.addBuild(build.getResult().toString(), String.valueOf(build.getNumber()), build.getTimestampString(), String.valueOf(build.getStartTimeInMillis()), String.valueOf(build.getDuration()), scmData, ModelFactory.createScmUsersList(users)); - } - } - AbstractBuild lastSuccessfulBuild = null; - AbstractBuild lastProjectBuild = project.getLastBuild(); - if (lastProjectBuild != null) { - lastSuccessfulBuild = (AbstractBuild) lastProjectBuild.getPreviousSuccessfulBuild(); - } - if (lastSuccessfulBuild != null) { - scmData = null; - users = null; - if (scmProcessor != null) { - scmData = scmProcessor.getSCMData(lastSuccessfulBuild); - users = lastSuccessfulBuild.getCulprits(); - } - buildHistory.addLastSuccesfullBuild(lastSuccessfulBuild.getResult().toString(), String.valueOf(lastSuccessfulBuild.getNumber()), lastSuccessfulBuild.getTimestampString(), String.valueOf(lastSuccessfulBuild.getStartTimeInMillis()), String.valueOf(lastSuccessfulBuild.getDuration()), scmData, ModelFactory.createScmUsersList(users)); - } - AbstractBuild lastBuild = project.getLastBuild(); - if (lastBuild != null) { - scmData = null; - users = null; - if (scmProcessor != null) { - scmData = scmProcessor.getSCMData(lastBuild); - users = lastBuild.getCulprits(); - } - - if (lastBuild.getResult() == null) { - buildHistory.addLastBuild("building", String.valueOf(lastBuild.getNumber()), lastBuild.getTimestampString(), String.valueOf(lastBuild.getStartTimeInMillis()), String.valueOf(lastBuild.getDuration()), scmData, ModelFactory.createScmUsersList(users)); - } else { - buildHistory.addLastBuild(lastBuild.getResult().toString(), String.valueOf(lastBuild.getNumber()), lastBuild.getTimestampString(), String.valueOf(lastBuild.getStartTimeInMillis()), String.valueOf(lastBuild.getDuration()), scmData, ModelFactory.createScmUsersList(users)); - } - } - stopImpersonation(securityContext); - } else { - logger.warn("non supported flow"); - } - return buildHistory; - } - - // TODO: implement - @Override - public TestsResult getTestsResult(String jobId, String buildNumber) { - return null; - } - - // TODO: the below flow should go via JobProcessor, once scheduleBuild will be implemented for all of them - private void doRunImpl(Job job, String originalBody) { - if (job instanceof AbstractProject) { - AbstractProject project = (AbstractProject) job; - int delay = project.getQuietPeriod(); - ParametersAction parametersAction = new ParametersAction(); - - if (originalBody != null && !originalBody.isEmpty()) { - JSONObject bodyJSON = JSONObject.fromObject(originalBody); - - // delay - if (bodyJSON.has("delay") && bodyJSON.get("delay") != null) { - delay = bodyJSON.getInt("delay"); - } - - // parameters - if (bodyJSON.has("parameters") && bodyJSON.get("parameters") != null) { - JSONArray paramsJSON = bodyJSON.getJSONArray("parameters"); - parametersAction = new ParametersAction(createParameters(project, paramsJSON)); - } - } - - project.scheduleBuild(delay, new Cause.RemoteCause(getOctaneConfiguration() == null ? "non available URL" : getOctaneConfiguration().getUrl(), "octane driven execution"), parametersAction); - } else if (job.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { - AbstractProjectProcessor workFlowJobProcessor = JobProcessorFactory.getFlowProcessor(job); - workFlowJobProcessor.scheduleBuild(originalBody); - } - } - - private List createParameters(AbstractProject project, JSONArray paramsJSON) { - List result = new ArrayList<>(); - boolean parameterHandled; - ParameterValue tmpValue; - ParametersDefinitionProperty paramsDefProperty = (ParametersDefinitionProperty) project.getProperty(ParametersDefinitionProperty.class); - if (paramsDefProperty != null) { - for (ParameterDefinition paramDef : paramsDefProperty.getParameterDefinitions()) { - parameterHandled = false; - for (int i = 0; i < paramsJSON.size(); i++) { - JSONObject paramJSON = paramsJSON.getJSONObject(i); - if (paramJSON.has("name") && paramJSON.get("name") != null && paramJSON.get("name").equals(paramDef.getName())) { - tmpValue = null; - switch (CIParameterType.fromValue(paramJSON.getString("type"))) { - case FILE: - try { - FileItemFactory fif = new DiskFileItemFactory(); - FileItem fi = fif.createItem(paramJSON.getString("name"), "text/plain", false, paramJSON.getString("file")); - fi.getOutputStream().write(DatatypeConverter.parseBase64Binary(paramJSON.getString("value"))); - tmpValue = new FileParameterValue(paramJSON.getString("name"), fi); - } catch (IOException ioe) { - logger.warn("failed to process file parameter", ioe); - } - break; - case NUMBER: - tmpValue = new StringParameterValue(paramJSON.getString("name"), paramJSON.get("value").toString()); - break; - case STRING: - tmpValue = new StringParameterValue(paramJSON.getString("name"), paramJSON.getString("value")); - break; - case BOOLEAN: - tmpValue = new BooleanParameterValue(paramJSON.getString("name"), paramJSON.getBoolean("value")); - break; - case PASSWORD: - tmpValue = new PasswordParameterValue(paramJSON.getString("name"), paramJSON.getString("value")); - break; - default: - break; - } - if (tmpValue != null) { - result.add(tmpValue); - parameterHandled = true; - } - break; - } - } - if (!parameterHandled) { - if (paramDef instanceof FileParameterDefinition) { - FileItemFactory fif = new DiskFileItemFactory(); - FileItem fi = fif.createItem(paramDef.getName(), "text/plain", false, ""); - try { - fi.getOutputStream().write(new byte[0]); - } catch (IOException ioe) { - logger.error("failed to create default value for file parameter '" + paramDef.getName() + "'", ioe); - } - tmpValue = new FileParameterValue(paramDef.getName(), fi); - result.add(tmpValue); - } else { - result.add(paramDef.getDefaultParameterValue()); - } - } - } - } - return result; - } - - private Job getJobByRefId(String jobRefId) { - Job result = null; - if (jobRefId != null) { - try { - jobRefId = URLDecoder.decode(jobRefId, "UTF-8"); - TopLevelItem item = getTopLevelItem(jobRefId); - if (item != null && item instanceof Job) { - result = (Job) item; - } else if (jobRefId.contains("/") && item == null) { - String newJobRefId = jobRefId.substring(0, jobRefId.indexOf("/")); - item = getTopLevelItem(newJobRefId); - if (item != null) { - Collection allJobs = item.getAllJobs(); - for (Job job : allJobs) { - if (jobRefId.endsWith(job.getName())) { - result = job; - break; - } - } - } - } - } catch (UnsupportedEncodingException uee) { - logger.error("failed to decode job ref ID '" + jobRefId + "'", uee); - } - } - return result; - } - - private TopLevelItem getTopLevelItem(String jobRefId) { - TopLevelItem item; - try { - item = Jenkins.getInstance().getItem(jobRefId); - } catch (AccessDeniedException e) { - String user = ConfigurationService.getModel().getImpersonatedUser(); - if (user != null && !user.isEmpty()) { - throw new PermissionException(403); - } else { - throw new PermissionException(405); - } - } - return item; - } +public class CIJenkinsServicesImpl extends CIPluginServicesBase { + private static final Logger logger = LogManager.getLogger(CIJenkinsServicesImpl.class); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + + @Override + public CIServerInfo getServerInfo() { + CIServerInfo result = dtoFactory.newDTO(CIServerInfo.class); + String serverUrl = Jenkins.getInstance().getRootUrl(); + if (serverUrl != null && serverUrl.endsWith("/")) { + serverUrl = serverUrl.substring(0, serverUrl.length() - 1); + } + OctaneServerSettingsModel model = ConfigurationService.getModel(); + result.setType(CIServerTypes.JENKINS) + .setVersion(Jenkins.VERSION) + .setUrl(serverUrl) + .setInstanceId(model.getIdentity()) + .setInstanceIdFrom(model.getIdentityFrom()) + .setSendingTime(System.currentTimeMillis()); + return result; + } + + @Override + public CIPluginInfo getPluginInfo() { + CIPluginInfo result = dtoFactory.newDTO(CIPluginInfo.class); + result.setVersion(ConfigurationService.getPluginVersion()); + return result; + } + + @Override + public File getAllowedOctaneStorage() { + return new File(Jenkins.getInstance().getRootDir(), "userContent"); + } + + @Override + public File getPredictiveOctanePath() { + return new File(Jenkins.getInstance().getRootDir(), "predictive"); + } + + @Override + public OctaneConfiguration getOctaneConfiguration() { + OctaneConfiguration result = null; + ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); + if (serverConfiguration.location != null && !serverConfiguration.location.isEmpty() && + serverConfiguration.sharedSpace != null && !serverConfiguration.sharedSpace.isEmpty()) { + result = dtoFactory.newDTO(OctaneConfiguration.class) + .setUrl(serverConfiguration.location) + .setSharedSpace(serverConfiguration.sharedSpace) + .setApiKey(serverConfiguration.username) + .setSecret(serverConfiguration.password.getPlainText()); + } + return result; + } + + @Override + public CIProxyConfiguration getProxyConfiguration(String targetHost) { + CIProxyConfiguration result = null; + ProxyConfiguration proxy = Jenkins.getInstance().proxy; + if (proxy != null) { + boolean noProxyHost = false; + for (Pattern pattern : proxy.getNoProxyHostPatterns()) { + if (pattern.matcher(targetHost).find()) { + noProxyHost = true; + break; + } + } + if (!noProxyHost) { + result = dtoFactory.newDTO(CIProxyConfiguration.class) + .setHost(proxy.name) + .setPort(proxy.port) + .setUsername(proxy.getUserName()) + .setPassword(proxy.getPassword()); + } + } + return result; + } + + @Override + public CIJobsList getJobsList(boolean includeParameters) { + SecurityContext securityContext = startImpersonation(); + CIJobsList result = dtoFactory.newDTO(CIJobsList.class); + PipelineNode tmpConfig; + TopLevelItem tmpItem; + List list = new ArrayList<>(); + try { + boolean hasReadPermission = Jenkins.getInstance().hasPermission(Item.READ); + if (!hasReadPermission) { + stopImpersonation(securityContext); + throw new PermissionException(403); + } + List itemNames = (List) Jenkins.getInstance().getTopLevelItemNames(); + for (String name : itemNames) { + tmpItem = Jenkins.getInstance().getItem(name); + + try { + if (tmpItem instanceof AbstractProject) { + AbstractProject abstractProject = (AbstractProject) tmpItem; + if (abstractProject.isDisabled()) { + continue; + } + tmpConfig = dtoFactory.newDTO(PipelineNode.class) + .setJobCiId(JobProcessorFactory.getFlowProcessor(abstractProject).getJobCiId()) + .setName(name); + if (includeParameters) { + tmpConfig.setParameters(ParameterProcessors.getConfigs(abstractProject)); + } + list.add(tmpConfig); + } else if (tmpItem.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { + Job tmpJob = (Job) tmpItem; + tmpConfig = dtoFactory.newDTO(PipelineNode.class) + .setJobCiId(JobProcessorFactory.getFlowProcessor(tmpJob).getJobCiId()) + .setName(name); + if (includeParameters) { + tmpConfig.setParameters(ParameterProcessors.getConfigs(tmpJob)); + } + list.add(tmpConfig); + } else if (tmpItem.getClass().getName().equals("com.cloudbees.hudson.plugins.folder.Folder")) { + for (Job tmpJob : tmpItem.getAllJobs()) { + tmpConfig = dtoFactory.newDTO(PipelineNode.class) + .setJobCiId(JobProcessorFactory.getFlowProcessor(tmpJob).getJobCiId()) + .setName(tmpJob.getName()); + if (includeParameters) { + tmpConfig.setParameters(ParameterProcessors.getConfigs(tmpJob)); + } + list.add(tmpConfig); + } + } else { + logger.info("item '" + name + "' is not of supported type"); + } + } catch (Throwable e) { + logger.error("Failed to add job '" + name + "' to JobList : " + e.getClass().getCanonicalName() + " - " + e.getMessage(), e); + //throw e; + } + + } + result.setJobs(list.toArray(new PipelineNode[list.size()])); + stopImpersonation(securityContext); + } catch (AccessDeniedException e) { + stopImpersonation(securityContext); + throw new PermissionException(403); + } + return result; + } + + + @Override + public PipelineNode getPipeline(String rootJobCiId) { + PipelineNode result; + SecurityContext securityContext = startImpersonation(); + boolean hasRead = Jenkins.getInstance().hasPermission(Item.READ); + if (!hasRead) { + stopImpersonation(securityContext); + throw new PermissionException(403); + } + Job project = getJobByRefId(rootJobCiId); + if (project != null) { + result = ModelFactory.createStructureItem(project); + stopImpersonation(securityContext); + return result; + } else { + //todo: check error message(s) + logger.warn("Failed to get project from jobRefId: '" + rootJobCiId + "' check plugin user Job Read/Overall Read permissions / project name"); + stopImpersonation(securityContext); + throw new ConfigurationException(404); + } + } + + private SecurityContext startImpersonation() { + String user = ConfigurationService.getModel().getImpersonatedUser(); + SecurityContext originalContext = null; + if (user != null && !user.equalsIgnoreCase("")) { + User jenkinsUser = User.get(user, false); + if (jenkinsUser != null) { + originalContext = ACL.impersonate(jenkinsUser.impersonate()); + } else { + throw new PermissionException(401); + } + } else { + logger.info("No user set to impersonating to. Operations will be done using Anonymous user"); + } + return originalContext; + } + + private void stopImpersonation(SecurityContext originalContext) { + if (originalContext != null) { + ACL.impersonate(originalContext.getAuthentication()); + } else { + logger.warn("Could not roll back impersonation, originalContext is null "); + } + } + + @Override + public void runPipeline(String jobCiId, String originalBody) { + SecurityContext securityContext = startImpersonation(); + Job job = getJobByRefId(jobCiId); + if (job != null) { + boolean hasBuildPermission = job.hasPermission(Item.BUILD); + if (!hasBuildPermission) { + stopImpersonation(securityContext); + throw new PermissionException(403); + } + if (job instanceof AbstractProject || job.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { + doRunImpl(job, originalBody); + } + stopImpersonation(securityContext); + } else { + stopImpersonation(securityContext); + throw new ConfigurationException(404); + } + } + + @Override + public SnapshotNode getSnapshotLatest(String jobCiId, boolean subTree) { + SecurityContext securityContext = startImpersonation(); + SnapshotNode result = null; + Job job = getJobByRefId(jobCiId); + if (job != null) { + Run run = job.getLastBuild(); + if (run != null) { + result = ModelFactory.createSnapshotItem(run, subTree); + } + } + stopImpersonation(securityContext); + return result; + } + + @Override + public SnapshotNode getSnapshotByNumber(String jobCiId, String buildCiId, boolean subTree) { + SecurityContext securityContext = startImpersonation(); + + SnapshotNode result = null; + Job job = getJobByRefId(jobCiId); + + Integer buildNumber = null; + try { + buildNumber = Integer.parseInt(buildCiId); + } catch (NumberFormatException nfe) { + logger.error("failed to parse build CI ID to build number, " + nfe.getMessage(), nfe); + } + if (job != null && buildNumber != null) { + Run build = job.getBuildByNumber(buildNumber); + if (build != null) { + result = ModelFactory.createSnapshotItem(build, subTree); + } + } + + stopImpersonation(securityContext); + return result; + } + + @Override + public BuildHistory getHistoryPipeline(String jobCiId, String originalBody) { + SecurityContext securityContext = startImpersonation(); + BuildHistory buildHistory = dtoFactory.newDTO(BuildHistory.class); + Job job = getJobByRefId(jobCiId); + AbstractProject project; + if (job instanceof AbstractProject) { + project = (AbstractProject) job; + SCMData scmData; + Set users; + SCMProcessor scmProcessor = SCMProcessors.getAppropriate(project.getScm().getClass().getName()); + + int numberOfBuilds = 5; + + //TODO : check if it works!! + if (originalBody != null && !originalBody.isEmpty()) { + JSONObject bodyJSON = JSONObject.fromObject(originalBody); + if (bodyJSON.has("numberOfBuilds")) { + numberOfBuilds = bodyJSON.getInt("numberOfBuilds"); + } + } + List result = project.getLastBuildsOverThreshold(numberOfBuilds, Result.ABORTED); // get last five build with result that better or equal failure + for (int i = 0; i < result.size(); i++) { + AbstractBuild build = (AbstractBuild) result.get(i); + scmData = null; + users = null; + if (build != null) { + if (scmProcessor != null) { + scmData = scmProcessor.getSCMData(build); + users = build.getCulprits(); + } + buildHistory.addBuild(build.getResult().toString(), String.valueOf(build.getNumber()), build.getTimestampString(), String.valueOf(build.getStartTimeInMillis()), String.valueOf(build.getDuration()), scmData, ModelFactory.createScmUsersList(users)); + } + } + AbstractBuild lastSuccessfulBuild = null; + AbstractBuild lastProjectBuild = project.getLastBuild(); + if (lastProjectBuild != null) { + lastSuccessfulBuild = (AbstractBuild) lastProjectBuild.getPreviousSuccessfulBuild(); + } + if (lastSuccessfulBuild != null) { + scmData = null; + users = null; + if (scmProcessor != null) { + scmData = scmProcessor.getSCMData(lastSuccessfulBuild); + users = lastSuccessfulBuild.getCulprits(); + } + buildHistory.addLastSuccesfullBuild(lastSuccessfulBuild.getResult().toString(), String.valueOf(lastSuccessfulBuild.getNumber()), lastSuccessfulBuild.getTimestampString(), String.valueOf(lastSuccessfulBuild.getStartTimeInMillis()), String.valueOf(lastSuccessfulBuild.getDuration()), scmData, ModelFactory.createScmUsersList(users)); + } + AbstractBuild lastBuild = project.getLastBuild(); + if (lastBuild != null) { + scmData = null; + users = null; + if (scmProcessor != null) { + scmData = scmProcessor.getSCMData(lastBuild); + users = lastBuild.getCulprits(); + } + + if (lastBuild.getResult() == null) { + buildHistory.addLastBuild("building", String.valueOf(lastBuild.getNumber()), lastBuild.getTimestampString(), String.valueOf(lastBuild.getStartTimeInMillis()), String.valueOf(lastBuild.getDuration()), scmData, ModelFactory.createScmUsersList(users)); + } else { + buildHistory.addLastBuild(lastBuild.getResult().toString(), String.valueOf(lastBuild.getNumber()), lastBuild.getTimestampString(), String.valueOf(lastBuild.getStartTimeInMillis()), String.valueOf(lastBuild.getDuration()), scmData, ModelFactory.createScmUsersList(users)); + } + } + stopImpersonation(securityContext); + } else { + logger.warn("non supported flow"); + } + return buildHistory; + } + + // TODO: implement + @Override + public TestsResult getTestsResult(String jobId, String buildNumber) { + return null; + } + + // TODO: the below flow should go via JobProcessor, once scheduleBuild will be implemented for all of them + private void doRunImpl(Job job, String originalBody) { + if (job instanceof AbstractProject) { + AbstractProject project = (AbstractProject) job; + int delay = project.getQuietPeriod(); + ParametersAction parametersAction = new ParametersAction(); + + if (originalBody != null && !originalBody.isEmpty()) { + JSONObject bodyJSON = JSONObject.fromObject(originalBody); + + // delay + if (bodyJSON.has("delay") && bodyJSON.get("delay") != null) { + delay = bodyJSON.getInt("delay"); + } + + // parameters + if (bodyJSON.has("parameters") && bodyJSON.get("parameters") != null) { + JSONArray paramsJSON = bodyJSON.getJSONArray("parameters"); + parametersAction = new ParametersAction(createParameters(project, paramsJSON)); + } + } + + project.scheduleBuild(delay, new Cause.RemoteCause(getOctaneConfiguration() == null ? "non available URL" : getOctaneConfiguration().getUrl(), "octane driven execution"), parametersAction); + } else if (job.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { + AbstractProjectProcessor workFlowJobProcessor = JobProcessorFactory.getFlowProcessor(job); + workFlowJobProcessor.scheduleBuild(originalBody); + } + } + + private List createParameters(AbstractProject project, JSONArray paramsJSON) { + List result = new ArrayList<>(); + boolean parameterHandled; + ParameterValue tmpValue; + ParametersDefinitionProperty paramsDefProperty = (ParametersDefinitionProperty) project.getProperty(ParametersDefinitionProperty.class); + if (paramsDefProperty != null) { + for (ParameterDefinition paramDef : paramsDefProperty.getParameterDefinitions()) { + parameterHandled = false; + for (int i = 0; i < paramsJSON.size(); i++) { + JSONObject paramJSON = paramsJSON.getJSONObject(i); + if (paramJSON.has("name") && paramJSON.get("name") != null && paramJSON.get("name").equals(paramDef.getName())) { + tmpValue = null; + switch (CIParameterType.fromValue(paramJSON.getString("type"))) { + case FILE: + try { + FileItemFactory fif = new DiskFileItemFactory(); + FileItem fi = fif.createItem(paramJSON.getString("name"), "text/plain", false, paramJSON.getString("file")); + fi.getOutputStream().write(DatatypeConverter.parseBase64Binary(paramJSON.getString("value"))); + tmpValue = new FileParameterValue(paramJSON.getString("name"), fi); + } catch (IOException ioe) { + logger.warn("failed to process file parameter", ioe); + } + break; + case NUMBER: + tmpValue = new StringParameterValue(paramJSON.getString("name"), paramJSON.get("value").toString()); + break; + case STRING: + tmpValue = new StringParameterValue(paramJSON.getString("name"), paramJSON.getString("value")); + break; + case BOOLEAN: + tmpValue = new BooleanParameterValue(paramJSON.getString("name"), paramJSON.getBoolean("value")); + break; + case PASSWORD: + tmpValue = new PasswordParameterValue(paramJSON.getString("name"), paramJSON.getString("value")); + break; + default: + break; + } + if (tmpValue != null) { + result.add(tmpValue); + parameterHandled = true; + } + break; + } + } + if (!parameterHandled) { + if (paramDef instanceof FileParameterDefinition) { + FileItemFactory fif = new DiskFileItemFactory(); + FileItem fi = fif.createItem(paramDef.getName(), "text/plain", false, ""); + try { + fi.getOutputStream().write(new byte[0]); + } catch (IOException ioe) { + logger.error("failed to create default value for file parameter '" + paramDef.getName() + "'", ioe); + } + tmpValue = new FileParameterValue(paramDef.getName(), fi); + result.add(tmpValue); + } else { + result.add(paramDef.getDefaultParameterValue()); + } + } + } + } + return result; + } + + private Job getJobByRefId(String jobRefId) { + Job result = null; + if (jobRefId != null) { + try { + jobRefId = URLDecoder.decode(jobRefId, "UTF-8"); + TopLevelItem item = getTopLevelItem(jobRefId); + if (item != null && item instanceof Job) { + result = (Job) item; + } else if (jobRefId.contains("/") && item == null) { + String newJobRefId = jobRefId.substring(0, jobRefId.indexOf("/")); + item = getTopLevelItem(newJobRefId); + if (item != null) { + Collection allJobs = item.getAllJobs(); + for (Job job : allJobs) { + if (jobRefId.endsWith(job.getName())) { + result = job; + break; + } + } + } + } + } catch (UnsupportedEncodingException uee) { + logger.error("failed to decode job ref ID '" + jobRefId + "'", uee); + } + } + return result; + } + + private TopLevelItem getTopLevelItem(String jobRefId) { + TopLevelItem item; + try { + item = Jenkins.getInstance().getItem(jobRefId); + } catch (AccessDeniedException e) { + String user = ConfigurationService.getModel().getImpersonatedUser(); + if (user != null && !user.isEmpty()) { + throw new PermissionException(403); + } else { + throw new PermissionException(405); + } + } + return item; + } + + @Override + public void runTestDiscovery(DiscoveryInfo discoveryInfo) { + TestExecutionJobCreatorService.runTestDiscovery(discoveryInfo); + } + + @Override + public void runTestSuiteExecution(TestSuiteExecutionInfo suiteExecutionInfo) { + TestExecutionJobCreatorService.runTestSuiteExecution(suiteExecutionInfo); + } + + @Override + public boolean checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { + return ExecutorConnTestService.checkRepositoryConnectivity(testConnectivityInfo); + } + + @Override + public void deleteExecutor(String id) { + TestExecutionJobCreatorService.deleteExecutor(id); + } + + @Override + public CredentialsInfo upsertCredentials(CredentialsInfo credentialsInfo) { + return ExecutorConnTestService.upsertRepositoryCredentials(credentialsInfo); + } + } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/PluginActions.java b/src/main/java/com/hp/application/automation/tools/octane/actions/PluginActions.java index fec8351d63..f6e699d983 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/PluginActions.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/PluginActions.java @@ -31,6 +31,7 @@ import org.kohsuke.stapler.StaplerResponse; import javax.servlet.ServletException; +import java.io.BufferedReader; import java.io.IOException; import java.util.Map; import java.util.UUID; @@ -80,7 +81,7 @@ public void doDynamic(StaplerRequest req, StaplerResponse res) throws IOExceptio octaneTaskAbridged.setId(UUID.randomUUID().toString()); octaneTaskAbridged.setMethod(method); octaneTaskAbridged.setUrl(req.getRequestURIWithQueryString()); - octaneTaskAbridged.setBody(""); + octaneTaskAbridged.setBody(getBody(req.getReader())); TasksProcessor taskProcessor = OctaneSDK.getInstance().getTasksProcessor(); OctaneResultAbridged result = taskProcessor.execute(octaneTaskAbridged); @@ -97,4 +98,15 @@ public void doDynamic(StaplerRequest req, StaplerResponse res) throws IOExceptio res.setStatus(501); } } + + public static String getBody(BufferedReader reader) throws IOException { + + StringBuilder buffer = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) { + buffer.append(line); + } + String body = buffer.toString(); + return body; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java index 598052923b..8b2d244fea 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTParameterFactory.java @@ -17,8 +17,6 @@ package com.hp.application.automation.tools.octane.actions; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.poi.poifs.filesystem.*; -import org.apache.poi.util.StringUtil; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.input.SAXBuilder; @@ -31,7 +29,7 @@ import java.util.*; /** - * This class Converts UFT's Paramters info stored in Resource.mtr file into JSON string + * This class Converts UFT's Parameters info stored in Resource.mtr file into JSON string */ public class UFTParameterFactory { @@ -44,23 +42,7 @@ public static String convertResourceMtrAsJSON(InputStream resourceMtrInputStream //String QTPFileParameterFileName = "resource.mtr"; //InputStream is = paths.get(0).getParent().child("Action0").child(QTPFileParameterFileName).read(); - POIFSFileSystem poiFS = new POIFSFileSystem(resourceMtrInputStream); - DirectoryNode root = poiFS.getRoot(); - String xmlData = ""; - - for (Entry entry : root) { - String name = entry.getName(); - if (name.equals("ComponentInfo")) { - if (entry instanceof DirectoryEntry) { - System.out.println(entry); - } else if (entry instanceof DocumentEntry) { - byte[] content = new byte[((DocumentEntry) entry).getSize()]; - poiFS.createDocumentInputStream("ComponentInfo").read(content); - String fromUnicodeLE = StringUtil.getFromUnicodeLE(content); - xmlData = fromUnicodeLE.substring(fromUnicodeLE.indexOf('<')).replaceAll("\u0000", ""); - } - } - } + String xmlData = UFTTestUtil.decodeXmlContent(resourceMtrInputStream); try { SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, null, null); diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java index 6cb73327ed..d1774ad697 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java @@ -16,47 +16,20 @@ package com.hp.application.automation.tools.octane.actions; -import com.hp.application.automation.tools.octane.actions.dto.AutomatedTest; -import com.hp.application.automation.tools.octane.actions.dto.AutomatedTests; -import com.hp.application.automation.tools.octane.actions.dto.TestFramework; -import com.hp.application.automation.tools.octane.actions.dto.TestingToolType; -import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; -import com.hp.application.automation.tools.octane.configuration.ConfigurationService; -import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; -import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.exception.RequestErrorException; -import com.hp.mqm.client.model.ListItem; -import com.hp.mqm.client.model.PagedList; -import com.hp.mqm.client.model.Test; -import hudson.ExtensionList; -import hudson.FilePath; +import com.hp.application.automation.tools.octane.executor.UFTTestDetectionResult; +import com.hp.application.automation.tools.octane.executor.UFTTestDetectionService; import hudson.model.AbstractBuild; import hudson.model.Action; -import hudson.model.BuildListener; -import hudson.plugins.git.GitChangeSet; -import hudson.scm.ChangeLogSet; -import hudson.scm.EditType; -import jenkins.model.Jenkins; -import net.sf.json.JSONObject; -import org.apache.commons.lang.StringUtils; +import hudson.model.Run; -import java.io.File; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.*; - - +/** + * Class responsible to show report of {@link UFTTestDetectionService} + */ public class UFTTestDetectionBuildAction implements Action { - private final static int RESPONSE_STATUS_CONFLICT=409; private AbstractBuild build; - private String workspaceId; - private BuildListener buildListener; - private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(UFTTestDetectionBuildAction.class.getName()); - private final String INITIAL_DETECTION_FILE = "INITIAL_DETECTION_FILE.txt"; - private final String STFileExtention = ".st";//api test - private final String QTPFileExtention = ".tsp";//gui test + private UFTTestDetectionResult results; @Override public String getIconFileName() { @@ -73,271 +46,48 @@ public String getUrlName() { return "uft_report"; } - - public UFTTestDetectionBuildAction(final AbstractBuild build, String workspaceId, BuildListener buildListener) { - this.build = build; - this.workspaceId = workspaceId; - this.buildListener = buildListener; - } - - public void startScanning() { - ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - MqmRestClient client = createClient(serverConfiguration); - String serverURL = getServerURL(workspaceId, serverConfiguration.sharedSpace, serverConfiguration.location); - - ChangeLogSet changeSet = build.getChangeSet(); - Object[] changeSetItems = changeSet.getItems(); - - - try { - if (!isInitialDetectionDone()) { - printToConsole("Executing initial detection"); - Collection foundTests = doInitialDetection(client, serverURL); - printToConsole(String.format("Found %s tests", foundTests.size())); - } else { - printToConsole("Executing ChangeSetDetection"); - doChangeSetDetection(client, serverURL, changeSetItems); - } - } catch (InterruptedException | IOException e) { - e.printStackTrace(); - } - } - - private void printToConsole(String msg) { - buildListener.getLogger().println("UFTTestDetectionBuildAction : " + msg); - logger.info(msg); - } - - private void doChangeSetDetection(MqmRestClient client, String serverURL, Object[] changeSetItems) throws IOException, InterruptedException { - if (changeSetItems.length == 0) { - return; - } - - boolean isGitChanges = changeSetItems[0] instanceof GitChangeSet; - if (!isGitChanges) { - printToConsole(String.format("Expected GitChangeSet but found %s, detection is canceled.", changeSetItems[0].getClass().getName())); - return; - } - - List addedTests = new ArrayList<>(); - List removedTests = new ArrayList<>(); - - for (int i = 0; i < changeSetItems.length; i++) { - GitChangeSet changeSet = (GitChangeSet) changeSetItems[i]; - for (GitChangeSet.Path path : changeSet.getPaths()) { - if (EditType.ADD.equals(path.getEditType())) { - if (isTestMainFilePath(path.getPath())) { - String filePath = build.getWorkspace() + File.separator + path.getPath(); - if (isFileExist(filePath)) { - FilePath testFolder = getTestFolderForTestMainFile(filePath); - scanFileSystemRecursively(build.getWorkspace(), testFolder, addedTests); - } - - } - } else if (EditType.DELETE.equals(path.getEditType())) { - if (isTestMainFilePath(path.getPath())) { - String filePath = build.getWorkspace() + File.separator + path.getPath(); - if (!isFileExist(filePath)) { - FilePath testFolder = getTestFolderForTestMainFile(filePath); - AutomatedTest test = createAutomatedTest(build.getWorkspace(), testFolder); - removedTests.add(test); - } - } - - } - } - } - - postTests(client, serverURL, addedTests); - deleteTests(client, removedTests); - - } - - private AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath) throws IOException, InterruptedException { - AutomatedTest test = new AutomatedTest(); - test.setName(dirPath.getName()); - - //set component - relative path from root - String testPath = dirPath.toURI().toString(); - String rootPath = root.toURI().toString(); - String path = testPath.replace(rootPath, ""); - path = StringUtils.strip(path, "\\/"); - String component = path.length() != dirPath.getName().length() ? path.substring(0, path.length() - dirPath.getName().length() - 1) : ""; - test.setComponent(component); - return test; - } - - - private boolean isFileExist(String path) { - File file = new File(path); - return file.exists(); - } - - private boolean isInitialDetectionDone() { - try { - File rootFile = new File(build.getWorkspace().toURI()); - File file = new File(rootFile, INITIAL_DETECTION_FILE); - return file.exists(); - - } catch (Exception e) { - return false; - } - } - - private Collection doInitialDetection(MqmRestClient client, String serverURL) throws IOException, InterruptedException { - List tests = new ArrayList<>(); - - scanFileSystemRecursively(build.getWorkspace(), build.getWorkspace(), tests); - - postTests(client, serverURL, tests); - - - File rootFile = new File(build.getWorkspace().toURI()); - File file = new File(rootFile, INITIAL_DETECTION_FILE); - file.createNewFile(); - - - return tests; - } - - private void scanFileSystemRecursively(FilePath root, FilePath dirPath, List tests) throws IOException, InterruptedException { - List paths = dirPath.list(); - - - //if it test folder - create new test, else drill down to subFolders - if (isUftTestFolder(paths)) { - AutomatedTest test = createAutomatedTest(root, dirPath); - - tests.add(test); - - } else { - for (FilePath path : paths) { - if (path.isDirectory()) { - scanFileSystemRecursively(root, path, tests); - } - } - } - } - - private MqmRestClient createClient(ServerConfiguration configuration) { - JenkinsMqmRestClientFactory clientFactory = getExtension(JenkinsMqmRestClientFactory.class); - MqmRestClient client = clientFactory.obtain( - configuration.location, - configuration.sharedSpace, - configuration.username, - configuration.password); - return client; - } - - private void postTests(MqmRestClient client, String serverURL, List tests) throws UnsupportedEncodingException { - if (tests.isEmpty()) { - return; - } - - completeUftProperties(client, Long.parseLong(workspaceId), tests); - - int BULK_SIZE = 100; - for (int i = 0; i < tests.size(); i += BULK_SIZE) - try { - AutomatedTests data = AutomatedTests.createWithTests(tests.subList(i, Math.min(i + BULK_SIZE, tests.size()))); - String uftTestJson = JSONObject.fromObject(data).toString(); - client.postTest(uftTestJson, null, serverURL); - //JSONObject testObject = (JSONObject) jsonObject.getJSONArray("data").get(0); - - } catch (RequestErrorException e) { - //TODO: replace with constant from common lib - if (e.getStatusCode() != RESPONSE_STATUS_CONFLICT);{ // "Conflict" parallel to : Response.Status.CONFLICT.getStatusCode()) { - throw e; - } - //else : the test with the same hash code , so do nothing - } - } - - private void deleteTests(MqmRestClient client, List removedTests) throws UnsupportedEncodingException { - List idsToDelete = new ArrayList<>(); - long workspaceIdAsLong = Long.parseLong(workspaceId); - for (AutomatedTest test : removedTests) { - Map queryFields = new HashMap<>(); - queryFields.put("name", test.getName()); - queryFields.put("component", test.getComponent()); - PagedList foundTests = client.getTests(workspaceIdAsLong, queryFields, Arrays.asList("id")); - if (foundTests.getItems().size() == 1) { - idsToDelete.add(foundTests.getItems().get(0).getId()); - } - } - - int BULK_SIZE = 100; - for (int i = 0; i < idsToDelete.size(); i += BULK_SIZE) { - client.deleteTests(workspaceIdAsLong, idsToDelete.subList(i, Math.min(i + BULK_SIZE, idsToDelete.size()))); - } - } - - - private void completeUftProperties(MqmRestClient client, long workspaceId, Collection tests) { - TestingToolType uftTestingTool = getUftTestingTool(client, workspaceId); - TestFramework uftFramework = getUftFramework(client, workspaceId); - for (AutomatedTest test : tests) { - test.setTesting_tool_type(uftTestingTool); - test.setFramework(uftFramework); - } - } - - public boolean isUftTestFolder(List paths) { - for (FilePath path : paths) { - if (path.getName().endsWith(STFileExtention) || path.getName().endsWith(QTPFileExtention)) - return true; - } - - return false; + @SuppressWarnings("squid:S1452") + public final Run getBuild() { + return build; } - public boolean isTestMainFilePath(String path) { - String lowerPath = path.toLowerCase(); - boolean isMainFile = lowerPath.endsWith(STFileExtention) || lowerPath.endsWith(QTPFileExtention); - return isMainFile; + public UFTTestDetectionBuildAction(final AbstractBuild build, UFTTestDetectionResult results) { + this.build = build; + this.results = results == null ? new UFTTestDetectionResult() : results; } - public FilePath getTestFolderForTestMainFile(String path) { - if (isTestMainFilePath(path)) { - File file = new File(path); - File parent = file.getParentFile(); - return new FilePath(parent); - } - return null; + public UFTTestDetectionResult getResults() { + return results; } - - private TestingToolType getUftTestingTool(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.testing_tool_type", null, workspaceId, 0, 100); - String uftTestingToolLogicalName = "list_node.testing_tool_type.uft"; - - for (ListItem item : testingTools.getItems()) { - if (uftTestingToolLogicalName.equals(item.getLogicalName())) { - return TestingToolType.fromListItem(item); - } - } - return null; + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTTestDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasNewTests() { + return results.getNewTests().size() > 0; } - private TestFramework getUftFramework(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.je.framework", null, workspaceId, 0, 100); - String uftTestingToolLogicalName = "list_node.je.framework.uft"; - - for (ListItem item : testingTools.getItems()) { - if (uftTestingToolLogicalName.equals(item.getLogicalName())) { - return TestFramework.fromListItem(item); - } - } - return null; + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTTestDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasDeletedTests() { + return results.getDeletedTests().size() > 0; } - private String getServerURL(String workspaceId, String sharedspaceId, String location) { - return location + "/api/shared_spaces/" + sharedspaceId + "/workspaces/" + workspaceId; + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTTestDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasUpdatedTests() { + return results.getUpdatedTests().size() > 0; } - private static T getExtension(Class clazz) { - ExtensionList items = Jenkins.getInstance().getExtensionList(clazz); - return items.get(0); + public void setResults(UFTTestDetectionResult results) { + this.results = results; } - } \ No newline at end of file diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java index 3243f88f14..9f56676508 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java @@ -16,6 +16,8 @@ package com.hp.application.automation.tools.octane.actions; +import com.hp.application.automation.tools.octane.executor.UFTTestDetectionResult; +import com.hp.application.automation.tools.octane.executor.UFTTestDetectionService; import com.hp.mqm.client.MqmRestClient; import com.hp.mqm.client.model.PagedList; import com.hp.mqm.client.model.Workspace; @@ -28,6 +30,7 @@ import hudson.model.AbstractBuild; import hudson.model.AbstractProject; import hudson.model.BuildListener; +import hudson.model.FreeStyleProject; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.BuildStepMonitor; import hudson.tasks.Publisher; @@ -47,22 +50,29 @@ public class UFTTestDetectionPublisher extends Recorder { private final String workspaceName; + private final String scmResourceId; public String getWorkspaceName() { return workspaceName; } + public String getScmResourceId() { + return scmResourceId; + } + // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" @DataBoundConstructor - public UFTTestDetectionPublisher(String workspaceName) { + public UFTTestDetectionPublisher(String workspaceName, String scmResourceId) { + this.workspaceName = workspaceName; + this.scmResourceId = scmResourceId; } @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { - UFTTestDetectionBuildAction buildAction = new UFTTestDetectionBuildAction(build, getWorkspaceName(), listener); - buildAction.startScanning(); - //build.addAction(buildAction); + UFTTestDetectionResult results = UFTTestDetectionService.startScanning(build, getWorkspaceName(), getScmResourceId(), listener); + UFTTestDetectionBuildAction buildAction = new UFTTestDetectionBuildAction(build, results); + build.addAction(buildAction); return true; } @@ -100,11 +110,6 @@ public DescriptorImpl() { load(); } - /** - * This method determines the values of the album drop-down list box. - * - * @return ListBoxModel result - */ public ListBoxModel doFillWorkspaceNameItems() { ListBoxModel m = new ListBoxModel(); PagedList workspacePagedList = createClient().queryWorkspaces("", 0, 200); @@ -125,7 +130,8 @@ public FormValidation doCheckWorkspaceName(@QueryParameter String value) throws public boolean isApplicable(Class aClass) { // Indicates that this builder can be used with all kinds of project types - return true; + + return aClass.equals(FreeStyleProject.class); } public String getDisplayName() { @@ -146,5 +152,6 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc public String getWorkspace() { return workspace; } + } } \ No newline at end of file diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java new file mode 100644 index 0000000000..dc5f585c61 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java @@ -0,0 +1,82 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.actions; + +import hudson.FilePath; +import org.apache.poi.poifs.filesystem.*; +import org.apache.poi.util.StringUtil; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.input.SAXBuilder; +import org.jdom2.input.sax.XMLReaders; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; + +/** + * Utility for extracting information from UFT test located on FS + */ +public class UFTTestUtil { + + /** + * Extract test description from UFT GUI test. + * Note : UFT API test doesn't contain description + * @param dirPath path of UFT test + * @return test description + */ + public static String getTestDescription(FilePath dirPath) { + String desc = null; + try { + FilePath tspTestFile = new FilePath(dirPath, "Test.tsp"); + InputStream is = new FileInputStream(tspTestFile.getRemote()); + String xmlContent = decodeXmlContent(is); + + SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, null, null); + Document document = saxBuilder.build(new StringReader(xmlContent)); + Element rootElement = document.getRootElement(); + Element descElement = rootElement.getChild("Description"); + desc = descElement.getValue(); + } catch (Exception e) { + return null; + } + + return desc; + } + + public static String decodeXmlContent(InputStream stream) throws IOException { + POIFSFileSystem poiFS = new POIFSFileSystem(stream); + DirectoryNode root = poiFS.getRoot(); + String xmlData = ""; + + for (Entry entry : root) { + String name = entry.getName(); + if ("ComponentInfo".equals(name)) { + if (entry instanceof DirectoryEntry) { + System.out.println(entry); + } else if (entry instanceof DocumentEntry) { + byte[] content = new byte[((DocumentEntry) entry).getSize()]; + poiFS.createDocumentInputStream("ComponentInfo").read(content); + String fromUnicodeLE = StringUtil.getFromUnicodeLE(content); + xmlData = fromUnicodeLE.substring(fromUnicodeLE.indexOf('<')).replaceAll("\u0000", ""); + } + } + } + return xmlData; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UftTestType.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UftTestType.java new file mode 100644 index 0000000000..1c0f6ca2f8 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UftTestType.java @@ -0,0 +1,33 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.actions; + +/** + * Created by berkovir on 20/04/2017. + */ +public enum UftTestType { + GUI("gui"), API("api"), None("none"); + private String testType; + + UftTestType(String testType) { + this.testType = testType; + } + + public boolean isNone() { + return this.testType.equals(None.testType); + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java index b0a329bb7a..d8f9250ab8 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java @@ -16,16 +16,43 @@ package com.hp.application.automation.tools.octane.actions.dto; +import com.hp.application.automation.tools.octane.actions.UftTestType; + +import javax.xml.bind.annotation.*; + /** * Created by kashbi on 25/09/2016. */ +@XmlRootElement(name="test") +@XmlAccessorType(XmlAccessType.FIELD) public class AutomatedTest { + + @XmlTransient + private Long id; + @XmlTransient private String type = "test"; + @XmlTransient private String subtype = "test_automated"; - private TestingToolType testing_tool_type; - private TestFramework framework; + @XmlTransient + private ListNodeEntity testingToolType; + @XmlTransient + private ListNodeEntity framework; + @XmlTransient + private ListNodeEntityCollection testTypes; + + //don't serialized to server, used to set testType property + @XmlAttribute + private UftTestType uftTestType; + + @XmlAttribute private String name; - private String component; + @XmlAttribute + private String packageName; + + private String description; + + @XmlTransient + private BaseRefEntity scmRepository; public String getName() { return name; @@ -51,28 +78,67 @@ public void setSubtype(String subtype) { this.subtype = subtype; } - - public TestFramework getFramework() { + public ListNodeEntity getFramework() { return framework; } - public void setFramework(TestFramework framework) { + public void setFramework(ListNodeEntity framework) { this.framework = framework; } - public String getComponent() { - return component; + public String getPackage() { + return packageName; + } + + public void setPackage(String packageName) { + this.packageName = packageName; + } + + public ListNodeEntity getTestingToolType() { + return testingToolType; + } + + public void setTestingToolType(ListNodeEntity testingToolType) { + this.testingToolType = testingToolType; + } + + public BaseRefEntity getScmRepository() { + return scmRepository; + } + + public void setScmRepository(BaseRefEntity scmRepository) { + this.scmRepository = scmRepository; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setUftTestType(UftTestType uftTestType) { + this.uftTestType = uftTestType; + } + + public UftTestType getUftTestType() { + return uftTestType; + } + + public ListNodeEntityCollection getTestTypes() { + return testTypes; } - public void setComponent(String component) { - this.component = component; + public void setTestTypes(ListNodeEntityCollection testTypes) { + this.testTypes = testTypes; } - public TestingToolType getTesting_tool_type() { - return testing_tool_type; + public Long getId() { + return id; } - public void setTesting_tool_type(TestingToolType testing_tool_type) { - this.testing_tool_type = testing_tool_type; + public void setId(Long id) { + this.id = id; } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestFramework.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/BaseRefEntity.java similarity index 64% rename from src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestFramework.java rename to src/main/java/com/hp/application/automation/tools/octane/actions/dto/BaseRefEntity.java index d76d6a6b34..acaaa20ca6 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestFramework.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/BaseRefEntity.java @@ -1,4 +1,3 @@ -/* /* * Copyright 2017 Hewlett-Packard Development Company, L.P. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,24 +16,20 @@ package com.hp.application.automation.tools.octane.actions.dto; -import com.hp.mqm.client.model.ListItem; - /** - * Created by kashbi on 25/09/2016. + * Base class for (de)serialization of reference entities in Octane */ @SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"}) -public class TestFramework { - private String type = "list_node"; - private String logical_name; - private String name; +public class BaseRefEntity { + + private String type; private Long id; - public static TestFramework fromListItem(ListItem item) { - TestFramework type = new TestFramework(); - type.logical_name = item.getLogicalName(); - type.id = item.getId(); - type.name = item.getName(); - return type; + public static BaseRefEntity create(String type, Long id) { + BaseRefEntity baseRefEntity = new BaseRefEntity(); + baseRefEntity.setType(type); + baseRefEntity.setId(id); + return baseRefEntity; } public String getType() { @@ -45,15 +40,12 @@ public void setType(String type) { this.type = type; } - public String getLogical_name() { - return logical_name; + public Long getId() { + return id; } - public String getName() { - return name; - } - public Long getId() { - return id; + public void setId(Long id) { + this.id = id; } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ListNodeEntity.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ListNodeEntity.java new file mode 100644 index 0000000000..8452718e6c --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ListNodeEntity.java @@ -0,0 +1,35 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.actions.dto; + +/** + * Class for (de)serialization of list_node entities in Octane + */ +@SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"}) +public class ListNodeEntity extends BaseRefEntity { + + public ListNodeEntity(){ + setType("list_node"); + } + + public static ListNodeEntity create(Long id) { + ListNodeEntity entity = new ListNodeEntity(); + entity.setId(id); + return entity; + } + +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestingToolType.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java similarity index 50% rename from src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestingToolType.java rename to src/main/java/com/hp/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java index 315e01ff94..180cee510a 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/TestingToolType.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java @@ -16,41 +16,28 @@ package com.hp.application.automation.tools.octane.actions.dto; -import com.hp.mqm.client.model.ListItem; +import java.util.Arrays; +import java.util.List; /** - * Created by kashbi on 25/09/2016. + * Class for (de)serialization of collection of list_node entities in Octane */ -@SuppressWarnings("squid:S109") -public class TestingToolType { - private String type = "list_node"; - private String logical_name; - private String name; - private Long id; +@SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"}) +public class ListNodeEntityCollection { - public static TestingToolType fromListItem(ListItem item) { - TestingToolType type = new TestingToolType(); - type.logical_name = item.getLogicalName(); - type.id = item.getId(); - type.name = item.getName(); - return type; - } + private List data; - public String getType() { - return type; + public static ListNodeEntityCollection create(ListNodeEntity item) { + ListNodeEntityCollection coll = new ListNodeEntityCollection(); + coll.setData(Arrays.asList(item)); + return coll; } - - public String getName() { - return name; - } - - - public Long getId() { - return id; + public List getData() { + return data; } - public String getLogical_name() { - return logical_name; + public void setData(List data) { + this.data = data; } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationParser.java b/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationParser.java index d22185af8a..5f4a0690b7 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationParser.java +++ b/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationParser.java @@ -39,8 +39,6 @@ @Extension public class ConfigurationParser { - public ConfigurationParser(){} - private final static Logger logger = LogManager.getLogger(ConfigurationParser.class); private static final String PARAM_SHARED_SPACE = "p"; // NON-NLS diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java new file mode 100644 index 0000000000..e200e2944d --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java @@ -0,0 +1,118 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.CredentialsScope; +import com.cloudbees.plugins.credentials.CredentialsStore; +import com.cloudbees.plugins.credentials.SystemCredentialsProvider; +import com.cloudbees.plugins.credentials.domains.Domain; +import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; +import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; +import com.hp.octane.integrations.dto.executor.CredentialsInfo; +import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; +import com.hp.octane.integrations.dto.scm.SCMType; +import hudson.EnvVars; +import hudson.model.Item; +import hudson.model.TaskListener; +import hudson.plugins.git.GitException; +import hudson.plugins.git.GitTool; +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jenkinsci.plugins.gitclient.Git; +import org.jenkinsci.plugins.gitclient.GitClient; + +import java.io.IOException; +import java.util.List; + +/** + * Utility for handling of scm repositories + */ +public class ExecutorConnTestService { + + private static final Logger logger = LogManager.getLogger(ExecutorConnTestService.class); + + /** + * Validate that scm repository is valid + * @param testConnectivityInfo + * @return + */ + public static boolean checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { + if (testConnectivityInfo.getScmRepository() != null && + StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl()) && + SCMType.GIT.equals(testConnectivityInfo.getScmRepository().getType())) { + + BaseStandardCredentials c = null; + if (StringUtils.isNotEmpty(testConnectivityInfo.getUsername()) && testConnectivityInfo.getPassword() != null) { + c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, null, null, testConnectivityInfo.getUsername(), testConnectivityInfo.getPassword()); + } + + try { + EnvVars environment = new EnvVars(System.getenv()); + GitClient git = Git.with(TaskListener.NULL, environment).using(GitTool.getDefaultInstallation().getGitExe()).getClient(); + git.addDefaultCredentials(c); + git.getHeadRev(testConnectivityInfo.getScmRepository().getUrl(), "HEAD"); + + return true; + } catch (IOException | InterruptedException e) { + logger.error("Failed to connect to git : " + e.getMessage()); + } catch (GitException e) { + logger.error("Failed to execute getHeadRev : " + e.getMessage()); + } + } + return false; + } + + /** + * Insert of update(if already exist) of credentials in Jenkins. + * If credentialsInfo containscredentialsId - we update existing credentials with new user/password, otherwise - create new credentials + * @param credentialsInfo + * @return created/updated credentials with filled credentials id + */ + public static CredentialsInfo upsertRepositoryCredentials(final CredentialsInfo credentialsInfo) { + + if (StringUtils.isEmpty(credentialsInfo.getCredentialId())) { + if (StringUtils.isNotEmpty(credentialsInfo.getUsername()) && credentialsInfo.getPassword() != null) { + BaseStandardCredentials c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, null, null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); + CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); + try { + store.addCredentials(Domain.global(), c); + credentialsInfo.setCredentialId(c.getId()); + } catch (IOException e) { + logger.error("Failed to add credentials " + e.getMessage()); + } + } + } else { + List list = CredentialsProvider.lookupCredentials(BaseStandardCredentials.class, (Item) null, null); + for (BaseStandardCredentials cred : list) { + if (cred.getId().equals(credentialsInfo.getCredentialId())) { + BaseStandardCredentials newCred = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialId(), + null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); + CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); + try { + store.updateCredentials(Domain.global(), cred, newCred); + } catch (IOException e) { + logger.error("Failed to add credentials " + e.getMessage()); + } + } + } + } + + return credentialsInfo; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java new file mode 100644 index 0000000000..f069244893 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -0,0 +1,418 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import antlr.ANTLRException; +import com.hp.application.automation.tools.model.ResultsPublisherModel; +import com.hp.application.automation.tools.octane.actions.UFTTestDetectionPublisher; +import com.hp.application.automation.tools.results.RunResultRecorder; +import com.hp.application.automation.tools.run.RunFromFileBuilder; +import com.hp.octane.integrations.dto.executor.DiscoveryInfo; +import com.hp.octane.integrations.dto.executor.TestExecutionInfo; +import com.hp.octane.integrations.dto.executor.TestSuiteExecutionInfo; +import com.hp.octane.integrations.dto.executor.impl.TestingToolType; +import com.hp.octane.integrations.dto.scm.SCMRepository; +import com.hp.octane.integrations.dto.scm.SCMType; +import hudson.model.*; +import hudson.plugins.git.BranchSpec; +import hudson.plugins.git.GitSCM; +import hudson.plugins.git.SubmoduleConfig; +import hudson.plugins.git.UserRemoteConfig; +import hudson.tasks.LogRotator; +import hudson.triggers.SCMTrigger; +import jenkins.model.BuildDiscarder; +import jenkins.model.Jenkins; +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.util.*; + +/** + * This service is responsible to create jobs (discovery and execution) for execution process. + */ +public class TestExecutionJobCreatorService { + + + private static final Logger logger = LogManager.getLogger(TestExecutionJobCreatorService.class); + public static final String EXECUTOR_ID_PARAMETER_NAME = "executorId"; + public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; + public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; + + /** + * Create (if needed) and run test execution + * + * @param suiteExecutionInfo + */ + public static void runTestSuiteExecution(TestSuiteExecutionInfo suiteExecutionInfo) { + + /* + { + "tests": [{ + "testName": "GUITest2", + "packageName": "GUITests" + }, { + "testName": "GUITest3", + "packageName": "GUITests" + } + ], + "scmRepository": { + "type": "git", + "url": "git@github.com:radislavB/UftTests.git" + }, + "executorId": "1", + "workspaceId": "1002", + "suiteId": "6", + "testingToolType": "uft" + } + */ + FreeStyleProject proj = getExecutionJob(suiteExecutionInfo); + + //start job + if (proj != null) { + ParameterValue suiteRunIdParam = new StringParameterValue(SUITE_RUN_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteRunId()); + ParameterValue suiteIdParam = new StringParameterValue(SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId()); + ParametersAction parameters = new ParametersAction(suiteRunIdParam, suiteIdParam); + + Cause cause = StringUtils.isNotEmpty(suiteExecutionInfo.getSuiteRunId()) ? TriggeredBySuiteRunCause.create(suiteExecutionInfo.getSuiteRunId()) : new Cause.UserIdCause(); + CauseAction causeAction = new CauseAction(cause); + proj.scheduleBuild2(0, parameters, causeAction); + } + } + + private static FreeStyleProject getExecutionJob(TestSuiteExecutionInfo suiteExecutionInfo) { + + try { + String projectName = String.format("%s test execution job - suiteId %s", + suiteExecutionInfo.getTestingToolType().toString(), + suiteExecutionInfo.getSuiteId()); + + //validate creation of job + FreeStyleProject proj = (FreeStyleProject) Jenkins.getInstance().getItem(projectName); + if (proj == null) { + proj = Jenkins.getInstance().createProject(FreeStyleProject.class, projectName); + proj.setDescription(String.format("This job was created by HP AA Plugin for execution of %s tests, as part of Octane suite with id %s", + suiteExecutionInfo.getTestingToolType().toString(), suiteExecutionInfo.getSuiteId())); + } + + setScmRepository(suiteExecutionInfo.getScmRepository(), suiteExecutionInfo.getScmRepositoryCredentialsId(), proj); + setBuildDiscarder(proj, 20); + addParameter(proj, SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId(), true, "Octane suite id"); + addParameter(proj, SUITE_RUN_ID_PARAMETER_NAME, null, false, "This parameter is relevant only if the suite is run from Octane and allows to publish tests to the existing Octane suite run"); + addAssignedNode(proj); + + //add build action + String fsTestsData = prepareMtbxData(suiteExecutionInfo.getTests()); + List builders = proj.getBuildersList().getAll(RunFromFileBuilder.class); + if (builders != null && !builders.isEmpty()) { + builders.get(0).setFsTests(fsTestsData); + } else { + proj.getBuildersList().add(new RunFromFileBuilder(fsTestsData)); + } + + //add post-build action - publisher + RunResultRecorder runResultRecorder = null; + List publishers = proj.getPublishersList();//.add(new RunResultRecorder(ResultsPublisherModel.alwaysArchiveResults.getValue())); + for (Object publisher : publishers) { + if (publisher instanceof RunResultRecorder) { + runResultRecorder = (RunResultRecorder) publisher; + } + } + if (runResultRecorder == null) { + runResultRecorder = new RunResultRecorder(ResultsPublisherModel.alwaysArchiveResults.getValue()); + publishers.add(runResultRecorder); + } + return proj; + } catch (IOException e) { + logger.error("Failed to create ExecutionJob : " + e.getMessage()); + return null; + } + } + + private static void setScmRepository(SCMRepository scmRepository, String scmRepositoryCredentialsId, FreeStyleProject proj) { + if (SCMType.GIT.equals(scmRepository.getType())) { + try { + + List repoLists = Arrays.asList(new UserRemoteConfig(scmRepository.getUrl(), null, null, scmRepositoryCredentialsId)); + GitSCM scm = new GitSCM(repoLists, Collections.singletonList(new BranchSpec("")), Boolean.valueOf(false), Collections.emptyList(), null, null, null); + + //GitSCM scm = new GitSCM(scmRepository.getUrl()); + proj.setScm(scm); + } catch (IOException e) { + throw new IllegalArgumentException("Failed to set Git repository : " + e.getMessage()); + } + } else { + throw new IllegalArgumentException("SCM repository " + scmRepository.getType() + " isn't supported yet"); + } + } + + private static String prepareMtbxData(List tests) throws IOException { + /* + + + …. + + + + + …. + + */ + + try { + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); + Document doc = docBuilder.newDocument(); + Element rootElement = doc.createElement("mtbx"); + doc.appendChild(rootElement); + + for (TestExecutionInfo test : tests) { + Element testElement = doc.createElement("test"); + testElement.setAttribute("name", test.getTestName()); + + String path = "${WORKSPACE}" + File.separator + test.getPackageName() + (StringUtils.isEmpty(test.getPackageName()) ? "" : File.separator) + test.getTestName(); + testElement.setAttribute("path", path); + rootElement.appendChild(testElement); + } + + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + + StringWriter writer = new StringWriter(); + transformer.transform(new DOMSource(doc), new StreamResult(writer)); + + String str = writer.toString(); + return str; + } catch (Exception e) { + throw new IOException("Failed to build MTBX content : " + e.getMessage()); + } + + } + + /** + * Create (if needed) and run test discovery + * + * @param discoveryInfo + */ + public static void runTestDiscovery(DiscoveryInfo discoveryInfo) { + + /* + { + "scmRepository": { + "type": "git", + "url": "git@github.com:radislavB/UftTests.git" + }, + "executorId": "1", + "workspaceId": "1002", + "testingToolType": "uft", + "forceFullDiscovery": true + } + */ + FreeStyleProject proj = getDiscoveryJob(discoveryInfo); + + if (proj != null) { + if (discoveryInfo.isForceFullDiscovery() && proj.getWorkspace() != null) { + UFTTestDetectionService.removeInitialDetectionFlag(proj.getWorkspace()); + } + + proj.scheduleBuild2(0); + } + } + + private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { + + try { + String discoveryJobName = buildDiscoveryJobName(discoveryInfo.getTestingToolType(), discoveryInfo.getExecutorId()); + //validate creation of job + FreeStyleProject proj = (FreeStyleProject) Jenkins.getInstance().getItem(discoveryJobName); + if (proj == null) { + + proj = Jenkins.getInstance().createProject(FreeStyleProject.class, discoveryJobName); + proj.setDescription(String.format("This job was created by HP AA Plugin for discovery of %s tests, as part of Octane executor with id %s", + discoveryInfo.getTestingToolType().toString(), discoveryInfo.getExecutorId())); + } + + setScmRepository(discoveryInfo.getScmRepository(), discoveryInfo.getScmRepositoryCredentialsId(), proj); + setBuildDiscarder(proj, 20); + addParameter(proj, EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId(), true, "Octane executor id"); + + //set polling once in two minutes + SCMTrigger scmTrigger = new SCMTrigger("H/2 * * * *");//H/2 * * * * : once in two minutes + proj.addTrigger(scmTrigger); + delayPollingStart(proj, scmTrigger); + + + //add post-build action - publisher + UFTTestDetectionPublisher uftTestDetectionPublisher = null; + List publishers = proj.getPublishersList(); + for (Object publisher : publishers) { + if (publisher instanceof UFTTestDetectionPublisher) { + uftTestDetectionPublisher = (UFTTestDetectionPublisher) publisher; + } + } + + + if (uftTestDetectionPublisher == null) { + uftTestDetectionPublisher = new UFTTestDetectionPublisher(discoveryInfo.getWorkspaceId(), discoveryInfo.getScmRepositoryId()); + publishers.add(uftTestDetectionPublisher); + } + + return proj; + } catch (IOException | ANTLRException e) { + logger.error("Failed to create DiscoveryJob : " + e.getMessage()); + return null; + } + } + + private static String buildDiscoveryJobName(TestingToolType testingToolType, String executorId) { + String name = String.format("%s test discovery job - executorId %s", testingToolType.toString(), executorId); + return name; + } + + private static void setBuildDiscarder(FreeStyleProject proj, int numBuildsToKeep) throws IOException { + int IRRELEVANT = -1; + BuildDiscarder bd = new LogRotator(IRRELEVANT, numBuildsToKeep, IRRELEVANT, IRRELEVANT); + proj.setBuildDiscarder(bd); + } + + /** + * Delay starting of polling by 5 minutes to allow original clone + * + * @param proj + * @param scmTrigger + */ + private static void delayPollingStart(final FreeStyleProject proj, final SCMTrigger scmTrigger) { + long delayStartPolling = 1000 * 60 * 5;//5 minute + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + scmTrigger.start(proj, false); + } + }, delayStartPolling); + } + + private static void addParameter(FreeStyleProject proj, String parameterName, String parameterValue, boolean constantValue, String desc) throws IOException { + ParametersDefinitionProperty parameters = proj.getProperty(ParametersDefinitionProperty.class); + if (parameters == null) { + parameters = new ParametersDefinitionProperty(new ArrayList()); + proj.addProperty(parameters); + } + + if (constantValue) { + if (parameters.getParameterDefinition(parameterName) == null) { + //String name, List choices, String defaultValue, String description + ParameterDefinition param = new ChoiceParameterDefinition(parameterName, new String[]{parameterValue}, desc); + parameters.getParameterDefinitions().add(param); + } + } else { + if (parameters.getParameterDefinition(parameterName) == null) { + //String name, List choices, String defaultValue, String description + ParameterDefinition param = new StringParameterDefinition(parameterName, null, desc); + parameters.getParameterDefinitions().add(param); + } + } + + } + + /** + * Delete discovery job that related to specific executor in Octane + * + * @param id + */ + public static void deleteExecutor(String id) { + String jobName = buildDiscoveryJobName(TestingToolType.UFT, id); + FreeStyleProject proj = (FreeStyleProject) Jenkins.getInstance().getItem(jobName); + if (proj != null) { + boolean waitBeforeDelete = false; + + if (proj.isBuilding()) { + proj.getLastBuild().getExecutor().interrupt(); + waitBeforeDelete = true; + } else if (proj.isInQueue()) { + Jenkins.getInstance().getQueue().cancel(proj); + waitBeforeDelete = true; + } + + if (waitBeforeDelete) { + try { + //we cancelled building/queue - wait before deleting the job, so Jenkins will be able to complete some IO actions + Thread.sleep(10000); + } catch (InterruptedException e) { + //do nothing + } + } + + try { + proj.delete(); + } catch (IOException | InterruptedException e) { + logger.error("Failed to delete job " + proj.getName() + " : " + e.getMessage()); + } + } + } + + private static void addAssignedNode(FreeStyleProject proj) { + Computer[] computers = Jenkins.getInstance().getComputers(); + Set labels = new HashSet(); + + //add existing + String assigned = proj.getAssignedLabelString(); + if (assigned != null) { + String[] assignedArr = StringUtils.split(assigned, "||"); + for (String item : assignedArr) { + labels.add(item.trim()); + } + } + + //try to add new + try { + for (Computer computer : computers) { + if (computer instanceof Jenkins.MasterComputer) { + continue; + } + + String label = "" + computer.getNode().getSelfLabel(); + if (label.toLowerCase().contains("uft")) { + labels.add(label.trim()); + } + } + + if (!labels.isEmpty()) { + Label joinedLabel = Label.parseExpression(StringUtils.join(labels, "||")); + proj.setAssignedLabel(joinedLabel); + } + + } catch (IOException | ANTLRException e) { + logger.error("Failed to set addAssignedNode : " + e.getMessage()); + } + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java b/src/main/java/com/hp/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java new file mode 100644 index 0000000000..524a64bf1d --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java @@ -0,0 +1,41 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import hudson.model.Cause; + +/** + * Representing job trigger by Octane suite run + */ +public class TriggeredBySuiteRunCause extends Cause { + + String suiteRunId; + + + public TriggeredBySuiteRunCause(String suiteRunId) { + this.suiteRunId = suiteRunId; + } + + public static TriggeredBySuiteRunCause create(String suiteRunId){ + return new TriggeredBySuiteRunCause(suiteRunId); + } + + @Override + public String getShortDescription() { + return "Triggered by octane suite run " + suiteRunId; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java new file mode 100644 index 0000000000..ffcff781f4 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java @@ -0,0 +1,87 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import com.hp.application.automation.tools.octane.actions.dto.AutomatedTest; + +import javax.xml.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; + + +@XmlRootElement(name="detectionResult") +@XmlAccessorType(XmlAccessType.FIELD) +public class UFTTestDetectionResult { + + + @XmlElementWrapper(name="newTests") + @XmlElement(name="test") + private List newTests = new ArrayList<>(); + + private List deletedTests = new ArrayList<>(); + + private List updatedTests = new ArrayList<>(); + + @XmlAttribute + private String scmResourceId; + + @XmlAttribute + private String workspaceId; + + @XmlAttribute + private boolean initialDetection; + + public List getNewTests() { + return newTests; + } + + public List getDeletedTests() { + return deletedTests; + } + + public List getUpdatedTests() { + return updatedTests; + } + + public String getScmResourceId() { + return scmResourceId; + } + + public void setScmResourceId(String scmResourceId) { + this.scmResourceId = scmResourceId; + } + + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public boolean isInitialDetection() { + return initialDetection; + } + + public void setInitialDetection(boolean initialDetection) { + this.initialDetection = initialDetection; + } + + public boolean hasChanges(){ + return !getNewTests().isEmpty() || !getUpdatedTests().isEmpty(); + } +} \ No newline at end of file diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java new file mode 100644 index 0000000000..f36bc23d30 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -0,0 +1,316 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import com.hp.application.automation.tools.octane.actions.UFTTestUtil; +import com.hp.application.automation.tools.octane.actions.UftTestType; +import com.hp.application.automation.tools.octane.actions.dto.AutomatedTest; +import hudson.ExtensionList; +import hudson.FilePath; +import hudson.model.AbstractBuild; +import hudson.model.BuildListener; +import hudson.model.Run; +import hudson.model.TaskListener; +import hudson.plugins.git.GitChangeSet; +import hudson.scm.ChangeLogSet; +import hudson.scm.EditType; +import jenkins.model.Jenkins; +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.*; + +public class UFTTestDetectionService { + private static final Logger logger = LogManager.getLogger(UFTTestDetectionService.class); + private static final String INITIAL_DETECTION_FILE = "INITIAL_DETECTION_FILE.txt"; + private static final String DETECTION_RESULT_FILE = "detection_result.xml"; + private static final String STFileExtention = ".st";//api test + private static final String QTPFileExtention = ".tsp";//gui test + + public static UFTTestDetectionResult startScanning(AbstractBuild build, String workspaceId, String scmResourceId, BuildListener buildListener) { + ChangeLogSet changeSet = build.getChangeSet(); + Object[] changeSetItems = changeSet.getItems(); + UFTTestDetectionResult result = null; + + try { + + boolean initialDetection = !initialDetectionFileExist(build.getWorkspace()); + if (initialDetection) { + printToConsole(buildListener, "Executing initial detection"); + result = doInitialDetection(build.getWorkspace()); + } else { + printToConsole(buildListener, "Executing changeSet detection"); + result = doChangeSetDetection(changeSetItems, build.getWorkspace()); + removeTestDuplicated(result.getUpdatedTests()); + } + + printToConsole(buildListener, String.format("Found %s new tests", result.getNewTests().size())); + printToConsole(buildListener, String.format("Found %s updated tests", result.getUpdatedTests().size())); + + + result.setScmResourceId(scmResourceId); + result.setWorkspaceId(workspaceId); + result.setInitialDetection(initialDetection); + sortTests(result.getNewTests()); + sortTests(result.getUpdatedTests()); + publishDetectionResults(build, buildListener, result); + + if (result.hasChanges()) { + UftTestDiscoveryDispatcher dispatcher = getExtension(UftTestDiscoveryDispatcher.class); + dispatcher.enqueueResult(build.getProject().getName(), build.getNumber()); + } + + } catch (InterruptedException | IOException e) { + e.printStackTrace(); + } + + return result; + } + + private static void sortTests(List newTests) { + Collections.sort(newTests, new Comparator() { + @Override + public int compare(AutomatedTest o1, AutomatedTest o2) { + int comparePackage = o1.getPackage().compareTo(o2.getPackage()); + if (comparePackage == 0) { + return o1.getName().compareTo(o2.getName()); + } else { + return comparePackage; + } + } + }); + } + + private static T getExtension(Class clazz) { + ExtensionList items = Jenkins.getInstance().getExtensionList(clazz); + return items.get(0); + } + + private static void removeTestDuplicated(List tests) { + Set keys = new HashSet<>(); + List testsToRemove = new ArrayList<>(); + for (AutomatedTest test : tests) { + String key = test.getPackage() + "_" + test.getName(); + if (keys.contains(key)) { + testsToRemove.add(test); + } + keys.add(key); + + } + tests.removeAll(testsToRemove); + } + + private static void printToConsole(BuildListener buildListener, String msg) { + if (buildListener != null) { + buildListener.getLogger().println("UFTTestDetectionService : " + msg); + } + } + + private static UFTTestDetectionResult doChangeSetDetection(Object[] changeSetItems, FilePath workspace) throws IOException, InterruptedException { + UFTTestDetectionResult result = new UFTTestDetectionResult(); + if (changeSetItems.length == 0) { + return result; + } + + boolean isGitChanges = changeSetItems[0] instanceof GitChangeSet; + if (!isGitChanges) { + return result; + } + + for (int i = 0; i < changeSetItems.length; i++) { + GitChangeSet changeSet = (GitChangeSet) changeSetItems[i]; + for (GitChangeSet.Path path : changeSet.getPaths()) { + if (isTestMainFilePath(path.getPath())) { + String filePath = workspace + File.separator + path.getPath(); + + if (EditType.ADD.equals(path.getEditType())) { + if (isFileExist(filePath)) { + FilePath testFolder = getTestFolderForTestMainFile(filePath); + scanFileSystemRecursively(workspace, testFolder, result.getNewTests()); + } + } else if (EditType.DELETE.equals(path.getEditType())) { + if (!isFileExist(filePath)) { + FilePath testFolder = getTestFolderForTestMainFile(filePath); + AutomatedTest test = createAutomatedTest(workspace, testFolder); + result.getDeletedTests().add(test); + } + } else if (EditType.EDIT.equals(path.getEditType())) { + if (isFileExist(filePath)) { + FilePath testFolder = getTestFolderForTestMainFile(filePath); + scanFileSystemRecursively(workspace, testFolder, result.getUpdatedTests()); + } + } + } + } + } + + return result; + } + + private static AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath) throws IOException, InterruptedException { + AutomatedTest test = new AutomatedTest(); + test.setName(dirPath.getName()); + + //set component - relative path from root + String testPath = dirPath.toURI().toString(); + String rootPath = root.toURI().toString(); + String path = testPath.replace(rootPath, ""); + path = StringUtils.strip(path, "\\/"); + String _package = path.length() != dirPath.getName().length() ? path.substring(0, path.length() - dirPath.getName().length() - 1) : ""; + test.setPackage(_package); + return test; + } + + private static boolean isFileExist(String path) { + File file = new File(path); + return file.exists(); + } + + private static boolean initialDetectionFileExist(FilePath workspace) { + try { + File rootFile = new File(workspace.toURI()); + File file = new File(rootFile, INITIAL_DETECTION_FILE); + return file.exists(); + + } catch (Exception e) { + return false; + } + } + + public static void createInitialDetectionFile(FilePath workspace) { + try { + File rootFile = new File(workspace.toURI()); + File file = new File(rootFile, INITIAL_DETECTION_FILE); + file.createNewFile(); + } catch (IOException | InterruptedException e) { + logger.error("Failed to createInitialDetectionFile : " + e.getMessage()); + } + } + + public static void removeInitialDetectionFlag(FilePath workspace) { + try { + File rootFile = new File(workspace.toURI()); + File file = new File(rootFile, INITIAL_DETECTION_FILE); + file.delete(); + } catch (IOException | InterruptedException e) { + logger.error("Failed to removeInitialDetectionFlag"); + } + } + + private static UFTTestDetectionResult doInitialDetection(FilePath workspace) throws IOException, InterruptedException { + UFTTestDetectionResult result = new UFTTestDetectionResult(); + scanFileSystemRecursively(workspace, workspace, result.getNewTests()); + return result; + } + + private static void scanFileSystemRecursively(FilePath root, FilePath dirPath, List foundTests) throws IOException, InterruptedException { + List paths = dirPath.list(); + + //if it test folder - create new test, else drill down to subFolders + UftTestType testType = isUftTestFolder(paths); + if (!testType.isNone()) { + AutomatedTest test = createAutomatedTest(root, dirPath); + test.setUftTestType(testType); + String description = UFTTestUtil.getTestDescription(dirPath); + test.setDescription(description); + foundTests.add(test); + + } else { + for (FilePath path : paths) { + if (path.isDirectory()) { + scanFileSystemRecursively(root, path, foundTests); + } + } + } + } + + private static UftTestType isUftTestFolder(List paths) { + for (FilePath path : paths) { + if (path.getName().endsWith(STFileExtention)) { + return UftTestType.API; + } + if (path.getName().endsWith(QTPFileExtention)) { + return UftTestType.GUI; + } + } + + return UftTestType.None; + } + + private static boolean isTestMainFilePath(String path) { + String lowerPath = path.toLowerCase(); + if (lowerPath.endsWith(STFileExtention)) { + return true; + } else if (lowerPath.endsWith(QTPFileExtention)) { + return true; + } + + return false; + } + + private static FilePath getTestFolderForTestMainFile(String path) { + if (isTestMainFilePath(path)) { + File file = new File(path); + File parent = file.getParentFile(); + return new FilePath(parent); + } + return null; + } + + private static void publishDetectionResults(AbstractBuild build, TaskListener _logger, UFTTestDetectionResult detectionResult) { + + try { + File file = getReportXmlFile(build); + JAXBContext jaxbContext = JAXBContext.newInstance(UFTTestDetectionResult.class); + Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); + + jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + jaxbMarshaller.marshal(detectionResult, file); + //jaxbMarshaller.marshal(detectionResult, System.out); + + } catch (JAXBException e) { + _logger.error("Failed to persist detection results: " + e); + } + } + + public static UFTTestDetectionResult readDetectionResults(Run run) { + + File file = getReportXmlFile(run); + try { + JAXBContext context = JAXBContext.newInstance(UFTTestDetectionResult.class); + Unmarshaller m = context.createUnmarshaller(); + UFTTestDetectionResult result = (UFTTestDetectionResult) m.unmarshal(new FileReader(file)); + return result; + } catch (JAXBException | FileNotFoundException e) { + return null; + } + } + + private static File getReportXmlFile(Run run) { + File reportXmlFile = new File(run.getRootDir(), DETECTION_RESULT_FILE); + return reportXmlFile; + } +} \ No newline at end of file diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java new file mode 100644 index 0000000000..b2cc834e58 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java @@ -0,0 +1,98 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import com.hp.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; +import hudson.Extension; +import hudson.model.FreeStyleProject; +import hudson.model.ParametersDefinitionProperty; +import hudson.model.PeriodicWork; +import hudson.model.TaskListener; +import jenkins.model.Jenkins; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.IOException; +import java.util.Date; +import java.util.List; + + +/** + * This class cleans outdated test execution jobs that were not used more than 7 days. + * Only jobs that were created by {@link TestExecutionJobCreatorService} are checked. + */ +@Extension +public class UftJobCleaner extends AbstractSafeLoggingAsyncPeriodWork { + + private static Logger logger = LogManager.getLogger(UftJobCleaner.class); + + + public UftJobCleaner() { + super("Uft Job Cleaner"); + logger.warn(String.format("Initial delay %d minutes, recurrencePeriod %d minutes, outdate threshold %d days", getInitialDelay() / MIN, getRecurrencePeriod() / MIN, getOutdateThreshold())); + } + + @Override + public long getRecurrencePeriod() { + return DAY; + } + + @Override + public long getInitialDelay() { + return MIN * 10;//start 10 minutes after jenkins restart + } + + private long getOutdateThreshold() { + return 7; + } + + @Override + protected void doExecute(TaskListener listener) throws IOException, InterruptedException { + List jobs = Jenkins.getInstance().getAllItems(FreeStyleProject.class); + long thresholdTimeInMillis = new Date().getTime() - PeriodicWork.DAY * getOutdateThreshold(); + + int clearCounter = 0; + for (FreeStyleProject job : jobs) { + if (isExecutorJob(job) && job.getLastBuild() != null && !job.isBuilding()) { + if (thresholdTimeInMillis > job.getLastBuild().getTimeInMillis()) { + try { + logger.warn(String.format("Job %s is going to be deleted as outdated job, last build was executed at %s", job.getName(), job.getLastBuild().getTimestampString2())); + job.delete(); + } catch (Exception e) { + logger.warn(String.format("Failed to delete job %s : %s", job.getName(), e.getMessage())); + } + + clearCounter++; + } + } + } + + logger.warn(String.format("Cleaner found %s outdated job", clearCounter)); + } + + private boolean isExecutorJob(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + if (parameters != null && + parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_ID_PARAMETER_NAME) != null && + parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_RUN_ID_PARAMETER_NAME) != null) { + return true; + } + return false; + } + + +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java new file mode 100644 index 0000000000..ec5645e2e4 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java @@ -0,0 +1,405 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import com.google.inject.Inject; +import com.hp.application.automation.tools.octane.ResultQueue; +import com.hp.application.automation.tools.octane.actions.UftTestType; +import com.hp.application.automation.tools.octane.actions.dto.*; +import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; +import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactoryImpl; +import com.hp.application.automation.tools.octane.configuration.ConfigurationService; +import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; +import com.hp.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; +import com.hp.mqm.client.MqmRestClient; +import com.hp.mqm.client.exception.LoginException; +import com.hp.mqm.client.exception.RequestErrorException; +import com.hp.mqm.client.exception.RequestException; +import com.hp.mqm.client.exception.SharedSpaceNotExistException; +import com.hp.mqm.client.model.ListItem; +import com.hp.mqm.client.model.PagedList; +import com.hp.mqm.client.model.Test; +import hudson.Extension; +import hudson.model.AbstractBuild; +import hudson.model.Job; +import hudson.model.Run; +import hudson.model.TaskListener; +import hudson.util.TimeUnit2; +import jenkins.model.Jenkins; +import net.sf.json.JSONObject; +import net.sf.json.JsonConfig; +import net.sf.json.processors.PropertyNameProcessor; +import net.sf.json.util.PropertyFilter; +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.*; + + +/** + * This class is responsible to send discovered uft tests to Octane. + * Class uses file-based queue so if octane or jenkins will be down before sending, + * after connection is up - this dispatcher will send tests to Octane. + *

+ * Actually list of discovered tests are persisted in job run directory. Queue contains only reference to that job run. + */ +@Extension +public class UftTestDiscoveryDispatcher extends AbstractSafeLoggingAsyncPeriodWork { + + private static Logger logger = LogManager.getLogger(UftTestDiscoveryDispatcher.class); + private final static int RESPONSE_STATUS_CONFLICT = 409; + + private UftTestDiscoveryQueue queue; + private JenkinsMqmRestClientFactory clientFactory; + + public UftTestDiscoveryDispatcher() { + super("Uft Test Discovery Dispatcher"); + } + + + @Override + protected void doExecute(TaskListener listener) throws IOException, InterruptedException { + if (queue.peekFirst() == null) { + return; + } + + logger.warn("Queue size " + queue.size()); + //logger.info("... done, left to send " + events.size() + " events"); + ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); + MqmRestClient client = createClient(serverConfiguration); + if (client == null) { + return; + } + + ResultQueue.QueueItem item; + while ((item = queue.peekFirst()) != null) { + + Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + if (project == null) { + logger.warn("Project [" + item.getProjectName() + "] no longer exists, pending discovered tests can't be submitted"); + queue.remove(); + continue; + } + + Run build = project.getBuildByNumber(item.getBuildNumber()); + if (build == null) { + logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer exists, pending discovered tests can't be submitted"); + queue.remove(); + continue; + } + + UFTTestDetectionResult result = UFTTestDetectionService.readDetectionResults(build); + if (result == null) { + logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer contains valid detection result file"); + queue.remove(); + continue; + } + + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "]"); + dispatchDetectionResults(item, client, serverConfiguration, result); + if (result.isInitialDetection()) { + UFTTestDetectionService.createInitialDetectionFile(((AbstractBuild) build).getWorkspace()); + } + queue.remove(); + } + } + + private void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient client, ServerConfiguration serverConfiguration, UFTTestDetectionResult result) throws UnsupportedEncodingException { + String serverURL = getServerURL(result.getWorkspaceId(), serverConfiguration.sharedSpace, serverConfiguration.location); + //post new tests + if (!result.getNewTests().isEmpty()) { + boolean posted = postTests(client, serverURL, result.getNewTests(), result.getWorkspaceId(), result.getScmResourceId()); + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getNewTests().size() + " new tests posted successfully = " + posted); + } + + //post updated + if (!result.getUpdatedTests().isEmpty()) { + boolean updated = updateTests(client, result.getUpdatedTests(), result.getWorkspaceId()); + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getUpdatedTests().size() + " updated tests posted successfully = " + updated); + } + } + + private static boolean postTests(MqmRestClient client, String serverURL, List tests, String workspaceId, String scmResourceId) throws UnsupportedEncodingException { + + if (!tests.isEmpty()) { + try { + completeTestProperties(client, Long.parseLong(workspaceId), tests, scmResourceId); + } catch (RequestErrorException e) { + logger.error("Failed to completeTestProperties : " + e.getMessage()); + return false; + } + + int BULK_SIZE = 100; + for (int i = 0; i < tests.size(); i += BULK_SIZE) + try { + AutomatedTests data = AutomatedTests.createWithTests(tests.subList(i, Math.min(i + BULK_SIZE, tests.size()))); + String uftTestJson = convertToJsonString(data); + + client.postTest(uftTestJson, null, serverURL); + //JSONObject testObject = (JSONObject) jsonObject.getJSONArray("data").get(0); + + } catch (RequestErrorException e) { + if (e.getStatusCode() != RESPONSE_STATUS_CONFLICT) { + logger.error("Failed to postTests to Octane : " + e.getMessage()); + return false; + } + + //else : the test with the same hash code , so do nothing + } + } + return true; + } + + private static String convertToJsonString(AutomatedTests data) { + JsonConfig config = getJsonConfig(); + return JSONObject.fromObject(data, config).toString(); + } + + private static String convertToJsonString(AutomatedTest test) { + JsonConfig config = getJsonConfig(); + return JSONObject.fromObject(test, config).toString(); + } + + private static JsonConfig getJsonConfig() { + JsonConfig config = new JsonConfig(); + //override field names + config.registerJsonPropertyNameProcessor(AutomatedTest.class, new PropertyNameProcessor() { + + @Override + public String processPropertyName(Class className, String fieldName) { + String result = fieldName; + switch (fieldName) { + case "scmRepository": + result = "scm_repository"; + break; + case "testingToolType": + result = "testing_tool_type"; + break; + case "testTypes": + result = "test_type"; + break; + default: + break; + } + return result; + } + }); + + //filter empty fields + PropertyFilter pf = new PropertyFilter() { + public boolean apply(Object source, String name, Object value) { + if (value != null) { + return false; + } + return true; + } + }; + config.setJsonPropertyFilter(pf); + + //skip fields + config.registerPropertyExclusion(AutomatedTest.class, "uftTestType"); + return config; + } + + /*private static void deleteTests(MqmRestClient client, Collection removedTests, String workspaceId) throws UnsupportedEncodingException { + List idsToDelete = new ArrayList<>(); + long workspaceIdAsLong = Long.parseLong(workspaceId); + for (AutomatedTest test : removedTests) { + Map queryFields = new HashMap<>(); + queryFields.put("name", test.getName()); + queryFields.put("package", test.getPackage()); + PagedList foundTests = client.getTests(workspaceIdAsLong, queryFields, Arrays.asList("id")); + if (foundTests.getItems().size() == 1) { + idsToDelete.add(foundTests.getItems().get(0).getId()); + } + } + + int BULK_SIZE = 100; + for (int i = 0; i < idsToDelete.size(); i += BULK_SIZE) { + client.deleteTests(workspaceIdAsLong, idsToDelete.subList(i, Math.min(i + BULK_SIZE, idsToDelete.size()))); + } + }*/ + + private static boolean updateTests(MqmRestClient client, Collection updateTests, String workspaceId) throws UnsupportedEncodingException { + long workspaceIdAsLong = Long.parseLong(workspaceId); + + try { + for (AutomatedTest test : updateTests) { + if (StringUtils.isEmpty(test.getDescription())) { + continue; + } + Map queryFields = new HashMap<>(); + queryFields.put("name", test.getName()); + queryFields.put("package", test.getPackage()); + PagedList foundTests = client.getTests(workspaceIdAsLong, queryFields, Arrays.asList("id, description")); + if (foundTests.getItems().size() == 1) { + Test foundTest = foundTests.getItems().get(0); + AutomatedTest testForUpdate = new AutomatedTest(); + testForUpdate.setSubtype(null); + testForUpdate.setDescription(test.getDescription()); + testForUpdate.setId(foundTest.getId()); + String json = convertToJsonString(testForUpdate); + client.updateTest(Long.parseLong(workspaceId), foundTests.getItems().get(0).getId(), json); + } + } + return true; + + } catch (Exception e) { + return false; + } + } + + private static void completeTestProperties(MqmRestClient client, long workspaceId, Collection tests, String scmResourceId) { + ListNodeEntity uftTestingTool = getUftTestingTool(client, workspaceId); + ListNodeEntity uftFramework = getUftFramework(client, workspaceId); + ListNodeEntity guiTestType = hasTestsByType(tests, UftTestType.GUI) ? getGuiTestType(client, workspaceId) : null; + ListNodeEntity apiTestType = hasTestsByType(tests, UftTestType.API) ? getApiTestType(client, workspaceId) : null; + + BaseRefEntity scmRepository = StringUtils.isEmpty(scmResourceId) ? null : BaseRefEntity.create("scm_repository", Long.valueOf(scmResourceId)); + for (AutomatedTest test : tests) { + test.setTestingToolType(uftTestingTool); + test.setFramework(uftFramework); + test.setScmRepository(scmRepository); + + ListNodeEntity testType = guiTestType; + if (UftTestType.API.equals(test.getUftTestType())) { + testType = apiTestType; + } + test.setTestTypes(ListNodeEntityCollection.create(testType)); + } + } + + private static ListNodeEntity getUftTestingTool(MqmRestClient client, long workspaceId) { + PagedList testingTools = client.queryListItems("list_node.testing_tool_type", null, workspaceId, 0, 100); + String uftTestingToolLogicalName = "list_node.testing_tool_type.uft"; + + for (ListItem item : testingTools.getItems()) { + if (uftTestingToolLogicalName.equals(item.getLogicalName())) { + return ListNodeEntity.create(item.getId()); + } + } + return null; + } + + private static ListNodeEntity getUftFramework(MqmRestClient client, long workspaceId) { + PagedList testingTools = client.queryListItems("list_node.je.framework", null, workspaceId, 0, 100); + String uftTestingToolLogicalName = "list_node.je.framework.uft"; + + for (ListItem item : testingTools.getItems()) { + if (uftTestingToolLogicalName.equals(item.getLogicalName())) { + return ListNodeEntity.create(item.getId()); + } + } + return null; + } + + private static ListNodeEntity getGuiTestType(MqmRestClient client, long workspaceId) { + PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, 100); + String guiLogicalName = "list_node.test_type.gui"; + + for (ListItem item : testingTools.getItems()) { + if (guiLogicalName.equals(item.getLogicalName())) { + return ListNodeEntity.create(item.getId()); + } + } + return null; + } + + private static ListNodeEntity getApiTestType(MqmRestClient client, long workspaceId) { + PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, 100); + String guiLogicalName = "list_node.test_type.api"; + + for (ListItem item : testingTools.getItems()) { + if (guiLogicalName.equals(item.getLogicalName())) { + return ListNodeEntity.create(item.getId()); + } + } + return null; + } + + private static String getServerURL(String workspaceId, String sharedspaceId, String location) { + return location + "/api/shared_spaces/" + sharedspaceId + "/workspaces/" + workspaceId; + } + + private MqmRestClient createClient(ServerConfiguration serverConfiguration) { + + if (!serverConfiguration.isValid()) { + logger.warn("There are pending discovered UFT tests, but MQM server configuration is not valid, results can't be submitted"); + return null; + } + + MqmRestClient client = clientFactory.obtain( + serverConfiguration.location, + serverConfiguration.sharedSpace, + serverConfiguration.username, + serverConfiguration.password); + + try { + client.validateConfigurationWithoutLogin(); + return client; + } catch (SharedSpaceNotExistException e) { + logger.warn("Invalid shared space"); + } catch (LoginException e) { + logger.warn("Login failed : " + e.getMessage()); + } catch (RequestException e) { + logger.warn("Problem with communication with MQM server : " + e.getMessage()); + } + + return null; + } + + @Override + public long getRecurrencePeriod() { + String value = System.getProperty("UftTestDiscoveryDispatcher.Period"); // let's us config the recurrence period. default is 60 seconds. + if (!StringUtils.isEmpty(value)) { + return Long.valueOf(value); + } + return TimeUnit2.SECONDS.toMillis(30); + } + + @Inject + public void setTestResultQueue(UftTestDiscoveryQueue queue) { + this.queue = queue; + } + + @Inject + public void setMqmRestClientFactory(JenkinsMqmRestClientFactoryImpl clientFactory) { + this.clientFactory = clientFactory; + } + + private static boolean hasTestsByType(Collection tests, UftTestType uftTestType) { + for (AutomatedTest test : tests) { + if (uftTestType.equals(test.getUftTestType())) { + return true; + } + } + return false; + } + + /** + * Queue that current run contains discovered tests + * + * @param projectName + * @param buildNumber + */ + public void enqueueResult(String projectName, int buildNumber) { + queue.add(projectName, buildNumber); + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java new file mode 100644 index 0000000000..50d3767330 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java @@ -0,0 +1,34 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import com.hp.application.automation.tools.octane.AbstractResultQueueImpl; +import jenkins.model.Jenkins; + +import java.io.File; +import java.io.IOException; + +/** + * Queue for uft test discovery before dispatching + */ +public class UftTestDiscoveryQueue extends AbstractResultQueueImpl { + + public UftTestDiscoveryQueue() throws IOException { + File queueFile = new File(Jenkins.getInstance().getRootDir(), "octane-uft-tests-queue.dat"); + init(queueFile); + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java b/src/main/java/com/hp/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java index bf73e65eac..88125018ac 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java @@ -20,6 +20,7 @@ import hudson.model.TaskListener; import java.io.IOException; +import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; @@ -54,4 +55,9 @@ private void logError(Throwable t) { lr.setParameters(new Object[] { name }); logger.log(lr); } + + @Override + protected Level getNormalLoggingLevel() { + return Level.CONFIG; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitExtension.java b/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitExtension.java index 6f8d9d8bec..c8c7692be8 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitExtension.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitExtension.java @@ -128,10 +128,10 @@ public TestResultContainer getTestResults(Run build, HPRunnerType hpRunner } private boolean shallStripPackageAndClass(ResultFields resultFields) { - if (resultFields == null) { + /*if (resultFields == null) { return false; - } - return resultFields.equals(new ResultFields("UFT", "UFT", null)); + }*/ + return false; //resultFields.equals(new ResultFields("UFT", "UFT", null)); } private boolean isLoadRunnerProject(Run build) throws IOException, InterruptedException { diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index 8d833c6133..eb42b8def3 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -17,11 +17,12 @@ package com.hp.application.automation.tools.octane.tests.junit; import com.hp.application.automation.tools.octane.tests.HPRunnerType; +import com.hp.application.automation.tools.octane.tests.xml.AbstractXmlIterator; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.tests.Property; import com.hp.octane.integrations.dto.tests.TestSuite; -import com.hp.application.automation.tools.octane.tests.xml.AbstractXmlIterator; import hudson.FilePath; +import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -141,12 +142,27 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I } } else if ("testName".equals(localName)) { // NON-NLS testName = readNextValue(); - if (testName.startsWith(workspace.getRemote())) { - // if workspace is prefix of the method name, cut it off - // currently this handling is needed for UFT tests - testName = testName.substring(workspace.getRemote().length()).replaceAll("^[/\\\\]", ""); - } + if (hpRunnerType.equals(HPRunnerType.UFT)) { + packageName = ""; + className = ""; + + if (testName.startsWith(workspace.getRemote())) { + // if workspace is prefix of the method name, cut it off + // currently this handling is needed for UFT tests + String path = testName.substring(workspace.getRemote().length()); + path = StringUtils.strip(path, "\\/"); + + //split path to package and and name fields + if (path.contains(File.separator)) { + int testNameStartIndex = path.indexOf(File.separator); + + testName = path.substring(testNameStartIndex + 1); + packageName = path.substring(0, testNameStartIndex); + } else { + testName = path; + } + } externalURL = jenkinsRootUrl + "job/" + jobName + "/" + buildId + "/artifact/UFTReport/" + cleanTestName(testName) + "/run_results.html"; } } else if ("duration".equals(localName)) { // NON-NLS diff --git a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java index a05155d0fb..5764c8e9b3 100644 --- a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java @@ -74,6 +74,10 @@ public RunFromFileBuilder(String fsTests) { runFromFileModel = new RunFromFileSystemModel(fsTests); } + public void setFsTests(String fsTests){ + runFromFileModel.setFsTests(fsTests); + } + /** * Instantiates a new Run from file builder. * @@ -325,6 +329,8 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn throws InterruptedException, IOException { + runFromFileModel.setWorkspace(workspace); + // get the mc server settings MCServerSettingsModel mcServerSettingsModel = getMCServerSettingsModel(); @@ -704,8 +710,8 @@ public FormValidation doCheckPerScenarioTimeOut(@QueryParameter String value) { return FormValidation.error("Per Scenario Timeout must be a number"); } - return FormValidation.ok(); - } + return FormValidation.ok(); + } - } + } } diff --git a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly new file mode 100644 index 0000000000..c6057b6df5 --- /dev/null +++ b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly @@ -0,0 +1,102 @@ + + + + + + + +

HP Octane UFT Tests Scanner Report

+
+
+

+ + + New tests : ${it.results.newTests.size()} +
+
+
+ + Deleted tests : ${it.results.deletedTests.size()} +
+
+
+ + Updated tests : ${it.results.updatedTests.size()} +
+
+
+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Test packageTest nameStatus
${s.package}${s.name}new
${s.package}${s.name}deleted
${s.package}${s.name}updated
+

+ + + + \ No newline at end of file diff --git a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly index 9544040c52..062bff98ec 100644 --- a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly +++ b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly @@ -12,8 +12,12 @@ --> - + + + + + \ No newline at end of file diff --git a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/help-workspaceName.html b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/help-workspaceName.html deleted file mode 100644 index bd659d82bf..0000000000 --- a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/help-workspaceName.html +++ /dev/null @@ -1,19 +0,0 @@ - - -
- Select Workspace name to assign the detected UFT tests to. -
From 6a908c416da87dfb3a92bad23d65022c2fa3903f Mon Sep 17 00:00:00 2001 From: radislavB Date: Thu, 11 May 2017 13:31:46 +0300 Subject: [PATCH 0056/2502] Improvements in ExecutorConnectivityService (#189) * create credentials + code review with radi fixes + add http statuses enum class * before deleteExecutor print to log that job is going to be deleted * adding comments and license details * add possibility to change getOutdateThreshold by SystemProperty --- pom.xml | 2 +- .../automation/tools/common/HttpStatus.java | 76 +++++++++ .../tools/octane/CIJenkinsServicesImpl.java | 11 +- .../executor/ExecutorConnTestService.java | 118 -------------- .../executor/ExecutorConnectivityService.java | 153 ++++++++++++++++++ .../TestExecutionJobCreatorService.java | 1 + .../tools/octane/executor/UftJobCleaner.java | 15 +- 7 files changed, 250 insertions(+), 126 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/common/HttpStatus.java delete mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnectivityService.java diff --git a/pom.xml b/pom.xml index e9217c06bf..239a0a1048 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.3 + 1.4 diff --git a/src/main/java/com/hp/application/automation/tools/common/HttpStatus.java b/src/main/java/com/hp/application/automation/tools/common/HttpStatus.java new file mode 100644 index 0000000000..55321e0bc0 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/common/HttpStatus.java @@ -0,0 +1,76 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.common; + +/** + * Created by shitritn on 10/05/2017. + * enum class that define all http protocol statuses with thire cuase for intenral use in plugin + */ +public enum HttpStatus { + OK(200, "OK"), + CREATED(201, "Created"), + ACCEPTED(202, "Accepted"), + NO_CONTENT(204, "No Content"), + RESET_CONTENT(205, "Reset Content"), + PARTIAL_CONTENT(206, "Partial Content"), + MOVED_PERMANENTLY(301, "Moved Permanently"), + FOUND(302, "Found"), + SEE_OTHER(303, "See Other"), + NOT_MODIFIED(304, "Not Modified"), + USE_PROXY(305, "Use Proxy"), + TEMPORARY_REDIRECT(307, "Temporary Redirect"), + BAD_REQUEST(400, "Bad Request"), + UNAUTHORIZED(401, "Unauthorized"), + PAYMENT_REQUIRED(402, "Payment Required"), + FORBIDDEN(403, "Forbidden"), + NOT_FOUND(404, "Not Found"), + METHOD_NOT_ALLOWED(405, "Method Not Allowed"), + NOT_ACCEPTABLE(406, "Not Acceptable"), + PROXY_AUTHENTICATION_REQUIRED(407, "Proxy Authentication Required"), + REQUEST_TIMEOUT(408, "Request Timeout"), + CONFLICT(409, "Conflict"), + GONE(410, "Gone"), + LENGTH_REQUIRED(411, "Length Required"), + PRECONDITION_FAILED(412, "Precondition Failed"), + REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"), + REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"), + UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"), + REQUESTED_RANGE_NOT_SATISFIABLE(416, "Requested Range Not Satisfiable"), + EXPECTATION_FAILED(417, "Expectation Failed"), + INTERNAL_SERVER_ERROR(500, "Internal Server Error"), + NOT_IMPLEMENTED(501, "Not Implemented"), + BAD_GATEWAY(502, "Bad Gateway"), + SERVICE_UNAVAILABLE(503, "Service Unavailable"), + GATEWAY_TIMEOUT(504, "Gateway Timeout"), + HTTP_VERSION_NOT_SUPPORTED(505, "HTTP Version Not Supported"); + + private final int code; + private final String reason; + + private HttpStatus(int statusCode, String reason) { + this.code = statusCode; + this.reason = reason; + } + + public int getCode() { + return code; + } + + public String getReason() { + return reason; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java index 976704f2e7..9c5a2a935e 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -19,7 +19,7 @@ import com.hp.application.automation.tools.model.OctaneServerSettingsModel; import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; -import com.hp.application.automation.tools.octane.executor.ExecutorConnTestService; +import com.hp.application.automation.tools.octane.executor.ExecutorConnectivityService; import com.hp.application.automation.tools.octane.executor.TestExecutionJobCreatorService; import com.hp.application.automation.tools.octane.model.ModelFactory; import com.hp.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; @@ -30,6 +30,7 @@ import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.configuration.CIProxyConfiguration; import com.hp.octane.integrations.dto.configuration.OctaneConfiguration; +import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.CredentialsInfo; import com.hp.octane.integrations.dto.executor.DiscoveryInfo; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; @@ -548,8 +549,8 @@ public void runTestSuiteExecution(TestSuiteExecutionInfo suiteExecutionInfo) { } @Override - public boolean checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { - return ExecutorConnTestService.checkRepositoryConnectivity(testConnectivityInfo); + public OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { + return ExecutorConnectivityService.checkRepositoryConnectivity(testConnectivityInfo); } @Override @@ -558,8 +559,8 @@ public void deleteExecutor(String id) { } @Override - public CredentialsInfo upsertCredentials(CredentialsInfo credentialsInfo) { - return ExecutorConnTestService.upsertRepositoryCredentials(credentialsInfo); + public OctaneResponse upsertCredentials(CredentialsInfo credentialsInfo) { + return ExecutorConnectivityService.upsertRepositoryCredentials(credentialsInfo); } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java deleted file mode 100644 index e200e2944d..0000000000 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnTestService.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package com.hp.application.automation.tools.octane.executor; - -import com.cloudbees.plugins.credentials.CredentialsProvider; -import com.cloudbees.plugins.credentials.CredentialsScope; -import com.cloudbees.plugins.credentials.CredentialsStore; -import com.cloudbees.plugins.credentials.SystemCredentialsProvider; -import com.cloudbees.plugins.credentials.domains.Domain; -import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; -import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; -import com.hp.octane.integrations.dto.executor.CredentialsInfo; -import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; -import com.hp.octane.integrations.dto.scm.SCMType; -import hudson.EnvVars; -import hudson.model.Item; -import hudson.model.TaskListener; -import hudson.plugins.git.GitException; -import hudson.plugins.git.GitTool; -import org.apache.commons.lang.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.jenkinsci.plugins.gitclient.Git; -import org.jenkinsci.plugins.gitclient.GitClient; - -import java.io.IOException; -import java.util.List; - -/** - * Utility for handling of scm repositories - */ -public class ExecutorConnTestService { - - private static final Logger logger = LogManager.getLogger(ExecutorConnTestService.class); - - /** - * Validate that scm repository is valid - * @param testConnectivityInfo - * @return - */ - public static boolean checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { - if (testConnectivityInfo.getScmRepository() != null && - StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl()) && - SCMType.GIT.equals(testConnectivityInfo.getScmRepository().getType())) { - - BaseStandardCredentials c = null; - if (StringUtils.isNotEmpty(testConnectivityInfo.getUsername()) && testConnectivityInfo.getPassword() != null) { - c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, null, null, testConnectivityInfo.getUsername(), testConnectivityInfo.getPassword()); - } - - try { - EnvVars environment = new EnvVars(System.getenv()); - GitClient git = Git.with(TaskListener.NULL, environment).using(GitTool.getDefaultInstallation().getGitExe()).getClient(); - git.addDefaultCredentials(c); - git.getHeadRev(testConnectivityInfo.getScmRepository().getUrl(), "HEAD"); - - return true; - } catch (IOException | InterruptedException e) { - logger.error("Failed to connect to git : " + e.getMessage()); - } catch (GitException e) { - logger.error("Failed to execute getHeadRev : " + e.getMessage()); - } - } - return false; - } - - /** - * Insert of update(if already exist) of credentials in Jenkins. - * If credentialsInfo containscredentialsId - we update existing credentials with new user/password, otherwise - create new credentials - * @param credentialsInfo - * @return created/updated credentials with filled credentials id - */ - public static CredentialsInfo upsertRepositoryCredentials(final CredentialsInfo credentialsInfo) { - - if (StringUtils.isEmpty(credentialsInfo.getCredentialId())) { - if (StringUtils.isNotEmpty(credentialsInfo.getUsername()) && credentialsInfo.getPassword() != null) { - BaseStandardCredentials c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, null, null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); - CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); - try { - store.addCredentials(Domain.global(), c); - credentialsInfo.setCredentialId(c.getId()); - } catch (IOException e) { - logger.error("Failed to add credentials " + e.getMessage()); - } - } - } else { - List list = CredentialsProvider.lookupCredentials(BaseStandardCredentials.class, (Item) null, null); - for (BaseStandardCredentials cred : list) { - if (cred.getId().equals(credentialsInfo.getCredentialId())) { - BaseStandardCredentials newCred = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialId(), - null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); - CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); - try { - store.updateCredentials(Domain.global(), cred, newCred); - } catch (IOException e) { - logger.error("Failed to add credentials " + e.getMessage()); - } - } - } - } - - return credentialsInfo; - } -} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnectivityService.java new file mode 100644 index 0000000000..8e1163fd5e --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -0,0 +1,153 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.CredentialsScope; +import com.cloudbees.plugins.credentials.CredentialsStore; +import com.cloudbees.plugins.credentials.SystemCredentialsProvider; +import com.cloudbees.plugins.credentials.domains.Domain; +import com.cloudbees.plugins.credentials.domains.DomainRequirement; +import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; +import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; +import com.hp.application.automation.tools.common.HttpStatus; +import com.hp.octane.integrations.dto.DTOFactory; +import com.hp.octane.integrations.dto.connectivity.OctaneResponse; +import com.hp.octane.integrations.dto.executor.CredentialsInfo; +import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; +import com.hp.octane.integrations.dto.scm.SCMType; +import hudson.EnvVars; +import hudson.model.Item; +import hudson.model.TaskListener; +import hudson.plugins.git.GitException; +import hudson.plugins.git.GitTool; +import org.apache.commons.lang.StringUtils; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jenkinsci.plugins.gitclient.Git; +import org.jenkinsci.plugins.gitclient.GitClient; + +import java.io.IOException; +import java.util.List; + +/** + * Utility for handling connectivity with scm repositories + */ +public class ExecutorConnectivityService { + + private static final Logger logger = LogManager.getLogger(ExecutorConnectivityService.class); + + /** + * Validate that scm repository is valid + * + * @param testConnectivityInfo contains values to check + * @return OctaneResponse return status code and error to show for client + */ + public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { + OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); + if (testConnectivityInfo.getScmRepository() != null && + StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl()) && + SCMType.GIT.equals(testConnectivityInfo.getScmRepository().getType())) { + + BaseStandardCredentials c = null; + if (StringUtils.isNotEmpty(testConnectivityInfo.getUsername()) && testConnectivityInfo.getPassword() != null) { + c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, null, null, testConnectivityInfo.getUsername(), testConnectivityInfo.getPassword()); + } else if (StringUtils.isEmpty(testConnectivityInfo.getCredentialsId())) { + c = getCredentialsById(testConnectivityInfo.getCredentialsId()); + } + + try { + EnvVars environment = new EnvVars(System.getenv()); + GitClient git = Git.with(TaskListener.NULL, environment).using(GitTool.getDefaultInstallation().getGitExe()).getClient(); + git.addDefaultCredentials(c); + git.getHeadRev(testConnectivityInfo.getScmRepository().getUrl(), "HEAD"); + + result = result.setStatus(HttpStatus.OK.getCode()); + + } catch (IOException | InterruptedException e) { + logger.error("Failed to connect to git : " + e.getMessage()); + result.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.getCode()); + result.setBody(e.getMessage()); + } catch (GitException e) { + logger.error("Failed to execute getHeadRev : " + e.getMessage()); + result.setStatus(HttpStatus.NOT_FOUND.getCode()); + result.setBody(e.getMessage()); + } + } else { + result.setStatus(HttpStatus.BAD_REQUEST.getCode()); + result.setBody("Missing input for testing"); + } + return result; + } + + /** + * Insert of update(if already exist) of credentials in Jenkins. + * If credentialsInfo contains credentialsId - we update existing credentials with new user/password, otherwise - create new credentials + * + * @param credentialsInfo contains values to insert / update - exist credentials will be updated or recreate if deleted in jenkins + * @return OctaneResponse created/updated credentials with filled credentials id as body + */ + public static OctaneResponse upsertRepositoryCredentials(final CredentialsInfo credentialsInfo) { + + OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); + result.setStatus(HttpStatus.CREATED.getCode()); + + if (StringUtils.isNotEmpty(credentialsInfo.getCredentialsId())) { + BaseStandardCredentials cred = getCredentialsById(credentialsInfo.getCredentialsId()); + if (cred != null) { + BaseStandardCredentials newCred = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialsId(), + null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); + CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); + try { + store.updateCredentials(Domain.global(), cred, newCred); + result.setStatus(HttpStatus.CREATED.getCode()); + result.setBody(newCred.getId()); + } catch (IOException e) { + logger.error("Failed to update credentials " + e.getMessage()); + result.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.getCode()); + result.setBody("Failed to update credentials " + e.getMessage()); + } + return result; + } + } + if (StringUtils.isNotEmpty(credentialsInfo.getUsername()) && credentialsInfo.getPassword() != null) { + BaseStandardCredentials c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialsId(), null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); + CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); + try { + store.addCredentials(Domain.global(), c); + result.setStatus(HttpStatus.CREATED.getCode()); + result.setBody(c.getId()); + } catch (IOException e) { + logger.error("Failed to add credentials " + e.getMessage()); + result.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.getCode()); + result.setBody("Failed to add credentials " + e.getMessage()); + } + } + + return result; + } + + private static BaseStandardCredentials getCredentialsById(String credentialsId) { + List list = CredentialsProvider.lookupCredentials(BaseStandardCredentials.class, (Item) null, null, (DomainRequirement) null); + for (BaseStandardCredentials cred : list) { + if (cred.getId().equals(credentialsId)) + return cred; + } + return null; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index f069244893..6debb4c166 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -373,6 +373,7 @@ public static void deleteExecutor(String id) { } try { + logger.warn(String.format("Job %s is going to be deleted since matching executor in Octane was deleted", proj.getName())); proj.delete(); } catch (IOException | InterruptedException e) { logger.error("Failed to delete job " + proj.getName() + " : " + e.getMessage()); diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java index b2cc834e58..bc3cf56248 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java @@ -23,6 +23,7 @@ import hudson.model.PeriodicWork; import hudson.model.TaskListener; import jenkins.model.Jenkins; +import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -48,7 +49,7 @@ public UftJobCleaner() { @Override public long getRecurrencePeriod() { - return DAY; + return HOUR; } @Override @@ -57,7 +58,17 @@ public long getInitialDelay() { } private long getOutdateThreshold() { - return 7; + int DEFAULT_OUTDATE_THRESHOLD = 7; + int threshold = DEFAULT_OUTDATE_THRESHOLD; + String paramValue = System.getProperty("octane.plugin.UftJobCleaner.outdateThreshold"); + if (StringUtils.isNotEmpty(paramValue)) { + try { + threshold = Integer.parseInt(paramValue); + } catch (NumberFormatException e) { + threshold = DEFAULT_OUTDATE_THRESHOLD; + } + } + return threshold; } @Override From 835020160983daa4757ee29ae9fb1c6bff7c9703 Mon Sep 17 00:00:00 2001 From: radislavB Date: Thu, 11 May 2017 13:32:02 +0300 Subject: [PATCH 0057/2502] Fix createMtbxFileInWs to handle saving mtbx file on slave machine workspace (#190) --- .../tools/model/RunFromFileSystemModel.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java index 55da31fe57..6fa60b7886 100644 --- a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java @@ -5,21 +5,23 @@ package com.hp.application.automation.tools.model; -import com.hp.application.automation.tools.common.RuntimeIOException; import com.hp.application.automation.tools.mc.JobConfigurationProxy; import hudson.EnvVars; import hudson.FilePath; import hudson.util.Secret; import hudson.util.VariableResolver; import net.minidev.json.JSONObject; -import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import javax.annotation.Nullable; -import java.io.File; import java.io.IOException; +import java.io.InputStream; +import java.text.Format; +import java.text.SimpleDateFormat; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Properties; @@ -690,16 +692,23 @@ private Properties createProperties(EnvVars envVars) { private String createMtbxFileInWs(String mtbxContent) { try { + Date now = new Date(); + Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); + String time = formatter.format(now); - String filePath = File.separator + "test_suite.mtbx"; - String fullPath = workspace.getRemote() + filePath; + String fileName = "test_suite_" + time + ".mtbx"; - String content = mtbxContent.replace("${WORKSPACE}", workspace.getRemote()); - FileUtils.writeStringToFile(new File(fullPath), content); + FilePath remoteFile = workspace.child(fileName); - return "${WORKSPACE}" + filePath; - } catch (IOException e) { - throw new RuntimeIOException("Failed to save MTBX file : " + e.getMessage()); + String mtbxContentUpdated = mtbxContent.replace("${WORKSPACE}", workspace.getRemote()); + InputStream in = IOUtils.toInputStream(mtbxContentUpdated, "UTF-8"); + remoteFile.copyFrom(in); + + String filePath = remoteFile.getRemote(); + return filePath; + + } catch (IOException | InterruptedException e) { + throw new RuntimeException("Failed to save MTBX file : " + e.getMessage()); } } From e1c13c637aad686cefa68af48fe6c25d3d1a98ec Mon Sep 17 00:00:00 2001 From: Jackzenko Date: Sun, 21 May 2017 12:20:17 +0800 Subject: [PATCH 0058/2502] fixed report path issue for TFS plugin (#192) CPE QCIM1J93134 How to configure Microsoft TFS 'Copy Publish Artifact' task, for API Testing results JIRA ticket: JENKINS-44364 https://issues.jenkins-ci.org/projects/JENKINS/issues/JENKINS-44364 AGM defect number: 35681 --- HpToolsLauncher/TestRunners/ApiTestRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HpToolsLauncher/TestRunners/ApiTestRunner.cs b/HpToolsLauncher/TestRunners/ApiTestRunner.cs index 86e84b52fc..5a73fe0460 100644 --- a/HpToolsLauncher/TestRunners/ApiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ApiTestRunner.cs @@ -72,7 +72,7 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance ConsoleWriter.ActiveTestRun = runDesc; ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testinf.TestPath); - runDesc.ReportLocation = Helper.CreateTempDir(); + runDesc.ReportLocation = testinf.TestPath; runDesc.ErrorDesc = errorReason; runDesc.TestPath = testinf.TestPath; runDesc.TestState = TestState.Unknown; From e86d97dc31020dee7356d07606ecf2ceb4bcb7a4 Mon Sep 17 00:00:00 2001 From: bamh Date: Sun, 21 May 2017 11:25:04 +0300 Subject: [PATCH 0059/2502] PC Adding features (#194) * index on master: ab83a3d Merge remote-tracking branch 'remotes/origin/5.0.1-beta-SNAPSHOT' * Revert pom changes * Merge branch '5.0.1-beta-SNAPSHOT' of https://github.com/hpsa/hp-application-automation-tools-plugin into development # Conflicts: # .github/PULL_REQUEST_TEMPLATE.md * Added some comments * changes according to sonarlint * changes for sonarlint * Remove some comments * Comments * * Fix for supporting SECURITY-170 changes * https://jenkins.io/blog/2016/05/11/security-update/ * https://issues.jenkins-ci.org/browse/JENKINS-39654 * code changes for sonarlint * Changes in PC configuration section header * Adding support for Jenkins using proxy: https://issues.jenkins-ci.org/browse/JENKINS-44314 Changing the HTTPS checkbox position * Adding link under Test ID text box for browsing to the PC Server --- .../automation/tools/model/PcModel.java | 8 ++- .../automation/tools/pc/PcClient.java | 11 ++-- .../automation/tools/pc/PcRestProxy.java | 53 ++++++++++++++----- .../automation/tools/run/PcBuilder.java | 10 ++-- .../tools/run/PcBuilder/config.jelly | 27 +++++++++- .../tools/run/PcBuilder/help-proxyOutURL.html | 5 ++ .../automation/tools/pc/MockPcModel.java | 18 +------ .../automation/tools/pc/MockPcRestProxy.java | 20 +------ .../tools/pc/MockPcRestProxyBadResponses.java | 20 +------ 9 files changed, 96 insertions(+), 76 deletions(-) create mode 100644 src/main/resources/com/hp/application/automation/tools/run/PcBuilder/help-proxyOutURL.html diff --git a/src/main/java/com/hp/application/automation/tools/model/PcModel.java b/src/main/java/com/hp/application/automation/tools/model/PcModel.java index 620cad6626..d5d8b2031b 100644 --- a/src/main/java/com/hp/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hp/application/automation/tools/model/PcModel.java @@ -28,11 +28,12 @@ public class PcModel { private final boolean addRunToTrendReport; private final String trendReportId; private final boolean HTTPSProtocol; + private final String proxyOutURL; @DataBoundConstructor public PcModel(String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, - PostRunAction postRunAction, boolean vudsMode, String description, boolean addRunToTrendReport, String trendReportId, boolean HTTPSProtocol) { + PostRunAction postRunAction, boolean vudsMode, String description, boolean addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { this.pcServerName = pcServerName; this.almUserName = almUserName; @@ -48,6 +49,7 @@ public PcModel(String pcServerName, String almUserName, String almPassword, Stri this.addRunToTrendReport = addRunToTrendReport; this.HTTPSProtocol = HTTPSProtocol; this.trendReportId = trendReportId; + this.proxyOutURL = proxyOutURL; } protected SecretContainer setPassword(String almPassword) { @@ -116,6 +118,10 @@ public boolean httpsProtocol(){ return this.HTTPSProtocol; } + public String getProxyOutURL(){ + return this.proxyOutURL; + } + public static List getPostRunActions() { return Arrays.asList(PostRunAction.values()); diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcClient.java b/src/main/java/com/hp/application/automation/tools/pc/PcClient.java index e3bdb42fcd..115f239f01 100644 --- a/src/main/java/com/hp/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hp/application/automation/tools/pc/PcClient.java @@ -54,9 +54,14 @@ public class PcClient { private PrintStream logger; public PcClient(PcModel pcModel, PrintStream logger) { - model = pcModel; - restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(), model.getAlmDomain(), model.getAlmProject(),logger); - this.logger = logger; + try { + model = pcModel; + restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(), model.getAlmDomain(), model.getAlmProject(),logger, model.getProxyOutURL()); + this.logger = logger; + }catch (PcException e){ + logger.println(e.getMessage()); + } + } public PcClient(PcModel pcModel, PrintStream logger, T proxy) { diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java index a6d1a63aa1..fd10aa7fa7 100644 --- a/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java @@ -30,8 +30,8 @@ import com.hp.application.automation.tools.rest.RESTConstants; import com.hp.application.automation.tools.sse.sdk.Base64Encoder; import org.apache.commons.io.IOUtils; -import org.apache.http.Header; import org.apache.http.HttpHeaders; +import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CookieStore; @@ -40,6 +40,7 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.protocol.ClientContext; +import org.apache.http.conn.params.ConnRoutePNames; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.BasicCookieStore; @@ -53,9 +54,7 @@ import java.io.InputStream; import java.io.IOException; import java.io.FileOutputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.*; import java.io.PrintStream; @@ -84,13 +83,16 @@ public class PcRestProxy { private String domain; private String project; private String webProtocol; + private String proxyScheme; + private String proxyHostName; + private int proxyPort; private HttpClient client; private HttpContext context; private CookieStore cookieStore; // private PrintStream logger; - public PcRestProxy(String webProtocolName, String pcServerName, String almDomain, String almProject,PrintStream mainLogger) { + public PcRestProxy(String webProtocolName, String pcServerName, String almDomain, String almProject,PrintStream mainLogger, String proxyOutURL) throws PcException { // logger = mainLogger; pcServer = pcServerName; @@ -104,12 +106,42 @@ public PcRestProxy(String webProtocolName, String pcServerName, String almDomain cxMgr.setDefaultMaxPerRoute(20); - client = new DefaultHttpClient(cxMgr); + client = new DefaultHttpClient(cxMgr); + if (proxyOutURL != null && !proxyOutURL.isEmpty()) { + // Setting proxy + // we should get the full proxy URL from the user: http(s)://: + // PAC (proxy auto-config) or Automatic configuration script is not supported (for example our proxy: http://autocache.hpecorp.net/) + getProxyDataFromURL(proxyOutURL); + HttpHost proxy = new HttpHost(proxyHostName, proxyPort, proxyScheme); + client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); + } context = new BasicHttpContext(); cookieStore = new BasicCookieStore(); context.setAttribute(ClientContext.COOKIE_STORE, cookieStore); } + private void getProxyDataFromURL(String proxyURL) throws PcException{ + + try { + if (proxyURL != null && !proxyURL.isEmpty()){ + proxyScheme = proxyURL.split("://")[0]; + proxyHostName = proxyURL.split("://")[1].split(":")[0]; + if (proxyURL.split("://")[1].contains(":")){ + proxyPort = Integer.parseInt(proxyURL.split("://")[1].split(":")[1]); + }else{ + proxyPort = 80; + } + + } + } catch (Exception ex) { + throw new PcException("Error: Validating Proxy URL: " + ex + " Please add a proxy URL in this pattern: http(s)://: or leave blank"); + } + + + + + } + public boolean authenticate(String userName, String password) throws PcException, ClientProtocolException, IOException { String userNameAndPassword = userName + ":" + password; @@ -222,14 +254,7 @@ public boolean logout() throws PcException, ClientProtocolException, IOException } protected HttpResponse executeRequest(HttpRequestBase request) throws PcException, IOException { -// logger.println(String.format("DEBUGMSG - Request uri %s",request.getURI().toString())); -// logger.println(String.format("DEBUGMSG - Request Method %s",request.getMethod().toString())); -// // Print all headers -// logger.println("DEBUGMSG - Headers"); -// List
httpHeaders = Arrays.asList(request.getAllHeaders()); -// for (Header header : httpHeaders) { -// logger.println("DEBUGMSG - " + header.getName() + " : " + header.getValue()); -// } + HttpResponse response = client.execute(request,context); if (!isOk(response)){ String message; diff --git a/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java index 0fcd40f6ce..812ca2a5b0 100644 --- a/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java @@ -110,7 +110,8 @@ public PcBuilder( String description, boolean addRunToTrendReport, String trendReportId, - boolean HTTPSProtocol) { + boolean HTTPSProtocol, + String proxyOutURL) { this.almUserName = almUserName; this.almPassword = almPassword; this.timeslotDurationHours = timeslotDurationHours; @@ -133,7 +134,8 @@ public PcBuilder( description, addRunToTrendReport, trendReportId, - HTTPSProtocol); + HTTPSProtocol, + proxyOutURL); } @Override @@ -625,6 +627,8 @@ public boolean isStatusBySLA() { return statusBySLA; } + public String getProxyOutURL(){ return getPcModel().getProxyOutURL();} + // This indicates to Jenkins that this is an implementation of an extension // point @Extension @@ -646,7 +650,7 @@ public boolean isApplicable( @Override public String getDisplayName() { - return "Execute HP tests using HP Performance Center"; + return "Execute performance test using Performance Center"; } public FormValidation doCheckPcServerName(@QueryParameter String value) { diff --git a/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly index 2d834aabdf..15bf085df5 100644 --- a/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly @@ -59,6 +59,22 @@ } + function verifyURLAvailable(){ + + var pcServer = document.getElementsByName("pc.pcServerName")[0].value; + var scheme = "http"; + if(document.getElementsByName("pc.HTTPSProtocol")[0].checked){ + scheme = "https" + } + if(pcServer){ + var popup = window.open(scheme + "://" + pcServer + "/loadtest/"); + popup.opener = null; + }else{ + alert("Performance Center Server name is missing."); + } + return false; + } + @@ -75,8 +91,9 @@ - + + @@ -92,9 +109,15 @@ + + Browse to find the Test ID + + + +
@@ -205,7 +228,7 @@
- +
diff --git a/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/help-proxyOutURL.html b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/help-proxyOutURL.html new file mode 100644 index 0000000000..34149e688b --- /dev/null +++ b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/help-proxyOutURL.html @@ -0,0 +1,5 @@ +
+ Add your local proxy as following: http(s)://<host>:<port>
+ Leave empty if not using a local proxy.
+ PAC (proxy auto-config) or Automatic configuration script are not supported. +
\ No newline at end of file diff --git a/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java index 35970925b8..d8f8baf43c 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/hp/application/automation/tools/pc/MockPcModel.java @@ -1,19 +1,3 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - package com.hp.application.automation.tools.pc; import com.hp.application.automation.tools.model.PcModel; @@ -28,7 +12,7 @@ public MockPcModel(String pcServerName, String almUserName, String almPassword, String almProject, String testId, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description,boolean webProtocol) { super(pcServerName, almUserName, almPassword, almDomain, almProject, testId, testInstanceId, timeslotDurationHours, - timeslotDurationMinutes, postRunAction, vudsMode, description, false, null,false + timeslotDurationMinutes, postRunAction, vudsMode, description, false, null,false,null ); } diff --git a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java index 9a514b4efe..000920b412 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java +++ b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxy.java @@ -1,19 +1,3 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - package com.hp.application.automation.tools.pc; import java.io.File; @@ -42,8 +26,8 @@ public class MockPcRestProxy extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); - public MockPcRestProxy(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) { - super(webProtocol, pcServerName, almDomain, almProject,logger); + public MockPcRestProxy(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) throws PcException { + super(webProtocol, pcServerName, almDomain, almProject,logger,null); } @Override diff --git a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java index 3fd1fa3b56..91acdc5854 100644 --- a/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java +++ b/src/test/java/com/hp/application/automation/tools/pc/MockPcRestProxyBadResponses.java @@ -1,19 +1,3 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - package com.hp.application.automation.tools.pc; import java.io.IOException; @@ -37,8 +21,8 @@ public class MockPcRestProxyBadResponses extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); - public MockPcRestProxyBadResponses(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) { - super(webProtocol, pcServerName, almDomain, almProject,logger); + public MockPcRestProxyBadResponses(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) throws PcException { + super(webProtocol, pcServerName, almDomain, almProject,logger,null); } @Override From d6195f036372562012c8aa91de2123a227917562 Mon Sep 17 00:00:00 2001 From: radislavB Date: Sun, 28 May 2017 08:51:10 +0300 Subject: [PATCH 0060/2502] Improving uft test discovery and execution (#195) * support discovery of data tables * increment version of mqm-rest-client * revert - last change * small fixes * fix running test from file system in mtbx file , while tests executed on slave * small fixes * support discovery of data tables * support discovery of data tables * tech: add license header * Defect #317023: [ Jenkins plugin] Tests doesn't appear in Pipeline created from Maven project under Folder and always in status run * improving JobCleaner to remove orphan discovery jobs * adding fullScan parameter for discovery job * 1.set deleted tests to be not executable 2.fix detection of deleted data tables 3.fix detection of test on linux (failed to replaceAll / by \\) * add some java docs * add some java docs * codacy fixes * tech : When deleting test from octane there is no option to updated it from UFT repository (the test doesn't exists) * fix sonarLint issues * refactor error handling of createMtbxFileInWs --- pom.xml | 2 +- .../tools/model/RunFromFileSystemModel.java | 50 +-- .../actions/UFTTestDetectionBuildAction.java | 18 ++ .../actions/UFTTestDetectionPublisher.java | 15 +- .../tools/octane/actions/UFTTestUtil.java | 7 +- .../octane/actions/dto/AutomatedTest.java | 26 +- .../octane/actions/dto/ScmResourceFile.java | 88 ++++++ .../octane/actions/dto/ScmResources.java | 43 +++ .../configuration/ConfigurationService.java | 114 ++++++- .../tools/octane/events/TestListenerImpl.java | 21 +- .../TestExecutionJobCreatorService.java | 57 ++-- .../executor/UFTTestDetectionResult.java | 66 +++- .../executor/UFTTestDetectionService.java | 183 ++++++++--- .../tools/octane/executor/UftJobCleaner.java | 137 +++++++- .../executor/UftTestDiscoveryDispatcher.java | 294 ++++++++++++------ .../tests/build/MavenBuildExtension.java | 4 +- .../tools/run/RunFromFileBuilder.java | 36 ++- .../UFTTestDetectionBuildAction/index.jelly | 46 +++ .../UFTTestDetectionPublisher/config.jelly | 2 +- 19 files changed, 933 insertions(+), 276 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java create mode 100644 src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResources.java diff --git a/pom.xml b/pom.xml index 239a0a1048..abad3cbbeb 100644 --- a/pom.xml +++ b/pom.xml @@ -395,7 +395,7 @@ mqm-rest-client com.hpe.adm.octane.ciplugins - 1.3 + 1.4.1 diff --git a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java index 6fa60b7886..77e4f82e6f 100644 --- a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java @@ -7,21 +7,14 @@ import com.hp.application.automation.tools.mc.JobConfigurationProxy; import hudson.EnvVars; -import hudson.FilePath; import hudson.util.Secret; import hudson.util.VariableResolver; import net.minidev.json.JSONObject; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import javax.annotation.Nullable; -import java.io.IOException; -import java.io.InputStream; -import java.text.Format; -import java.text.SimpleDateFormat; import java.util.Arrays; -import java.util.Date; import java.util.List; import java.util.Properties; @@ -61,7 +54,6 @@ public class RunFromFileSystemModel { private String fsJobId; private ProxySettings proxySettings; private boolean useSSL; - private FilePath workspace; /** * Instantiates a new Run from file system model. @@ -600,16 +592,14 @@ private Properties createProperties(EnvVars envVars) { Properties props = new Properties(); if (!StringUtils.isEmpty(this.fsTests)) { - String expandedFsTests; - if (isMtbxContent(fsTests)) { - String path = createMtbxFileInWs(fsTests); - expandedFsTests = envVars.expand(path); + String expandedFsTests = envVars.expand(fsTests); + String[] testsArr; + if (isMtbxContent(expandedFsTests)) { + testsArr = new String[]{expandedFsTests}; } else { - expandedFsTests = envVars.expand(fsTests); + testsArr = expandedFsTests.replaceAll("\r", "").split("\n"); } - String[] testsArr = expandedFsTests.replaceAll("\r", "").split("\n"); - int i = 1; for (String test : testsArr) { @@ -690,30 +680,8 @@ private Properties createProperties(EnvVars envVars) { return props; } - private String createMtbxFileInWs(String mtbxContent) { - try { - Date now = new Date(); - Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); - String time = formatter.format(now); - - String fileName = "test_suite_" + time + ".mtbx"; - - FilePath remoteFile = workspace.child(fileName); - - String mtbxContentUpdated = mtbxContent.replace("${WORKSPACE}", workspace.getRemote()); - InputStream in = IOUtils.toInputStream(mtbxContentUpdated, "UTF-8"); - remoteFile.copyFrom(in); - - String filePath = remoteFile.getRemote(); - return filePath; - - } catch (IOException | InterruptedException e) { - throw new RuntimeException("Failed to save MTBX file : " + e.getMessage()); - } - } - - private static boolean isMtbxContent(String fsTests) { - return fsTests.toLowerCase().contains(""); + public static boolean isMtbxContent(String testContent) { + return testContent.toLowerCase().contains(""); } /** @@ -731,8 +699,4 @@ public JSONObject getJobDetails(String mcUrl, String proxyAddress, String proxyU } return JobConfigurationProxy.getInstance().getJobById(mcUrl, fsUserName, fsPassword.getPlainText(), proxyAddress, proxyUserName, proxyPassword, fsJobId); } - - public void setWorkspace(FilePath workspace) { - this.workspace = workspace; - } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java index d1774ad697..fd21068c18 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java @@ -87,6 +87,24 @@ public boolean getHasUpdatedTests() { return results.getUpdatedTests().size() > 0; } + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTTestDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasNewScmResources() { + return results.getNewScmResourceFiles().size() > 0; + } + + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTTestDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasDeletedScmResources() { + return results.getDeletedScmResourceFiles().size() > 0; + } + public void setResults(UFTTestDetectionResult results) { this.results = results; } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java index 9f56676508..b7a5418481 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java @@ -47,30 +47,33 @@ import java.io.IOException; import java.util.List; +/** + * Post-build action of Uft test detection + */ public class UFTTestDetectionPublisher extends Recorder { private final String workspaceName; - private final String scmResourceId; + private final String scmRepositoryId; public String getWorkspaceName() { return workspaceName; } - public String getScmResourceId() { - return scmResourceId; + public String getScmRepositoryId() { + return scmRepositoryId; } // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" @DataBoundConstructor - public UFTTestDetectionPublisher(String workspaceName, String scmResourceId) { + public UFTTestDetectionPublisher(String workspaceName, String scmRepositoryId) { this.workspaceName = workspaceName; - this.scmResourceId = scmResourceId; + this.scmRepositoryId = scmRepositoryId; } @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { - UFTTestDetectionResult results = UFTTestDetectionService.startScanning(build, getWorkspaceName(), getScmResourceId(), listener); + UFTTestDetectionResult results = UFTTestDetectionService.startScanning(build, getWorkspaceName(), getScmRepositoryId(), listener); UFTTestDetectionBuildAction buildAction = new UFTTestDetectionBuildAction(build, results); build.addAction(buildAction); diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java index dc5f585c61..3b364eca3f 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/UFTTestUtil.java @@ -41,8 +41,13 @@ public class UFTTestUtil { * @return test description */ public static String getTestDescription(FilePath dirPath) { - String desc = null; + String desc; + try { + if(!dirPath.exists()){ + return null; + } + FilePath tspTestFile = new FilePath(dirPath, "Test.tsp"); InputStream is = new FileInputStream(tspTestFile.getRemote()); String xmlContent = decodeXmlContent(is); diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java index d8f9250ab8..5c4028c970 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java @@ -21,18 +21,16 @@ import javax.xml.bind.annotation.*; /** - * Created by kashbi on 25/09/2016. + * This file represents automated test for sending to Octane */ -@XmlRootElement(name="test") +@XmlRootElement(name = "test") @XmlAccessorType(XmlAccessType.FIELD) public class AutomatedTest { @XmlTransient private Long id; @XmlTransient - private String type = "test"; - @XmlTransient - private String subtype = "test_automated"; + private String type = "test_automated"; @XmlTransient private ListNodeEntity testingToolType; @XmlTransient @@ -48,6 +46,8 @@ public class AutomatedTest { private String name; @XmlAttribute private String packageName; + @XmlAttribute + private Boolean executable; private String description; @@ -70,14 +70,6 @@ public void setType(String type) { this.type = type; } - public String getSubtype() { - return subtype; - } - - public void setSubtype(String subtype) { - this.subtype = subtype; - } - public ListNodeEntity getFramework() { return framework; } @@ -141,4 +133,12 @@ public Long getId() { public void setId(Long id) { this.id = id; } + + public Boolean getExecutable() { + return executable; + } + + public void setExecutable(Boolean executable) { + this.executable = executable; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java new file mode 100644 index 0000000000..271977585d --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java @@ -0,0 +1,88 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.actions.dto; + +import javax.xml.bind.annotation.*; + +/** + * This file represents scm resource for sending to Octane + */ +@XmlRootElement(name="dataTable") +@XmlAccessorType(XmlAccessType.FIELD) +public class ScmResourceFile { + + @XmlTransient + private Long id; + @XmlTransient + private String type = "scm_resource_file"; + @XmlTransient + private BaseRefEntity scmRepository; + + private String name; + + private String relativePath; + + private String relativePathPrevious; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRelativePath() { + return relativePath; + } + + public void setRelativePath(String relativePath) { + this.relativePath = relativePath; + } + + public String getRelativePathPrevious() { + return relativePathPrevious; + } + + public void setRelativePathPrevious(String relativePathPrevious) { + this.relativePathPrevious = relativePathPrevious; + } + + public BaseRefEntity getScmRepository() { + return scmRepository; + } + + public void setScmRepository(BaseRefEntity scmRepository) { + this.scmRepository = scmRepository; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResources.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResources.java new file mode 100644 index 0000000000..0810fb5173 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResources.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.actions.dto; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * This file represents collection of scm resources for sending to Octane + */ +public class ScmResources { + + private List data = new ArrayList<>(); + + public static ScmResources createWithItems(Collection resources) { + ScmResources result = new ScmResources(); + result.setData(new ArrayList<>(resources)); + return result; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java b/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java index 7172a6b3ea..5111cc5f90 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java @@ -16,35 +16,115 @@ package com.hp.application.automation.tools.octane.configuration; +import com.google.inject.Inject; import com.hp.application.automation.tools.model.OctaneServerSettingsModel; +import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactoryImpl; import com.hp.application.automation.tools.settings.OctaneServerSettingsBuilder; +import com.hp.mqm.client.MqmRestClient; +import com.hp.mqm.client.exception.LoginException; +import com.hp.mqm.client.exception.RequestException; +import com.hp.mqm.client.exception.SharedSpaceNotExistException; import hudson.Extension; import hudson.Plugin; -import hudson.model.Hudson; import jenkins.model.Jenkins; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +/*** + * Octane plugin configuration service - + * 1. helps to change Octane configuration + * 2. helps to get Octane configuration and model + * 3. helps to get RestClient based on some configuration + */ @Extension public class ConfigurationService { - public static OctaneServerSettingsModel getModel() { - return getOctaneDescriptor().getModel(); - } + private JenkinsMqmRestClientFactoryImpl clientFactory; + + private static Logger logger = LogManager.getLogger(ConfigurationService.class); + + /** + * Get current {@see OctaneServerSettingsModel} model + * + * @return + */ + public static OctaneServerSettingsModel getModel() { + return getOctaneDescriptor().getModel(); + } + + /** + * Get current Octane server configuration (that is based on model) + * + * @return + */ + public static ServerConfiguration getServerConfiguration() { + return getOctaneDescriptor().getServerConfiguration(); + } + + /** + * Change model (used by tests) + * + * @param newModel + */ + public static void configurePlugin(OctaneServerSettingsModel newModel) { + getOctaneDescriptor().setModel(newModel); + } + + private static OctaneServerSettingsBuilder.OctaneDescriptorImpl getOctaneDescriptor() { + return Jenkins.getInstance().getDescriptorByType(OctaneServerSettingsBuilder.OctaneDescriptorImpl.class); + } + + /** + * Get plugin version + * + * @return + */ + public static String getPluginVersion() { + Plugin plugin = Jenkins.getInstance().getPlugin("hp-application-automation-tools-plugin"); + return plugin.getWrapper().getVersion(); + } + + /** + * Create restClient based on some server configuration + * + * @param serverConfiguration + * @return + */ + public MqmRestClient createClient(ServerConfiguration serverConfiguration) { + + if (!serverConfiguration.isValid()) { + logger.warn("MQM server configuration is not valid"); + return null; + } - public static ServerConfiguration getServerConfiguration() { - return getOctaneDescriptor().getServerConfiguration(); - } + MqmRestClient client = clientFactory.obtain( + serverConfiguration.location, + serverConfiguration.sharedSpace, + serverConfiguration.username, + serverConfiguration.password); - public static void configurePlugin(OctaneServerSettingsModel newModel){ - getOctaneDescriptor().setModel(newModel); - } + try { + client.validateConfigurationWithoutLogin(); + return client; + } catch (SharedSpaceNotExistException e) { + logger.warn("Invalid shared space"); + } catch (LoginException e) { + logger.warn("Login failed : " + e.getMessage()); + } catch (RequestException e) { + logger.warn("Problem with communication with MQM server : " + e.getMessage()); + } - private static OctaneServerSettingsBuilder.OctaneDescriptorImpl getOctaneDescriptor(){ - return Hudson.getInstance().getDescriptorByType(OctaneServerSettingsBuilder.OctaneDescriptorImpl.class); - } + return null; + } - public static String getPluginVersion(){ - Plugin plugin = Jenkins.getInstance().getPlugin("hp-application-automation-tools-plugin"); - return plugin.getWrapper().getVersion(); - } + /** + * Inject client factory + * + * @param clientFactory + */ + @Inject + public void setMqmRestClientFactory(JenkinsMqmRestClientFactoryImpl clientFactory) { + this.clientFactory = clientFactory; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java index 0c56a6ba62..5c0e68f30d 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/events/TestListenerImpl.java @@ -1,16 +1,31 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.hp.application.automation.tools.octane.events; import com.google.inject.Inject; import com.hp.application.automation.tools.octane.tests.TestListener; import hudson.Extension; -import hudson.model.Run; -import hudson.model.TaskListener; +import hudson.model.*; import hudson.model.listeners.RunListener; import javax.annotation.Nonnull; /** - * Created by leviy on 27/03/2017. + * Listener on job complete event */ @Extension public class TestListenerImpl extends RunListener { diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 6debb4c166..354d343ca2 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -64,6 +64,7 @@ public class TestExecutionJobCreatorService { public static final String EXECUTOR_ID_PARAMETER_NAME = "executorId"; public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; + public static final String FULL_SCAN_PARAMETER_NAME = "Full Scan"; /** * Create (if needed) and run test execution @@ -123,8 +124,8 @@ private static FreeStyleProject getExecutionJob(TestSuiteExecutionInfo suiteExec setScmRepository(suiteExecutionInfo.getScmRepository(), suiteExecutionInfo.getScmRepositoryCredentialsId(), proj); setBuildDiscarder(proj, 20); - addParameter(proj, SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId(), true, "Octane suite id"); - addParameter(proj, SUITE_RUN_ID_PARAMETER_NAME, null, false, "This parameter is relevant only if the suite is run from Octane and allows to publish tests to the existing Octane suite run"); + addConstantParameter(proj, SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId(), "Octane suite id"); + addStringParameter(proj, SUITE_RUN_ID_PARAMETER_NAME, null, "This parameter is relevant only if the suite is run from Octane and allows to publish tests to the existing Octane suite run"); addAssignedNode(proj); //add build action @@ -239,12 +240,15 @@ public static void runTestDiscovery(DiscoveryInfo discoveryInfo) { */ FreeStyleProject proj = getDiscoveryJob(discoveryInfo); + //start job if (proj != null) { - if (discoveryInfo.isForceFullDiscovery() && proj.getWorkspace() != null) { - UFTTestDetectionService.removeInitialDetectionFlag(proj.getWorkspace()); - } + ParameterValue executorIdParam = new StringParameterValue(EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId()); + ParameterValue fullScanParam = new BooleanParameterValue(FULL_SCAN_PARAMETER_NAME, discoveryInfo.isForceFullDiscovery()); + ParametersAction parameters = new ParametersAction(executorIdParam, fullScanParam); - proj.scheduleBuild2(0); + Cause cause = new Cause.UserIdCause(); + CauseAction causeAction = new CauseAction(cause); + proj.scheduleBuild2(0, parameters, causeAction); } } @@ -263,7 +267,8 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { setScmRepository(discoveryInfo.getScmRepository(), discoveryInfo.getScmRepositoryCredentialsId(), proj); setBuildDiscarder(proj, 20); - addParameter(proj, EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId(), true, "Octane executor id"); + addConstantParameter(proj, EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId(), "Octane executor id"); + addBooleanParameter(proj, FULL_SCAN_PARAMETER_NAME, false, "Indicate whether to scan full scm repository to discover all tests or to use changes (Change Sets) to update already existing tests"); //set polling once in two minutes SCMTrigger scmTrigger = new SCMTrigger("H/2 * * * *");//H/2 * * * * : once in two minutes @@ -321,27 +326,37 @@ public void run() { }, delayStartPolling); } - private static void addParameter(FreeStyleProject proj, String parameterName, String parameterValue, boolean constantValue, String desc) throws IOException { + private static ParametersDefinitionProperty getParametersDefinitions(FreeStyleProject proj) throws IOException { ParametersDefinitionProperty parameters = proj.getProperty(ParametersDefinitionProperty.class); if (parameters == null) { parameters = new ParametersDefinitionProperty(new ArrayList()); proj.addProperty(parameters); } + return parameters; + } - if (constantValue) { - if (parameters.getParameterDefinition(parameterName) == null) { - //String name, List choices, String defaultValue, String description - ParameterDefinition param = new ChoiceParameterDefinition(parameterName, new String[]{parameterValue}, desc); - parameters.getParameterDefinitions().add(param); - } - } else { - if (parameters.getParameterDefinition(parameterName) == null) { - //String name, List choices, String defaultValue, String description - ParameterDefinition param = new StringParameterDefinition(parameterName, null, desc); - parameters.getParameterDefinitions().add(param); - } + private static void addConstantParameter(FreeStyleProject proj, String parameterName, String parameterValue, String desc) throws IOException { + ParametersDefinitionProperty parameters = getParametersDefinitions(proj); + if (parameters.getParameterDefinition(parameterName) == null) { + ParameterDefinition param = new ChoiceParameterDefinition(parameterName, new String[]{parameterValue}, desc); + parameters.getParameterDefinitions().add(param); + } + } + + private static void addStringParameter(FreeStyleProject proj, String parameterName, String defaultValue, String desc) throws IOException { + ParametersDefinitionProperty parameters = getParametersDefinitions(proj); + if (parameters.getParameterDefinition(parameterName) == null) { + ParameterDefinition param = new StringParameterDefinition(parameterName, defaultValue, desc); + parameters.getParameterDefinitions().add(param); } + } + private static void addBooleanParameter(FreeStyleProject proj, String parameterName, Boolean defaultValue, String desc) throws IOException { + ParametersDefinitionProperty parameters = getParametersDefinitions(proj); + if (parameters.getParameterDefinition(parameterName) == null) { + ParameterDefinition param = new BooleanParameterDefinition(parameterName, defaultValue, desc); + parameters.getParameterDefinitions().add(param); + } } /** @@ -373,7 +388,7 @@ public static void deleteExecutor(String id) { } try { - logger.warn(String.format("Job %s is going to be deleted since matching executor in Octane was deleted", proj.getName())); + logger.warn(String.format("Job '%s' is going to be deleted since matching executor in Octane was deleted", proj.getName())); proj.delete(); } catch (IOException | InterruptedException e) { logger.error("Failed to delete job " + proj.getName() + " : " + e.getMessage()); diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java index ffcff781f4..7525fa663a 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java @@ -17,33 +17,53 @@ package com.hp.application.automation.tools.octane.executor; import com.hp.application.automation.tools.octane.actions.dto.AutomatedTest; +import com.hp.application.automation.tools.octane.actions.dto.ScmResourceFile; import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; - -@XmlRootElement(name="detectionResult") +/** + * This file represents result of UFT detection files (tests and data tables) + */ +@XmlRootElement(name = "detectionResult") @XmlAccessorType(XmlAccessType.FIELD) public class UFTTestDetectionResult { - @XmlElementWrapper(name="newTests") - @XmlElement(name="test") + @XmlElementWrapper(name = "newTests") + @XmlElement(name = "test") private List newTests = new ArrayList<>(); + @XmlElementWrapper(name = "deletedTests") + @XmlElement(name = "test") private List deletedTests = new ArrayList<>(); + @XmlElementWrapper(name = "updatedTests") + @XmlElement(name = "test") private List updatedTests = new ArrayList<>(); + @XmlElementWrapper(name = "newDataTables") + @XmlElement(name = "dataTable") + private List newScmResourceFiles = new ArrayList<>(); + + @XmlElementWrapper(name = "deletedDataTables") + @XmlElement(name = "dataTable") + private List deletedScmResourceFiles = new ArrayList<>(); + + @XmlElementWrapper(name = "updatedDataTables") + @XmlElement(name = "dataTable") + private List updatedScmResourceFiles = new ArrayList<>(); + + @XmlAttribute - private String scmResourceId; + private String scmRepositoryId; @XmlAttribute private String workspaceId; @XmlAttribute - private boolean initialDetection; + private boolean fullScan; public List getNewTests() { return newTests; @@ -57,12 +77,12 @@ public List getUpdatedTests() { return updatedTests; } - public String getScmResourceId() { - return scmResourceId; + public String getScmRepositoryId() { + return scmRepositoryId; } - public void setScmResourceId(String scmResourceId) { - this.scmResourceId = scmResourceId; + public void setScmRepositoryId(String scmRepositoryId) { + this.scmRepositoryId = scmRepositoryId; } public String getWorkspaceId() { @@ -73,15 +93,29 @@ public void setWorkspaceId(String workspaceId) { this.workspaceId = workspaceId; } - public boolean isInitialDetection() { - return initialDetection; + public boolean isFullScan() { + return fullScan; } - public void setInitialDetection(boolean initialDetection) { - this.initialDetection = initialDetection; + public void setFullScan(boolean fullScan) { + this.fullScan = fullScan; } - public boolean hasChanges(){ - return !getNewTests().isEmpty() || !getUpdatedTests().isEmpty(); + public boolean hasChanges() { + return !getNewTests().isEmpty() || !getUpdatedTests().isEmpty() || !getDeletedTests().isEmpty() + || !getNewScmResourceFiles().isEmpty() || !getDeletedScmResourceFiles().isEmpty() || !getUpdatedScmResourceFiles().isEmpty(); } + + public List getNewScmResourceFiles() { + return newScmResourceFiles; + } + + public List getDeletedScmResourceFiles() { + return deletedScmResourceFiles; + } + + public List getUpdatedScmResourceFiles() { + return updatedScmResourceFiles; + } + } \ No newline at end of file diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java index f36bc23d30..28b16ef2db 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -19,12 +19,10 @@ import com.hp.application.automation.tools.octane.actions.UFTTestUtil; import com.hp.application.automation.tools.octane.actions.UftTestType; import com.hp.application.automation.tools.octane.actions.dto.AutomatedTest; +import com.hp.application.automation.tools.octane.actions.dto.ScmResourceFile; import hudson.ExtensionList; import hudson.FilePath; -import hudson.model.AbstractBuild; -import hudson.model.BuildListener; -import hudson.model.Run; -import hudson.model.TaskListener; +import hudson.model.*; import hudson.plugins.git.GitChangeSet; import hudson.scm.ChangeLogSet; import hudson.scm.EditType; @@ -49,31 +47,49 @@ public class UFTTestDetectionService { private static final String DETECTION_RESULT_FILE = "detection_result.xml"; private static final String STFileExtention = ".st";//api test private static final String QTPFileExtention = ".tsp";//gui test + private static final String XLSXExtention = ".xlsx";//excel file + private static final String XLSExtention = ".xls";//excel file + private static final String windowsPathSplitter = "\\"; + private static final String linuxPathSplitter = "/"; - public static UFTTestDetectionResult startScanning(AbstractBuild build, String workspaceId, String scmResourceId, BuildListener buildListener) { + + public static UFTTestDetectionResult startScanning(AbstractBuild build, String workspaceId, String scmRepositoryId, BuildListener buildListener) { ChangeLogSet changeSet = build.getChangeSet(); Object[] changeSetItems = changeSet.getItems(); UFTTestDetectionResult result = null; try { - boolean initialDetection = !initialDetectionFileExist(build.getWorkspace()); - if (initialDetection) { + boolean fullScan = build.getId().equals("1") || !initialDetectionFileExist(build.getWorkspace()) || isFullScan((build)); + if (fullScan) { printToConsole(buildListener, "Executing initial detection"); result = doInitialDetection(build.getWorkspace()); } else { printToConsole(buildListener, "Executing changeSet detection"); result = doChangeSetDetection(changeSetItems, build.getWorkspace()); removeTestDuplicated(result.getUpdatedTests()); + removeFalsePositiveDeletedDataTables(result.getDeletedTests(), result.getDeletedScmResourceFiles()); } - printToConsole(buildListener, String.format("Found %s new tests", result.getNewTests().size())); - printToConsole(buildListener, String.format("Found %s updated tests", result.getUpdatedTests().size())); - + if (!result.getNewTests().isEmpty()) { + printToConsole(buildListener, String.format("Found %s new tests", result.getNewTests().size())); + } + if (!result.getUpdatedTests().isEmpty()) { + printToConsole(buildListener, String.format("Found %s updated tests", result.getUpdatedTests().size())); + } + if (!result.getDeletedTests().isEmpty()) { + printToConsole(buildListener, String.format("Found %s deleted tests", result.getDeletedTests().size())); + } + if (!result.getNewScmResourceFiles().isEmpty()) { + printToConsole(buildListener, String.format("Found %s new data tables", result.getNewScmResourceFiles().size())); + } + if (!result.getDeletedScmResourceFiles().isEmpty()) { + printToConsole(buildListener, String.format("Found %s deleted data tables", result.getDeletedScmResourceFiles().size())); + } - result.setScmResourceId(scmResourceId); + result.setScmRepositoryId(scmRepositoryId); result.setWorkspaceId(workspaceId); - result.setInitialDetection(initialDetection); + result.setFullScan(fullScan); sortTests(result.getNewTests()); sortTests(result.getUpdatedTests()); publishDetectionResults(build, buildListener, result); @@ -82,6 +98,7 @@ public static UFTTestDetectionResult startScanning(AbstractBuild build, St UftTestDiscoveryDispatcher dispatcher = getExtension(UftTestDiscoveryDispatcher.class); dispatcher.enqueueResult(build.getProject().getName(), build.getNumber()); } + createInitialDetectionFile(build.getWorkspace()); } catch (InterruptedException | IOException e) { e.printStackTrace(); @@ -90,6 +107,45 @@ public static UFTTestDetectionResult startScanning(AbstractBuild build, St return result; } + /** + * Deleted data table might be part of deleted test. During discovery its very hard to know. + * Here we pass through all deleted data tables, if we found table parent is test package - we know that the delete was part of test delete + * + * @param deletedTests + * @param deletedScmResourceFiles + */ + private static void removeFalsePositiveDeletedDataTables(List deletedTests, List deletedScmResourceFiles) { + if (!deletedScmResourceFiles.isEmpty() && !deletedTests.isEmpty()) { + + List falsePositive = new ArrayList<>(); + for (ScmResourceFile item : deletedScmResourceFiles) { + int parentSplitterIndex = item.getRelativePath().lastIndexOf(windowsPathSplitter); + if (parentSplitterIndex != -1) { + String parentName = item.getRelativePath().substring(0, parentSplitterIndex); + for (AutomatedTest test : deletedTests) { + String testPath = test.getPackage() + windowsPathSplitter + test.getName(); + if (testPath.equals(parentName)) { + falsePositive.add(item); + break; + } + } + } + } + deletedScmResourceFiles.removeAll(falsePositive); + } + } + + private static boolean isFullScan(AbstractBuild build) { + ParametersAction parameters = build.getAction(ParametersAction.class); + if (parameters != null) { + ParameterValue parameterValue = parameters.getParameter(TestExecutionJobCreatorService.FULL_SCAN_PARAMETER_NAME); + if (parameterValue != null) { + return (Boolean) parameterValue.getValue(); + } + } + return false; + } + private static void sortTests(List newTests) { Collections.sort(newTests, new Comparator() { @Override @@ -143,24 +199,40 @@ private static UFTTestDetectionResult doChangeSetDetection(Object[] changeSetIte for (int i = 0; i < changeSetItems.length; i++) { GitChangeSet changeSet = (GitChangeSet) changeSetItems[i]; for (GitChangeSet.Path path : changeSet.getPaths()) { + String fileFullPath = workspace + File.separator + path.getPath(); if (isTestMainFilePath(path.getPath())) { - String filePath = workspace + File.separator + path.getPath(); if (EditType.ADD.equals(path.getEditType())) { - if (isFileExist(filePath)) { - FilePath testFolder = getTestFolderForTestMainFile(filePath); - scanFileSystemRecursively(workspace, testFolder, result.getNewTests()); + if (isFileExist(fileFullPath)) { + FilePath testFolder = getTestFolderForTestMainFile(fileFullPath); + scanFileSystemRecursively(workspace, testFolder, result.getNewTests(), result.getNewScmResourceFiles()); } } else if (EditType.DELETE.equals(path.getEditType())) { - if (!isFileExist(filePath)) { - FilePath testFolder = getTestFolderForTestMainFile(filePath); - AutomatedTest test = createAutomatedTest(workspace, testFolder); + if (!isFileExist(fileFullPath)) { + FilePath testFolder = getTestFolderForTestMainFile(fileFullPath); + AutomatedTest test = createAutomatedTest(workspace, testFolder, null, false); result.getDeletedTests().add(test); } } else if (EditType.EDIT.equals(path.getEditType())) { - if (isFileExist(filePath)) { - FilePath testFolder = getTestFolderForTestMainFile(filePath); - scanFileSystemRecursively(workspace, testFolder, result.getUpdatedTests()); + if (isFileExist(fileFullPath)) { + FilePath testFolder = getTestFolderForTestMainFile(fileFullPath); + scanFileSystemRecursively(workspace, testFolder, result.getUpdatedTests(), result.getUpdatedScmResourceFiles()); + } + } + } else if (isUftDataTableFile(path.getPath())) { + FilePath filePath = new FilePath(new File(fileFullPath)); + if (EditType.ADD.equals(path.getEditType())) { + UftTestType testType = isUftTestFolder(filePath.getParent().list()); + if (testType.isNone()) { + if (filePath.exists()) { + ScmResourceFile resourceFile = createDataTable(workspace, filePath); + result.getNewScmResourceFiles().add(resourceFile); + } + } + } else if (EditType.DELETE.equals(path.getEditType())) { + if (!filePath.exists()) { + ScmResourceFile resourceFile = createDataTable(workspace, filePath); + result.getDeletedScmResourceFiles().add(resourceFile); } } } @@ -170,20 +242,37 @@ private static UFTTestDetectionResult doChangeSetDetection(Object[] changeSetIte return result; } - private static AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath) throws IOException, InterruptedException { + private static AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath, UftTestType testType, boolean executable) throws IOException, InterruptedException { AutomatedTest test = new AutomatedTest(); test.setName(dirPath.getName()); - //set component - relative path from root - String testPath = dirPath.toURI().toString(); - String rootPath = root.toURI().toString(); - String path = testPath.replace(rootPath, ""); - path = StringUtils.strip(path, "\\/"); - String _package = path.length() != dirPath.getName().length() ? path.substring(0, path.length() - dirPath.getName().length() - 1) : ""; - test.setPackage(_package); + + String relativePath = getRelativePath(root, dirPath); + String packageName = relativePath.length() != dirPath.getName().length() ? relativePath.substring(0, relativePath.length() - dirPath.getName().length() - 1) : ""; + test.setPackage(packageName); + test.setExecutable(executable); + + if (testType != null && !testType.isNone()) { + test.setUftTestType(testType); + } + + String description = UFTTestUtil.getTestDescription(dirPath); + test.setDescription(description); + return test; } + private static String getRelativePath(FilePath root, FilePath path) throws IOException, InterruptedException { + String testPath = path.getRemote(); + String rootPath = root.getRemote(); + String relativePath = testPath.replace(rootPath, ""); + relativePath = StringUtils.strip(relativePath, windowsPathSplitter + linuxPathSplitter); + //we want all paths will be in sindows style, because tests are run in windows, therefore we replace all linux splitters (/) by windows one (\) + //http://stackoverflow.com/questions/23869613/how-to-replace-one-or-more-in-string-with-just + relativePath = relativePath.replaceAll(linuxPathSplitter, windowsPathSplitter + windowsPathSplitter);//str.replaceAll("/", "\\\\"); + return relativePath; + } + private static boolean isFileExist(String path) { File file = new File(path); return file.exists(); @@ -200,7 +289,7 @@ private static boolean initialDetectionFileExist(FilePath workspace) { } } - public static void createInitialDetectionFile(FilePath workspace) { + private static void createInitialDetectionFile(FilePath workspace) { try { File rootFile = new File(workspace.toURI()); File file = new File(rootFile, INITIAL_DETECTION_FILE); @@ -210,7 +299,7 @@ public static void createInitialDetectionFile(FilePath workspace) { } } - public static void removeInitialDetectionFlag(FilePath workspace) { + /*private static void removeInitialDetectionFlag(FilePath workspace) { try { File rootFile = new File(workspace.toURI()); File file = new File(rootFile, INITIAL_DETECTION_FILE); @@ -218,35 +307,47 @@ public static void removeInitialDetectionFlag(FilePath workspace) { } catch (IOException | InterruptedException e) { logger.error("Failed to removeInitialDetectionFlag"); } - } + }*/ private static UFTTestDetectionResult doInitialDetection(FilePath workspace) throws IOException, InterruptedException { UFTTestDetectionResult result = new UFTTestDetectionResult(); - scanFileSystemRecursively(workspace, workspace, result.getNewTests()); + scanFileSystemRecursively(workspace, workspace, result.getNewTests(), result.getNewScmResourceFiles()); return result; } - private static void scanFileSystemRecursively(FilePath root, FilePath dirPath, List foundTests) throws IOException, InterruptedException { - List paths = dirPath.list(); + private static void scanFileSystemRecursively(FilePath root, FilePath dirPath, List foundTests, List foundResources) throws IOException, InterruptedException { + List paths = dirPath.isDirectory() ? dirPath.list() : Arrays.asList(dirPath); //if it test folder - create new test, else drill down to subFolders UftTestType testType = isUftTestFolder(paths); if (!testType.isNone()) { - AutomatedTest test = createAutomatedTest(root, dirPath); - test.setUftTestType(testType); - String description = UFTTestUtil.getTestDescription(dirPath); - test.setDescription(description); + AutomatedTest test = createAutomatedTest(root, dirPath, testType, true); foundTests.add(test); } else { for (FilePath path : paths) { if (path.isDirectory()) { - scanFileSystemRecursively(root, path, foundTests); + scanFileSystemRecursively(root, path, foundTests, foundResources); + } else if (isUftDataTableFile(path.getName())) { + ScmResourceFile dataTable = createDataTable(root, path); + foundResources.add(dataTable); } } } } + private static ScmResourceFile createDataTable(FilePath root, FilePath path) throws IOException, InterruptedException { + ScmResourceFile resourceFile = new ScmResourceFile(); + resourceFile.setName(path.getName()); + resourceFile.setRelativePath(getRelativePath(root, path)); + return resourceFile; + + } + + private static boolean isUftDataTableFile(String path) { + return path.endsWith(XLSXExtention) || path.endsWith(XLSExtention); + } + private static UftTestType isUftTestFolder(List paths) { for (FilePath path : paths) { if (path.getName().endsWith(STFileExtention)) { diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java index bc3cf56248..858e4dabaf 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java @@ -16,20 +16,25 @@ package com.hp.application.automation.tools.octane.executor; +import com.google.inject.Inject; +import com.hp.application.automation.tools.octane.actions.UFTTestDetectionPublisher; +import com.hp.application.automation.tools.octane.configuration.ConfigurationService; +import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; import com.hp.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; +import com.hp.mqm.client.MqmRestClient; +import com.hp.mqm.client.QueryHelper; +import com.hp.mqm.client.model.Entity; +import com.hp.mqm.client.model.PagedList; import hudson.Extension; -import hudson.model.FreeStyleProject; -import hudson.model.ParametersDefinitionProperty; -import hudson.model.PeriodicWork; -import hudson.model.TaskListener; +import hudson.model.*; import jenkins.model.Jenkins; +import org.apache.commons.collections.map.HashedMap; import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.IOException; -import java.util.Date; -import java.util.List; +import java.util.*; /** @@ -40,7 +45,8 @@ public class UftJobCleaner extends AbstractSafeLoggingAsyncPeriodWork { private static Logger logger = LogManager.getLogger(UftJobCleaner.class); - + private ConfigurationService configurationService; + private static String EXECUTORS_COLLECTION_NAME = "executors"; public UftJobCleaner() { super("Uft Job Cleaner"); @@ -74,8 +80,13 @@ private long getOutdateThreshold() { @Override protected void doExecute(TaskListener listener) throws IOException, InterruptedException { List jobs = Jenkins.getInstance().getAllItems(FreeStyleProject.class); - long thresholdTimeInMillis = new Date().getTime() - PeriodicWork.DAY * getOutdateThreshold(); + clearExecutionJobs(jobs); + clearDiscoveryJobs(jobs); + } + + private void clearExecutionJobs(List jobs) { + long thresholdTimeInMillis = new Date().getTime() - PeriodicWork.DAY * getOutdateThreshold(); int clearCounter = 0; for (FreeStyleProject job : jobs) { if (isExecutorJob(job) && job.getLastBuild() != null && !job.isBuilding()) { @@ -92,18 +103,118 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE } } - logger.warn(String.format("Cleaner found %s outdated job", clearCounter)); + logger.warn(String.format("Cleaner found %s outdated execution job", clearCounter)); } private boolean isExecutorJob(FreeStyleProject job) { ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); - if (parameters != null && + boolean isExecutorJob = job.getName().contains("execution job") && + parameters != null && parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_ID_PARAMETER_NAME) != null && - parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_RUN_ID_PARAMETER_NAME) != null) { - return true; + parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_RUN_ID_PARAMETER_NAME) != null; + + return isExecutorJob; + } + + + private boolean isDiscoveryJobJob(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + boolean isDiscoveryJob = job.getName().contains("discovery job") && + parameters != null && + parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_ID_PARAMETER_NAME) != null; + return isDiscoveryJob; + } + + private void clearDiscoveryJobs(List jobs) { + + //Generally, after deleting executor in Octane, relevant job in Jenkins is also deleted. But if jenkins was down during delete of executor, job remains + //This method handle orphan job that doesn't hava mathing executors in Octane + //1. build map of discovery jobs per workspace + //2. Loop by workspace + //2.1 Get from octane executors in workspace + //2.2 If some discovery job exist that doesn't have matching executor - remove it from Jenkins + + Map> workspace2executorId2DiscoveryJobMap = new HashMap<>(); + for (FreeStyleProject job : jobs) { + if (isDiscoveryJobJob(job)) { + Long executorId = getExecutorId(job); + Long workspaceId = getOctaneWorkspaceId(job); + if (executorId != null && workspaceId != null) { + if (!workspace2executorId2DiscoveryJobMap.containsKey(workspaceId)) { + workspace2executorId2DiscoveryJobMap.put(workspaceId, new HashedMap()); + } + workspace2executorId2DiscoveryJobMap.get(workspaceId).put(executorId, job); + } + } } - return false; + + if (!workspace2executorId2DiscoveryJobMap.isEmpty()) { + ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); + MqmRestClient client = configurationService.createClient(serverConfiguration); + if (client != null) { + int deleteCounter = 0; + for (Long workspaceId : workspace2executorId2DiscoveryJobMap.keySet()) { + Map discoveryJobs = workspace2executorId2DiscoveryJobMap.get(workspaceId); + List conditions = new ArrayList<>(); + conditions.add(QueryHelper.conditionIn("id", discoveryJobs.keySet(), true)); + try { + PagedList entities = client.getEntities(workspaceId, EXECUTORS_COLLECTION_NAME, conditions, Arrays.asList("id")); + Set octaneExecutorIds = new HashSet<>(); + for (Entity executor : entities.getItems()) { + octaneExecutorIds.add(executor.getId()); + } + for (Long jobExecutorId : discoveryJobs.keySet()) { + if (!octaneExecutorIds.contains(jobExecutorId)) { + //found discovery job that is not related to any executor in Octane + FreeStyleProject job = discoveryJobs.get(jobExecutorId); + try { + logger.warn(String.format("Job %s is going to be deleted as is doesn't have matching executor in Octane in workspace %s", job.getName(), workspaceId)); + deleteCounter++; + job.delete(); + + } catch (Exception e) { + logger.warn(String.format("Failed to delete job %s : %s", job.getName(), e.getMessage())); + } + + } + } + } catch (Exception e) { + //on exception - do nothing and skip to next workspace + logger.warn(String.format("Failed to get executors from workspace %s : %s", workspaceId, e.getMessage())); + continue; + } + } + logger.warn(String.format("Cleaner found %s not-related discovery job", deleteCounter)); + } + } + } + + + private Long getExecutorId(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + ParameterDefinition pd = parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_ID_PARAMETER_NAME); + String value = (String) pd.getDefaultParameterValue().getValue(); + return Long.valueOf(value); } + private Long getOctaneWorkspaceId(FreeStyleProject job) { + + UFTTestDetectionPublisher uftTestDetectionPublisher = null; + List publishers = job.getPublishersList(); + for (Object publisher : publishers) { + if (publisher instanceof UFTTestDetectionPublisher) { + uftTestDetectionPublisher = (UFTTestDetectionPublisher) publisher; + String workspaceId = uftTestDetectionPublisher.getWorkspaceName(); + return Long.valueOf(workspaceId); + } + } + + return null; + } + + @Inject + public void setConfigurationService(ConfigurationService configurationService) { + this.configurationService = configurationService; + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java index ec5645e2e4..1b6f20066a 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java @@ -17,24 +17,20 @@ package com.hp.application.automation.tools.octane.executor; import com.google.inject.Inject; +import com.hp.application.automation.tools.common.HttpStatus; import com.hp.application.automation.tools.octane.ResultQueue; import com.hp.application.automation.tools.octane.actions.UftTestType; import com.hp.application.automation.tools.octane.actions.dto.*; -import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; -import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactoryImpl; import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; import com.hp.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.exception.LoginException; +import com.hp.mqm.client.QueryHelper; import com.hp.mqm.client.exception.RequestErrorException; -import com.hp.mqm.client.exception.RequestException; -import com.hp.mqm.client.exception.SharedSpaceNotExistException; +import com.hp.mqm.client.model.Entity; import com.hp.mqm.client.model.ListItem; import com.hp.mqm.client.model.PagedList; -import com.hp.mqm.client.model.Test; import hudson.Extension; -import hudson.model.AbstractBuild; import hudson.model.Job; import hudson.model.Run; import hudson.model.TaskListener; @@ -64,10 +60,13 @@ public class UftTestDiscoveryDispatcher extends AbstractSafeLoggingAsyncPeriodWork { private static Logger logger = LogManager.getLogger(UftTestDiscoveryDispatcher.class); - private final static int RESPONSE_STATUS_CONFLICT = 409; + private final static String TESTS_COLLECTION_NAME = "automated_tests"; + private final static String SCM_RESOURCE_FILES_COLLECTION_NAME = "scm_resource_files"; + + private final static int BULK_SIZE = 100; private UftTestDiscoveryQueue queue; - private JenkinsMqmRestClientFactory clientFactory; + private ConfigurationService configurationService; public UftTestDiscoveryDispatcher() { super("Uft Test Discovery Dispatcher"); @@ -81,82 +80,107 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE } logger.warn("Queue size " + queue.size()); - //logger.info("... done, left to send " + events.size() + " events"); ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - MqmRestClient client = createClient(serverConfiguration); + MqmRestClient client = configurationService.createClient(serverConfiguration); + if (client == null) { + logger.warn("There are pending discovered UFT tests, but MQM server configuration is not valid, results can't be submitted"); return; } - ResultQueue.QueueItem item; - while ((item = queue.peekFirst()) != null) { + ResultQueue.QueueItem item = null; + try { + while ((item = queue.peekFirst()) != null) { - Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); - if (project == null) { - logger.warn("Project [" + item.getProjectName() + "] no longer exists, pending discovered tests can't be submitted"); - queue.remove(); - continue; - } + Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + if (project == null) { + logger.warn("Project [" + item.getProjectName() + "] no longer exists, pending discovered tests can't be submitted"); + queue.remove(); + continue; + } - Run build = project.getBuildByNumber(item.getBuildNumber()); - if (build == null) { - logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer exists, pending discovered tests can't be submitted"); - queue.remove(); - continue; - } + Run build = project.getBuildByNumber(item.getBuildNumber()); + if (build == null) { + logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer exists, pending discovered tests can't be submitted"); + queue.remove(); + continue; + } + + UFTTestDetectionResult result = UFTTestDetectionService.readDetectionResults(build); + if (result == null) { + logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer contains valid detection result file"); + queue.remove(); + continue; + } - UFTTestDetectionResult result = UFTTestDetectionService.readDetectionResults(build); - if (result == null) { - logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer contains valid detection result file"); + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "]"); + dispatchDetectionResults(item, client, result); queue.remove(); - continue; } - - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "]"); - dispatchDetectionResults(item, client, serverConfiguration, result); - if (result.isInitialDetection()) { - UFTTestDetectionService.createInitialDetectionFile(((AbstractBuild) build).getWorkspace()); + } catch (Exception e) { + if (item != null) { + item.incrementFailCount(); + int maxTrial = 5; + if (item.incrementFailCount() > maxTrial) { + queue.remove(); + logger.warn("Failed to persist discovery of [" + item.getProjectName() + "#" + item.getBuildNumber() + "] after " + maxTrial + " trials"); + } } - queue.remove(); } } - private void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient client, ServerConfiguration serverConfiguration, UFTTestDetectionResult result) throws UnsupportedEncodingException { - String serverURL = getServerURL(result.getWorkspaceId(), serverConfiguration.sharedSpace, serverConfiguration.location); + private void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient client, UFTTestDetectionResult result) throws UnsupportedEncodingException { //post new tests if (!result.getNewTests().isEmpty()) { - boolean posted = postTests(client, serverURL, result.getNewTests(), result.getWorkspaceId(), result.getScmResourceId()); + boolean posted = postTests(client, result.getNewTests(), result.getWorkspaceId(), result.getScmRepositoryId()); logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getNewTests().size() + " new tests posted successfully = " + posted); } - //post updated + //post test updated if (!result.getUpdatedTests().isEmpty()) { - boolean updated = updateTests(client, result.getUpdatedTests(), result.getWorkspaceId()); + boolean updated = updateTests(client, result.getUpdatedTests(), result.getWorkspaceId(), result.getScmRepositoryId()); logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getUpdatedTests().size() + " updated tests posted successfully = " + updated); } + + //post test deleted + if (!result.getDeletedTests().isEmpty()) { + boolean updated = setTestsNotExecutable(client, result.getDeletedTests(), result.getWorkspaceId()); + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getDeletedTests().size() + " deleted tests set as not executable successfully = " + updated); + } + + //post scm resources + if (!result.getNewScmResourceFiles().isEmpty()) { + boolean posted = postScmResources(client, result.getNewScmResourceFiles(), result.getWorkspaceId(), result.getScmRepositoryId()); + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getNewScmResourceFiles().size() + " new scmResources posted successfully = " + posted); + } + + //delete scm resources + if (!result.getDeletedScmResourceFiles().isEmpty()) { + boolean posted = deleteScmResources(client, result.getDeletedScmResourceFiles(), result.getWorkspaceId(), result.getScmRepositoryId()); + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getDeletedScmResourceFiles().size() + " scmResources deleted successfully = " + posted); + } + } - private static boolean postTests(MqmRestClient client, String serverURL, List tests, String workspaceId, String scmResourceId) throws UnsupportedEncodingException { + private static boolean postTests(MqmRestClient client, List tests, String workspaceId, String scmRepositoryId) throws UnsupportedEncodingException { if (!tests.isEmpty()) { try { - completeTestProperties(client, Long.parseLong(workspaceId), tests, scmResourceId); + completeTestProperties(client, Long.parseLong(workspaceId), tests, scmRepositoryId); } catch (RequestErrorException e) { logger.error("Failed to completeTestProperties : " + e.getMessage()); return false; } - int BULK_SIZE = 100; for (int i = 0; i < tests.size(); i += BULK_SIZE) try { AutomatedTests data = AutomatedTests.createWithTests(tests.subList(i, Math.min(i + BULK_SIZE, tests.size()))); String uftTestJson = convertToJsonString(data); - client.postTest(uftTestJson, null, serverURL); - //JSONObject testObject = (JSONObject) jsonObject.getJSONArray("data").get(0); + client.postEntities(Long.parseLong(workspaceId), TESTS_COLLECTION_NAME, uftTestJson); } catch (RequestErrorException e) { - if (e.getStatusCode() != RESPONSE_STATUS_CONFLICT) { + if (e.getStatusCode() != HttpStatus.CONFLICT.getCode()) { logger.error("Failed to postTests to Octane : " + e.getMessage()); return false; } @@ -167,14 +191,38 @@ private static boolean postTests(MqmRestClient client, String serverURL, List resources, String workspaceId, String scmResourceId) throws UnsupportedEncodingException { + + if (!resources.isEmpty()) { + try { + completeScmResourceProperties(resources, scmResourceId); + } catch (RequestErrorException e) { + logger.error("Failed to completeTestProperties : " + e.getMessage()); + return false; + } + + for (int i = 0; i < resources.size(); i += BULK_SIZE) + try { + ScmResources data = ScmResources.createWithItems(resources.subList(i, Math.min(i + BULK_SIZE, resources.size()))); + String uftTestJson = convertToJsonString(data); + + client.postEntities(Long.parseLong(workspaceId), SCM_RESOURCE_FILES_COLLECTION_NAME, uftTestJson); + + } catch (RequestErrorException e) { + if (e.getStatusCode() != HttpStatus.CONFLICT.getCode()) { + logger.error("Failed to post scm resource files to Octane : " + e.getMessage()); + return false; + } + + //else : the file with the same hash code , so do nothing + } + } + return true; } - private static String convertToJsonString(AutomatedTest test) { + private static String convertToJsonString(Object data) { JsonConfig config = getJsonConfig(); - return JSONObject.fromObject(test, config).toString(); + return JSONObject.fromObject(data, config).toString(); } private static JsonConfig getJsonConfig() { @@ -202,6 +250,25 @@ public String processPropertyName(Class className, String fieldName) { } }); + config.registerJsonPropertyNameProcessor(ScmResourceFile.class, new PropertyNameProcessor() { + + @Override + public String processPropertyName(Class className, String fieldName) { + String result = fieldName; + switch (fieldName) { + case "relativePath": + result = "relative_path"; + break; + case "scmRepository": + result = "scm_repository"; + break; + default: + break; + } + return result; + } + }); + //filter empty fields PropertyFilter pf = new PropertyFilter() { public boolean apply(Object source, String name, Object value) { @@ -237,42 +304,105 @@ public boolean apply(Object source, String name, Object value) { } }*/ - private static boolean updateTests(MqmRestClient client, Collection updateTests, String workspaceId) throws UnsupportedEncodingException { + private static boolean setTestsNotExecutable(MqmRestClient client, Collection deletedTest, String workspaceId) throws UnsupportedEncodingException { long workspaceIdAsLong = Long.parseLong(workspaceId); try { + for (AutomatedTest test : deletedTest) { + List conditions = new ArrayList<>(); + conditions.add(QueryHelper.condition("name", test.getName())); + conditions.add(QueryHelper.condition("package", test.getPackage())); + PagedList foundTests = client.getEntities(workspaceIdAsLong, TESTS_COLLECTION_NAME, conditions, Arrays.asList("id")); + if (foundTests.getItems().size() == 1) { + Entity foundTest = foundTests.getItems().get(0); + AutomatedTest testForUpdate = new AutomatedTest(); + testForUpdate.setExecutable(false); + testForUpdate.setId(foundTest.getId()); + String json = convertToJsonString(testForUpdate); + client.updateEntity(Long.parseLong(workspaceId), TESTS_COLLECTION_NAME, foundTests.getItems().get(0).getId(), json); + } + } + return true; + + } catch (Exception e) { + return false; + } + } + + private static boolean updateTests(MqmRestClient client, Collection updateTests, String workspaceId, String scmRepositoryId) throws UnsupportedEncodingException { + long workspaceIdAsLong = Long.parseLong(workspaceId); + + try { + List createAsNewTests = new ArrayList<>(); for (AutomatedTest test : updateTests) { if (StringUtils.isEmpty(test.getDescription())) { continue; } - Map queryFields = new HashMap<>(); - queryFields.put("name", test.getName()); - queryFields.put("package", test.getPackage()); - PagedList foundTests = client.getTests(workspaceIdAsLong, queryFields, Arrays.asList("id, description")); + + List conditions = new ArrayList<>(); + conditions.add(QueryHelper.condition("name", test.getName())); + conditions.add(QueryHelper.condition("package", test.getPackage())); + PagedList foundTests = client.getEntities(workspaceIdAsLong, TESTS_COLLECTION_NAME, conditions, Arrays.asList("id")); if (foundTests.getItems().size() == 1) { - Test foundTest = foundTests.getItems().get(0); + Entity foundTest = foundTests.getItems().get(0); AutomatedTest testForUpdate = new AutomatedTest(); - testForUpdate.setSubtype(null); testForUpdate.setDescription(test.getDescription()); + testForUpdate.setExecutable(test.getExecutable()); testForUpdate.setId(foundTest.getId()); String json = convertToJsonString(testForUpdate); - client.updateTest(Long.parseLong(workspaceId), foundTests.getItems().get(0).getId(), json); + client.updateEntity(Long.parseLong(workspaceId), TESTS_COLLECTION_NAME, foundTests.getItems().get(0).getId(), json); + } else if (foundTests.getItems().size() == 0) { + //test not exist in Octane, create it from scratch + logger.error(String.format("Test %s\\%s should be updated but wasn't found on Octane, creating test from scratch ", test.getPackage(), test.getName())); + createAsNewTests.add(test); + } } + + + if (!createAsNewTests.isEmpty()) { + return postTests(client, createAsNewTests, workspaceId, scmRepositoryId); + } else { + return true; + } + } catch (Exception e) { + return false; + } + } + + private boolean deleteScmResources(MqmRestClient client, List deletedResourceFiles, String workspaceId, String scmRepositoryId) { + + long workspaceIdAsLong = Long.parseLong(workspaceId); + Set deletedIds = new HashSet<>(); + try { + for (ScmResourceFile scmResource : deletedResourceFiles) { + List conditions = new ArrayList<>(); + conditions.add(QueryHelper.condition("relative_path", scmResource.getRelativePath())); + conditions.add(QueryHelper.conditionRef("scm_repository", Long.valueOf(scmRepositoryId))); + + PagedList foundResources = client.getEntities(workspaceIdAsLong, SCM_RESOURCE_FILES_COLLECTION_NAME, conditions, Arrays.asList("id, name")); + if (foundResources.getItems().size() == 1) { + Entity found = foundResources.getItems().get(0); + deletedIds.add(found.getId()); + } + } + + client.deleteEntities(Long.parseLong(workspaceId), SCM_RESOURCE_FILES_COLLECTION_NAME, deletedIds); return true; } catch (Exception e) { return false; } + } - private static void completeTestProperties(MqmRestClient client, long workspaceId, Collection tests, String scmResourceId) { + private static void completeTestProperties(MqmRestClient client, long workspaceId, Collection tests, String scmRepositoryId) { ListNodeEntity uftTestingTool = getUftTestingTool(client, workspaceId); ListNodeEntity uftFramework = getUftFramework(client, workspaceId); ListNodeEntity guiTestType = hasTestsByType(tests, UftTestType.GUI) ? getGuiTestType(client, workspaceId) : null; ListNodeEntity apiTestType = hasTestsByType(tests, UftTestType.API) ? getApiTestType(client, workspaceId) : null; - BaseRefEntity scmRepository = StringUtils.isEmpty(scmResourceId) ? null : BaseRefEntity.create("scm_repository", Long.valueOf(scmResourceId)); + BaseRefEntity scmRepository = StringUtils.isEmpty(scmRepositoryId) ? null : BaseRefEntity.create("scm_repository", Long.valueOf(scmRepositoryId)); for (AutomatedTest test : tests) { test.setTestingToolType(uftTestingTool); test.setFramework(uftFramework); @@ -286,6 +416,13 @@ private static void completeTestProperties(MqmRestClient client, long workspaceI } } + private static void completeScmResourceProperties(List resources, String scmResourceId) { + BaseRefEntity scmRepository = StringUtils.isEmpty(scmResourceId) ? null : BaseRefEntity.create("scm_repository", Long.valueOf(scmResourceId)); + for (ScmResourceFile resource : resources) { + resource.setScmRepository(scmRepository); + } + } + private static ListNodeEntity getUftTestingTool(MqmRestClient client, long workspaceId) { PagedList testingTools = client.queryListItems("list_node.testing_tool_type", null, workspaceId, 0, 100); String uftTestingToolLogicalName = "list_node.testing_tool_type.uft"; @@ -334,37 +471,6 @@ private static ListNodeEntity getApiTestType(MqmRestClient client, long workspac return null; } - private static String getServerURL(String workspaceId, String sharedspaceId, String location) { - return location + "/api/shared_spaces/" + sharedspaceId + "/workspaces/" + workspaceId; - } - - private MqmRestClient createClient(ServerConfiguration serverConfiguration) { - - if (!serverConfiguration.isValid()) { - logger.warn("There are pending discovered UFT tests, but MQM server configuration is not valid, results can't be submitted"); - return null; - } - - MqmRestClient client = clientFactory.obtain( - serverConfiguration.location, - serverConfiguration.sharedSpace, - serverConfiguration.username, - serverConfiguration.password); - - try { - client.validateConfigurationWithoutLogin(); - return client; - } catch (SharedSpaceNotExistException e) { - logger.warn("Invalid shared space"); - } catch (LoginException e) { - logger.warn("Login failed : " + e.getMessage()); - } catch (RequestException e) { - logger.warn("Problem with communication with MQM server : " + e.getMessage()); - } - - return null; - } - @Override public long getRecurrencePeriod() { String value = System.getProperty("UftTestDiscoveryDispatcher.Period"); // let's us config the recurrence period. default is 60 seconds. @@ -380,8 +486,8 @@ public void setTestResultQueue(UftTestDiscoveryQueue queue) { } @Inject - public void setMqmRestClientFactory(JenkinsMqmRestClientFactoryImpl clientFactory) { - this.clientFactory = clientFactory; + public void setConfigurationService(ConfigurationService configurationService) { + this.configurationService = configurationService; } private static boolean hasTestsByType(Collection tests, UftTestType uftTestType) { diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/build/MavenBuildExtension.java b/src/main/java/com/hp/application/automation/tools/octane/tests/build/MavenBuildExtension.java index d7dc132f3b..fca4d3be18 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/build/MavenBuildExtension.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/build/MavenBuildExtension.java @@ -32,7 +32,7 @@ public boolean supports(Run build) { @Override public BuildDescriptor getBuildType(Run build) { return new BuildDescriptor( - ((AbstractBuild)build).getRootBuild().getProject().getName(), + BuildHandlerUtils.getJobCiId(build), ((AbstractBuild)build).getProject().getName(), String.valueOf(build.getNumber()), String.valueOf(build.getNumber()), @@ -45,7 +45,7 @@ public String getProjectFullName(Run build) { // we don't push individual maven module results (although we create the file) return null; } else { - return ((AbstractBuild)build).getProject().getName(); + return ((AbstractBuild)build).getProject().getFullName(); } } } diff --git a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java index 5764c8e9b3..e7702692a3 100644 --- a/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/RunFromFileBuilder.java @@ -329,8 +329,6 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn throws InterruptedException, IOException { - runFromFileModel.setWorkspace(workspace); - // get the mc server settings MCServerSettingsModel mcServerSettingsModel = getMCServerSettingsModel(); @@ -365,9 +363,8 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } if (runFromFileModel != null && StringUtils.isNotBlank(runFromFileModel.getFsPassword())) { - String encPassword = ""; try { - encPassword = EncryptionUtils.Encrypt(runFromFileModel.getFsPassword(), EncryptionUtils.getSecretKey()); + String encPassword = EncryptionUtils.Encrypt(runFromFileModel.getFsPassword(), EncryptionUtils.getSecretKey()); mergedProperties.put("MobilePassword", encPassword); } catch (Exception e) { build.setResult(Result.FAILURE); @@ -409,6 +406,21 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn mergedProperties.put("runType", RunType.FileSystem.toString()); mergedProperties.put("resultsFilename", ResultFilename); + //handling mtbx file content : + // If we have mtbx content - it is located in Test1 property and there is no other test properties (like Test2 etc) + // We save mtbx content in workspace and replace content of Test1 by reference to saved file + String firstTestKey = "Test1"; + String firstTestContent = mergedProperties.getProperty(firstTestKey, ""); + if (RunFromFileSystemModel.isMtbxContent(firstTestContent)) { + try { + String mtbxFilePath = createMtbxFileInWs(workspace, firstTestContent); + mergedProperties.setProperty(firstTestKey, mtbxFilePath); + } catch (IOException | InterruptedException e) { + build.setResult(Result.FAILURE); + listener.error("Failed to save MTBX file : " + e.getMessage()); + } + } + // get properties serialized into a stream ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { @@ -483,6 +495,22 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } } + private static String createMtbxFileInWs(FilePath workspace, String mtbxContent) throws IOException, InterruptedException { + Date now = new Date(); + Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); + String time = formatter.format(now); + + String fileName = "test_suite_" + time + ".mtbx"; + + FilePath remoteFile = workspace.child(fileName); + + String mtbxContentUpdated = mtbxContent.replace("${WORKSPACE}", workspace.getRemote()); + InputStream in = IOUtils.toInputStream(mtbxContentUpdated, "UTF-8"); + remoteFile.copyFrom(in); + + return remoteFile.getRemote(); + } + /** * Gets mc server settings model. * diff --git a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly index c6057b6df5..80d49fc2cf 100644 --- a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly +++ b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly @@ -20,6 +20,11 @@ color: #555753; } + .myTable caption{ + font-weight: bold; + padding-bottom: 10px; + } + .myTable td, .myTable th { border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; @@ -58,9 +63,20 @@

+ + New data tables : ${it.results.newScmResourceFiles.size()} +
+
+
+ + Deleted data tables : ${it.results.deletedScmResourceFiles.size()} +
+
+

+ @@ -96,6 +112,36 @@
Tests

+ +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Data tables
PathStatus
${s.relativePath}new
${s.relativePath}deleted
+

diff --git a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly index 062bff98ec..abbd63e0c4 100644 --- a/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly +++ b/src/main/resources/com/hp/application/automation/tools/octane/actions/UFTTestDetectionPublisher/config.jelly @@ -16,7 +16,7 @@ - + From 30a59ea0d327ef1cc38be5e3382aaaa0d209a0ec Mon Sep 17 00:00:00 2001 From: Michael S Date: Wed, 7 Jun 2017 15:12:33 +0300 Subject: [PATCH 0061/2502] Handling data table and defects (#5) (#197) 1. recognize duplicate entity exception 2. make ConfigurationService.createClient to be static 3. defect 317026 : Jenkins executor job name is not unique 4. user story #305028: Provide data table path for UFT GUI test. 5. fixing building mtbx file : elements starts with Upper case + handling correctly tests without package name 6. update octane dependencies version (mqm & java-sdk to 1.4.4) 7. fix package name detection during test result dispatching --- HpToolsLauncher/MtbxManager.cs | 7 + HpToolsLauncher/MtbxSchema.xsd | 5 + HpToolsLauncher/TestInfo.cs | 7 + HpToolsLauncher/TestRunners/GuiTestRunner.cs | 11 +- pom.xml | 4 +- .../tools/octane/CIJenkinsServicesImpl.java | 3 +- .../octane/actions/dto/AutomatedTest.java | 5 + .../octane/actions/dto/ScmResourceFile.java | 10 - .../configuration/ConfigurationService.java | 22 +- .../octane/executor/OctaneConstants.java | 56 +++ .../TestExecutionJobCreatorService.java | 62 +-- .../executor/UFTTestDetectionResult.java | 2 +- .../executor/UFTTestDetectionService.java | 49 +- .../tools/octane/executor/UftJobCleaner.java | 112 +++-- .../executor/UftTestDiscoveryDispatcher.java | 443 ++++++++++++------ .../octane/tests/junit/JUnitXmlIterator.java | 11 +- 16 files changed, 543 insertions(+), 266 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/octane/executor/OctaneConstants.java diff --git a/HpToolsLauncher/MtbxManager.cs b/HpToolsLauncher/MtbxManager.cs index 11aba14770..489780161d 100644 --- a/HpToolsLauncher/MtbxManager.cs +++ b/HpToolsLauncher/MtbxManager.cs @@ -24,6 +24,7 @@ public class MtbxManager +
@@ -176,6 +177,12 @@ public static List LoadMtbx(string xmlContent, Dictionary + + + + + diff --git a/HpToolsLauncher/TestInfo.cs b/HpToolsLauncher/TestInfo.cs index 1bbf03b72f..917ec699b9 100644 --- a/HpToolsLauncher/TestInfo.cs +++ b/HpToolsLauncher/TestInfo.cs @@ -124,6 +124,7 @@ public TestInfo(string testPath, string testName, string testGroup) List _paramList = new List(); string _testName; string _testGroup; + string _dataTablePath; public string TestGroup { @@ -149,6 +150,12 @@ public List ParameterList set { _paramList = value; } } + public string DataTablePath + { + get { return _dataTablePath; } + set { _dataTablePath = value; } + } + internal Dictionary GetParameterDictionaryForQTP() { diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 2266e25287..5960b75600 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -222,7 +222,7 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance ? tagUnifiedLicenseType.qtUnifiedFunctionalTesting : tagUnifiedLicenseType.qtNonUnified); - if (!HandleInputParameters(testPath, ref errorReason, testinf.GetParameterDictionaryForQTP())) + if (!HandleInputParameters(testPath, ref errorReason, testinf.GetParameterDictionaryForQTP(), testinf.DataTablePath)) { runDesc.TestState = TestState.Error; runDesc.ErrorDesc = errorReason; @@ -577,7 +577,7 @@ private bool VerifyParameterValueType(object paramValue, qtParameterType type) return legal; } - private bool HandleInputParameters(string fileName, ref string errorReason, Dictionary inputParams) + private bool HandleInputParameters(string fileName, ref string errorReason, Dictionary inputParams, string dataTablePath) { try { @@ -619,6 +619,13 @@ private bool HandleInputParameters(string fileName, ref string errorReason, Dict } } } + + // specify data table path + if (dataTablePath != null) + { + _qtpApplication.Test.Settings.Resources.DataTablePath = dataTablePath; + ConsoleWriter.WriteLine("Using external data table: " + dataTablePath); + } } catch (Exception e) { diff --git a/pom.xml b/pom.xml index abad3cbbeb..6c5b90ee09 100644 --- a/pom.xml +++ b/pom.xml @@ -388,14 +388,14 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.4 + 1.4.4 mqm-rest-client com.hpe.adm.octane.ciplugins - 1.4.1 + 1.4.4 diff --git a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java index 9c5a2a935e..b0b5d4e790 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hp/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -21,6 +21,7 @@ import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; import com.hp.application.automation.tools.octane.executor.ExecutorConnectivityService; import com.hp.application.automation.tools.octane.executor.TestExecutionJobCreatorService; +import com.hp.application.automation.tools.octane.executor.UftJobCleaner; import com.hp.application.automation.tools.octane.model.ModelFactory; import com.hp.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; import com.hp.application.automation.tools.octane.model.processors.projects.AbstractProjectProcessor; @@ -555,7 +556,7 @@ public OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConne @Override public void deleteExecutor(String id) { - TestExecutionJobCreatorService.deleteExecutor(id); + UftJobCleaner.deleteExecutor(id); } @Override diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java index 5c4028c970..80f34a4988 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/AutomatedTest.java @@ -141,4 +141,9 @@ public Boolean getExecutable() { public void setExecutable(Boolean executable) { this.executable = executable; } + + @Override + public String toString() { + return "#" + getId() == null ? "0" : getId() + " - " + getPackage() + "@" + getName(); + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java index 271977585d..f0e4a21145 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java +++ b/src/main/java/com/hp/application/automation/tools/octane/actions/dto/ScmResourceFile.java @@ -36,8 +36,6 @@ public class ScmResourceFile { private String relativePath; - private String relativePathPrevious; - public String getName() { return name; } @@ -70,14 +68,6 @@ public void setRelativePath(String relativePath) { this.relativePath = relativePath; } - public String getRelativePathPrevious() { - return relativePathPrevious; - } - - public void setRelativePathPrevious(String relativePathPrevious) { - this.relativePathPrevious = relativePathPrevious; - } - public BaseRefEntity getScmRepository() { return scmRepository; } diff --git a/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java b/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java index 5111cc5f90..a5d0e45d90 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/configuration/ConfigurationService.java @@ -16,7 +16,6 @@ package com.hp.application.automation.tools.octane.configuration; -import com.google.inject.Inject; import com.hp.application.automation.tools.model.OctaneServerSettingsModel; import com.hp.application.automation.tools.octane.client.JenkinsMqmRestClientFactoryImpl; import com.hp.application.automation.tools.settings.OctaneServerSettingsBuilder; @@ -24,7 +23,6 @@ import com.hp.mqm.client.exception.LoginException; import com.hp.mqm.client.exception.RequestException; import com.hp.mqm.client.exception.SharedSpaceNotExistException; -import hudson.Extension; import hudson.Plugin; import jenkins.model.Jenkins; import org.apache.logging.log4j.LogManager; @@ -36,10 +34,9 @@ * 2. helps to get Octane configuration and model * 3. helps to get RestClient based on some configuration */ -@Extension public class ConfigurationService { - private JenkinsMqmRestClientFactoryImpl clientFactory; + private static JenkinsMqmRestClientFactoryImpl clientFactory; private static Logger logger = LogManager.getLogger(ConfigurationService.class); @@ -90,14 +87,14 @@ public static String getPluginVersion() { * @param serverConfiguration * @return */ - public MqmRestClient createClient(ServerConfiguration serverConfiguration) { + public static MqmRestClient createClient(ServerConfiguration serverConfiguration) { if (!serverConfiguration.isValid()) { logger.warn("MQM server configuration is not valid"); return null; } - MqmRestClient client = clientFactory.obtain( + MqmRestClient client = getMqmRestClientFactory().obtain( serverConfiguration.location, serverConfiguration.sharedSpace, serverConfiguration.username, @@ -117,14 +114,11 @@ public MqmRestClient createClient(ServerConfiguration serverConfiguration) { return null; } - /** - * Inject client factory - * - * @param clientFactory - */ - @Inject - public void setMqmRestClientFactory(JenkinsMqmRestClientFactoryImpl clientFactory) { - this.clientFactory = clientFactory; + private static JenkinsMqmRestClientFactoryImpl getMqmRestClientFactory() { + if (clientFactory == null) { + clientFactory = Jenkins.getInstance().getExtensionList(JenkinsMqmRestClientFactoryImpl.class).get(0); + } + return clientFactory; } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/OctaneConstants.java b/src/main/java/com/hp/application/automation/tools/octane/executor/OctaneConstants.java new file mode 100644 index 0000000000..f9438cd102 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/OctaneConstants.java @@ -0,0 +1,56 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hp.application.automation.tools.octane.executor; + +/** + * Constants of Octane Entities + */ +public class OctaneConstants { + + public static class General{ + + public static final String WINDOWS_PATH_SPLITTER = "\\"; + public static final String LINUX_PATH_SPLITTER = "/"; + } + + public static class Base { + public static final String ID_FIELD = "id"; + public static final String NAME_FIELD = "name"; + public static final String LOGICAL_NAME_FIELD = "logical_name"; + public static final String DESCRIPTION_FIELD = "description"; + } + + public static class Tests extends Base { + public static final String COLLECTION_NAME = "automated_tests"; + public static final String SCM_REPOSITORY_FIELD = "scm_repository"; + public static final String TESTING_TOOL_TYPE_FIELD = "testing_tool_type"; + public static final String TEST_TYPE_FIELD = "test_type"; + public static final String PACKAGE_FIELD = "package"; + public static final String EXECUTABLE_FIELD = "executable"; + } + + public static class DataTables extends Base { + public static final String COLLECTION_NAME = "scm_resource_files"; + public static final String RELATIVE_PATH_FIELD = "relative_path"; + public static final String SCM_REPOSITORY_FIELD = "scm_repository"; + } + + public static class Executors extends Base { + public static final String COLLECTION_NAME = "executors"; + } + +} diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 354d343ca2..e13bf3ebcf 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -59,9 +59,9 @@ */ public class TestExecutionJobCreatorService { - private static final Logger logger = LogManager.getLogger(TestExecutionJobCreatorService.class); public static final String EXECUTOR_ID_PARAMETER_NAME = "executorId"; + public static final String EXECUTOR_LOGICAL_NAME_PARAMETER_NAME = "executorLogicalName"; public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; public static final String FULL_SCAN_PARAMETER_NAME = "Full Scan"; @@ -177,6 +177,7 @@ private static String prepareMtbxData(List tests) throws IOEx /* + …. @@ -190,15 +191,21 @@ private static String prepareMtbxData(List tests) throws IOEx DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); Document doc = docBuilder.newDocument(); - Element rootElement = doc.createElement("mtbx"); + Element rootElement = doc.createElement("Mtbx"); doc.appendChild(rootElement); for (TestExecutionInfo test : tests) { - Element testElement = doc.createElement("test"); + Element testElement = doc.createElement("Test"); testElement.setAttribute("name", test.getTestName()); - - String path = "${WORKSPACE}" + File.separator + test.getPackageName() + (StringUtils.isEmpty(test.getPackageName()) ? "" : File.separator) + test.getTestName(); + String path = "${WORKSPACE}" + (StringUtils.isEmpty(test.getPackageName()) ? "" : OctaneConstants.General.WINDOWS_PATH_SPLITTER + test.getPackageName()) + OctaneConstants.General.WINDOWS_PATH_SPLITTER + test.getTestName(); testElement.setAttribute("path", path); + + if (StringUtils.isNotEmpty(test.getDataTable())) { + Element dataTableElement = doc.createElement("DataTable"); + dataTableElement.setAttribute("path", "${WORKSPACE}" + OctaneConstants.General.WINDOWS_PATH_SPLITTER + test.getDataTable()); + testElement.appendChild(dataTableElement); + } + rootElement.appendChild(testElement); } @@ -233,6 +240,7 @@ public static void runTestDiscovery(DiscoveryInfo discoveryInfo) { "url": "git@github.com:radislavB/UftTests.git" }, "executorId": "1", + "executorLogialName": "ABC", "workspaceId": "1002", "testingToolType": "uft", "forceFullDiscovery": true @@ -255,7 +263,7 @@ public static void runTestDiscovery(DiscoveryInfo discoveryInfo) { private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { try { - String discoveryJobName = buildDiscoveryJobName(discoveryInfo.getTestingToolType(), discoveryInfo.getExecutorId()); + String discoveryJobName = buildDiscoveryJobName(discoveryInfo.getTestingToolType(), discoveryInfo.getExecutorId(), discoveryInfo.getExecutorLogicalName()); //validate creation of job FreeStyleProject proj = (FreeStyleProject) Jenkins.getInstance().getItem(discoveryJobName); if (proj == null) { @@ -268,6 +276,7 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { setScmRepository(discoveryInfo.getScmRepository(), discoveryInfo.getScmRepositoryCredentialsId(), proj); setBuildDiscarder(proj, 20); addConstantParameter(proj, EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId(), "Octane executor id"); + addConstantParameter(proj, EXECUTOR_LOGICAL_NAME_PARAMETER_NAME, discoveryInfo.getExecutorLogicalName(), "Octane executor logical name"); addBooleanParameter(proj, FULL_SCAN_PARAMETER_NAME, false, "Indicate whether to scan full scm repository to discover all tests or to use changes (Change Sets) to update already existing tests"); //set polling once in two minutes @@ -298,8 +307,8 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { } } - private static String buildDiscoveryJobName(TestingToolType testingToolType, String executorId) { - String name = String.format("%s test discovery job - executorId %s", testingToolType.toString(), executorId); + private static String buildDiscoveryJobName(TestingToolType testingToolType, String executorId, String executorLogicalName) { + String name = String.format("%s test discovery job - executorId %s (%s)", testingToolType.toString(), executorId, executorLogicalName); return name; } @@ -359,43 +368,6 @@ private static void addBooleanParameter(FreeStyleProject proj, String parameterN } } - /** - * Delete discovery job that related to specific executor in Octane - * - * @param id - */ - public static void deleteExecutor(String id) { - String jobName = buildDiscoveryJobName(TestingToolType.UFT, id); - FreeStyleProject proj = (FreeStyleProject) Jenkins.getInstance().getItem(jobName); - if (proj != null) { - boolean waitBeforeDelete = false; - - if (proj.isBuilding()) { - proj.getLastBuild().getExecutor().interrupt(); - waitBeforeDelete = true; - } else if (proj.isInQueue()) { - Jenkins.getInstance().getQueue().cancel(proj); - waitBeforeDelete = true; - } - - if (waitBeforeDelete) { - try { - //we cancelled building/queue - wait before deleting the job, so Jenkins will be able to complete some IO actions - Thread.sleep(10000); - } catch (InterruptedException e) { - //do nothing - } - } - - try { - logger.warn(String.format("Job '%s' is going to be deleted since matching executor in Octane was deleted", proj.getName())); - proj.delete(); - } catch (IOException | InterruptedException e) { - logger.error("Failed to delete job " + proj.getName() + " : " + e.getMessage()); - } - } - } - private static void addAssignedNode(FreeStyleProject proj) { Computer[] computers = Jenkins.getInstance().getComputers(); Set labels = new HashSet(); diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java index 7525fa663a..254a63db5a 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionResult.java @@ -103,7 +103,7 @@ public void setFullScan(boolean fullScan) { public boolean hasChanges() { return !getNewTests().isEmpty() || !getUpdatedTests().isEmpty() || !getDeletedTests().isEmpty() - || !getNewScmResourceFiles().isEmpty() || !getDeletedScmResourceFiles().isEmpty() || !getUpdatedScmResourceFiles().isEmpty(); + || !getNewScmResourceFiles().isEmpty() || !getDeletedScmResourceFiles().isEmpty(); } public List getNewScmResourceFiles() { diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java index 28b16ef2db..708b33c4f6 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -41,6 +41,9 @@ import java.io.IOException; import java.util.*; +/** + * Service is responsible to detect changes according to SCM change and to put it to queue of UftTestDiscoveryDispatcher + */ public class UFTTestDetectionService { private static final Logger logger = LogManager.getLogger(UFTTestDetectionService.class); private static final String INITIAL_DETECTION_FILE = "INITIAL_DETECTION_FILE.txt"; @@ -92,7 +95,10 @@ public static UFTTestDetectionResult startScanning(AbstractBuild build, St result.setFullScan(fullScan); sortTests(result.getNewTests()); sortTests(result.getUpdatedTests()); - publishDetectionResults(build, buildListener, result); + sortTests(result.getDeletedTests()); + sortDataTables(result.getNewScmResourceFiles()); + sortDataTables(result.getDeletedScmResourceFiles()); + publishDetectionResults(getReportXmlFile(build), buildListener, result); if (result.hasChanges()) { UftTestDiscoveryDispatcher dispatcher = getExtension(UftTestDiscoveryDispatcher.class); @@ -160,6 +166,15 @@ public int compare(AutomatedTest o1, AutomatedTest o2) { }); } + private static void sortDataTables(List dataTables) { + Collections.sort(dataTables, new Comparator() { + @Override + public int compare(ScmResourceFile o1, ScmResourceFile o2) { + return o1.getRelativePath().compareTo(o2.getRelativePath()); + } + }); + } + private static T getExtension(Class clazz) { ExtensionList items = Jenkins.getInstance().getExtensionList(clazz); return items.get(0); @@ -242,11 +257,10 @@ private static UFTTestDetectionResult doChangeSetDetection(Object[] changeSetIte return result; } - private static AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath, UftTestType testType, boolean executable) throws IOException, InterruptedException { + private static AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath, UftTestType testType, boolean executable) { AutomatedTest test = new AutomatedTest(); test.setName(dirPath.getName()); - String relativePath = getRelativePath(root, dirPath); String packageName = relativePath.length() != dirPath.getName().length() ? relativePath.substring(0, relativePath.length() - dirPath.getName().length() - 1) : ""; test.setPackage(packageName); @@ -262,12 +276,12 @@ private static AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath return test; } - private static String getRelativePath(FilePath root, FilePath path) throws IOException, InterruptedException { + private static String getRelativePath(FilePath root, FilePath path) { String testPath = path.getRemote(); String rootPath = root.getRemote(); String relativePath = testPath.replace(rootPath, ""); relativePath = StringUtils.strip(relativePath, windowsPathSplitter + linuxPathSplitter); - //we want all paths will be in sindows style, because tests are run in windows, therefore we replace all linux splitters (/) by windows one (\) + //we want all paths will be in windows style, because tests are run in windows, therefore we replace all linux splitters (/) by windows one (\) //http://stackoverflow.com/questions/23869613/how-to-replace-one-or-more-in-string-with-just relativePath = relativePath.replaceAll(linuxPathSplitter, windowsPathSplitter + windowsPathSplitter);//str.replaceAll("/", "\\\\"); return relativePath; @@ -336,7 +350,7 @@ private static void scanFileSystemRecursively(FilePath root, FilePath dirPath, L } } - private static ScmResourceFile createDataTable(FilePath root, FilePath path) throws IOException, InterruptedException { + private static ScmResourceFile createDataTable(FilePath root, FilePath path) { ScmResourceFile resourceFile = new ScmResourceFile(); resourceFile.setName(path.getName()); resourceFile.setRelativePath(getRelativePath(root, path)); @@ -381,19 +395,26 @@ private static FilePath getTestFolderForTestMainFile(String path) { return null; } - private static void publishDetectionResults(AbstractBuild build, TaskListener _logger, UFTTestDetectionResult detectionResult) { + /** + * Serialize detectionResult to file in XML format + * @param fileToWriteTo + * @param taskListenerLog + * @param detectionResult + */ + public static void publishDetectionResults(File fileToWriteTo, TaskListener taskListenerLog, UFTTestDetectionResult detectionResult) { try { - File file = getReportXmlFile(build); JAXBContext jaxbContext = JAXBContext.newInstance(UFTTestDetectionResult.class); Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - jaxbMarshaller.marshal(detectionResult, file); - //jaxbMarshaller.marshal(detectionResult, System.out); + jaxbMarshaller.marshal(detectionResult, fileToWriteTo); } catch (JAXBException e) { - _logger.error("Failed to persist detection results: " + e); + if (taskListenerLog != null) { + taskListenerLog.error("Failed to persist detection results: " + e.getMessage()); + } + logger.error("Failed to persist detection results: " + e.getMessage()); } } @@ -403,15 +424,13 @@ public static UFTTestDetectionResult readDetectionResults(Run run) { try { JAXBContext context = JAXBContext.newInstance(UFTTestDetectionResult.class); Unmarshaller m = context.createUnmarshaller(); - UFTTestDetectionResult result = (UFTTestDetectionResult) m.unmarshal(new FileReader(file)); - return result; + return (UFTTestDetectionResult) m.unmarshal(new FileReader(file)); } catch (JAXBException | FileNotFoundException e) { return null; } } private static File getReportXmlFile(Run run) { - File reportXmlFile = new File(run.getRootDir(), DETECTION_RESULT_FILE); - return reportXmlFile; + return new File(run.getRootDir(), DETECTION_RESULT_FILE); } } \ No newline at end of file diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java index 858e4dabaf..26f61c2f09 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftJobCleaner.java @@ -16,15 +16,12 @@ package com.hp.application.automation.tools.octane.executor; -import com.google.inject.Inject; import com.hp.application.automation.tools.octane.actions.UFTTestDetectionPublisher; import com.hp.application.automation.tools.octane.configuration.ConfigurationService; import com.hp.application.automation.tools.octane.configuration.ServerConfiguration; import com.hp.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.QueryHelper; import com.hp.mqm.client.model.Entity; -import com.hp.mqm.client.model.PagedList; import hudson.Extension; import hudson.model.*; import jenkins.model.Jenkins; @@ -45,8 +42,6 @@ public class UftJobCleaner extends AbstractSafeLoggingAsyncPeriodWork { private static Logger logger = LogManager.getLogger(UftJobCleaner.class); - private ConfigurationService configurationService; - private static String EXECUTORS_COLLECTION_NAME = "executors"; public UftJobCleaner() { super("Uft Job Cleaner"); @@ -55,7 +50,7 @@ public UftJobCleaner() { @Override public long getRecurrencePeriod() { - return HOUR; + return DAY; } @Override @@ -106,7 +101,7 @@ private void clearExecutionJobs(List jobs) { logger.warn(String.format("Cleaner found %s outdated execution job", clearCounter)); } - private boolean isExecutorJob(FreeStyleProject job) { + private static boolean isExecutorJob(FreeStyleProject job) { ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); boolean isExecutorJob = job.getName().contains("execution job") && parameters != null && @@ -116,8 +111,7 @@ private boolean isExecutorJob(FreeStyleProject job) { return isExecutorJob; } - - private boolean isDiscoveryJobJob(FreeStyleProject job) { + private static boolean isDiscoveryJobJob(FreeStyleProject job) { ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); boolean isDiscoveryJob = job.getName().contains("discovery job") && parameters != null && @@ -128,50 +122,44 @@ private boolean isDiscoveryJobJob(FreeStyleProject job) { private void clearDiscoveryJobs(List jobs) { //Generally, after deleting executor in Octane, relevant job in Jenkins is also deleted. But if jenkins was down during delete of executor, job remains - //This method handle orphan job that doesn't hava mathing executors in Octane + //This method handle orphan job that doesn't hava matching executors in Octane //1. build map of discovery jobs per workspace //2. Loop by workspace //2.1 Get from octane executors in workspace //2.2 If some discovery job exist that doesn't have matching executor - remove it from Jenkins - Map> workspace2executorId2DiscoveryJobMap = new HashMap<>(); + Map> workspace2executorLogical2DiscoveryJobMap = new HashMap<>(); for (FreeStyleProject job : jobs) { if (isDiscoveryJobJob(job)) { - Long executorId = getExecutorId(job); + String executorLogicalName = getExecutorLogicalName(job); Long workspaceId = getOctaneWorkspaceId(job); - if (executorId != null && workspaceId != null) { - if (!workspace2executorId2DiscoveryJobMap.containsKey(workspaceId)) { - workspace2executorId2DiscoveryJobMap.put(workspaceId, new HashedMap()); + if (executorLogicalName != null && workspaceId != null) { + if (!workspace2executorLogical2DiscoveryJobMap.containsKey(workspaceId)) { + workspace2executorLogical2DiscoveryJobMap.put(workspaceId, new HashedMap()); } - workspace2executorId2DiscoveryJobMap.get(workspaceId).put(executorId, job); + workspace2executorLogical2DiscoveryJobMap.get(workspaceId).put(executorLogicalName, job); } } } - if (!workspace2executorId2DiscoveryJobMap.isEmpty()) { + if (!workspace2executorLogical2DiscoveryJobMap.isEmpty()) { ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - MqmRestClient client = configurationService.createClient(serverConfiguration); + MqmRestClient client = ConfigurationService.createClient(serverConfiguration); if (client != null) { int deleteCounter = 0; - for (Long workspaceId : workspace2executorId2DiscoveryJobMap.keySet()) { - Map discoveryJobs = workspace2executorId2DiscoveryJobMap.get(workspaceId); - List conditions = new ArrayList<>(); - conditions.add(QueryHelper.conditionIn("id", discoveryJobs.keySet(), true)); + for (Long workspaceId : workspace2executorLogical2DiscoveryJobMap.keySet()) { try { - PagedList entities = client.getEntities(workspaceId, EXECUTORS_COLLECTION_NAME, conditions, Arrays.asList("id")); - Set octaneExecutorIds = new HashSet<>(); - for (Entity executor : entities.getItems()) { - octaneExecutorIds.add(executor.getId()); - } - for (Long jobExecutorId : discoveryJobs.keySet()) { - if (!octaneExecutorIds.contains(jobExecutorId)) { + Map discoveryJobs = workspace2executorLogical2DiscoveryJobMap.get(workspaceId); + Set octaneExecutorsLogicalNames = getOctaneExecutorsLogicalNames(client, workspaceId); + for (String jobExecutorLogical : discoveryJobs.keySet()) { + boolean isExistInOctane = octaneExecutorsLogicalNames.contains(jobExecutorLogical); + if (!isExistInOctane) { //found discovery job that is not related to any executor in Octane - FreeStyleProject job = discoveryJobs.get(jobExecutorId); + FreeStyleProject job = discoveryJobs.get(jobExecutorLogical); try { logger.warn(String.format("Job %s is going to be deleted as is doesn't have matching executor in Octane in workspace %s", job.getName(), workspaceId)); deleteCounter++; job.delete(); - } catch (Exception e) { logger.warn(String.format("Failed to delete job %s : %s", job.getName(), e.getMessage())); } @@ -189,14 +177,30 @@ private void clearDiscoveryJobs(List jobs) { } } + private Set getOctaneExecutorsLogicalNames(MqmRestClient client, Long workspaceId) { + List entities = client.getEntities(workspaceId, OctaneConstants.Executors.COLLECTION_NAME, null, + Arrays.asList(OctaneConstants.Base.ID_FIELD, OctaneConstants.Base.LOGICAL_NAME_FIELD)); + Set octaneExecutorIds = new HashSet<>(); + for (Entity executor : entities) { + octaneExecutorIds.add(executor.getStringValue(OctaneConstants.Base.LOGICAL_NAME_FIELD)); + } + return octaneExecutorIds; + } - private Long getExecutorId(FreeStyleProject job) { + private static Long getExecutorId(FreeStyleProject job) { ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); ParameterDefinition pd = parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_ID_PARAMETER_NAME); String value = (String) pd.getDefaultParameterValue().getValue(); return Long.valueOf(value); } + private static String getExecutorLogicalName(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + ParameterDefinition pd = parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_LOGICAL_NAME_PARAMETER_NAME); + String value = (String) pd.getDefaultParameterValue().getValue(); + return value; + } + private Long getOctaneWorkspaceId(FreeStyleProject job) { UFTTestDetectionPublisher uftTestDetectionPublisher = null; @@ -212,9 +216,45 @@ private Long getOctaneWorkspaceId(FreeStyleProject job) { return null; } - @Inject - public void setConfigurationService(ConfigurationService configurationService) { - this.configurationService = configurationService; - } + /** + * Delete discovery job that related to specific executor in Octane + * + * @param id + */ + public static void deleteExecutor(String id) { + long executorToDelete = Long.parseLong(id); + List jobs = Jenkins.getInstance().getAllItems(FreeStyleProject.class); + for (FreeStyleProject proj : jobs) { + if (isDiscoveryJobJob(proj)) { + Long executorId = getExecutorId(proj); + if (executorId != null && executorId == executorToDelete) { + boolean waitBeforeDelete = false; + + if (proj.isBuilding()) { + proj.getLastBuild().getExecutor().interrupt(); + waitBeforeDelete = true; + } else if (proj.isInQueue()) { + Jenkins.getInstance().getQueue().cancel(proj); + waitBeforeDelete = true; + } + if (waitBeforeDelete) { + try { + //we cancelled building/queue - wait before deleting the job, so Jenkins will be able to complete some IO actions + Thread.sleep(10000); + } catch (InterruptedException e) { + //do nothing + } + } + + try { + logger.warn(String.format("Job '%s' is going to be deleted since matching executor in Octane was deleted", proj.getName())); + proj.delete(); + } catch (IOException | InterruptedException e) { + logger.error("Failed to delete job " + proj.getName() + " : " + e.getMessage()); + } + } + } + } + } } diff --git a/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java index 1b6f20066a..11a26d0c28 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java +++ b/src/main/java/com/hp/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java @@ -31,21 +31,25 @@ import com.hp.mqm.client.model.ListItem; import com.hp.mqm.client.model.PagedList; import hudson.Extension; +import hudson.FilePath; +import hudson.model.FreeStyleProject; import hudson.model.Job; import hudson.model.Run; import hudson.model.TaskListener; import hudson.util.TimeUnit2; import jenkins.model.Jenkins; +import net.sf.json.JSONArray; import net.sf.json.JSONObject; import net.sf.json.JsonConfig; import net.sf.json.processors.PropertyNameProcessor; import net.sf.json.util.PropertyFilter; +import org.apache.commons.collections.map.HashedMap; import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.io.File; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.*; @@ -59,14 +63,12 @@ @Extension public class UftTestDiscoveryDispatcher extends AbstractSafeLoggingAsyncPeriodWork { - private static Logger logger = LogManager.getLogger(UftTestDiscoveryDispatcher.class); - private final static String TESTS_COLLECTION_NAME = "automated_tests"; - private final static String SCM_RESOURCE_FILES_COLLECTION_NAME = "scm_resource_files"; - - private final static int BULK_SIZE = 100; + private final static Logger logger = LogManager.getLogger(UftTestDiscoveryDispatcher.class); + private final static String DUPLICATE_ERROR_CODE = "platform.duplicate_entity_error"; + private final static int POST_BULK_SIZE = 100; + private final static int MAX_DISPATCH_TRIALS = 5; private UftTestDiscoveryQueue queue; - private ConfigurationService configurationService; public UftTestDiscoveryDispatcher() { super("Uft Test Discovery Dispatcher"); @@ -81,7 +83,7 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE logger.warn("Queue size " + queue.size()); ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - MqmRestClient client = configurationService.createClient(serverConfiguration); + MqmRestClient client = ConfigurationService.createClient(serverConfiguration); if (client == null) { logger.warn("There are pending discovered UFT tests, but MQM server configuration is not valid, results can't be submitted"); @@ -120,16 +122,38 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE } catch (Exception e) { if (item != null) { item.incrementFailCount(); - int maxTrial = 5; - if (item.incrementFailCount() > maxTrial) { + if (item.incrementFailCount() > MAX_DISPATCH_TRIALS) { queue.remove(); - logger.warn("Failed to persist discovery of [" + item.getProjectName() + "#" + item.getBuildNumber() + "] after " + maxTrial + " trials"); + logger.warn("Failed to persist discovery of [" + item.getProjectName() + "#" + item.getBuildNumber() + "] after " + MAX_DISPATCH_TRIALS + " trials"); } } } } - private void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient client, UFTTestDetectionResult result) throws UnsupportedEncodingException { + private static void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient client, UFTTestDetectionResult result) { + //Check if there is diff in discovery and server status + //for example : discovery found new test , but it already exist in server , instead of create new tests we will do update test + if (result.isFullScan()) { + validateTestDiscoveryForFullDetection(client, result); + validateDataTablesDiscoveryForFullDetection(client, result); + } else { + validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(client, result); + //no need to add validation for dataTables, because there is no DTs update and there is no special delete strategy + } + + //publish final results + FreeStyleProject project = (FreeStyleProject) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + FilePath subWorkspace = project.getWorkspace().child("_Final_Detection_Results"); + try { + if (!subWorkspace.exists()) { + subWorkspace.mkdirs(); + } + File reportXmlFile = new File(subWorkspace.getRemote(), "final_detection_result_build_" + item.getBuildNumber() + ".xml"); + UFTTestDetectionService.publishDetectionResults(reportXmlFile, null, result); + } catch (IOException | InterruptedException e) { + logger.error("Failed to write final_detection_result file :" + e.getMessage()); + } + //post new tests if (!result.getNewTests().isEmpty()) { boolean posted = postTests(client, result.getNewTests(), result.getWorkspaceId(), result.getScmRepositoryId()); @@ -138,13 +162,13 @@ private void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient //post test updated if (!result.getUpdatedTests().isEmpty()) { - boolean updated = updateTests(client, result.getUpdatedTests(), result.getWorkspaceId(), result.getScmRepositoryId()); + boolean updated = updateTests(client, result.getUpdatedTests(), result.getWorkspaceId()); logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getUpdatedTests().size() + " updated tests posted successfully = " + updated); } //post test deleted if (!result.getDeletedTests().isEmpty()) { - boolean updated = setTestsNotExecutable(client, result.getDeletedTests(), result.getWorkspaceId()); + boolean updated = updateTests(client, result.getDeletedTests(), result.getWorkspaceId()); logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getDeletedTests().size() + " deleted tests set as not executable successfully = " + updated); } @@ -159,10 +183,184 @@ private void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient boolean posted = deleteScmResources(client, result.getDeletedScmResourceFiles(), result.getWorkspaceId(), result.getScmRepositoryId()); logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + result.getDeletedScmResourceFiles().size() + " scmResources deleted successfully = " + posted); } + } + + /** + * This method try to find ids of updated and deleted tests for scm change detection + * if test is found on server - update id of discovered test + * if test is not found and test is marked for update - move it to new tests (possibly test was deleted on server) + * + * @return true if there were changes comparing to discoverede results + */ + private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(MqmRestClient client, UFTTestDetectionResult result) { + boolean hasDiff = false; + List allTests = new ArrayList<>(); + allTests.addAll(result.getUpdatedTests()); + allTests.addAll(result.getDeletedTests()); + Set allTestNames = new HashSet<>(); + for (AutomatedTest test : allTests) { + allTestNames.add(test.getName()); + } + + //GET TESTS FROM OCTANE + Map octaneTestsMapByKey = getTestsFromServer(client, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allTestNames); + + + //MATCHING + for (AutomatedTest test : allTests) { + String key = createKey(test.getPackage(), test.getName()); + Entity octaneTest = octaneTestsMapByKey.get(key); + if (octaneTest != null) { + test.setId(octaneTest.getId()); + } else {//no match{ + hasDiff = true; + if (result.getUpdatedTests().remove(test)) { + result.getNewTests().add(test); + } else { + //test that is marked to be deleted - doesn't exist in Octane - do nothing + result.getDeletedTests().remove(test); + } + } + } + return hasDiff; } - private static boolean postTests(MqmRestClient client, List tests, String workspaceId, String scmRepositoryId) throws UnsupportedEncodingException { + /** + * This method check whether discovered test are already exist on server, and instead of creation - those tests will be updated + * Go over discovered and octane tests + * 1.if test doesn't exist on octane - this is new test + * 2.if test exist + * 2.1 if test different from discovered - this is test for update + * 2.2 if tests are equal - skip test + * 3. all tests that are found in Octane but not discovered - those deleted tests and they will be turned to not executable + * + * @return true if there were changes comparing to discoverede results + */ + private static boolean validateTestDiscoveryForFullDetection(MqmRestClient client, UFTTestDetectionResult detectionResult) { + boolean hasDiff = false; + Map octaneTestsMap = getTestsFromServer(client, Long.parseLong(detectionResult.getWorkspaceId()), Long.parseLong(detectionResult.getScmRepositoryId()), null); + + List discoveredTests = new ArrayList(detectionResult.getNewTests()); + detectionResult.getNewTests().clear(); + for (AutomatedTest discoveredTest : discoveredTests) { + String key = createKey(discoveredTest.getPackage(), discoveredTest.getName()); + Entity octaneTest = octaneTestsMap.remove(key); + + if (octaneTest == null) { + detectionResult.getNewTests().add(discoveredTest); + } else { + hasDiff = true;//if we get here - there is diff with discovered tests + //the only fields that might be different is description and executable + boolean octaneExecutable = octaneTest.getBooleanValue(OctaneConstants.Tests.EXECUTABLE_FIELD); + String octaneDescription = octaneTest.getStringValue(OctaneConstants.Tests.DESCRIPTION_FIELD); + boolean descriptionEquals = ((StringUtils.isEmpty(octaneDescription) || "null".equals(octaneDescription)) && discoveredTest.getDescription() == null) || + octaneDescription.contains(discoveredTest.getDescription()); + boolean testsEqual = (octaneExecutable && descriptionEquals); + if (!testsEqual) { //if equal - skip + discoveredTest.setId(octaneTest.getId()); + detectionResult.getUpdatedTests().add(discoveredTest); + } + } + } + + //go over executable tests that exist in Octane but not discovered and disable them + for (Entity octaneTest : octaneTestsMap.values()) { + hasDiff = true;//if some test exist - there is diff with discovered tests + boolean octaneExecutable = octaneTest.getBooleanValue(OctaneConstants.Tests.EXECUTABLE_FIELD); + if (octaneExecutable) { + AutomatedTest test = new AutomatedTest(); + test.setId(octaneTest.getId()); + test.setExecutable(false); + test.setName(octaneTest.getName()); + test.setPackage(octaneTest.getStringValue(OctaneConstants.Tests.PACKAGE_FIELD)); + detectionResult.getDeletedTests().add(test); + } + } + + return hasDiff; + } + + /** + * Go over discovered and octane data tables + * 1.if DT doesn't exist on octane - this is new DT + * 2. all DTs that are found in Octane but not discovered - delete those DTs from server + */ + private static boolean validateDataTablesDiscoveryForFullDetection(MqmRestClient client, UFTTestDetectionResult detectionResult) { + boolean hasDiff = false; + List discoveredDataTables = new ArrayList(detectionResult.getNewScmResourceFiles()); + detectionResult.getNewScmResourceFiles().clear(); + + Map octaneDataTablesMap = getDataTablesFromServer(client, Long.parseLong(detectionResult.getWorkspaceId()), Long.parseLong(detectionResult.getScmRepositoryId())); + for (ScmResourceFile dataTable : discoveredDataTables) { + Entity octaneDataTable = octaneDataTablesMap.remove(dataTable.getRelativePath()); + if (octaneDataTable == null) { + detectionResult.getNewScmResourceFiles().add(dataTable); + } else { + hasDiff = true; + } + } + + //go over DT that exist in Octane but not discovered + for (Entity octaneDataTable : octaneDataTablesMap.values()) { + hasDiff = true; + ScmResourceFile dt = new ScmResourceFile(); + dt.setId(octaneDataTable.getId()); + dt.setName(octaneDataTable.getName()); + dt.setRelativePath(octaneDataTable.getStringValue(OctaneConstants.DataTables.RELATIVE_PATH_FIELD)); + detectionResult.getDeletedScmResourceFiles().add(dt); + } + + return hasDiff; + } + + private static Map getTestsFromServer(MqmRestClient client, long workspaceId, long scmRepositoryId, Set allTestNames) { + List conditions = new ArrayList<>(); + if (allTestNames != null && !allTestNames.isEmpty()) { + String byNameCondition = QueryHelper.conditionIn(OctaneConstants.Tests.NAME_FIELD, allTestNames, false); + int byNameConditionSizeThreshold = 3000; + //Query string is part of UR, some servers limit request size by 4K, + //Here we limit nameCondition by 3K, if it exceed, we will fetch all tests + if (byNameCondition.length() < byNameConditionSizeThreshold) { + conditions.add(byNameCondition); + } + } + + conditions.add(QueryHelper.conditionRef(OctaneConstants.Tests.SCM_REPOSITORY_FIELD, scmRepositoryId)); + Collection fields = Arrays.asList(OctaneConstants.Tests.ID_FIELD, OctaneConstants.Tests.NAME_FIELD, OctaneConstants.Tests.PACKAGE_FIELD, OctaneConstants.Tests.EXECUTABLE_FIELD, OctaneConstants.Tests.DESCRIPTION_FIELD); + List octaneTests = client.getEntities(workspaceId, OctaneConstants.Tests.COLLECTION_NAME, conditions, fields); + Map octaneTestsMapByKey = new HashedMap(); + for (Entity octaneTest : octaneTests) { + String key = createKey(octaneTest.getStringValue(OctaneConstants.Tests.PACKAGE_FIELD), octaneTest.getName()); + octaneTestsMapByKey.put(key, octaneTest); + } + return octaneTestsMapByKey; + } + + private static Map getDataTablesFromServer(MqmRestClient client, long workspaceId, long scmRepositoryId) { + List conditionByScmRepository = Arrays.asList(QueryHelper.conditionRef(OctaneConstants.DataTables.SCM_REPOSITORY_FIELD, scmRepositoryId)); + + List dataTablesFields = Arrays.asList(OctaneConstants.DataTables.ID_FIELD, OctaneConstants.DataTables.NAME_FIELD, OctaneConstants.DataTables.RELATIVE_PATH_FIELD); + List octaneDataTables = client.getEntities(workspaceId, OctaneConstants.DataTables.COLLECTION_NAME, conditionByScmRepository, dataTablesFields); + + Map octaneDataTablesMap = new HashedMap(); + for (Entity dataTable : octaneDataTables) { + octaneDataTablesMap.put(dataTable.getStringValue(OctaneConstants.DataTables.RELATIVE_PATH_FIELD), dataTable); + } + + return octaneDataTablesMap; + } + + private static String createKey(String... values) { + for (int i = 0; i < values.length; i++) { + if (values[i] == null || "null".equals(values[i])) { + values[i] = ""; + } + } + return StringUtils.join(values, "#"); + } + + private static boolean postTests(MqmRestClient client, List tests, String workspaceId, String scmRepositoryId) { if (!tests.isEmpty()) { try { @@ -172,54 +370,81 @@ private static boolean postTests(MqmRestClient client, List tests return false; } - for (int i = 0; i < tests.size(); i += BULK_SIZE) + for (int i = 0; i < tests.size(); i += POST_BULK_SIZE) { try { - AutomatedTests data = AutomatedTests.createWithTests(tests.subList(i, Math.min(i + BULK_SIZE, tests.size()))); + AutomatedTests data = AutomatedTests.createWithTests(tests.subList(i, Math.min(i + POST_BULK_SIZE, tests.size()))); String uftTestJson = convertToJsonString(data); - - client.postEntities(Long.parseLong(workspaceId), TESTS_COLLECTION_NAME, uftTestJson); - + client.postEntities(Long.parseLong(workspaceId), OctaneConstants.Tests.COLLECTION_NAME, uftTestJson); } catch (RequestErrorException e) { - if (e.getStatusCode() != HttpStatus.CONFLICT.getCode()) { - logger.error("Failed to postTests to Octane : " + e.getMessage()); - return false; - } - - //else : the test with the same hash code , so do nothing + return checkIfExceptionCanBeIgnoredInPOST(e, "Failed to post tests"); } + } } return true; } - private static boolean postScmResources(MqmRestClient client, List resources, String workspaceId, String scmResourceId) throws UnsupportedEncodingException { + private static boolean postScmResources(MqmRestClient client, List resources, String workspaceId, String scmResourceId) { if (!resources.isEmpty()) { try { completeScmResourceProperties(resources, scmResourceId); } catch (RequestErrorException e) { - logger.error("Failed to completeTestProperties : " + e.getMessage()); + logger.error("Failed to completeScmResourceProperties : " + e.getMessage()); return false; } - for (int i = 0; i < resources.size(); i += BULK_SIZE) + for (int i = 0; i < resources.size(); i += POST_BULK_SIZE) try { - ScmResources data = ScmResources.createWithItems(resources.subList(i, Math.min(i + BULK_SIZE, resources.size()))); + ScmResources data = ScmResources.createWithItems(resources.subList(i, Math.min(i + POST_BULK_SIZE, resources.size()))); String uftTestJson = convertToJsonString(data); - - client.postEntities(Long.parseLong(workspaceId), SCM_RESOURCE_FILES_COLLECTION_NAME, uftTestJson); - + client.postEntities(Long.parseLong(workspaceId), OctaneConstants.DataTables.COLLECTION_NAME, uftTestJson); } catch (RequestErrorException e) { - if (e.getStatusCode() != HttpStatus.CONFLICT.getCode()) { - logger.error("Failed to post scm resource files to Octane : " + e.getMessage()); - return false; - } - - //else : the file with the same hash code , so do nothing + return checkIfExceptionCanBeIgnoredInPOST(e, "Failed to post scm resource files"); } } return true; } + /** + * Entities might be posted while they already exist in Octane, such POST request will fail with general error code will be 409. + * The same error code might be received on other validation error. + * In this method we check whether exist other exception than duplicate + * + * @param e + * @param errorPrefix + * @return + */ + private static boolean checkIfExceptionCanBeIgnoredInPOST(RequestErrorException e, String errorPrefix) { + if (e.getStatusCode() == HttpStatus.CONFLICT.getCode() && e.getJsonObject() != null && e.getJsonObject().containsKey("errors")) { + JSONObject error = findFirstErrorDifferThan(e.getJsonObject().getJSONArray("errors"), DUPLICATE_ERROR_CODE); + String errorMessage = null; + if (error != null) { + errorMessage = error.getString("description"); + logger.error(errorPrefix + " : " + errorMessage); + } + return errorMessage == null; + } + + logger.error(errorPrefix + " : " + e.getMessage()); + return false; + } + + /** + * Search for error code that differ from supplied errorCode. + */ + private static JSONObject findFirstErrorDifferThan(JSONArray errors, String excludeErrorCode) { + for (int errorIndex = 0; errorIndex < errors.size(); errorIndex++) { + JSONObject error = errors.getJSONObject(errorIndex); + String errorCode = error.getString("error_code"); + if (errorCode.equals(excludeErrorCode)) { + continue; + } else { + return error; + } + } + return null; + } + private static String convertToJsonString(Object data) { JsonConfig config = getJsonConfig(); return JSONObject.fromObject(data, config).toString(); @@ -235,13 +460,13 @@ public String processPropertyName(Class className, String fieldName) { String result = fieldName; switch (fieldName) { case "scmRepository": - result = "scm_repository"; + result = OctaneConstants.Tests.SCM_REPOSITORY_FIELD; break; case "testingToolType": - result = "testing_tool_type"; + result = OctaneConstants.Tests.TESTING_TOOL_TYPE_FIELD; break; case "testTypes": - result = "test_type"; + result = OctaneConstants.Tests.TEST_TYPE_FIELD; break; default: break; @@ -257,10 +482,10 @@ public String processPropertyName(Class className, String fieldName) { String result = fieldName; switch (fieldName) { case "relativePath": - result = "relative_path"; + result = OctaneConstants.DataTables.RELATIVE_PATH_FIELD; break; case "scmRepository": - result = "scm_repository"; + result = OctaneConstants.DataTables.SCM_REPOSITORY_FIELD; break; default: break; @@ -285,115 +510,64 @@ public boolean apply(Object source, String name, Object value) { return config; } - /*private static void deleteTests(MqmRestClient client, Collection removedTests, String workspaceId) throws UnsupportedEncodingException { - List idsToDelete = new ArrayList<>(); - long workspaceIdAsLong = Long.parseLong(workspaceId); - for (AutomatedTest test : removedTests) { - Map queryFields = new HashMap<>(); - queryFields.put("name", test.getName()); - queryFields.put("package", test.getPackage()); - PagedList foundTests = client.getTests(workspaceIdAsLong, queryFields, Arrays.asList("id")); - if (foundTests.getItems().size() == 1) { - idsToDelete.add(foundTests.getItems().get(0).getId()); - } - } - - int BULK_SIZE = 100; - for (int i = 0; i < idsToDelete.size(); i += BULK_SIZE) { - client.deleteTests(workspaceIdAsLong, idsToDelete.subList(i, Math.min(i + BULK_SIZE, idsToDelete.size()))); - } - }*/ - - private static boolean setTestsNotExecutable(MqmRestClient client, Collection deletedTest, String workspaceId) throws UnsupportedEncodingException { - long workspaceIdAsLong = Long.parseLong(workspaceId); + private static boolean updateTests(MqmRestClient client, Collection tests, String workspaceId) { try { - for (AutomatedTest test : deletedTest) { - List conditions = new ArrayList<>(); - conditions.add(QueryHelper.condition("name", test.getName())); - conditions.add(QueryHelper.condition("package", test.getPackage())); - PagedList foundTests = client.getEntities(workspaceIdAsLong, TESTS_COLLECTION_NAME, conditions, Arrays.asList("id")); - if (foundTests.getItems().size() == 1) { - Entity foundTest = foundTests.getItems().get(0); - AutomatedTest testForUpdate = new AutomatedTest(); - testForUpdate.setExecutable(false); - testForUpdate.setId(foundTest.getId()); - String json = convertToJsonString(testForUpdate); - client.updateEntity(Long.parseLong(workspaceId), TESTS_COLLECTION_NAME, foundTests.getItems().get(0).getId(), json); + //build testsForUpdate + List testsForUpdate = new ArrayList<>(); + for (AutomatedTest test : tests) { + AutomatedTest testForUpdate = new AutomatedTest(); + if (test.getDescription() != null) { + testForUpdate.setDescription(test.getDescription()); } + testForUpdate.setExecutable(test.getExecutable()); + testForUpdate.setId(test.getId()); + testsForUpdate.add(testForUpdate); } - return true; - - } catch (Exception e) { - return false; - } - } - - private static boolean updateTests(MqmRestClient client, Collection updateTests, String workspaceId, String scmRepositoryId) throws UnsupportedEncodingException { - long workspaceIdAsLong = Long.parseLong(workspaceId); - - try { - List createAsNewTests = new ArrayList<>(); - for (AutomatedTest test : updateTests) { - if (StringUtils.isEmpty(test.getDescription())) { - continue; - } - - List conditions = new ArrayList<>(); - conditions.add(QueryHelper.condition("name", test.getName())); - conditions.add(QueryHelper.condition("package", test.getPackage())); - PagedList foundTests = client.getEntities(workspaceIdAsLong, TESTS_COLLECTION_NAME, conditions, Arrays.asList("id")); - if (foundTests.getItems().size() == 1) { - Entity foundTest = foundTests.getItems().get(0); - AutomatedTest testForUpdate = new AutomatedTest(); - testForUpdate.setDescription(test.getDescription()); - testForUpdate.setExecutable(test.getExecutable()); - testForUpdate.setId(foundTest.getId()); - String json = convertToJsonString(testForUpdate); - client.updateEntity(Long.parseLong(workspaceId), TESTS_COLLECTION_NAME, foundTests.getItems().get(0).getId(), json); - } else if (foundTests.getItems().size() == 0) { - //test not exist in Octane, create it from scratch - logger.error(String.format("Test %s\\%s should be updated but wasn't found on Octane, creating test from scratch ", test.getPackage(), test.getName())); - createAsNewTests.add(test); + if (!testsForUpdate.isEmpty()) { + for (int i = 0; i < tests.size(); i += POST_BULK_SIZE) { + AutomatedTests data = AutomatedTests.createWithTests(testsForUpdate.subList(i, Math.min(i + POST_BULK_SIZE, tests.size()))); + String uftTestJson = convertToJsonString(data); + client.updateEntities(Long.parseLong(workspaceId), OctaneConstants.Tests.COLLECTION_NAME, uftTestJson); } } - - if (!createAsNewTests.isEmpty()) { - return postTests(client, createAsNewTests, workspaceId, scmRepositoryId); - } else { - return true; - } + return true; } catch (Exception e) { + logger.error("Failed to update tests : " + e.getMessage()); return false; } } - private boolean deleteScmResources(MqmRestClient client, List deletedResourceFiles, String workspaceId, String scmRepositoryId) { + private static Entity fetchDataTableFromOctane(MqmRestClient client, long workspaceIdAsLong, long scmRepositoryId, ScmResourceFile scmResource) { + List conditions = new ArrayList<>(); + conditions.add(QueryHelper.condition(OctaneConstants.DataTables.RELATIVE_PATH_FIELD, scmResource.getRelativePath())); + conditions.add(QueryHelper.conditionRef(OctaneConstants.DataTables.SCM_REPOSITORY_FIELD, scmRepositoryId)); + List entities = client.getEntities(workspaceIdAsLong, OctaneConstants.DataTables.COLLECTION_NAME, conditions, Arrays.asList("id, name")); + + return entities.size() == 1 ? entities.get(0) : null; + } + + private static boolean deleteScmResources(MqmRestClient client, List deletedResourceFiles, String workspaceId, String scmRepositoryId) { long workspaceIdAsLong = Long.parseLong(workspaceId); + long scmRepositoryIdAsLong = Long.parseLong(scmRepositoryId); Set deletedIds = new HashSet<>(); try { for (ScmResourceFile scmResource : deletedResourceFiles) { - List conditions = new ArrayList<>(); - conditions.add(QueryHelper.condition("relative_path", scmResource.getRelativePath())); - conditions.add(QueryHelper.conditionRef("scm_repository", Long.valueOf(scmRepositoryId))); - - PagedList foundResources = client.getEntities(workspaceIdAsLong, SCM_RESOURCE_FILES_COLLECTION_NAME, conditions, Arrays.asList("id, name")); - if (foundResources.getItems().size() == 1) { - Entity found = foundResources.getItems().get(0); + Entity found = fetchDataTableFromOctane(client, workspaceIdAsLong, scmRepositoryIdAsLong, scmResource); + if (found != null) { deletedIds.add(found.getId()); } } - client.deleteEntities(Long.parseLong(workspaceId), SCM_RESOURCE_FILES_COLLECTION_NAME, deletedIds); + client.deleteEntities(Long.parseLong(workspaceId), OctaneConstants.DataTables.COLLECTION_NAME, deletedIds); return true; } catch (Exception e) { return false; } - } private static void completeTestProperties(MqmRestClient client, long workspaceId, Collection tests, String scmRepositoryId) { @@ -402,7 +576,7 @@ private static void completeTestProperties(MqmRestClient client, long workspaceI ListNodeEntity guiTestType = hasTestsByType(tests, UftTestType.GUI) ? getGuiTestType(client, workspaceId) : null; ListNodeEntity apiTestType = hasTestsByType(tests, UftTestType.API) ? getApiTestType(client, workspaceId) : null; - BaseRefEntity scmRepository = StringUtils.isEmpty(scmRepositoryId) ? null : BaseRefEntity.create("scm_repository", Long.valueOf(scmRepositoryId)); + BaseRefEntity scmRepository = StringUtils.isEmpty(scmRepositoryId) ? null : BaseRefEntity.create(OctaneConstants.Tests.SCM_REPOSITORY_FIELD, Long.valueOf(scmRepositoryId)); for (AutomatedTest test : tests) { test.setTestingToolType(uftTestingTool); test.setFramework(uftFramework); @@ -417,14 +591,14 @@ private static void completeTestProperties(MqmRestClient client, long workspaceI } private static void completeScmResourceProperties(List resources, String scmResourceId) { - BaseRefEntity scmRepository = StringUtils.isEmpty(scmResourceId) ? null : BaseRefEntity.create("scm_repository", Long.valueOf(scmResourceId)); + BaseRefEntity scmRepository = StringUtils.isEmpty(scmResourceId) ? null : BaseRefEntity.create(OctaneConstants.DataTables.SCM_REPOSITORY_FIELD, Long.valueOf(scmResourceId)); for (ScmResourceFile resource : resources) { resource.setScmRepository(scmRepository); } } private static ListNodeEntity getUftTestingTool(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.testing_tool_type", null, workspaceId, 0, 100); + PagedList testingTools = client.queryListItems("list_node.testing_tool_type", null, workspaceId, 0, POST_BULK_SIZE); String uftTestingToolLogicalName = "list_node.testing_tool_type.uft"; for (ListItem item : testingTools.getItems()) { @@ -436,7 +610,7 @@ private static ListNodeEntity getUftTestingTool(MqmRestClient client, long works } private static ListNodeEntity getUftFramework(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.je.framework", null, workspaceId, 0, 100); + PagedList testingTools = client.queryListItems("list_node.je.framework", null, workspaceId, 0, POST_BULK_SIZE); String uftTestingToolLogicalName = "list_node.je.framework.uft"; for (ListItem item : testingTools.getItems()) { @@ -448,7 +622,7 @@ private static ListNodeEntity getUftFramework(MqmRestClient client, long workspa } private static ListNodeEntity getGuiTestType(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, 100); + PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, POST_BULK_SIZE); String guiLogicalName = "list_node.test_type.gui"; for (ListItem item : testingTools.getItems()) { @@ -460,7 +634,7 @@ private static ListNodeEntity getGuiTestType(MqmRestClient client, long workspac } private static ListNodeEntity getApiTestType(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, 100); + PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, POST_BULK_SIZE); String guiLogicalName = "list_node.test_type.api"; for (ListItem item : testingTools.getItems()) { @@ -485,11 +659,6 @@ public void setTestResultQueue(UftTestDiscoveryQueue queue) { this.queue = queue; } - @Inject - public void setConfigurationService(ConfigurationService configurationService) { - this.configurationService = configurationService; - } - private static boolean hasTestsByType(Collection tests, UftTestType uftTestType) { for (AutomatedTest test : tests) { if (uftTestType.equals(test.getUftTestType())) { diff --git a/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index eb42b8def3..376f798d16 100644 --- a/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/hp/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -16,6 +16,7 @@ package com.hp.application.automation.tools.octane.tests.junit; +import com.hp.application.automation.tools.octane.executor.OctaneConstants; import com.hp.application.automation.tools.octane.tests.HPRunnerType; import com.hp.application.automation.tools.octane.tests.xml.AbstractXmlIterator; import com.hp.octane.integrations.dto.DTOFactory; @@ -38,6 +39,9 @@ import java.text.ParseException; import java.util.List; +/** + * JUnit iterator over test result. Enrich test result before sending to server + */ public class JUnitXmlIterator extends AbstractXmlIterator { private static final Logger logger = LogManager.getLogger(JUnitXmlIterator.class); @@ -151,11 +155,12 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I // if workspace is prefix of the method name, cut it off // currently this handling is needed for UFT tests String path = testName.substring(workspace.getRemote().length()); - path = StringUtils.strip(path, "\\/"); + path = path.replace(OctaneConstants.General.LINUX_PATH_SPLITTER, OctaneConstants.General.WINDOWS_PATH_SPLITTER); + path = StringUtils.strip(path, OctaneConstants.General.WINDOWS_PATH_SPLITTER); //split path to package and and name fields - if (path.contains(File.separator)) { - int testNameStartIndex = path.indexOf(File.separator); + if (path.contains(OctaneConstants.General.WINDOWS_PATH_SPLITTER)) { + int testNameStartIndex = path.lastIndexOf(OctaneConstants.General.WINDOWS_PATH_SPLITTER); testName = path.substring(testNameStartIndex + 1); packageName = path.substring(0, testNameStartIndex); From c3b8a069342c75210aec76b5c884d79d78706327 Mon Sep 17 00:00:00 2001 From: bamh Date: Thu, 8 Jun 2017 13:06:43 +0300 Subject: [PATCH 0062/2502] Advanced trending option and Support automatically finding and creating Test Instance (#198) * index on master: ab83a3d Merge remote-tracking branch 'remotes/origin/5.0.1-beta-SNAPSHOT' * Revert pom changes * Merge branch '5.0.1-beta-SNAPSHOT' of https://github.com/hpsa/hp-application-automation-tools-plugin into development # Conflicts: # .github/PULL_REQUEST_TEMPLATE.md * Added some comments * changes according to sonarlint * changes for sonarlint * Remove some comments * Comments * * Fix for supporting SECURITY-170 changes * https://jenkins.io/blog/2016/05/11/security-update/ * https://issues.jenkins-ci.org/browse/JENKINS-39654 * code changes for sonarlint * Changes in PC configuration section header * Adding support for Jenkins using proxy: https://issues.jenkins-ci.org/browse/JENKINS-44314 Changing the HTTPS checkbox position * Adding link under Test ID text box for browsing to the PC Server * Added support for creating TESTINSTANCEID before running a test. Still needs to add: 1. TestSetID is a stub, we need to check if there is one and to create if not exists 2. Need to check if a test instance id is already exists * Adding support for createTestInstance if test instance is not available. * SonarLint Changes * Support auto trending options https://issues.jenkins-ci.org/browse/JENKINS-44723 * Added Unit Testing for new Tests Rest API * Minor change in UI * Small change regarding the flow of the Auto Trending feature --- .../automation/tools/model/PcModel.java | 28 +++++--- .../automation/tools/model/PostRunAction.java | 2 +- .../automation/tools/pc/PcClient.java | 71 +++++++++++++++++-- .../automation/tools/pc/PcRestProxy.java | 48 +++++++++++++ .../automation/tools/pc/PcTest.java | 36 ++++++++++ .../automation/tools/pc/PcTestData.java | 71 +++++++++++++++++++ .../automation/tools/pc/PcTestInstance.java | 31 ++++++++ .../automation/tools/pc/PcTestInstances.java | 32 +++++++++ .../automation/tools/pc/PcTestSet.java | 37 ++++++++++ .../automation/tools/pc/PcTestSets.java | 32 +++++++++ .../tools/pc/TestInstanceCreateRequest.java | 56 +++++++++++++++ .../automation/tools/run/PcBuilder.java | 55 ++++++++++---- .../tools/run/PcBuilder/config.jelly | 60 ++++++++++++---- .../automation/tools/pc/MockPcModel.java | 6 +- .../automation/tools/pc/MockPcRestProxy.java | 4 ++ .../automation/tools/pc/PcTestBase.java | 8 ++- 16 files changed, 534 insertions(+), 43 deletions(-) create mode 100644 src/main/java/com/hp/application/automation/tools/pc/PcTest.java create mode 100644 src/main/java/com/hp/application/automation/tools/pc/PcTestData.java create mode 100644 src/main/java/com/hp/application/automation/tools/pc/PcTestInstance.java create mode 100644 src/main/java/com/hp/application/automation/tools/pc/PcTestInstances.java create mode 100644 src/main/java/com/hp/application/automation/tools/pc/PcTestSet.java create mode 100644 src/main/java/com/hp/application/automation/tools/pc/PcTestSets.java create mode 100644 src/main/java/com/hp/application/automation/tools/pc/TestInstanceCreateRequest.java diff --git a/src/main/java/com/hp/application/automation/tools/model/PcModel.java b/src/main/java/com/hp/application/automation/tools/model/PcModel.java index d5d8b2031b..37c9041c15 100644 --- a/src/main/java/com/hp/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hp/application/automation/tools/model/PcModel.java @@ -11,7 +11,7 @@ public class PcModel { public static final String COLLATE = "Collate Results"; - public static final String COLLATE_ANALYZE = "Collate And Analyze"; + public static final String COLLATE_ANALYZE = "Collate and Analyze"; public static final String DO_NOTHING = "Do Not Collate"; private final String pcServerName; @@ -21,19 +21,21 @@ public class PcModel { private final String almProject; private final String testId; private final String testInstanceId; + private final String autoTestInstanceID; private final TimeslotDuration timeslotDuration; private final PostRunAction postRunAction; private final boolean vudsMode; private final String description; - private final boolean addRunToTrendReport; - private final String trendReportId; + private final String addRunToTrendReport; + private String trendReportId; private final boolean HTTPSProtocol; private final String proxyOutURL; + @DataBoundConstructor public PcModel(String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, - String testId, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, - PostRunAction postRunAction, boolean vudsMode, String description, boolean addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { + String testId,String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, + PostRunAction postRunAction, boolean vudsMode, String description, String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { this.pcServerName = pcServerName; this.almUserName = almUserName; @@ -41,6 +43,7 @@ public PcModel(String pcServerName, String almUserName, String almPassword, Stri this.almDomain = almDomain; this.almProject = almProject; this.testId = testId; + this.autoTestInstanceID = autoTestInstanceID; this.testInstanceId = testInstanceId; this.timeslotDuration = new TimeslotDuration(timeslotDurationHours, timeslotDurationMinutes); this.postRunAction = postRunAction; @@ -90,10 +93,13 @@ public String getTestId() { } public String getTestInstanceId() { - return this.testInstanceId; } + public String getAutoTestInstanceID(){ + return this.autoTestInstanceID; + } + public TimeslotDuration getTimeslotDuration() { return this.timeslotDuration; @@ -122,11 +128,11 @@ public String getProxyOutURL(){ return this.proxyOutURL; } - public static List getPostRunActions() { return Arrays.asList(PostRunAction.values()); } + @Override public String toString() { @@ -136,7 +142,7 @@ public String toString() { public String runParamsToString() { String vudsModeString = (vudsMode) ? ", VUDsMode='true'" : ""; - String trendString = (addRunToTrendReport) ? String.format(", TrendReportID = '%s'",trendReportId) : ""; + String trendString = ("USE_ID").equals(addRunToTrendReport) ? String.format(", TrendReportID = '%s'",trendReportId) : ""; return String.format("[Domain='%s', Project='%s', TestID='%s', " + "TestInstanceID='%s', TimeslotDuration='%s', PostRunAction='%s'%s%s]", @@ -150,7 +156,11 @@ public String getTrendReportId() { return trendReportId; } - public boolean isAddRunToTrendReport() { + public void setTrendReportId(String trendReportId){ + this.trendReportId = trendReportId; + } + + public String getAddRunToTrendReport() { return addRunToTrendReport; } diff --git a/src/main/java/com/hp/application/automation/tools/model/PostRunAction.java b/src/main/java/com/hp/application/automation/tools/model/PostRunAction.java index e1e84de1b9..64d8a1df5d 100644 --- a/src/main/java/com/hp/application/automation/tools/model/PostRunAction.java +++ b/src/main/java/com/hp/application/automation/tools/model/PostRunAction.java @@ -3,7 +3,7 @@ public enum PostRunAction { COLLATE("Collate Results"), - COLLATE_AND_ANALYZE("Collate And Analyze"), + COLLATE_AND_ANALYZE("Collate and Analyze"), DO_NOTHING("Do Not Collate"); private String value; diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcClient.java b/src/main/java/com/hp/application/automation/tools/pc/PcClient.java index 115f239f01..c9b501dd1b 100644 --- a/src/main/java/com/hp/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hp/application/automation/tools/pc/PcClient.java @@ -73,7 +73,7 @@ public PcClient(PcModel pcModel, PrintStream logger, T p public boolean login() { try { String user = model.getAlmUserName(); - logger.println(String.format("Trying to login\n[PCServer='%s', User='%s']", model.getPcServerName(), user)); + logger.println(String.format("Trying to login\n[PCServer='%s://%s', User='%s']",model.isHTTPSProtocol(), model.getPcServerName(), user)); loggedIn = restProxy.authenticate(user, model.getAlmPassword().toString()); } catch (PcException e) { logger.println(e.getMessage()); @@ -102,9 +102,17 @@ public boolean isLoggedIn() { public int startRun() throws NumberFormatException, ClientProtocolException, PcException, IOException { + + + + int testID = Integer.parseInt(model.getTestId()); + int testInstance = getCorrectTestInstanceID(testID); + setCorrectTrendReportID(); + + logger.println(String.format("\nExecuting Load Test: \n====================\nTest ID: %s \nTest Instance ID: %s \nTimeslot Duration: %s \nPost Run Action: %s \nUse VUDS: %s\n====================\n", Integer.parseInt(model.getTestId()), testInstance, model.getTimeslotDuration() ,model.getPostRunAction().getValue(),model.isVudsMode())); // logger.println("Sending run request:\n" + model.runParamsToString()); - PcRunResponse response = restProxy.startRun(Integer.parseInt(model.getTestId()), - Integer.parseInt(model.getTestInstanceId()), + PcRunResponse response = restProxy.startRun(testID, + testInstance, model.getTimeslotDuration(), model.getPostRunAction().getValue(), model.isVudsMode()); @@ -113,6 +121,60 @@ public int startRun() throws NumberFormatException, ClientProtocolException, PcE return response.getID(); } + private int getCorrectTestInstanceID(int testID) throws IOException, PcException { + if("AUTO".equals(model.getAutoTestInstanceID())){ + try { + + + logger.println("Searching for available Test Instance"); + PcTestInstances pcTestInstances = restProxy.getTestInstancesByTestId(testID); + int testInstanceID = 0; + if (pcTestInstances != null && pcTestInstances.getTestInstancesList() != null){ + PcTestInstance pcTestInstance = pcTestInstances.getTestInstancesList().get(pcTestInstances.getTestInstancesList().size()-1); + testInstanceID = pcTestInstance.getInstanceId(); + logger.println("Found testInstanceId: " + testInstanceID); + }else{ + logger.println("Could not find available TestInstanceID, Creating Test Instance."); + logger.println("Searching for available TestSet"); + // Get a random TestSet + PcTestSets pcTestSets = restProxy.GetAllTestSets(); + if (pcTestSets !=null && pcTestSets.getPcTestSetsList() !=null){ + PcTestSet pcTestSet = pcTestSets.getPcTestSetsList().get(pcTestSets.getPcTestSetsList().size()-1); + int testSetID = pcTestSet.TestSetID; + logger.println(String.format("Creating Test Instance with testID: %s and TestSetID: %s", testID,testSetID)); + testInstanceID = restProxy.createTestInstance(testID,testSetID); + logger.println(String.format("Test Instance with ID : %s has been created successfully.", testInstanceID)); + }else{ + String msg = "No TestSetID available in project, please create a testset from Performance Center UI"; + logger.println(msg); + throw new PcException(msg); + } + } + return testInstanceID; + } catch (Exception e){ + logger.println(String.format("getCorrectTestInstanceID failed, reason: %s",e)); + return Integer.parseInt(null); + } + } + return Integer.parseInt(model.getTestInstanceId()); + } + + private void setCorrectTrendReportID() throws IOException, PcException { + // If the user selected "Use trend report associated with the test" we want the report ID to be the one from the test + if (("ASSOCIATED").equals(model.getAddRunToTrendReport())){ + PcTest pcTest = restProxy.getTestData(Integer.parseInt(model.getTestId())); + if (pcTest.getTrendReportId() > -1) + model.setTrendReportId(String.valueOf(pcTest.getTrendReportId())); + else{ + String msg = "No trend report ID is associated with the test.\n" + + "Please turn Automatic Trending on for the test through Performance Center UI.\n" + + "Alternatively you can check 'Add run to trend report with ID' on Jenkins job configuration."; + throw new PcException(msg); + } + } + + } + public PcRunResponse waitForRunCompletion(int runId) throws InterruptedException, ClientProtocolException, PcException, IOException { return waitForRunCompletion(runId, 5000); @@ -232,7 +294,8 @@ public PcRunEventLog getRunEventLog(int runId){ return null; } - public void addRunToTrendReport(int runId, String trendReportId){ + public void addRunToTrendReport(int runId, String trendReportId) + { TrendReportRequest trRequest = new TrendReportRequest(model.getAlmProject(), runId, null); logger.println("Adding run: " + runId + " to trend report: " + trendReportId); diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java index fd10aa7fa7..e2371da70c 100644 --- a/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hp/application/automation/tools/pc/PcRestProxy.java @@ -49,11 +49,14 @@ import org.apache.http.impl.conn.SchemeRegistryFactory; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.HttpContext; +import org.xml.sax.SAXException; +import javax.xml.parsers.ParserConfigurationException; import java.io.OutputStream; import java.io.InputStream; import java.io.IOException; import java.io.FileOutputStream; +import java.net.URLEncoder; import java.util.*; import java.io.PrintStream; @@ -69,6 +72,9 @@ public class PcRestProxy { protected static final String AUTHENTICATION_LOGOUT_URL = BASE_PC_API_AUTHENTICATION_URL + "/logout"; protected static final String PC_API_RESOURCES_TEMPLATE = BASE_PC_API_URL + "/domains/%s/projects/%s"; protected static final String RUNS_RESOURCE_NAME = "Runs"; + protected static final String TESTS_RESOURCE_NAME = "tests"; + protected static final String TEST_INSTANCES_NAME = "testinstances"; + protected static final String TEST_SETS_NAME = "testsets"; protected static final String RESULTS_RESOURCE_NAME = "Results"; protected static final String EVENTLOG_RESOURCE_NAME = "EventLog"; protected static final String TREND_REPORT_RESOURCE_NAME = "TrendReports"; @@ -164,6 +170,40 @@ public PcRunResponse startRun(int testId, int testInstaceId, TimeslotDuration ti return PcRunResponse.xmlToObject(startRunResponse); } + + public int createTestInstance(int testId, int testSetId) throws PcException, ClientProtocolException, IOException { + HttpPost createTestInstanceRequest = new HttpPost(String.format(baseURL + "/%s", TEST_INSTANCES_NAME)); + TestInstanceCreateRequest testInstanceCreateRequest = new TestInstanceCreateRequest(testId,testSetId); + createTestInstanceRequest.setEntity(new StringEntity(testInstanceCreateRequest.objectToXML(), ContentType.APPLICATION_XML)); + createTestInstanceRequest.addHeader(RESTConstants.CONTENT_TYPE, CONTENT_TYPE_XML); + HttpResponse response = executeRequest(createTestInstanceRequest); + String responseXml = IOUtils.toString(response.getEntity().getContent()); + int testInstanceID = 0; + try { + testInstanceID = testInstanceCreateRequest.getTestInstanceIDFromResponse(responseXml,"TestInstanceID"); + } catch (SAXException|ParserConfigurationException e) { + throw new PcException("createTestInstance exception: " + e); + } + return testInstanceID; + } + + public PcTestSets GetAllTestSets()throws IOException,PcException{ + String getTestSetsUrl = String.format(baseURL + "/%s", TEST_SETS_NAME); + HttpGet getTestSetsRequest = new HttpGet(getTestSetsUrl); + HttpResponse response = executeRequest(getTestSetsRequest); + String testSets = IOUtils.toString(response.getEntity().getContent()); + return PcTestSets.xmlToObject(testSets); + } + + public PcTestInstances getTestInstancesByTestId(int testId)throws PcException,IOException{ + String uri = String.format(baseURL + "/%s?%s=%s", TEST_INSTANCES_NAME,"query",URLEncoder.encode("{test-id[" + testId + "]}","UTF-8")); + HttpGet getFirtstTestInstanceByTestID = new HttpGet(uri); + HttpResponse response = executeRequest(getFirtstTestInstanceByTestID); + String testInstances = IOUtils.toString(response.getEntity().getContent()); + return PcTestInstances.xmlToObject(testInstances); + + } + public boolean stopRun(int runId, String stopMode) throws PcException, ClientProtocolException, IOException { String stopUrl = String.format(baseURL + "/%s/%s/%s", RUNS_RESOURCE_NAME, runId, stopMode); HttpPost stopRunRequest = new HttpPost(stopUrl); @@ -181,6 +221,13 @@ public PcRunResponse getRunData(int runId) throws PcException, ClientProtocolExc return PcRunResponse.xmlToObject(runData); } + public PcTest getTestData(int testId) throws IOException, PcException { + HttpGet getTestDataRequest = new HttpGet(String.format(baseURL + "/%s/%s",TESTS_RESOURCE_NAME,testId )); + HttpResponse response = executeRequest(getTestDataRequest); + String testData = IOUtils.toString(response.getEntity().getContent()); + return PcTestData.xmlToObject(testData); + } + public PcRunResults getRunResults(int runId) throws PcException, ClientProtocolException, IOException { String getRunResultsUrl = String .format(baseURL + "/%s/%s/%s", RUNS_RESOURCE_NAME, runId, RESULTS_RESOURCE_NAME); @@ -278,4 +325,5 @@ public static boolean isOk (HttpResponse response) { protected String getBaseURL() { return baseURL; } + } diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcTest.java b/src/main/java/com/hp/application/automation/tools/pc/PcTest.java new file mode 100644 index 0000000000..2886be759d --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/pc/PcTest.java @@ -0,0 +1,36 @@ +package com.hp.application.automation.tools.pc; + +/** + * Created by bemh on 6/5/2017. + * Partial implementation of the test xml structure + */ +public class PcTest { + + + private int testId; + private String testName; + + private int trendReportId = -1; + + + + public int getTestId() { + return testId; + } + + public String getTestName() { + return testName; + } + + public void setTrendReportId(int trendReportId) { + this.trendReportId = trendReportId; + } + + public int getTrendReportId() { + return trendReportId; + } + + public void setTestId(int testId){this.testId = testId;} + + public void setTestName(String testName){this.testName = testName;} +} diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcTestData.java b/src/main/java/com/hp/application/automation/tools/pc/PcTestData.java new file mode 100644 index 0000000000..7f98bdc392 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/pc/PcTestData.java @@ -0,0 +1,71 @@ +package com.hp.application.automation.tools.pc; + +import com.thoughtworks.xstream.XStream; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.StringReader; + +/** + * Created by bemh on 6/5/2017. + * Partial implementation of the test xml structure + */ +public class PcTestData { + + + + + static Document dom; + static DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + + + public static PcTest xmlToObject(String xml){ + + PcTest pcTest = new PcTest(); + + try { + DocumentBuilder db = dbf.newDocumentBuilder(); + dom = db.parse(new InputSource(new StringReader(xml))); + Element doc = dom.getDocumentElement(); + NodeList nListTestNodes = doc.getElementsByTagName("AutomaticTrending"); + if (nListTestNodes.getLength() >0 ) + { + NodeList nListChild = nListTestNodes.item(0).getChildNodes(); + for (int j=0;j < nListChild.getLength();j++) { + if (nListChild.item(j).getNodeName().equals("ReportId")){ + pcTest.setTrendReportId(Integer.parseInt(nListChild.item(j).getTextContent())); + break; + } + } + } + + nListTestNodes = doc.getElementsByTagName("ID"); + pcTest.setTestId(Integer.parseInt(nListTestNodes.item(0).getFirstChild().getNodeValue())); + + nListTestNodes = doc.getElementsByTagName("Name"); + pcTest.setTestName(nListTestNodes.item(0).getFirstChild().getNodeValue()); + + + + + }catch (ParserConfigurationException pce) { + System.out.println(pce.getMessage()); + } catch (SAXException se) { + System.out.println(se.getMessage()); + } catch (IOException ioe) { + System.err.println(ioe.getMessage()); + } + + return pcTest; + } + +} diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcTestInstance.java b/src/main/java/com/hp/application/automation/tools/pc/PcTestInstance.java new file mode 100644 index 0000000000..ba02002e45 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/pc/PcTestInstance.java @@ -0,0 +1,31 @@ +package com.hp.application.automation.tools.pc; + +import com.thoughtworks.xstream.XStream; + +/** + * Created by bemh on 6/1/2017. + */ +public class PcTestInstance { + public int TestID; + public int TestSetID; + public int TestInstanceID; + + public static PcTestInstance xmlToObject(String xml) + { + XStream xstream = new XStream(); + xstream.alias("TestInstanceID" , PcRunResult.class); + return (PcTestInstance)xstream.fromXML(xml); + } + + public int getInstanceId() { + return TestInstanceID; + } + + public int getTestId(){ + return TestID; + } + + public int getTestSetId(){ + return TestSetID; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcTestInstances.java b/src/main/java/com/hp/application/automation/tools/pc/PcTestInstances.java new file mode 100644 index 0000000000..90a088b457 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/pc/PcTestInstances.java @@ -0,0 +1,32 @@ +package com.hp.application.automation.tools.pc; + +import com.thoughtworks.xstream.XStream; + +import java.util.ArrayList; + +/** + * Created by bemh on 6/1/2017. + */ +public class PcTestInstances { + + + private ArrayList TestInstancesList; + + public PcTestInstances() { + TestInstancesList = new ArrayList(); + } + + public static PcTestInstances xmlToObject(String xml) + { + XStream xstream = new XStream(); + xstream.alias("TestInstance" , PcTestInstance.class); + xstream.alias("TestInstances" , PcTestInstances.class); + xstream.addImplicitCollection(PcTestInstances.class, "TestInstancesList"); + xstream.setClassLoader(PcTestInstances.class.getClassLoader()); + return (PcTestInstances)xstream.fromXML(xml); + } + + public ArrayList getTestInstancesList() { + return TestInstancesList; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcTestSet.java b/src/main/java/com/hp/application/automation/tools/pc/PcTestSet.java new file mode 100644 index 0000000000..16e30529fb --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/pc/PcTestSet.java @@ -0,0 +1,37 @@ +package com.hp.application.automation.tools.pc; + +import com.thoughtworks.xstream.XStream; + +/** + * Created by bemh on 6/1/2017. + */ +public class PcTestSet { + + String TestSetName; + String TestSetComment; + int TestSetParentId; + int TestSetID; + + public static PcTestSet xmlToObject(String xml){ + XStream xstream = new XStream(); + xstream.alias("TestSetID" , PcRunResult.class); + return (PcTestSet)xstream.fromXML(xml); + } + + + public String getTestSetName(){ + return TestSetName; + } + public String getTestSetComment(){ + return TestSetComment; + } + + public int getTestSetParentId(){ + return TestSetParentId; + } + + public int getTestSetID(){ + return TestSetID; + } + +} diff --git a/src/main/java/com/hp/application/automation/tools/pc/PcTestSets.java b/src/main/java/com/hp/application/automation/tools/pc/PcTestSets.java new file mode 100644 index 0000000000..63f09a847f --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/pc/PcTestSets.java @@ -0,0 +1,32 @@ +package com.hp.application.automation.tools.pc; + +import com.thoughtworks.xstream.XStream; + +import java.util.ArrayList; + +/** + * Created by bemh on 6/1/2017. + */ +public class PcTestSets { + + private ArrayList pcTestSetsList; + + public PcTestSets(){ + pcTestSetsList = new ArrayList(); + } + + + public static PcTestSets xmlToObject(String xml) + { + XStream xstream = new XStream(); + xstream.alias("TestSet" , PcTestSet.class); + xstream.alias("TestSets" , PcTestSets.class); + xstream.addImplicitCollection(PcTestSets.class, "pcTestSetsList"); + xstream.setClassLoader(PcTestSets.class.getClassLoader()); + return (PcTestSets)xstream.fromXML(xml); + } + + public ArrayList getPcTestSetsList() { + return pcTestSetsList; + } +} diff --git a/src/main/java/com/hp/application/automation/tools/pc/TestInstanceCreateRequest.java b/src/main/java/com/hp/application/automation/tools/pc/TestInstanceCreateRequest.java new file mode 100644 index 0000000000..705c13c9e4 --- /dev/null +++ b/src/main/java/com/hp/application/automation/tools/pc/TestInstanceCreateRequest.java @@ -0,0 +1,56 @@ +package com.hp.application.automation.tools.pc; + +import com.thoughtworks.xstream.XStream; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.StringReader; + +/** + * Created by bemh on 5/23/2017. + */ +public class TestInstanceCreateRequest { + + private String xmlns = PcRestProxy.PC_API_XMLNS; + + private int testId; + private int testSetId; + + public TestInstanceCreateRequest(int testId, int testSetId) { + this.testId = testId; + this.testSetId = testSetId; + } + + public String objectToXML() { + XStream xstream = new XStream(); + xstream.useAttributeFor(TestInstanceCreateRequest.class, "xmlns"); + xstream.alias("TestInstance", TestInstanceCreateRequest.class); + xstream.aliasField("TestID", TestInstanceCreateRequest.class, "testId"); + xstream.aliasField("TestSetID", TestInstanceCreateRequest.class, "testSetId"); + return xstream.toXML(this); + } + + public int getTestInstanceIDFromResponse(String xml, String getTestInstanceID) throws IOException, SAXException, ParserConfigurationException { + + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + InputSource is = new InputSource(new ByteArrayInputStream(xml.getBytes("utf-8"))); + Document doc = builder.parse(is); + Element element = doc.getDocumentElement(); + + + NodeList nListTrendedRun = doc.getElementsByTagName("TestInstanceID"); + return Integer.parseInt(nListTrendedRun.item(0).getTextContent()); + + } +} diff --git a/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java index 812ca2a5b0..c01cd165c8 100644 --- a/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hp/application/automation/tools/run/PcBuilder.java @@ -102,13 +102,14 @@ public PcBuilder( String almProject, String testId, String testInstanceId, + String autoTestInstanceID, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, boolean statusBySLA, String description, - boolean addRunToTrendReport, + String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { @@ -126,6 +127,7 @@ public PcBuilder( almDomain.trim(), almProject.trim(), testId.trim(), + autoTestInstanceID, testInstanceId.trim(), timeslotDurationHours.trim(), timeslotDurationMinutes.trim(), @@ -235,8 +237,16 @@ private Testsuites run(PcClient pcClient, Run build) if (response != null && RunState.get(response.getRunState()) == FINISHED) { pcReportFile = pcClient.publishRunReport(runId, getReportDirectory(build)); - // Adding the trend report section - if(pcModel.isAddRunToTrendReport() && pcModel.getTrendReportId() != null && RunState.get(response.getRunState()) != RUN_FAILURE){ + // Adding the trend report section if ID has been set + if(("USE_ID").equals(pcModel.getAddRunToTrendReport()) && pcModel.getTrendReportId() != null && RunState.get(response.getRunState()) != RUN_FAILURE){ + pcClient.addRunToTrendReport(this.runId, pcModel.getTrendReportId()); + pcClient.waitForRunToPublishOnTrendReport(this.runId, pcModel.getTrendReportId()); + pcClient.downloadTrendReportAsPdf(pcModel.getTrendReportId(), getTrendReportsDirectory(build)); + trendReportReady = true; + } + + // Adding the trend report if the Associated Trend report is selected. + if(("ASSOCIATED").equals(pcModel.getAddRunToTrendReport()) && RunState.get(response.getRunState()) != RUN_FAILURE){ pcClient.addRunToTrendReport(this.runId, pcModel.getTrendReportId()); pcClient.waitForRunToPublishOnTrendReport(this.runId, pcModel.getTrendReportId()); pcClient.downloadTrendReportAsPdf(pcModel.getTrendReportId(), getTrendReportsDirectory(build)); @@ -311,8 +321,10 @@ private boolean validatePcForm() { String modelMethodName = modelMethod.getName(); if (modelMethodName.toLowerCase().equals("get" + name)) { try { - Object obj = - method.invoke(getDescriptor(), modelMethod.invoke(getPcModel())); + Object obj = FormValidation.ok(); + if (!(name.equals("testinstanceid")&& pcModel.getAutoTestInstanceID().equals("AUTO"))){ + obj = method.invoke(getDescriptor(), modelMethod.invoke(getPcModel())); + } if (!obj.equals(FormValidation.ok())) { logger.println(obj); ret = false; @@ -326,14 +338,15 @@ private boolean validatePcForm() { } } - boolean isTrendReportIdValid = validateTrendReportIdIsNumeric(getPcModel().getTrendReportId(), - getPcModel().isAddRunToTrendReport()); + boolean isTrendReportIdValid = validateTrendReportIdIsNumeric(getPcModel().getTrendReportId(),("USE_ID").equals(getPcModel().getAddRunToTrendReport())); ret &= isTrendReportIdValid; return ret; } + + private boolean validateTrendReportIdIsNumeric(String trendReportId, boolean addRunToTrendReport){ FormValidation res = FormValidation.ok(); @@ -587,15 +600,19 @@ public String getTrendReportId() return getPcModel().getTrendReportId(); } + public String autoTestInstanceID() + { + return getPcModel().getAutoTestInstanceID(); + } public String getTestInstanceId() { return getPcModel().getTestInstanceId(); } - public boolean isAddRunToTrendReport() + public String getAddRunToTrendReport() { - return getPcModel().isAddRunToTrendReport(); + return getPcModel().getAddRunToTrendReport(); } @@ -677,11 +694,23 @@ public FormValidation doCheckTestId(@QueryParameter String value) { return validateHigherThanInt(value, "Test ID", 0, true); } - - public FormValidation doCheckTestInstanceId(@QueryParameter String value) { - + + + // if autoTestInstanceID is selected we don't need to check the validation of the test instance +// public static FormValidation CheckOnlyAutoTestInstanceId(String autoTestInstanceID){ +// if(autoTestInstanceID.equals("AUTO")) +// return FormValidation.ok(); +// else +// return FormValidation.error("Error "); +// } + + + + public FormValidation doCheckTestInstanceId(@QueryParameter String value){ return validateHigherThanInt(value, "Test Instance ID", 0, true); } + + public FormValidation doCheckTimeslotDuration(@QueryParameter TimeslotDuration value) { @@ -737,12 +766,12 @@ private FormValidation validateString(String value, String field) { return ret; } - public List getPostRunActions() { return PcModel.getPostRunActions(); } + } diff --git a/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly index 15bf085df5..b61e4b9ff7 100644 --- a/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/hp/application/automation/tools/run/PcBuilder/config.jelly @@ -14,7 +14,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> - + + + + diff --git a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java index 770522d5b2..6283bf6b24 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java @@ -8,10 +8,10 @@ public class MockPcModel extends PcModel { - public MockPcModel(String pcServerName, String almUserName, String almPassword, String almDomain, + public MockPcModel(String serverandport, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId, String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, boolean webProtocol) { - super(pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, + super(serverandport, pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null ); } diff --git a/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java b/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java index f2a84b2057..b9181d5984 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java @@ -22,7 +22,8 @@ public interface PcTestBase { - public static final String PC_SERVER_NAME = "pcServer.hp.com"; + public static final String SERVER_AND_PORT = "jenkins.server:8082"; + public static final String PC_SERVER_NAME = "pcServer.hp.com"; public static final String ALM_USER_NAME = "sa"; public static final String ALM_PASSWORD = "pwd"; public static final String ALM_DOMAIN = "ALMDOM"; @@ -44,7 +45,7 @@ public interface PcTestBase { public static final String TESTINSTANCEID = "MANUAL"; public static final PrintStream LOGGER = null; - public static final MockPcModel pcModel = new MockPcModel(PC_SERVER_NAME, ALM_USER_NAME, + public static final MockPcModel pcModel = new MockPcModel(SERVER_AND_PORT,PC_SERVER_NAME, ALM_USER_NAME, ALM_PASSWORD, ALM_DOMAIN, ALM_PROJECT, TEST_ID,TESTINSTANCEID, TEST_INSTANCE_ID, TIMESLOT_DURATION_HOURS, From 155206c81c0b3c9e4bc8cff1b354c872c1f15827 Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Wed, 13 Sep 2017 15:55:26 +0300 Subject: [PATCH 0140/2502] serverandport changed to serverAndPort --- .../application/automation/tools/model/PcModel.java | 10 +++++----- .../application/automation/tools/run/PcBuilder.java | 6 +++--- .../automation/tools/run/PcBuilder/config.jelly | 6 +++--- .../application/automation/tools/pc/MockPcModel.java | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java index cb6b62e9f4..4189190840 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java @@ -14,7 +14,7 @@ public class PcModel { public static final String COLLATE_ANALYZE = "Collate and Analyze"; public static final String DO_NOTHING = "Do Not Collate"; - private final String serverandport; + private final String serverAndPort; private final String pcServerName; private final String almUserName; private final SecretContainer almPassword; @@ -34,11 +34,11 @@ public class PcModel { @DataBoundConstructor - public PcModel(String serverandport, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, + public PcModel(String serverAndPort, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId,String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { - this.serverandport = serverandport; + this.serverAndPort = serverAndPort; this.pcServerName = pcServerName; this.almUserName = almUserName; this.almPassword = setPassword(almPassword); @@ -64,8 +64,8 @@ protected SecretContainer setPassword(String almPassword) { return secretContainer; } - public String getserverandport(){ - return this.serverandport; + public String getserverAndPort(){ + return this.serverAndPort; } public String getPcServerName() { diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index 6c6bcf6d32..3c23a54e40 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -107,7 +107,7 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ @DataBoundConstructor public PcBuilder( - String serverandport, + String serverAndPort, String pcServerName, String almUserName, String almPassword, @@ -134,7 +134,7 @@ public PcBuilder( pcModel = new PcModel( - serverandport.trim(), + serverAndPort.trim(), pcServerName.trim(), almUserName.trim(), almPassword, @@ -590,7 +590,7 @@ private String getOutputForReportLinks(Run build) { String downloadUrl = String.format(urlPattern + "/%s", "*zip*/pcRun"); logger.println(HyperlinkNote.encodeTo(viewUrl, "View analysis report of run " + runId)); - return String.format("Load Test Run ID: %s\n\nView analysis report:\n%s\n\nDownload Report:\n%s", runId, pcModel.getserverandport() + "/" + build.getUrl() + viewUrl, pcModel.getserverandport() + "/" + build.getUrl() + downloadUrl); + return String.format("Load Test Run ID: %s\n\nView analysis report:\n%s\n\nDownload Report:\n%s", runId, pcModel.getserverAndPort() + "/" + build.getUrl() + viewUrl, pcModel.getserverAndPort() + "/" + build.getUrl() + downloadUrl); } private String getArtifactsUrlPattern(Run build) { diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly index 7a921ca21a..b12bc30a1c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly @@ -44,7 +44,7 @@ var href = window.location.href; var splitter = href.split("/job"); var baseurl = splitter[0]; - var p = document.getElementById('serverandport'); + var p = document.getElementById('serverAndPort'); if(p){ p.value = baseurl; } @@ -127,8 +127,8 @@ - - + + diff --git a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java index 6283bf6b24..662431c1e9 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java @@ -8,10 +8,10 @@ public class MockPcModel extends PcModel { - public MockPcModel(String serverandport, String pcServerName, String almUserName, String almPassword, String almDomain, + public MockPcModel(String serverAndPort, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId, String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, boolean webProtocol) { - super(serverandport, pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, + super(serverAndPort, pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null ); } From dcb77d668345af5ca55d96ce7d2b0e6e75260b3d Mon Sep 17 00:00:00 2001 From: radislavB Date: Thu, 14 Sep 2017 11:17:11 +0300 Subject: [PATCH 0141/2502] expose jenkins user + Octane user/APIKey for DevOps Admin (#39) * tech: modify jenkins user help text * tech: protect thread from unexpected termination * defect #443021 :expose jenkins user + Octane user/APIKey for DevOps Admin --- pom.xml | 4 +- .../tools/octane/CIJenkinsServicesImpl.java | 3 +- .../tools/octane/bridge/BridgeClient.java | 42 ++++++++++++------- src/main/webapp/help/impersonatedUser.html | 2 +- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index 5394d96992..933e9e4fd3 100644 --- a/pom.xml +++ b/pom.xml @@ -386,14 +386,14 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.4.4 + 1.4.7 mqm-rest-client com.hpe.adm.octane.ciplugins - 1.4.13 + 1.4.14 diff --git a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java index 2cd4f56d6a..0478654201 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -94,7 +94,8 @@ public CIServerInfo getServerInfo() { .setUrl(serverUrl) .setInstanceId(model.getIdentity()) .setInstanceIdFrom(model.getIdentityFrom()) - .setSendingTime(System.currentTimeMillis()); + .setSendingTime(System.currentTimeMillis()) + .setImpersonatedUser(model.getImpersonatedUser()); return result; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java index d068d285f6..a2dcff9000 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java @@ -20,6 +20,7 @@ import com.hp.mqm.client.exception.AuthenticationException; import com.hp.mqm.client.exception.ServerException; import com.hp.mqm.client.exception.TemporarilyUnavailableException; +import com.hp.mqm.client.model.AbridgedTaskPluginInfo; import com.hp.octane.integrations.OctaneSDK; import com.hp.octane.integrations.spi.CIPluginServices; import com.hp.octane.integrations.api.TasksProcessor; @@ -27,6 +28,7 @@ import com.hp.octane.integrations.dto.connectivity.OctaneResultAbridged; import com.hp.octane.integrations.dto.connectivity.OctaneTaskAbridged; import com.hpe.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; +import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; import com.hpe.application.automation.tools.octane.configuration.ServerConfiguration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -75,13 +77,16 @@ public void run() { CIPluginServices pluginServices = OctaneSDK.getInstance().getPluginServices(); try { MqmRestClient restClient = restClientFactory.obtain(mqmConfig.location, mqmConfig.sharedSpace, mqmConfig.username, mqmConfig.password); - tasksJSON = restClient.getAbridgedTasks( - serverInstanceId, - pluginServices.getServerInfo().getType().value(), - pluginServices.getServerInfo().getUrl(), - OctaneSDK.API_VERSION, - OctaneSDK.SDK_VERSION, - OctaneSDK.getInstance().getPluginServices().getPluginInfo().getVersion()); + AbridgedTaskPluginInfo info = new AbridgedTaskPluginInfo() + .setSelfIdentity(serverInstanceId) + .setSelfType(pluginServices.getServerInfo().getType().value()) + .setSelfLocation(pluginServices.getServerInfo().getUrl()) + .setApiVersion(OctaneSDK.API_VERSION) + .setSdkVersion(OctaneSDK.SDK_VERSION) + .setPluginVersion(OctaneSDK.getInstance().getPluginServices().getPluginInfo().getVersion()) + .setOctaneUser(pluginServices.getOctaneConfiguration().getApiKey()) + .setCiServerUser(ConfigurationService.getModel().getImpersonatedUser()); + tasksJSON = restClient.getAbridgedTasks(info); isConnected = false; connect(); if (tasksJSON != null && !tasksJSON.isEmpty()) { @@ -145,18 +150,23 @@ private void dispatchTasks(String tasksJSON) { taskProcessingExecutors.execute(new Runnable() { @Override public void run() { - TasksProcessor TasksProcessor = OctaneSDK.getInstance().getTasksProcessor(); - OctaneResultAbridged result = TasksProcessor.execute(task); - MqmRestClient restClient = restClientFactory.obtain( - mqmConfig.location, - mqmConfig.sharedSpace, - mqmConfig.username, - mqmConfig.password); - int submitStatus = restClient.putAbridgedResult( + try { + TasksProcessor TasksProcessor = OctaneSDK.getInstance().getTasksProcessor(); + OctaneResultAbridged result = TasksProcessor.execute(task); + MqmRestClient restClient = restClientFactory.obtain( + mqmConfig.location, + mqmConfig.sharedSpace, + mqmConfig.username, + mqmConfig.password); + + int submitStatus = restClient.putAbridgedResult( serverInstanceId, result.getId(), dtoFactory.dtoToJson(result)); - logger.info("result for task '" + result.getId() + "' submitted with status " + submitStatus); + logger.info("result for task '" + result.getId() + "' submitted with status " + submitStatus); + } catch (Exception e) { + logger.error("failed to submit task '" + task.getId(), e); + } } }); } diff --git a/src/main/webapp/help/impersonatedUser.html b/src/main/webapp/help/impersonatedUser.html index 0262dce1b7..2d16ae8ee1 100644 --- a/src/main/webapp/help/impersonatedUser.html +++ b/src/main/webapp/help/impersonatedUser.html @@ -5,7 +5,7 @@ Make sure the user exists in Jenkins.
  • - We strongly recommend specifying a Jenkins user for ALM Octane. Set this user's permissions to the minimum required for this integration: Job Build permissions. + We strongly recommend specifying a Jenkins user for ALM Octane. Set this user's permissions to the minimum required for this integration: Job Build and Read permissions.
  • If you do not specify a Jenkins user, ALM Octane uses the Anonymous user, and is limited to Anonymous's user permissions. From 330b32e5d201eb89a9f08dcb32c605f1ce2509f2 Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Wed, 13 Sep 2017 15:41:53 +0300 Subject: [PATCH 0142/2502] Fixing: https://issues.jenkins-ci.org/browse/JENKINS-45863 --- .../automation/tools/model/PcModel.java | 8 +++++- .../automation/tools/run/PcBuilder.java | 4 ++- .../tools/run/PcBuilder/config.jelly | 27 +++++++++++++++++++ .../automation/tools/pc/MockPcModel.java | 4 +-- .../automation/tools/pc/PcTestBase.java | 5 ++-- 5 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java index 6c36429e85..cb6b62e9f4 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java @@ -14,6 +14,7 @@ public class PcModel { public static final String COLLATE_ANALYZE = "Collate and Analyze"; public static final String DO_NOTHING = "Do Not Collate"; + private final String serverandport; private final String pcServerName; private final String almUserName; private final SecretContainer almPassword; @@ -33,10 +34,11 @@ public class PcModel { @DataBoundConstructor - public PcModel(String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, + public PcModel(String serverandport, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId,String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { + this.serverandport = serverandport; this.pcServerName = pcServerName; this.almUserName = almUserName; this.almPassword = setPassword(almPassword); @@ -62,6 +64,10 @@ protected SecretContainer setPassword(String almPassword) { return secretContainer; } + public String getserverandport(){ + return this.serverandport; + } + public String getPcServerName() { return this.pcServerName; diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index 097fccf9c5..6c6bcf6d32 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -107,6 +107,7 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ @DataBoundConstructor public PcBuilder( + String serverandport, String pcServerName, String almUserName, String almPassword, @@ -133,6 +134,7 @@ public PcBuilder( pcModel = new PcModel( + serverandport.trim(), pcServerName.trim(), almUserName.trim(), almPassword, @@ -587,8 +589,8 @@ private String getOutputForReportLinks(Run build) { String viewUrl = String.format(urlPattern + "/%s", pcReportFileName); String downloadUrl = String.format(urlPattern + "/%s", "*zip*/pcRun"); logger.println(HyperlinkNote.encodeTo(viewUrl, "View analysis report of run " + runId)); - return String.format("Load Test Run ID: %s\n\nView analysis report:\n%s\n\nDownload Report:\n%s", runId,viewUrl, downloadUrl); + return String.format("Load Test Run ID: %s\n\nView analysis report:\n%s\n\nDownload Report:\n%s", runId, pcModel.getserverandport() + "/" + build.getUrl() + viewUrl, pcModel.getserverandport() + "/" + build.getUrl() + downloadUrl); } private String getArtifactsUrlPattern(Run build) { diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly index 2df8914a72..7a921ca21a 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly @@ -37,6 +37,23 @@ + + + + diff --git a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java index 770522d5b2..6283bf6b24 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java @@ -8,10 +8,10 @@ public class MockPcModel extends PcModel { - public MockPcModel(String pcServerName, String almUserName, String almPassword, String almDomain, + public MockPcModel(String serverandport, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId, String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, boolean webProtocol) { - super(pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, + super(serverandport, pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null ); } diff --git a/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java b/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java index f2a84b2057..b9181d5984 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/PcTestBase.java @@ -22,7 +22,8 @@ public interface PcTestBase { - public static final String PC_SERVER_NAME = "pcServer.hp.com"; + public static final String SERVER_AND_PORT = "jenkins.server:8082"; + public static final String PC_SERVER_NAME = "pcServer.hp.com"; public static final String ALM_USER_NAME = "sa"; public static final String ALM_PASSWORD = "pwd"; public static final String ALM_DOMAIN = "ALMDOM"; @@ -44,7 +45,7 @@ public interface PcTestBase { public static final String TESTINSTANCEID = "MANUAL"; public static final PrintStream LOGGER = null; - public static final MockPcModel pcModel = new MockPcModel(PC_SERVER_NAME, ALM_USER_NAME, + public static final MockPcModel pcModel = new MockPcModel(SERVER_AND_PORT,PC_SERVER_NAME, ALM_USER_NAME, ALM_PASSWORD, ALM_DOMAIN, ALM_PROJECT, TEST_ID,TESTINSTANCEID, TEST_INSTANCE_ID, TIMESLOT_DURATION_HOURS, From 0260d686f3e645248cd7ffac933e528d0f1db14f Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Wed, 13 Sep 2017 15:55:26 +0300 Subject: [PATCH 0143/2502] serverandport changed to serverAndPort --- .../application/automation/tools/model/PcModel.java | 10 +++++----- .../application/automation/tools/run/PcBuilder.java | 6 +++--- .../automation/tools/run/PcBuilder/config.jelly | 6 +++--- .../application/automation/tools/pc/MockPcModel.java | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java index cb6b62e9f4..4189190840 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java @@ -14,7 +14,7 @@ public class PcModel { public static final String COLLATE_ANALYZE = "Collate and Analyze"; public static final String DO_NOTHING = "Do Not Collate"; - private final String serverandport; + private final String serverAndPort; private final String pcServerName; private final String almUserName; private final SecretContainer almPassword; @@ -34,11 +34,11 @@ public class PcModel { @DataBoundConstructor - public PcModel(String serverandport, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, + public PcModel(String serverAndPort, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId,String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { - this.serverandport = serverandport; + this.serverAndPort = serverAndPort; this.pcServerName = pcServerName; this.almUserName = almUserName; this.almPassword = setPassword(almPassword); @@ -64,8 +64,8 @@ protected SecretContainer setPassword(String almPassword) { return secretContainer; } - public String getserverandport(){ - return this.serverandport; + public String getserverAndPort(){ + return this.serverAndPort; } public String getPcServerName() { diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index 6c6bcf6d32..3c23a54e40 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -107,7 +107,7 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ @DataBoundConstructor public PcBuilder( - String serverandport, + String serverAndPort, String pcServerName, String almUserName, String almPassword, @@ -134,7 +134,7 @@ public PcBuilder( pcModel = new PcModel( - serverandport.trim(), + serverAndPort.trim(), pcServerName.trim(), almUserName.trim(), almPassword, @@ -590,7 +590,7 @@ private String getOutputForReportLinks(Run build) { String downloadUrl = String.format(urlPattern + "/%s", "*zip*/pcRun"); logger.println(HyperlinkNote.encodeTo(viewUrl, "View analysis report of run " + runId)); - return String.format("Load Test Run ID: %s\n\nView analysis report:\n%s\n\nDownload Report:\n%s", runId, pcModel.getserverandport() + "/" + build.getUrl() + viewUrl, pcModel.getserverandport() + "/" + build.getUrl() + downloadUrl); + return String.format("Load Test Run ID: %s\n\nView analysis report:\n%s\n\nDownload Report:\n%s", runId, pcModel.getserverAndPort() + "/" + build.getUrl() + viewUrl, pcModel.getserverAndPort() + "/" + build.getUrl() + downloadUrl); } private String getArtifactsUrlPattern(Run build) { diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly index 7a921ca21a..b12bc30a1c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly @@ -44,7 +44,7 @@ var href = window.location.href; var splitter = href.split("/job"); var baseurl = splitter[0]; - var p = document.getElementById('serverandport'); + var p = document.getElementById('serverAndPort'); if(p){ p.value = baseurl; } @@ -127,8 +127,8 @@ - - + + diff --git a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java index 6283bf6b24..662431c1e9 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java @@ -8,10 +8,10 @@ public class MockPcModel extends PcModel { - public MockPcModel(String serverandport, String pcServerName, String almUserName, String almPassword, String almDomain, + public MockPcModel(String serverAndPort, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId, String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, boolean webProtocol) { - super(serverandport, pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, + super(serverAndPort, pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null ); } From d43d328d627a6ed9f4f1acfb6b922cd4fc71a264 Mon Sep 17 00:00:00 2001 From: radislavB Date: Mon, 18 Sep 2017 15:47:15 +0300 Subject: [PATCH 0144/2502] fix SonarQube issues (#40) --- .../octane/executor/CheckOutSubDirEnvContributor.java | 3 ++- .../tools/octane/tests/junit/JUnitXmlIterator.java | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java index 5ccd75b91f..3935b6f6d7 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java @@ -34,8 +34,9 @@ @Extension public class CheckOutSubDirEnvContributor extends EnvironmentContributor { - public static String CHECKOUT_SUBDIR_ENV_NAME = "CHECKOUT_SUBDIR"; + public static final String CHECKOUT_SUBDIR_ENV_NAME = "CHECKOUT_SUBDIR"; + @Override public void buildEnvironmentFor(Job j, EnvVars envs, TaskListener listener) throws IOException, InterruptedException { String dir = getSharedCheckOutDirectory(j); if (dir != null) { diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index 05858b7ba0..2cbb9b176d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -142,7 +142,7 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I errorMsg = ""; } else if ("className".equals(localName)) { // NON-NLS String fqn = readNextValue(); - int p = fqn.lastIndexOf("."); + int p = fqn.lastIndexOf('.'); className = fqn.substring(p + 1); if (p > 0) { packageName = fqn.substring(0, p); @@ -162,7 +162,7 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I if (testName.startsWith(workspace.getRemote())) { // if workspace is prefix of the method name, cut it off // currently this handling is needed for UFT tests - int testStartIndex = workspace.getRemote().length() + (sharedCheckOutDirectory == null ? 0 : sharedCheckOutDirectory.length() +1 /*+ for slash between workspace and shared dir*/); + int testStartIndex = workspace.getRemote().length() + (sharedCheckOutDirectory == null ? 0 : (sharedCheckOutDirectory.length() + 1)); String path = testName.substring(testStartIndex); path = path.replace(OctaneConstants.General.LINUX_PATH_SPLITTER, OctaneConstants.General.WINDOWS_PATH_SPLITTER); path = StringUtils.strip(path, OctaneConstants.General.WINDOWS_PATH_SPLITTER); @@ -219,7 +219,7 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I } else if ("errorDetails".equals(localName)) { // NON-NLS status = TestResultStatus.FAILED; errorMsg = readNextValue(); - int index = stackTraceStr.indexOf(":"); + int index = stackTraceStr.indexOf(':'); if (index >= 0) { errorType = stackTraceStr.substring(0, index); } @@ -244,10 +244,10 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I private String cleanTestName(String testName) { // subfolder\testname if (testName.contains("\\")) { - return testName.substring(testName.lastIndexOf("\\") + 1); + return testName.substring(testName.lastIndexOf('\\') + 1); } if (testName.contains("/")) { - return testName.substring(testName.lastIndexOf("/") + 1); + return testName.substring(testName.lastIndexOf('/') + 1); } return testName; } From 46e710e5d1dd93940ee56fc58ac3d01af811692c Mon Sep 17 00:00:00 2001 From: Gennady Korpachev Date: Tue, 19 Sep 2017 11:46:21 +0300 Subject: [PATCH 0145/2502] Fix NullPointerException blockers of SonarQube report. --- .../automation/tools/nv/common/NvNetworkProfileRegistry.java | 4 +++- .../automation/tools/nv/common/NvValidatorUtils.java | 4 +++- .../automation/tools/nv/plugin/results/NvResultsMerger.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java b/src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java index 0d3c980ba8..3794780e38 100644 --- a/src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java +++ b/src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; +import java.io.Serializable; import java.util.*; public class NvNetworkProfileRegistry { @@ -127,7 +128,8 @@ public boolean exists(String profileName) { return null != profiles.get(profileName); } - private static class ProfileNameComparator implements Comparator { + private static class ProfileNameComparator implements Comparator, Serializable { + private static final long serialVersionUID = 1; @Override public int compare(String o1, String o2) { if (o1 == o2) { diff --git a/src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java b/src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java index d4d09694c0..a57f02fd20 100644 --- a/src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java @@ -90,7 +90,9 @@ public static Map readThresholdsFile(String fileName) throws IOEx } } } finally { - br.close(); + if (br != null) { + br.close(); + } } return result; } diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java index 4f5ee0c119..6e2703d87b 100644 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java +++ b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java @@ -86,7 +86,9 @@ public Void invoke(File file, VirtualChannel channel) throws IOException, Interr writer.close(); } } finally { - writer.close(); + if (writer != null) { + writer.close(); + } } return null; From e7a14b0ab5504bf59048a289ca24a63059191706 Mon Sep 17 00:00:00 2001 From: radislavB Date: Sun, 24 Sep 2017 15:22:26 +0300 Subject: [PATCH 0146/2502] update pom to support GZIP compressed events and tasks (#43) * user story #447030: update pom to support GZIP compressed events and tasks * enhance finished event with boolean testResultsExpected value --- pom.xml | 4 +- .../tools/octane/events/RunListenerImpl.java | 10 ++++- .../tools/octane/events/TestListenerImpl.java | 40 ------------------- .../tools/octane/tests/TestListener.java | 22 +++------- 4 files changed, 17 insertions(+), 59 deletions(-) delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java diff --git a/pom.xml b/pom.xml index f3f5ee2d50..5c75410493 100644 --- a/pom.xml +++ b/pom.xml @@ -391,7 +391,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.4.7 + 1.4.13 @@ -431,7 +431,7 @@ mqm-rest-client com.hpe.adm.octane.ciplugins - 1.4.14 + 1.4.18 diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index 1df54e43f1..c94e4f0c8a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -16,7 +16,9 @@ package com.hpe.application.automation.tools.octane.events; +import com.google.inject.Inject; import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; +import com.hpe.application.automation.tools.octane.tests.TestListener; import com.hpe.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; @@ -56,6 +58,9 @@ public final class RunListenerImpl extends RunListener { private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); + @Inject + private TestListener testListener; + @Override public void onStarted(final Run r, TaskListener listener) { if(!ConfigurationService.getServerConfiguration().isValid()){ @@ -124,6 +129,8 @@ public void onFinalized(Run r) return; } + boolean hasTests = testListener.processBuild(r); + CIBuildResult result; if (r.getResult() == Result.SUCCESS) { result = CIBuildResult.SUCCESS; @@ -145,7 +152,8 @@ public void onFinalized(Run r) .setEstimatedDuration(r.getEstimatedDuration()) .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) .setResult(result) - .setDuration(r.getDuration()); + .setDuration(r.getDuration()) + .setTestResultExpected(hasTests); if(r instanceof AbstractBuild){ event.setParameters(ParameterProcessors.getInstances(r)) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java deleted file mode 100644 index 970501cb36..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package com.hpe.application.automation.tools.octane.events; - -import com.google.inject.Inject; -import com.hpe.application.automation.tools.octane.tests.TestListener; -import hudson.Extension; -import hudson.model.*; -import hudson.model.listeners.RunListener; - -import javax.annotation.Nonnull; - -/** - * Listener on job complete event - */ -@Extension -public class TestListenerImpl extends RunListener { - - @Inject - private TestListener testListener; - - @Override - public void onCompleted(Run r, @Nonnull TaskListener listener) { - testListener.processBuild(r, listener); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java index 7613acac43..efbe6d409d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java @@ -24,10 +24,8 @@ import com.hpe.application.automation.tools.octane.tests.xml.TestResultXmlWriter; import hudson.Extension; import hudson.FilePath; -import hudson.model.AbstractBuild; import hudson.model.Result; import hudson.model.Run; -import hudson.model.TaskListener; import hudson.tasks.Builder; import jenkins.model.Jenkins; import org.apache.logging.log4j.LogManager; @@ -44,15 +42,14 @@ public class TestListener { private static Logger logger = LogManager.getLogger(TestListener.class); - static final String TEST_RESULT_FILE = "mqmTests.xml"; - public static final String JENKINS_STORM_TEST_RUNNER_CLASS = "com.hpe.sr.plugins.jenkins.StormTestRunner"; - public static final String JENKINS_PERFORMANCE_CENTER_TEST_RUNNER_CLASS = "com.hpe.application.automation.tools.run.PcBuilder"; + public static final String TEST_RESULT_FILE = "mqmTests.xml"; + private static final String JENKINS_STORM_TEST_RUNNER_CLASS = "com.hpe.sr.plugins.jenkins.StormTestRunner"; + private static final String JENKINS_PERFORMANCE_CENTER_TEST_RUNNER_CLASS = "com.hpe.application.automation.tools.run.PcBuilder"; private ResultQueue queue; - public void processBuild(Run build, TaskListener listener) { - + public boolean processBuild(Run build) { FilePath resultPath = new FilePath(new FilePath(build.getRootDir()), TEST_RESULT_FILE); TestResultXmlWriter resultWriter = new TestResultXmlWriter(resultPath, build); boolean success = false; @@ -92,19 +89,16 @@ public void processBuild(Run build, TaskListener listener) { } } } catch (IllegalArgumentException e) { - listener.error(e.getMessage()); + logger.error(e.getMessage()); if (!build.getResult().isWorseOrEqualTo(Result.UNSTABLE)) { build.setResult(Result.UNSTABLE); } - return; } catch (InterruptedException ie) { logger.error("Interrupted processing test results in " + ext.getClass().getName(), ie); Thread.currentThread().interrupt(); - return; } catch (Exception e) { // extensibility involved: catch both checked and RuntimeExceptions logger.error("Error processing test results in " + ext.getClass().getName(), e); - return; } } success = true; @@ -121,11 +115,7 @@ public void processBuild(Run build, TaskListener listener) { logger.error("Error processing test results", xmlse); } } - } - - private boolean isUFTRunner(AbstractBuild build) { - UFTExtension uftExtension = new UFTExtension(); - return uftExtension.detect(build) != null; + return success && hasTests;//test results expected } @Inject From 63a9189feb5d2900473dd1f19018538303152774 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 25 Sep 2017 11:22:52 +0300 Subject: [PATCH 0147/2502] merge srf --- pom.xml | 12 + .../tools/model/CreateTunnelModel.java | 37 + .../automation/tools/model/Pair.java | 39 + .../tools/model/SrfServerSettingsModel.java | 61 + .../tools/model/SrfTestParamsModel.java | 68 + .../tools/model/SrfTestResultModel.java | 34 + .../tools/results/SrfDetailReport.java | 79 ++ .../tools/results/SrfResultsReport.java | 518 ++++++++ .../tools/results/SrfSummaryReport.java | 81 ++ .../tools/run/CreateTunnelBuilder.java | 242 ++++ .../tools/run/RunFromSrfBuilder.java | 1117 +++++++++++++++++ .../settings/SrfServerSettingsBuilder.java | 143 +++ .../model/SrfTestParamsModel/config.jelly | 30 + .../tools/results/SrfDetailReport/index.jelly | 19 + .../SrfHtmlBuildReportAction/index.jelly | 93 ++ .../results/SrfRunResultRecorder/config.jelly | 22 + .../help-archiveTestResultsMode.html | 8 + .../results/SrfSummaryReport/index.jelly | 19 + .../run/CreateTunnelBuilder/config.jelly | 27 + .../run/CreateTunnelBuilder/config.properties | 1 + .../tools/run/RunFromSrfBuilder/config.jelly | 54 + .../run/RunFromSrfBuilder/config.properties | 1 + .../SrfServerSettingsBuilder/global.jelly | 163 +++ .../hudson/tasks/junit/CaseResult/body.jelly | 112 ++ .../hudson/tasks/junit/CaseResult/index.jelly | 99 ++ .../hudson/tasks/junit/ClassResult/body.jelly | 71 ++ .../tasks/junit/PackageResult/body.jelly | 112 ++ .../hudson/tasks/junit/TestResult/_body.jelly | 66 + .../hudson/tasks/junit/TestResult/body.jelly | 117 ++ .../resources/hudson/tasks/junit/body.jelly | 112 ++ .../resources/hudson/tasks/junit/index.jelly | 97 ++ .../tasks/test/MetaTabulatedResult/body.jelly | 98 ++ 32 files changed, 3752 insertions(+) create mode 100644 src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java create mode 100644 src/main/java/com/hpe/application/automation/tools/model/Pair.java create mode 100644 src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java create mode 100644 src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java create mode 100644 src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java create mode 100644 src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java create mode 100644 src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java create mode 100644 src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java create mode 100644 src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java create mode 100644 src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java create mode 100644 src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java create mode 100644 src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/results/SrfDetailReport/index.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/results/SrfHtmlBuildReportAction/index.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/help-archiveTestResultsMode.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.properties create mode 100644 src/main/resources/com/hpe/application/automation/tools/run/RunFromSrfBuilder/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/run/RunFromSrfBuilder/config.properties create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly create mode 100644 src/main/resources/hudson/tasks/junit/CaseResult/body.jelly create mode 100644 src/main/resources/hudson/tasks/junit/CaseResult/index.jelly create mode 100644 src/main/resources/hudson/tasks/junit/ClassResult/body.jelly create mode 100644 src/main/resources/hudson/tasks/junit/PackageResult/body.jelly create mode 100644 src/main/resources/hudson/tasks/junit/TestResult/_body.jelly create mode 100644 src/main/resources/hudson/tasks/junit/TestResult/body.jelly create mode 100644 src/main/resources/hudson/tasks/junit/body.jelly create mode 100644 src/main/resources/hudson/tasks/junit/index.jelly create mode 100644 src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly diff --git a/pom.xml b/pom.xml index 5c75410493..af01199f59 100644 --- a/pom.xml +++ b/pom.xml @@ -597,6 +597,18 @@ 2.0 test + + + org.glassfish.jersey.core + jersey-common + 2.9 + + + + org.glassfish.jersey.media + jersey-media-sse + 2.9 + diff --git a/src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java b/src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java new file mode 100644 index 0000000000..9649129385 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java @@ -0,0 +1,37 @@ +package com.hpe.application.automation.tools.model; + +import com.hpe.application.automation.tools.model.EnumDescription; +import org.kohsuke.stapler.DataBoundConstructor; + +import java.util.Arrays; +import java.util.List; + +/** + * Created by shepshel on 5/24/2017. + */ +public class CreateTunnelModel { + public final static EnumDescription runModeLocal = new EnumDescription( + "RUN_LOCAL", "Run locally"); + public final static EnumDescription runModePlannedHost = new EnumDescription( + "RUN_PLANNED_HOST", "Run on planned host"); + public final static EnumDescription runModeRemote = new EnumDescription( + "RUN_REMOTE", "Run remotely"); + public final static List runModes = Arrays.asList( + runModeLocal, runModePlannedHost, runModeRemote); + + private final String srfTunnelName; + + @DataBoundConstructor + public CreateTunnelModel(String srfTunnelName) { + + this.srfTunnelName = srfTunnelName; + } + + + + public String getSrfTunnelName() { + return srfTunnelName; + } + +} + diff --git a/src/main/java/com/hpe/application/automation/tools/model/Pair.java b/src/main/java/com/hpe/application/automation/tools/model/Pair.java new file mode 100644 index 0000000000..d50049c05f --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/Pair.java @@ -0,0 +1,39 @@ +package com.hpe.application.automation.tools.model; + +import hudson.Extension; +import hudson.model.AbstractDescribableImpl; +import hudson.model.Descriptor; +import hudson.util.FormValidation; +import org.apache.commons.lang.StringUtils; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; + +class Pair extends AbstractDescribableImpl { + + @DataBoundConstructor + public Pair(String name, String value) { + this.name = name; + this.value = value; + } + + private String name; + private String value; + @Extension + public static class DescriptorImpl extends Descriptor { + + public String getDisplayName() { + return "Test Parameter"; + } + + + public FormValidation doCheckName(@QueryParameter String value) { + + FormValidation ret = FormValidation.ok(); + if (StringUtils.isBlank(value)) { + ret = FormValidation.error("Parameter name must be set"); + } + + return ret; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java new file mode 100644 index 0000000000..fc478f4dfb --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java @@ -0,0 +1,61 @@ +package com.hpe.application.automation.tools.model; + +import com.hpe.application.automation.tools.settings.SrfServerSettingsBuilder; +import org.apache.commons.lang.StringUtils; +import org.kohsuke.stapler.DataBoundConstructor; + +import java.util.Properties; + +/** + * Created by shepshel on 20/07/2016. + */ +public class SrfServerSettingsModel { + private final String srfTunnelPath; + private final String srfServerName; + private final String srfProxyName; + private final String srfAppName; + private final String srfSecretName; + + @DataBoundConstructor + public SrfServerSettingsModel(String srfTunnelPath, String srfServerName, String srfProxyName,String srfAppName, String srfSecretName ) { + + SrfServerSettingsBuilder mdl = new SrfServerSettingsBuilder(); + this.srfTunnelPath = srfTunnelPath; + this.srfServerName = srfServerName; + this.srfProxyName = srfProxyName; + this.srfAppName = srfAppName; + this.srfSecretName = srfSecretName; + } + + public String getSrfServerName() { + + return srfServerName; + } + public String getSrfTunnelPath(){ + return srfTunnelPath; + } + public String getSrfAppName() { + return srfAppName; + } + public String getSrfSecretName() { + + return srfSecretName; + } + + public String getSrfProxyName() { + + return srfProxyName; + } + + private Properties getProperties() { + + Properties prop = new Properties(); + if (!StringUtils.isEmpty(srfProxyName)) { + prop.put("srfProxyName", srfProxyName); + } else { + prop.put("srfProxyName", ""); + } + + return prop; + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java new file mode 100644 index 0000000000..158e7519a8 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java @@ -0,0 +1,68 @@ +package com.hpe.application.automation.tools.model; + +import hudson.Extension; +import hudson.model.AbstractDescribableImpl; +import hudson.model.Descriptor; +import hudson.util.FormValidation; +import org.apache.commons.lang.StringUtils; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; + +import java.util.UUID; +/** + * Created by shepshel on 27/07/2016. + */ +public class SrfTestParamsModel extends AbstractDescribableImpl { + private final String name; + private final String value; + private String resolvedValue; + private Boolean shouldGetOnlyFirstValueFromJson; + @DataBoundConstructor + public SrfTestParamsModel( + String name, + String value, + boolean shouldGetOnlyFirstValueFromJson) { + this.name = name; + this.value = value; + + this.shouldGetOnlyFirstValueFromJson = shouldGetOnlyFirstValueFromJson; + } + public boolean isShouldGetOnlyFirstValueFromJson() { + return shouldGetOnlyFirstValueFromJson; + } + public String getValue() { + return value; + } + public String getName() { + return name; + } + public String getResolvedValue() { + return resolvedValue; + } + public void setResolvedValue(String resolvedValue) { + this.resolvedValue = resolvedValue; + } + @Extension + public static class DescriptorImpl extends Descriptor { + public String getDisplayName() { + return ""; + } + public FormValidation doCheckName(@QueryParameter String value) { + FormValidation ret = FormValidation.ok(); + if (StringUtils.isBlank(value)) { + ret = FormValidation.error("Parameter name must be set"); + } + return ret; + } + public FormValidation doCheckValue(@QueryParameter String value) { + FormValidation ret = FormValidation.ok(); + if (StringUtils.isBlank(value)) { + ret = FormValidation.warning("You didn't assign any value to this parameter"); + } + return ret; + } + public String getRandomName(@QueryParameter String prefix) { + return prefix + UUID.randomUUID(); + } + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java new file mode 100644 index 0000000000..033ead5f52 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java @@ -0,0 +1,34 @@ +package com.hpe.application.automation.tools.model; + +/** + * Created by shepshel on 29/09/2016. + */ + + + +import org.kohsuke.stapler.DataBoundConstructor; + +import hudson.Extension; +import hudson.model.AbstractDescribableImpl; +import hudson.model.Descriptor; + +/** + * Created by shepshel on 27/07/2016. + */ +public class SrfTestResultModel extends AbstractDescribableImpl { + + @DataBoundConstructor + public SrfTestResultModel(){ + + } + private static DescriptorImpl _descriptor; + @Extension + public static class DescriptorImpl extends Descriptor { + public String getDisplayName() { + return "SrfTestResult"; + } + + + } +} + diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java new file mode 100644 index 0000000000..42f1ca07c1 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java @@ -0,0 +1,79 @@ +package com.hpe.application.automation.tools.results; + +import hudson.model.AbstractBuild; +import hudson.model.DirectoryBrowserSupport; +import hudson.model.ModelObject; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; + +import javax.servlet.ServletException; +import java.io.IOException; + +public class SrfDetailReport implements ModelObject { + + private String name = ""; + private String color = ""; + private String duration = ""; + private String pass = ""; + private String fail = ""; + private AbstractBuild build; + private DirectoryBrowserSupport _directoryBrowserSupport = null; + + public SrfDetailReport(AbstractBuild build, String name, DirectoryBrowserSupport directoryBrowserSupport) { + this.build = build; + this.name = name; + _directoryBrowserSupport = directoryBrowserSupport; + } + + @Override + public String getDisplayName() { + return name; + } + + private AbstractBuild getBuild() { + return build; + } + + public String getName() { + return name; + } + + public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + + if (_directoryBrowserSupport != null) + _directoryBrowserSupport.generateResponse(req, rsp, this); + } + + public String getColor() { + return color; + } + + public void setColor(String value) { + color = value; + } + + public String getDuration() { + return duration; + } + + public void setDuration(String value) { + duration = value; + } + + public String getPass() { + return pass; + } + + public void setPass(String value) { + pass = value; + } + + public String getFail() { + return fail; + } + + public void setFail(String value) { + fail = value; + } + +} diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java new file mode 100644 index 0000000000..b3f85c1a5a --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -0,0 +1,518 @@ +package com.hpe.application.automation.tools.results; + +import com.hpe.application.automation.tools.common.RuntimeUtils; +import com.hpe.application.automation.tools.model.EnumDescription; +import com.hpe.application.automation.tools.model.ResultsPublisherModel; +import com.hpe.application.automation.tools.run.RunFromSrfBuilder; +import hudson.AbortException; +import hudson.Extension; +import hudson.FilePath.FileCallable; +import hudson.Launcher; +import hudson.model.*; +import hudson.remoting.VirtualChannel; +import hudson.tasks.*; +import hudson.tasks.junit.TestResult; +import hudson.tasks.junit.TestResultAction; +import hudson.tasks.test.TestObject; +import hudson.tasks.test.TestResultProjectAction; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import org.apache.tools.ant.DirectoryScanner; +import org.jenkinsci.remoting.RoleChecker; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.MetaClassLoader; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.*; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.List; +import java.util.Properties; + +/** + * This class is adapted from {@link JunitResultArchiver}; Only the {@code perform()} method + * slightly differs. + * + * @author Thomas Maurel + */ +public class SrfResultsReport extends Recorder implements Serializable { + + private static final long serialVersionUID = 1L; + private static Hashtable myHash = new Hashtable(); + + + @DataBoundConstructor + public SrfResultsReport() { + + + } + + public class SrfTestResultAction extends TestResultAction { + private JSONArray _buildInfo; + private int _idx; + private PrintStream _logger; + private TestObject _target; + private TestResult _result; + public String getId(){ + return _target.getId(); + } + @Override + public TestResult getResult(){ + Properties props = System.getProperties(); + props.setProperty("stapler.trace", "true"); + props.setProperty("stapler.resourcePath", ""); + URL[] urls = {this.getClass().getProtectionDomain().getCodeSource().getLocation()}; + try { + MetaClassLoader.debugLoader = new MetaClassLoader(new SrfClassLoader(urls, null)); + }catch (Exception e){} + _result =super.getResult(); + return _result; + }; + public Object getWrappedTarget(){ + return _target; + } + + public SrfTestResultAction(AbstractBuild owner, TestResult result, BuildListener listener) { + super(owner, result, listener); + String data = null; + if(listener != null) + _logger = listener.getLogger(); + _result=result; + BufferedReader reader = null; + try { + String path = _build.getRootDir().getPath().concat("/report.json"); + reader = new BufferedReader(new FileReader(path)); + String line = null; + StringBuffer buf = new StringBuffer(); + while ( (line = reader.readLine() ) != null){ + buf.append(line); + } + data = buf.toString(); + } + catch (Exception e) { + } + finally { + try { + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + _buildInfo = JSONArray.fromObject(data); + } + public void startLoop(){ + _idx = 0; + } + public String getDeepLink(Object p){ + String testName = ""; + int idx = ++_idx; + try{ + testName = p.getClass().getMethod("getClassName").invoke(p).toString().toLowerCase(); + } + catch (NoSuchMethodException e){ + return "NoSuchMethodException"; + } + catch (IllegalAccessException e){ + return "IllegalAccessException"; + } + catch(InvocationTargetException e){ + return "InvocationTargetException"; + } + int cnt = _buildInfo.size(); + String srfUrl = ""; + for (int i = 0; i < cnt; i++) { + JSONObject jTest = _buildInfo.getJSONObject(i); + String name = jTest.getString("name").toLowerCase(); + if(name.compareTo(testName) != 0) + continue; + JSONArray scriptRuns = jTest.getJSONArray("scriptRuns"); + + JSONObject jo = (JSONObject)_buildInfo.get(0); + String y1 = jo.getString("yac"); + JSONArray runs = jo.getJSONArray("scriptRuns"); + int len = runs.size(); + JSONObject run = runs.getJSONObject(len - idx ); + String y2 = run.getString("yac"); + srfUrl = String.format("%1s/results/%1s/details/compare?script-runs=%1s", GetSrfServer(owner), y1, y2); + String tenant = jTest.getString("tenantid"); + srfUrl = srfUrl.concat("&TENANTID=").concat(tenant); + } + return srfUrl; + } + public String getEnvString(Object p){ + String testName = ""; + int idx = _idx + 1; + try{ + testName = p.getClass().getMethod("getClassName").invoke(p).toString().toLowerCase(); + } + catch (NoSuchMethodException e){ + return "NoSuchMethodException"; + } + catch (IllegalAccessException e){ + return "IllegalAccessException"; + } + catch(InvocationTargetException e){ + return "InvocationTargetException"; + } + catch (Exception e){ + return e.getMessage(); + } + int cnt = _buildInfo.size(); + for (int i = 0; i < cnt; i++) { + JSONObject jTest = _buildInfo.getJSONObject(i); + String name = jTest.getString("name").toLowerCase(); + if(name.compareTo(testName) != 0) + continue; + JSONArray scriptRuns = jTest.getJSONArray("scriptRuns"); + JSONObject scriptRun = scriptRuns.getJSONObject(idx - 1); + JSONObject env = scriptRun.getJSONObject("environment"); + JSONObject os = env.getJSONObject("os"); + JSONObject browser = env.getJSONObject("browser"); + String envString = String.format("%1s %1s %1s %1s", os.getString("name"), os.getString("version"), browser.getString("name"), browser.getString("version")); + return envString; + } + return _buildInfo.size() + ""; + } + private void setTarget(TestObject t, Hashtable h){ + _target = t; + myHash.putAll(h); + } + } + AbstractBuild _build; + private String GetSrfServer(AbstractBuild build){ + String ftaasServerAddress = ""; + try { + String path = build.getProject().getParent().getRootDir().toString(); + path = path.concat("/com.hpe.application.automation.tools.settings.SrfServerSettingsBuilder.xml"); + File file = new File(path); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document document = documentBuilder.parse(file); + String app = document.getElementsByTagName("srfAppName").item(0).getTextContent(); + String secret = document.getElementsByTagName("srfSecretName").item(0).getTextContent(); + ftaasServerAddress = document.getElementsByTagName("srfServerName").item(0).getTextContent(); + if((ftaasServerAddress.startsWith("http://")== false) && (ftaasServerAddress.startsWith("https://")== false)) + { + String tmp = ftaasServerAddress; + ftaasServerAddress="https://"; + ftaasServerAddress = ftaasServerAddress.concat(tmp); + } + if(ftaasServerAddress.startsWith("http://")) { + if (ftaasServerAddress.substring(6).contains(":") == false) + ftaasServerAddress = ftaasServerAddress.concat(":8080"); + } + else if(ftaasServerAddress.startsWith("https://")) { + if (ftaasServerAddress.substring(7).contains(":") == false) + ftaasServerAddress = ftaasServerAddress.concat(":443"); + } + String srfProxy = document.getElementsByTagName("srfProxyName").item(0).getTextContent(); + if((srfProxy != null) && (srfProxy.length() != 0)) { + String[] res = srfProxy.split(":", 2); + Properties systemProperties = System.getProperties(); + String proxy = res[0]; + systemProperties.setProperty("http.proxyHost", proxy); + if(res.length == 2) { + String port = res[1]; + systemProperties.setProperty("http.proxyPort", port); + } + } + } + catch (ParserConfigurationException e){ + } + catch (SAXException e){ + } + catch (IOException e){ + } + return ftaasServerAddress; + } + + @Override + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) + throws InterruptedException, IOException { + final List mergedResultNames = new ArrayList(); + _build = build; +// TestNameTransformer.all().add(new TestNameTransformer() ); + SrfTestResultAction action; + Project project = RuntimeUtils.cast(build.getProject()); + List builders = project.getBuilders(); + int cnt = builders.size(); + for (int i = 0; i () { + + @Override + public void checkRoles( RoleChecker roleChecker ) throws SecurityException { + + } + + private static final long serialVersionUID = 1L; + + @Override + public TestResult invoke(File ws, VirtualChannel channel) throws IOException { + final long nowSlave = System.currentTimeMillis(); + List files = new ArrayList(); + DirectoryScanner ds = new DirectoryScanner(); + ds.setBasedir(ws); + + // Transform the report file names list to a + // File + // Array, + // and add it to the DirectoryScanner includes + // set + for (String name : mergedResultNames) { + File file = new File(ws, name); + if (file.exists()) { + files.add(file.getName()); + } + } + + Object[] objectArray = new String[files.size()]; + files.toArray(objectArray); + ds.setIncludes((String[]) objectArray); + ds.scan(); + if (ds.getIncludedFilesCount() == 0) { + // no test result. Most likely a + // configuration + // error or + // fatal problem + throw new AbortException("Report not found"); + } + + return new TestResult(buildTime + (nowSlave - nowMaster), ds, true); + } + + /* @Override + public void checkRoles(RoleChecker arg0) throws SecurityException { + // TODO Auto-generated method stub + + } */ + }); + String str = result.getUrl(); + action = new SrfTestResultAction(build, result, listener); + if (result.getPassCount() == 0 && result.getFailCount() == 0) { + throw new AbortException("Result is empty"); + } + } catch (AbortException e) { + if (build.getResult() == Result.FAILURE) { + // most likely a build failed before it gets to the test + // phase. + // don't report confusing error message. + return true; + } + + listener.getLogger().println(e.getMessage()); + build.setResult(Result.FAILURE); + return true; + } catch (IOException e) { + e.printStackTrace(listener.error("Failed to archive testing tool reports")); + build.setResult(Result.FAILURE); + return true; + } + + build.getActions().add(action); + + /* try { + archiveTestsReport(build, listener, fileSystemResultNames, result); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + File artifactsDir = build.getArtifactsDir(); + if (artifactsDir.exists()) { + File reportDirectory = new File(artifactsDir.getParent(), PERFORMANCE_REPORT_FOLDER); + if (reportDirectory.exists()) { + File htmlIndexFile = new File(reportDirectory, INDEX_HTML_NAME); + if (htmlIndexFile.exists()) + build.getActions().add(new PerformanceReportAction(build)); + } + + File summaryDirectory = new File(artifactsDir.getParent(), TRANSACTION_SUMMARY_FOLDER); + if (summaryDirectory.exists()) { + File htmlIndexFile = new File(summaryDirectory, INDEX_HTML_NAME); + if (htmlIndexFile.exists()) + build.getActions().add(new TransactionSummaryAction(build)); + } + }*/ + + + // get the artifacts directory where we will upload the zipped report + // folder + + // read each result.xml + /* + * The structure of the result file is: + * + * + * + * + * + */ + + + + + + + + + + + + + + + return true; + } + + + + + + + + + + + + + + + + private void write2XML(Document document,String filename) + { + PrintWriter pw = null; + try { + document.normalize(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + DOMSource source = new DOMSource(document); + pw = new PrintWriter(new FileOutputStream(filename)); + StreamResult result = new StreamResult(pw); + transformer.transform(source, result); + } catch (Exception e) { + ; + } + finally { + pw.close(); + } + + } + + /* + * if we have a directory with file name "file.zip" we will return + * "file_1.zip"; + */ + + + + + + @Override + public Action getProjectAction(AbstractProject project) { + + return new TestResultProjectAction(project); + } + + + + @Override + public BuildStepMonitor getRequiredMonitorService() { + return BuildStepMonitor.BUILD; + } + + public ResultsPublisherModel getResultsPublisherModel() { + + return new ResultsPublisherModel(""); + } + + @Extension + public static class DescriptorImpl extends BuildStepDescriptor { + + public static DescriptorImpl _inst; + public DescriptorImpl() { + String s=this.getDescriptorUrl(); + + load(); + _inst = this; + } + + @Override + public String getDisplayName() { + + return "Publish HPE SRF Test Results"; + } + + @Override + public boolean isApplicable( + @SuppressWarnings("rawtypes") Class jobType) { + + return true; + } + + public List getReportArchiveModes() { + + return ResultsPublisherModel.archiveModes; + } + } + + //"Act*;Icons;Resources;CountersMonitorResults.txt;*.xls;GeneralInfo.ini;InstallNewReport.html;Results.qtp;Results.xml"; + + } + + +class SrfClassLoader extends URLClassLoader{ + URLClassLoader _parent; + public SrfClassLoader(URL[] urls, ClassLoader parent) { + super(urls, parent); + _parent = (URLClassLoader)parent; + } + @Override + public URL findResource(final String name){ + try { + URL url = super.findResource(name); + return url; + }catch(Exception e){ + return null; + } + + } + +} diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java new file mode 100644 index 0000000000..0b7376baba --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java @@ -0,0 +1,81 @@ +package com.hpe.application.automation.tools.results; + +import java.io.IOException; + +import javax.servlet.ServletException; + +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; + +import hudson.model.AbstractBuild; +import hudson.model.DirectoryBrowserSupport; +import hudson.model.ModelObject; + +public class SrfSummaryReport implements ModelObject { + + private String name = ""; + private String color = ""; + private String duration = ""; + private String pass = ""; + private String fail = ""; + private AbstractBuild build = null; + private DirectoryBrowserSupport _directoryBrowserSupport = null; + + public SrfSummaryReport(AbstractBuild build, String name, DirectoryBrowserSupport directoryBrowserSupport) { + this.build = build; + this.name = name; + _directoryBrowserSupport = directoryBrowserSupport; + } + + @Override + public String getDisplayName() { + return name; + } + + public AbstractBuild getBuild() { + return build; + } + + public String getName() { + return name; + } + + public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + + if (_directoryBrowserSupport != null) + _directoryBrowserSupport.generateResponse(req, rsp, this); + } + + public String getColor() { + return color; + } + + public void setColor(String value) { + color = value; + } + + public String getDuration() { + return duration; + } + + public void setDuration(String value) { + duration = value; + } + + public String getPass() { + return pass; + } + + public void setPass(String value) { + pass = value; + } + + public String getFail() { + return fail; + } + + public void setFail(String value) { + fail = value; + } + +} diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java new file mode 100644 index 0000000000..74d5fb7d0a --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -0,0 +1,242 @@ +package com.hpe.application.automation.tools.run; +import groovy.transform.Synchronized; +import hudson.Extension; +import hudson.FilePath; +import hudson.Launcher; +import hudson.model.AbstractBuild; +import hudson.model.AbstractProject; +import hudson.model.Run; +import hudson.model.TaskListener; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; +import jenkins.tasks.SimpleBuildStep; +import net.sf.json.JSONObject; +import org.jenkinsci.Symbol; +import org.kohsuke.stapler.DataBoundConstructor; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +import javax.annotation.Nonnull; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLSession; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.*; +import java.net.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.Properties; +import java.util.Timer; + +public class CreateTunnelBuilder extends Builder implements SimpleBuildStep { + private PrintStream logger; + private String srfTunnelName; + private AbstractBuild build; + public static final ArrayList Tunnels = new ArrayList(); + @DataBoundConstructor + public CreateTunnelBuilder( String srfTunnelName ){ + + this.srfTunnelName = srfTunnelName; + } + + public String getSrfTunnelName() { + return srfTunnelName; + } + + @Synchronized + @Override + public CreateTunnelBuilder.DescriptorImpl getDescriptor() { + return (CreateTunnelBuilder.DescriptorImpl) super.getDescriptor(); + } + + + @Override + public void perform( @Nonnull Run run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener ) throws InterruptedException, IOException { + logger = listener.getLogger(); + Run r = run.getParent().getBuild(run.getId()); + JSONObject connectionData = RunFromSrfBuilder.GetSrfConnectionData((AbstractBuild)r, logger); + String[] s = new String[5] ; + URL url = new URL(connectionData.getString("server")); + //check if tunnel exist + String server = url.getHost() + ":443" ; + + if(server.indexOf("-ftaas") < 0) + server= "opb-" + server; + else + server = server.replaceFirst("-ftaas", "-tunnel-ftaas"); + server ="\"" +"-server=wss://" + server + "/opb\"" ; + String client = "\"" +"-client=" + connectionData.getString("app") +"\""; + + String secret ="\"" + "-secret="+ connectionData.getString("secret")+"\""; + s[2]=secret; + + String name = "-name=" + srfTunnelName; + + + + URL proxyUrl ; + try { + proxyUrl =new URL(connectionData.getString("proxy")); + } + catch (MalformedURLException e){ + proxyUrl = new URL("http://"+connectionData.getString("proxy")); + } + String proxy = "\"" + "-http-proxy=" + proxyUrl.toString() +"\"" ; + s[4] = proxy; + String path =connectionData.getString("tunnel"); + + + + ProcessBuilder pb = new ProcessBuilder(path, server, client, name, proxy, secret, "\"-log-level=INFO\"","\"-log=stdout\""); + logger.println("Launching "+path ); + + Process p = pb.start(); + TunnelTracker tracker = new TunnelTracker(logger, p); + java.lang.Thread th = new Thread(tracker, "trackeer"); + Tunnels.add(p); + + InputStream is = p.getInputStream(); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + String line; + Timer t = new Timer(); + Date date = new Date(); + while(true){ + Date current = new Date(); + long diffSeconds = (current.getTime() - date.getTime())/1000; + if(diffSeconds > 30){ + p.destroy(); + logger.println("Failed to launch "+path); + Tunnels.remove(p); + return ; + } + + while ((line = br.readLine()) != null) { + logger.println(line); + if(line.indexOf("established at") >=0) + break; + Thread.sleep(100); + diffSeconds = (current.getTime() - date.getTime())/1000; + if(diffSeconds > 30){ + p.destroy(); + logger.println("Failed to launch "+path); + return ; + } + } + break; + } + + th.start(); + + + + + return ; +} + private JSONObject GetSrfConnectionData(){ + return new JSONObject(); + } + @Extension + @Symbol("CreateTunnelBuilder") + public static final class DescriptorImpl extends BuildStepDescriptor { + private String srfTunnelName; + @DataBoundConstructor + public DescriptorImpl(String srfTunnelName) { + this.srfTunnelName = srfTunnelName; + } + public DescriptorImpl(){ + load(); + } + @Override + public boolean isApplicable(Class aClass) { + return true; + } + + + @Override + public String getDisplayName() { + return "Create Tunnel"; + } + } + class TestRunData implements java.io.Serializable { + public TestRunData(JSONObject obj) + { + try { + id = (String) obj.get("id"); + status = (String) obj.get("status"); + if (id == null) { + id = (String) obj.get("message"); + status = "failed"; + } + name = (String) obj.get("name"); + duration = obj.get("durationMs").toString(); + } + catch (Exception e) + { + + } + } + + + public void merge(TestRunData newData) + { + if (newData.name != null ) this.name = newData.name; + if (newData.Start != null ) this.Start = newData.Start; + if (newData.duration != null ) this.duration = newData.duration; + if (newData.status != null ) this.status = newData.status; + if (newData.TunnelName != null ) this.TunnelName = newData.TunnelName; + if (newData.duration != null ) this.duration = newData.duration; + } + + String id; // "932c6c3e-939e-4b17-a04f-1a2951481758", + String name; // "Test-Test-Run", + String Start; // "2016-07-25T08:27:59.318Z", + String duration; + String status; // "status" : "success", + String TunnelName; // "246fa1a7-7ed2-4203-a4e9-7ce5fbf4f800", + int execCount; + String [] tags; + String user; + JSONObject _context; + } + + + class TunnelTracker implements Runnable{ + PrintStream logger; + Process p; + public TunnelTracker(PrintStream log, Process p){ + this.logger = log; + this.p=p; + } + @Override + public void run(){ + try{ + //Read out dir output + logger.println("In tracker!"); + InputStream is = p.getInputStream(); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + String line; + while ((line = br.readLine())!= null){ + // logger.println(line); + } + } + catch (Exception e){ + logger.print(e.getMessage()); + } + //Wait to get exit value + try { + int exitValue =0; + p.waitFor(); + logger.println("\n\nExit Value is " + exitValue); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + +} diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java new file mode 100644 index 0000000000..858abd418b --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java @@ -0,0 +1,1117 @@ +package com.hpe.application.automation.tools.run; +import com.hpe.application.automation.tools.model.SrfServerSettingsModel; +import com.hpe.application.automation.tools.model.SrfTestParamsModel; +import com.hpe.application.automation.tools.settings.SrfServerSettingsBuilder; +import groovy.transform.Synchronized; +import hudson.Extension; +import hudson.Launcher; +import hudson.model.AbstractBuild; +import hudson.model.AbstractProject; +import hudson.model.BuildListener; +import hudson.model.Hudson; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; +import hudson.util.FormValidation; +import net.sf.json.JSON; +import net.sf.json.JSONArray; +import net.sf.json.JSONNull; +import net.sf.json.JSONObject; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.httpclient.auth.AuthenticationException; +import org.apache.commons.lang.StringUtils; +import org.glassfish.jersey.media.sse.EventListener; +import org.glassfish.jersey.media.sse.EventSource; +import org.glassfish.jersey.media.sse.InboundEvent; +import org.glassfish.jersey.media.sse.SseFeature; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.Dispatcher; +import org.kohsuke.stapler.QueryParameter; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.SAXException; + +import javax.net.ssl.*; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.*; +import java.net.*; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.*; + +/** + * Created by shepshel on 20/07/2016. + */ + + + public class RunFromSrfBuilder extends Builder implements java.io.Serializable { + class TestRunData implements java.io.Serializable + { + public TestRunData(JSONObject obj) + { + try { + id = (String) obj.get("id"); + status = (String) obj.get("status"); + if (id == null) { + id = (String) obj.get("message"); + status = "failed"; + } + name = (String) obj.get("name"); + duration = obj.get("durationMs").toString(); + } + catch (Exception e) + { + + } + } + + + public void merge(TestRunData newData) + { + if (newData.name != null ) this.name = newData.name; + if (newData.Start != null ) this.Start = newData.Start; + if (newData.duration != null ) this.duration = newData.duration; + if (newData.status != null ) this.status = newData.status; + if (newData.testId != null ) this.testId = newData.testId; + if (newData.duration != null ) this.duration = newData.duration; + } + + String id; // "932c6c3e-939e-4b17-a04f-1a2951481758", + String name; // "Test-Test-Run", + String Start; // "2016-07-25T08:27:59.318Z", + String duration; + String status; // "status" : "success", + String testId; // "246fa1a7-7ed2-4203-a4e9-7ce5fbf4f800", + int execCount; + String [] tags; + String user; + JSONObject _context; +// "scriptStatus" : {}, +// "environmentCount" : 0, + // "scriptCount" : 0 + // }, + // "scriptRuns" : [] + } + + + static class OpenThread extends Thread { + private final EventSource eventSource; + + public OpenThread(EventSource eventSource) { + this.eventSource = eventSource; + } + + @Override + public void run() { + eventSource.open(); + } + } + static EventSource openAsynch(WebTarget target, String auth) { + target.request(MediaType.APPLICATION_JSON_TYPE).header("Authorization", auth); + EventSource eventSource = new EventSource(target, false); + HttpsURLConnection.setDefaultSSLSocketFactory(RunFromSrfBuilder._factory); + new OpenThread(eventSource).start(); + return eventSource; + } + private PrintStream logger; + private boolean _https; + private AbstractBuild build; + private String srfTestId; + private String srfBuildNumber; + private String srfTagNames; + private String srfReleaseNumber; + private String srfTunnelName; + private boolean srfCloseTunnel; + private List srfTestParameters; + private java.util.Hashtable _testRunData; + private JSONArray tests ; + public Object srfTestArg = null; + @DataBoundConstructor + public RunFromSrfBuilder( String srfTestId, + String srfTagNames, + String srfReleaseNumber, + String srfBuildNumber, + String srfTunnelName, + boolean srfCloseTunnel, + List srfTestParameters ){ + + this.srfTestId = srfTestId; + this.srfTagNames = srfTagNames; + this.srfTestParameters = srfTestParameters; + this.srfBuildNumber = srfBuildNumber; + this.srfReleaseNumber = srfReleaseNumber; + this.srfCloseTunnel = srfCloseTunnel; + this.srfTunnelName = srfTunnelName; + } + + public String getSrfTestId() { + return srfTestId; + } + public String getSrfTunnelName() { + return srfTunnelName; + } + public boolean getSrfCloseTunnel() { + return srfCloseTunnel; + } + public String getSrfBuildNumber(){ + return srfBuildNumber; + } + public String getSrfReleaseNumber(){ + return srfReleaseNumber; + } + public String getSrfTagNames() { + return srfTagNames; + } + public List getSrfTestParameters() {return srfTestParameters; } + + public String getRunResultsFileName() { + + + return String.format( "report%1d.xml", build.number); + } + @Synchronized + @Override + public RunFromSrfBuilder.DescriptorImpl getDescriptor() { + return (RunFromSrfBuilder.DescriptorImpl) super.getDescriptor(); + } + private boolean _runStatus; + private int runningCount; + private transient EventSource eventSrc; + private ArrayList _testRunEnds; + private int _timeout; + private String _ftaasServerAddress; + private String _app; + private String _tenant; + private String _secret; + private boolean _success; + private boolean _secretApplied; + private HttpURLConnection _con; + private static SrfTrustManager _trustMgr = new SrfTrustManager(); + static SSLSocketFactory _factory; + public static JSONObject GetSrfConnectionData(AbstractBuild build, PrintStream logger) { + try { + CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL)); + // Create all-trusting host name verifier + HostnameVerifier allHostsValid = new HostnameVerifier() { + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); + String path = build.getProject().getParent().getRootDir().toString(); + path = path.concat("/com.hpe.application.automation.tools.settings.SrfServerSettingsBuilder.xml"); + File file = new File(path); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document document = documentBuilder.parse(file); + // This also shows how you can consult the global configuration of the builder + JSONObject connectionData = new JSONObject(); + + + String app = document.getElementsByTagName("srfAppName").item(0).getTextContent(); + String tenant = app.substring(1, app.indexOf('_')); + String secret = document.getElementsByTagName("srfSecretName").item(0).getTextContent(); + String server = document.getElementsByTagName("srfServerName").item(0).getTextContent(); + boolean https = true; + if (server.startsWith("https://") == false) { + if (server.startsWith("http://") == false) { + String tmp = server; + server = "https://"; + server = server.concat(tmp); + } else + https = false; + } + URL urlTmp = new URL(server); + if (urlTmp.getPort() == -1) { + if (https) + server = server.concat(":443"); + else + server = server.concat(":8080"); + } + String srfProxy = ""; + String srfTunnel = ""; + try { + srfProxy = document.getElementsByTagName("srfProxyName").item(0).getTextContent(); + srfTunnel = document.getElementsByTagName("srfTunnelPath").item(0).getTextContent(); + } + catch (Exception e){ + + } + connectionData.put("app", app); + connectionData.put("tunnel", srfTunnel); + connectionData.put("secret", secret); + connectionData.put("server", server); + connectionData.put("https", (https) ? "True" : "False"); + connectionData.put("proxy", srfProxy); + connectionData.put("tenant", tenant); + return connectionData; + } + catch (ParserConfigurationException e){ + logger.print(e.getMessage()); + logger.print("\n\r"); + } + catch (SAXException e){ + logger.print(e.getMessage()); + } + catch (IOException e){ + logger.print(e.getMessage()); + } + return null; + } + + private JSONArray GetTestResults(JSONArray tests) throws IOException { + String url = ""; + JSONArray res = new JSONArray(); + for (int i = 0; i < tests.size(); i++) { + url = _ftaasServerAddress.concat("/rest/test-manager/test-runs"); + url = url.concat("?access-token="); + url=url.concat(_token); + url=url.concat("&"); + + JSONObject obj = JSONObject.fromObject(tests.get(i)); + String runId = obj.getString("id"); + url = url.concat(String.format("id=%1s", runId)); + url = url.concat("&include=resource,script-runs,script-steps"); + + URL srvUrl = new URL(url); + HttpURLConnection con; + con = (HttpURLConnection) srvUrl.openConnection(); + con.setDoOutput(true); + con.setRequestProperty("Content-Type", "application/json"); + int rc = con.getResponseCode(); + if(rc == 500) + { + i--; + continue; + } + BufferedReader br = new BufferedReader(new InputStreamReader((con.getInputStream()))); + StringBuffer response = new StringBuffer(); + String line; + while ((line = br.readLine()) != null) { + response.append(line); + } + JSONArray tmp = JSONArray.fromObject(response.toString()); + res.addAll(tmp); + } + return res; + } + private String ApplyJobParams(String val){ + if ((val.length() > 2) && val.startsWith("${") && val.endsWith("}")) { + String varName = val.substring(2, val.length() - 1); + val = build.getBuildVariables().get(varName); + if(val == null){ + try { + val = build.getEnvironment().get(varName); + } catch (IOException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + else if ((val.length() > 2) && val.startsWith("%") && val.endsWith("%")) { + String varName = val.substring(1, val.length() - 1); + try { + val = build.getEnvironment().get(varName); + } catch (IOException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + return val; + } + private HttpURLConnection Connect(String path, String method){ + try { + String reqUrl = _ftaasServerAddress.concat(path); + if(_token == null) { + _token = LoginToSrf(); + } + reqUrl = reqUrl.concat("?access-token="); + reqUrl = reqUrl.concat(_token); + //.concat("&TENANTID="+_tenant); + + URL srvUrl = new URL(reqUrl); + HttpURLConnection con = (HttpURLConnection) srvUrl.openConnection(); + if(_https) + ((HttpsURLConnection)con).setSSLSocketFactory(_factory); + con.setRequestMethod(method); + con.setRequestProperty("Content-Type", "application/json"); + if(_https) + ((HttpsURLConnection)con).setSSLSocketFactory(_factory); + return con; + } + catch (IOException e){ + return null; + } + } + private void FillExecutionReqBody() throws IOException{ + _con.setDoOutput(true); + JSONObject data = new JSONObject(); + JSONObject testParams = new JSONObject(); + JSONObject ciParameters = new JSONObject(); + if (srfTestId != null && srfTestId.length() > 0) { + data.put("yac", ApplyJobParams(srfTestId)); + } else { + String[] tagNames = ApplyJobParams(srfTagNames).split(","); + data.put("tags", tagNames); + } + if (srfTunnelName != null && srfTunnelName.length() > 0) { + + testParams.put("tunnelName", srfTunnelName); + } + if(data.size() == 0){ + throw new IOException("Wrong filter"); + } + + testParams.put("filter", data); + Properties ciProps = new Properties(); + Properties props = new Properties(); + String buildNumber = ApplyJobParams(srfBuildNumber); + String releaseNumber = ApplyJobParams(srfReleaseNumber); + if (buildNumber != null && buildNumber.length() > 0) { + ciProps.put("Build", buildNumber); + } + if (releaseNumber != null && releaseNumber.length() > 0) + ciProps.put("Release", releaseNumber); + + this.logger.print(String.format("Required build & release: %1s %2s\n\r", buildNumber, releaseNumber)); + HashMap paramObj = new HashMap(); + int cnt = 0; + + if ((srfTestParameters != null) && !srfTestParameters.isEmpty()) { + cnt = srfTestParameters.size(); + if (cnt > 0) + logger.print("Parameters: \n\r"); + for (int i = 0; i < cnt; i++) { + String name = srfTestParameters.get(i).getName(); + String val = ApplyJobParams(srfTestParameters.get(i).getValue()); + paramObj.put(name, val); + logger.print(String.format("%1s : %2s\n\r", name, val)); + } + } + if (ciProps.size() > 0) { + testParams.put("ciParameters", ciProps); + } + if (cnt > 0) + testParams.put("parameters", paramObj); + //add request header + + // con.setRequestProperty("session-context", context); + try { + OutputStream out = _con.getOutputStream(); + OutputStreamWriter writer = new OutputStreamWriter(out); + writer.write(testParams.toString()); + writer.flush(); + out.flush(); + out.close(); + } catch (java.net.ProtocolException e) { + logger.print(e.getMessage()); + logger.print("\n\r"); + } + } + private JSONArray GetTestsSet() throws MalformedURLException, AuthenticationException, IOException { + + StringBuffer response = new StringBuffer(); + JSONArray ar = new JSONArray(); + _con = Connect("/rest/test-manager/executions", "POST"); + try { + FillExecutionReqBody(); + } + catch (IOException e) { + logger.print(e.getMessage()); + logger.print("\n\r"); + throw e; + } + _timeout = 20000; + + int responseCode = _con.getResponseCode(); + BufferedReader br; + if(responseCode == 401 && _secretApplied){ + throw new AuthenticationException("Login required\n\r"); + } + if (responseCode == 200) { + br = new BufferedReader(new InputStreamReader((_con.getInputStream()))); + } + else { + br = new BufferedReader(new InputStreamReader((_con.getErrorStream()))); + } + + String inputLine; + while ((inputLine = br.readLine()) != null) { + response.append(inputLine); + logger.println(inputLine); + } + + if (responseCode != 200) { + try{ + JSONArray tests = JSONArray.fromObject(response.toString()); + int len = tests.size(); + for (int i= 0; i < len; i++) { + JSONObject jo = tests.getJSONObject(i); + if(jo.containsKey("id") && ( jo.size() == 1)) { + ar.add(jo); + } + else { + logger.print("\n\r"); + logger.print( jo.toString()); + logger.print("\n\r"); + } + } + } + catch(Exception e) { + + } + if(ar.size() == 0) { + logger.print("\n\r"); + logger.print(response); + logger.print("\n\r"); + String msg = response.toString(); + throw new IOException(msg); + } + } + else + ar = JSONArray.fromObject(response.toString()); + return ar; + } + + + private String AddAuthentication(HttpsURLConnection con){ + String auth = _app +":"+_secret; + byte[] auth64 = Base64.encodeBase64(auth.getBytes()); + String data = "Basic " + new String(auth64); + if(con != null) + con.addRequestProperty("Authorization", data); + return data; + } +private String LoginToSrf() throws MalformedURLException, IOException{ + String authorizationsAddress = _ftaasServerAddress.concat("/rest/security/authorizations/access-tokens"); + // .concat("/?TENANTID="+_tenant); + Writer writer = null; + // login // + JSONObject login = new JSONObject(); + login.put("loginName",_app); + login.put("password",_secret); + OutputStream out; + URL loginUrl = new URL(authorizationsAddress); + URLConnection loginCon; + if(_ftaasServerAddress.startsWith("http://")) { + loginCon = (HttpURLConnection)loginUrl.openConnection(); + loginCon.setDoOutput(true); + loginCon.setDoInput(true); + ((HttpURLConnection) loginCon).setRequestMethod("POST"); + loginCon.setRequestProperty("Content-Type", "application/json"); + out = loginCon.getOutputStream(); + } + else { + loginCon = loginUrl.openConnection(); + loginCon.setDoOutput(true); + loginCon.setDoInput(true); + ((HttpsURLConnection) loginCon).setRequestMethod("POST"); + loginCon.setRequestProperty("Content-Type", "application/json"); + ((HttpsURLConnection) loginCon).setSSLSocketFactory(_factory); + out = loginCon.getOutputStream(); + } + + + writer = new OutputStreamWriter(out); + writer.write(login.toString()); + writer.flush(); + out.flush(); + out.close(); + int responseCode = ((HttpURLConnection) loginCon).getResponseCode(); + BufferedReader br = new BufferedReader(new InputStreamReader((loginCon.getInputStream()))); + StringBuffer response = new StringBuffer(); + String line; + while ((line = br.readLine()) != null) { + response.append(line); + } + String tmp = response.toString(); + int n = tmp.length(); + + return tmp.substring(1, n-1); + } + private void InitSrfEventListener(){ + if(_token != null) + return; + try { + _token = LoginToSrf(); + } + catch (IOException e){ + if(_token == null){ + logger.println(""); + logger.println(e.getMessage()); + return; + } + } + String urlSSe = _ftaasServerAddress.concat("/rest/test-manager/events") + .concat("?level=session&types=test-run-started,test-run-ended,test-run-count,script-step-updated,script-step-created,script-run-started,script-run-ended"); + urlSSe = urlSSe.concat("&access-token=").concat(_token); +// urlSSe = urlSSe.concat("&TENANTID="+_tenant); + final String delim = "\r\n#########################################################################\r\n"; + ClientBuilder sslBuilder = ClientBuilder.newBuilder(); + SSLContext sslContext; + try { + sslContext = SSLContext.getInstance("TLS"); + _trustMgr = new SrfTrustManager(); + sslContext.init(null, new SrfTrustManager[]{_trustMgr}, null); + SSLContext.setDefault(sslContext); + } + catch (NoSuchAlgorithmException e1){return;} + catch (KeyManagementException e2){return;} + sslBuilder.register(SSLContext.class); + Client client = sslBuilder.register(SseFeature.class).build(); + client.register(sslContext); + try { + client.getSslContext().init(null, new SrfTrustManager[]{_trustMgr}, null); + } catch (KeyManagementException e) { + e.printStackTrace(); + } + WebTarget target = client.target(urlSSe); + int responseCode; + + eventSrc = openAsynch(target, AddAuthentication(null)); + eventSrc.register(new EventListener() { + @Override + public void onEvent(InboundEvent inboundEvent) { + _timeout = 20000; + // if(tests == null) + // return; + String eventName = inboundEvent.getName(); + // logger.print(String.format("***********%1s**********\r\n", eventName)); + String data = inboundEvent.readData(); + String str; + if(data != null && data.length()> 0) + try { + + JSONObject obj = JSONObject.fromObject(data); + if (eventName.compareTo("test-run-count") == 0) { + + return; + } + if (eventName.compareTo("test-run-started") == 0) { + logger.print(delim); + obj.discard("runningCount"); + JSONObject o1 = JSONObject.fromObject(obj.get("testRun")); + str = String.format("\r\n%1s %2s Status:%3s\r\n", + o1.get("name"), + eventName, + o1.get("status")); + logger.print(str); + _testRunEnds.add(o1.get("id").toString()); + + } + if ((eventName.compareTo("test-run-ended") == 0) /*|| (eventName.compareTo("test-run-started") == 0)*/) { + int testsCnt=tests.size(); + boolean skip = true; + String id = obj.getJSONObject("testRun").getString("id"); + for(int i = 0; i < testsCnt; i++){ + if(id.compareTo(tests.getJSONObject(i).getString("id") ) == 0){ + skip = false; + break; + } + } + if(skip) + return; + logger.print(delim); + obj.discard("runningCount"); + JSONObject o1 = JSONObject.fromObject(obj.get("testRun")); + o1.discard("id"); + o1.discard("tags"); + o1.discard("user"); + o1.discard("additionalData"); + obj.discard("testRun"); + + JSONObject o2 = JSONObject.fromObject(o1.get("test")); + o1.discard("test"); + obj.put("testRun", o1); + obj.put("environments", o2.get("environments")); + obj.put("scripts", o2.get("scripts")); + + str = String.format("\r\n%1s %2s Status:%3s\r\n", + o1.get("name"), + eventName, + o1.get("status") + ); + logger.print(str); + runningCount--; + } + if (eventName.contains ("script-step-")) { + String status = obj.getString("status"); + if(status.compareTo("running") == 0) + return; + logger.print(delim); + str = String.format("\r\n%1s Status: %2s\r\n", + eventName, + obj.get("status") + ); + logger.print(str); + obj.discard("id"); + obj.discard("scriptRun"); + obj.discard("snapshot"); + + } + if(eventName.contains("script-run-")){ + logger.print(delim); + } + logger.print(delim); + logger.print(obj.toString(2)); + logger.print("\r\n"); + } + catch (Exception e){ + logger.print(e.getMessage()); + }; + // if(runningCount == 0) + // eventSrc.close(); + + } + + }); + } + + String _token; + @Override + public boolean perform(final AbstractBuild build, final Launcher launcher, BuildListener _listener) + throws InterruptedException, IOException { + _testRunEnds = new ArrayList(); + _success = true; + this.logger = _listener.getLogger(); + Dispatcher.TRACE = true; + Dispatcher.TRACE_PER_REQUEST=true; + ClassLoader cl = ClassLoader.getSystemClassLoader(); + _token=null; + this.build = build; +////////////////////////////////////////////////////////////////////////////////////////////////////////// + JSONObject conData = GetSrfConnectionData(build, logger); + if(conData == null) + return false; + _app = conData.getString("app"); + _secret = conData.getString("secret"); + _ftaasServerAddress = conData.getString("server"); + _https = conData.getBoolean("https"); + _tenant = conData.getString("tenant"); + String srfProxy = conData.getString("proxy"); + + try{ + SSLContext sslContext = SSLContext.getInstance("TLS"); + _trustMgr = new SrfTrustManager(); + sslContext.init(null,new SrfTrustManager[]{_trustMgr }, null); + SSLContext.setDefault(sslContext); + _factory = sslContext.getSocketFactory(); + } + catch (NoSuchAlgorithmException e){ + logger.print(e.getMessage()); + logger.print("\n\r"); + } catch (KeyManagementException e){ + logger.print(e.getMessage()); + logger.print("\n\r"); + }; + + if((srfProxy != null) && (srfProxy.length() != 0)) { + String[] res = srfProxy.split(":", 2); + Properties systemProperties = System.getProperties(); + String proxy = res[0]; + systemProperties.setProperty("https.proxyHost", proxy); + if(res.length == 2) { + String port = res[1]; + systemProperties.setProperty("https.proxyPort", port); + } + } +////////////////////////////////////////////////////////////////////// + tests = null; + InitSrfEventListener(); + _secretApplied = false; + try { + while (true) { + try { + tests = GetTestsSet(); + if(tests.size()>0 && eventSrc==null) + InitSrfEventListener(); + break; + } catch (AuthenticationException e) { + InitSrfEventListener(); + if(_token == null) + _token = LoginToSrf(); + _secretApplied = true; + } catch (Exception e) { + // if(!_secretApplied) + // continue; + if (eventSrc != null) + eventSrc.close(); + eventSrc = null; + return false; + } + + } + runningCount = tests.size(); + while (runningCount > 0) { + dowait(1000); + _timeout = _timeout - 1000; + // if(_timeout <= 0) + // runningCount --; + } + } + finally { + if (eventSrc != null) { + eventSrc.close(); + eventSrc = null; + } + if (_con != null){ + _con.disconnect(); + _con = null; + if(srfCloseTunnel){ + if(CreateTunnelBuilder.Tunnels != null){ + for (Process p:CreateTunnelBuilder.Tunnels){ + p.destroy(); + } + CreateTunnelBuilder.Tunnels.clear(); + } + } + } + + } + JSONArray testRes = GetTestResults(tests); + int sz = testRes.size(); + for(int i = 0; i %1d %1s

    ",k+1, steps.getJSONObject(k).getString("description"))); + } + script.setTextContent(allSteps.toString()); + } + catch (Exception e){} + testCase.appendChild(script); + // testCase.setAttribute("classname", scriptName); + testCase.setAttribute("name", scriptName); + testCase.setAttribute("yac", scriptRun.getString("yac")); + String duration =scriptRun.getString("durationMs"); + if(duration == null) + duration = testDuration; + duration_i = Integer.parseInt(duration, 10)/1000; + testCase.setAttribute("time", String.format("%1d.0",duration_i )); + status = scriptRun.getString("status"); + JSONObject env = scriptRun.getJSONObject("environment"); + JSONObject os = env.getJSONObject("os"); + JSONObject browser = env.getJSONObject("browser"); + String envString = String.format("%1s %1s %1s %1s", os.getString("name"), os.getString("version"), browser.getString("name"), browser.getString("version")); + Element envXml = doc.createElement("properties"); + Element prop = doc.createElement("property"); + prop.setAttribute("Environment", envString) ; + envXml.appendChild(prop); + testCase.appendChild(envXml); + if((status != null) && (status.compareTo("success") != 0)){ + if("failed".compareTo(status) == 0) { + failuresTestSute++; + } + else + errorsTestSute ++; + if(scriptRun.containsKey("errors")) { + JSONArray errorsAr = new JSONArray(); + Object errors = ""; + try { + errorsAr = scriptRun.getJSONArray("errors"); + } + catch (Exception e){ + try { + errors = scriptRun.getJSONObject("errors"); + errorsAr.add(errors); + } + catch (Exception e1) { + JSONObject jErr = new JSONObject(); + jErr.put("error", errors.toString()); + errorsAr.add(jErr); + } + } + + int errCnt = errorsAr.size(); + for (int k = 0; k < errCnt; k++) { + Element error = doc.createElement("error"); + if(errorsAr.get(k) == JSONNull.getInstance()) + continue; + error.setAttribute("message", ((JSONObject)(errorsAr.get(k))).getString("message")); + testCase.appendChild(error); + } + } + + } + testSuite.appendChild(testCase); + testSuite.setAttribute("errors", String.format("%1d", errorsTestSute)); + testSuite.setAttribute("failures", String.format("%1d", failuresTestSute)); + errorsTestSute = 0; + failuresTestSute = 0; + } + root.appendChild(testSuite); + } + } + catch (Exception e){ + logger.println(e.getMessage()); + e.printStackTrace(); + } + doc.appendChild(root); + String xml = getStringFromDocument(doc); + return xml; + } + String getStringFromDocument(Document doc) + { + try + { + DOMSource domSource = new DOMSource(doc); + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + transformer.transform(domSource, result); + return writer.toString(); + } + catch(Exception ex) + { + ex.printStackTrace(); + return null; + } + + } + + static class SrfTrustManager extends X509ExtendedTrustManager implements X509TrustManager { + + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { + + } + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { + + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + } + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + } + + @Extension + // This indicates to Jenkins that this is an implementation of an extension + // point. + public static final class DescriptorImpl extends BuildStepDescriptor { + private String srfTestId; + private String srfTagNames; + private Object srfTestArgs; + private String srfTunnelName; + private boolean srfCloseTunnel; + public DescriptorImpl() { + load(); + } + + @Override + public boolean isApplicable(Class aClass) { + return true; + } + + @Override + public String getDisplayName() { + return "Execute tests by SRF"; + } + + public boolean hasSrfServers() { + return Hudson.getInstance().getDescriptorByType( + SrfServerSettingsBuilder.SrfDescriptorImpl.class).hasSrfServers(); + } + + public SrfServerSettingsModel[] getSrfServers() { + return Hudson.getInstance().getDescriptorByType( + SrfServerSettingsBuilder.SrfDescriptorImpl.class).getInstallations(); + } + + public FormValidation doCheckSrfUserName(@QueryParameter String value) { + if (StringUtils.isBlank(value)) { + return FormValidation.error("User name must be set"); + } + + return FormValidation.ok(); + } + + public FormValidation doCheckSrfTimeout(@QueryParameter String value) { + + if (StringUtils.isEmpty(value)) { + return FormValidation.ok(); + } + + String val1 = value.trim(); + + if (val1.length() > 0 && val1.charAt(0) == '-') + val1 = val1.substring(1); + + if (!StringUtils.isNumeric(val1) && val1 != "") { + return FormValidation.error("Timeout name must be a number"); + } + return FormValidation.ok(); + } + + public FormValidation doCheckSrfPassword(@QueryParameter String value) { + // if (StringUtils.isBlank(value)) { + // return FormValidation.error("Password must be set"); + // } + + return FormValidation.ok(); + } + + public FormValidation doCheckSrfDomain(@QueryParameter String value) { + if (StringUtils.isBlank(value)) { + return FormValidation.error("Domain must be set"); + } + + return FormValidation.ok(); + } + + public FormValidation doCheckSrfProject(@QueryParameter String value) { + if (StringUtils.isBlank(value)) { + return FormValidation.error("Project must be set"); + } + + return FormValidation.ok(); + } + + public FormValidation doCheckSrfTestSets(@QueryParameter String value) { + if (StringUtils.isBlank(value)) { + return FormValidation.error("Testsets are missing"); + } + + return FormValidation.ok(); + } + + } + +} diff --git a/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java new file mode 100644 index 0000000000..8e94f8582d --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java @@ -0,0 +1,143 @@ +package com.hpe.application.automation.tools.settings; + +import com.hpe.application.automation.tools.model.SrfServerSettingsModel; +import hudson.CopyOnWrite; +import hudson.Extension; +import hudson.model.AbstractProject; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; +import hudson.util.FormValidation; +import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.StaplerRequest; + +/** + * Created by shepshel on 20/07/2016. + */ +public class SrfServerSettingsBuilder extends Builder{ + + public SrfServerSettingsBuilder(){ + + } + + @Override + public SrfServerSettingsBuilder.SrfDescriptorImpl getDescriptor() { + return (SrfServerSettingsBuilder.SrfDescriptorImpl) super.getDescriptor(); + } + + /** + * Descriptor for {@link SrfServerSettingsBuilder}. Used as a singleton. The class is marked as + * public so that it can be accessed from views. + * + *

    + * See src/main/resources/hudson/plugins/hello_world/HelloWorldBuilder/*.jelly for the + * actual HTML fragment for the configuration screen. + */ + @Extension + // This indicates to Jenkins that this is an implementation of an extension + // point. + public static final class SrfDescriptorImpl extends BuildStepDescriptor { + private static String srfServer; + private int lastId = 0; + private Object _addButton; + public Object getaddButton(){ + return _addButton; + } + public void setaddButton(Object btn){ + _addButton = btn; + } + public boolean getAddButtonState(SrfDescriptorImpl o){ + boolean b= true; + if(o == null) + return false; + if(o.installations == null) + return false; + if(o.installations[0] == null) + return false; + + return b; + + } + + + @Override + public boolean isApplicable( + @SuppressWarnings("rawtypes") Class aClass) { + // Indicates that this builder can be used with all kinds of project + // types + return true; + } + + /** + * This human readable name is used in the configuration screen. + */ + @Override + public String getDisplayName() { + return ""; + } + + public SrfDescriptorImpl() { + load(); + } + public static String getSrfServerName() { + return srfServer; + } + @Override + public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { + // To persist global configuration information, + // set that to properties and call save(). + // useFrench = formData.getBoolean("useFrench"); + // ^Can also use req.bindJSON(this, formData); + // (easier when there are many fields; need set* methods for this, + // like setUseFrench) + // req.bindParameters(this, "locks."); + + setInstallations(req.bindParametersToList(SrfServerSettingsModel.class, "srf.").toArray( + new SrfServerSettingsModel[0])); + + save(); + return super.configure(req, formData); + } + + + + @CopyOnWrite + private SrfServerSettingsModel[] installations = new SrfServerSettingsModel[0]; + + public SrfServerSettingsModel[] getInstallations() { + return installations; + } + + public void setInstallations(SrfServerSettingsModel... installations) { + this.installations = installations; + + UpdateButtonState(); + } + private void UpdateButtonState(){ + try { + if(hasSrfServers()) + _addButton.getClass().getField("disabled").setBoolean(_addButton, true); + else + _addButton.getClass().getField("disabled").setBoolean(_addButton, false); + } + catch (Exception e) { + e.printStackTrace(); + } + } + public FormValidation doCheckSrfServerName(@QueryParameter String value) { + UpdateButtonState(); + if (StringUtils.isBlank(value)) { + return FormValidation.error("Srf server name cannot be empty"); + } + + return FormValidation.ok(); + } + + + + public Boolean hasSrfServers() { + return installations.length > 0; + } + } +} diff --git a/src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly new file mode 100644 index 0000000000..e741d62899 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + +

    + +
    + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SrfDetailReport/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/SrfDetailReport/index.jelly new file mode 100644 index 0000000000..8887ff1a36 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/results/SrfDetailReport/index.jelly @@ -0,0 +1,19 @@ + + + + + + +

    LoadRunner Performance Result

    +

    ${it.name}

    + +
    +
    +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SrfHtmlBuildReportAction/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/SrfHtmlBuildReportAction/index.jelly new file mode 100644 index 0000000000..7db44d42f2 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/results/SrfHtmlBuildReportAction/index.jelly @@ -0,0 +1,93 @@ + + + + + + + + +

    UFT Report

    +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeReport nameTimestampStatusFolder
    Html_report${s.disPlayName}RRV_report${s.disPlayName}${s.dateTime}PassedFailedOpen
    +

    +
    + +
    +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/config.jelly new file mode 100644 index 0000000000..ffa465c323 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/config.jelly @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/help-archiveTestResultsMode.html b/src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/help-archiveTestResultsMode.html new file mode 100644 index 0000000000..b1cc1dd440 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/results/SrfRunResultRecorder/help-archiveTestResultsMode.html @@ -0,0 +1,8 @@ +
    +To view the run results, do one of the following:
    +1) In the left pane, click the Report and Summary link to display the report link and the link to the report folder. From this link, you can open the run results directly in your browser or open the artifacts
    +2) From the Build Artifacts:
    +• Open the run_results.html to view the run results.
    +• Download the zipped report to your desired location and unzip it. In the HP Run Results Viewer, select the Results.xml file found inside the unzipped folder.
    +Note that this option is valid only when using the “Execute HP test from file system†build step. +
    diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly new file mode 100644 index 0000000000..d74e036231 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly @@ -0,0 +1,19 @@ + + + + + + +

    Transaction Summary

    +

    ${it.name}

    + +
    +
    +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly new file mode 100644 index 0000000000..e47d00d15f --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.properties b/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.properties new file mode 100644 index 0000000000..0d3e502276 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.properties @@ -0,0 +1 @@ +DontForgetThePublisher= \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/run/RunFromSrfBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/RunFromSrfBuilder/config.jelly new file mode 100644 index 0000000000..ec9c3aae8c --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/run/RunFromSrfBuilder/config.jelly @@ -0,0 +1,54 @@ + + + + + + + +
    + Example: 982 +
    + +
    + +
    + Example: tag1,tag2 +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    + + + + +
    + +
    diff --git a/src/main/resources/hudson/tasks/junit/CaseResult/body.jelly b/src/main/resources/hudson/tasks/junit/CaseResult/body.jelly new file mode 100644 index 0000000000..3c46ed2209 --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/CaseResult/body.jelly @@ -0,0 +1,112 @@ + + + + + +

    ${%All Failed Tests}

    + + + + + + + + + + + + + +
    ${%Test Name}${%Duration}${%Age}
    + ${f.durationString} + + ${f.age} +
    +
    + + + + + +

    ${%All Tests}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Test SetTest${it.childTitle}${%Duration}${%Fail}(${%diff})${%Skip}(${%diff})${%Pass}(${%diff})${%Total}(${%diff})
    + + + + + ${p.durationString}${p.failCount} + ${h.getDiffString2(p.failCount-prev.failCount)} + ${p.skipCount} + ${h.getDiffString2(p.skipCount-prev.skipCount)} + ${p.passCount} + ${h.getDiffString2(p.passCount-prev.passCount)} + ${p.totalCount} + ${h.getDiffString2(p.totalCount-prev.totalCount)} +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly b/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly new file mode 100644 index 0000000000..582f2031fc --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly @@ -0,0 +1,99 @@ + + + + + + + + + +

    + +

    + ${it.getClass.Name} +

    + + + + + (from ) + +

    + + +
    + + + ${%skippedFor(it.age)} + + + ${%failingFor(it.age)} + + + (${%since.before}${%since.after}) +
    +
    + + + + + + + + + +
    + + +

    ${%Skip Message}

    +
    +
    + + +

    ${it}

    +
    +
    + + +

    ${%Stacktrace}

    +
    +
    + +

    ${%Script steps}

    +

    +
    + + +

    ${%Standard Error}

    +
    +
    +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly b/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly new file mode 100644 index 0000000000..8580efaa63 --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/ClassResult/body.jelly @@ -0,0 +1,71 @@ + + + + + + +

    ${%All Tests}

    + + + + + + + + + + + + + + ${it.getParentAction().startLoop()} + + + + + + + + + +
    ${%Script name}${%Environment}${%Duration}${%Status}
    + + + + + + + + + + ${it.getParentAction().getEnvString(p)}${p.durationString} + + + + ${pst.message} + +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/junit/PackageResult/body.jelly b/src/main/resources/hudson/tasks/junit/PackageResult/body.jelly new file mode 100644 index 0000000000..3c46ed2209 --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/PackageResult/body.jelly @@ -0,0 +1,112 @@ + + + + + +

    ${%All Failed Tests}

    + + + + + + + + + + + + + +
    ${%Test Name}${%Duration}${%Age}
    + ${f.durationString} + + ${f.age} +
    +
    + + + + + +

    ${%All Tests}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Test SetTest${it.childTitle}${%Duration}${%Fail}(${%diff})${%Skip}(${%diff})${%Pass}(${%diff})${%Total}(${%diff})
    + + + + + ${p.durationString}${p.failCount} + ${h.getDiffString2(p.failCount-prev.failCount)} + ${p.skipCount} + ${h.getDiffString2(p.skipCount-prev.skipCount)} + ${p.passCount} + ${h.getDiffString2(p.passCount-prev.passCount)} + ${p.totalCount} + ${h.getDiffString2(p.totalCount-prev.totalCount)} +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/junit/TestResult/_body.jelly b/src/main/resources/hudson/tasks/junit/TestResult/_body.jelly new file mode 100644 index 0000000000..03bccae025 --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/TestResult/_body.jelly @@ -0,0 +1,66 @@ + + + + + +

    ${%All Tests}

    + + + + + + + + + + + + + + + + ${it.getParentAction().startLoop()} + + + + + + + + + +
    ${%Script name}${%Environment}${%Duration}${%Status}${%SRF Results}
    + + + + + ${it.getParentAction().getEnvString(p)}${p.durationString} + + + ${pst.message} + +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/junit/TestResult/body.jelly b/src/main/resources/hudson/tasks/junit/TestResult/body.jelly new file mode 100644 index 0000000000..908f8440f1 --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/TestResult/body.jelly @@ -0,0 +1,117 @@ + + + + + +

    ${%All Failed Tests}

    + + + + + + + + + + + + + + +
    ${%Test Name}${%Duration}${%Age}
    + ${f.durationString} + + ${f.age} +
    +
    + + + + +

    ${%All Tests}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Test SetTest${it.childTitle}${%Duration}${%Fail}(${%diff})${%Skip}(${%diff})${%Pass}(${%diff})${%Total}(${%diff})
    + + + + + + + + + + ${p.durationString}${p.failCount} + ${h.getDiffString2(p.failCount-prev.failCount)} + ${p.skipCount} + ${h.getDiffString2(p.skipCount-prev.skipCount)} + ${p.passCount} + ${h.getDiffString2(p.passCount-prev.passCount)} + ${p.totalCount} + ${h.getDiffString2(p.totalCount-prev.totalCount)} +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/junit/body.jelly b/src/main/resources/hudson/tasks/junit/body.jelly new file mode 100644 index 0000000000..3c46ed2209 --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/body.jelly @@ -0,0 +1,112 @@ + + + + + +

    ${%All Failed Tests}

    + + + + + + + + + + + + + +
    ${%Test Name}${%Duration}${%Age}
    + ${f.durationString} + + ${f.age} +
    +
    + + + + + +

    ${%All Tests}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Test SetTest${it.childTitle}${%Duration}${%Fail}(${%diff})${%Skip}(${%diff})${%Pass}(${%diff})${%Total}(${%diff})
    + + + + + ${p.durationString}${p.failCount} + ${h.getDiffString2(p.failCount-prev.failCount)} + ${p.skipCount} + ${h.getDiffString2(p.skipCount-prev.skipCount)} + ${p.passCount} + ${h.getDiffString2(p.passCount-prev.passCount)} + ${p.totalCount} + ${h.getDiffString2(p.totalCount-prev.totalCount)} +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/junit/index.jelly b/src/main/resources/hudson/tasks/junit/index.jelly new file mode 100644 index 0000000000..8627157186 --- /dev/null +++ b/src/main/resources/hudson/tasks/junit/index.jelly @@ -0,0 +1,97 @@ + + + + + + + + +

    + +

    +

    + + + + + (from ) + +

    + +
    + + + ${%skippedFor(it.age)} + + + ${%failingFor(it.age)} + + + (${%since.before}${%since.after}) +
    +
    + + + + + + + + + +
    + + +

    ${%Skip Message}

    +
    +
    + + +

    ${it}

    +
    +
    + + +

    ${%Stacktrace}

    +
    +
    + + +

    ${%Standard Output}

    +
    +
    + + +

    ${%Standard Error}

    +
    +
    +
    +
    +
    diff --git a/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly b/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly new file mode 100644 index 0000000000..36ee46de3a --- /dev/null +++ b/src/main/resources/hudson/tasks/test/MetaTabulatedResult/body.jelly @@ -0,0 +1,98 @@ + + + + + +

    ${%All Failed Tests}

    + + + + + + + + + + + + + +
    ${%Test Name}${%Duration}${%Age}
    + ${f.durationString} + + ${f.age} +
    +
    + + +

    ${%All Tests}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ${it.childTitle}${%Duration}${%Fail}(${%diff})${%Skip}(${%diff})${%Pass}(${%diff})${%Total}(${%diff})
    + + + + + ${p.durationString}${p.failCount} + ${h.getDiffString2(p.failCount-prev.failCount)} + ${p.skipCount} + ${h.getDiffString2(p.skipCount-prev.skipCount)} + ${p.passCount} + ${h.getDiffString2(p.passCount-prev.passCount)} + ${p.totalCount} + ${h.getDiffString2(p.totalCount-prev.totalCount)} +
    +
    +
    From a183d4f1972b90d1574561bb59a3cc49f11fe3f9 Mon Sep 17 00:00:00 2001 From: Yaniv Levi Date: Mon, 25 Sep 2017 12:54:53 +0300 Subject: [PATCH 0148/2502] user story #447030: update pom to support GZIP compressed events + update test (#44) --- pom.xml | 2 +- .../automation/tools/octane/events/EventsTest.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5c75410493..b0fb02db99 100644 --- a/pom.xml +++ b/pom.xml @@ -431,7 +431,7 @@ mqm-rest-client com.hpe.adm.octane.ciplugins - 1.4.18 + 1.4.20 diff --git a/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java b/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java index 0cc2c11109..50e1a03986 100644 --- a/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java +++ b/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java @@ -41,6 +41,7 @@ import java.util.Arrays; import java.util.List; import java.util.logging.Logger; +import java.util.zip.GZIPInputStream; import static org.junit.Assert.*; @@ -169,7 +170,9 @@ public void handle(String s, Request baseRequest, HttpServletRequest request, Ht } } else if (request.getPathInfo().equals("/internal-api/shared_spaces/" + sharedSpaceId + "/analytics/ci/events")) { buffer = new byte[1024]; - while ((len = request.getInputStream().read(buffer, 0, 1024)) > 0) { + + GZIPInputStream gzis = new GZIPInputStream( request.getInputStream() ); + while ((len = gzis.read(buffer, 0, 1024)) > 0) { body += new String(buffer, 0, len); } try { From f773a094500b6f4ade2db70e482b3535b9999d2c Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 25 Sep 2017 13:00:57 +0300 Subject: [PATCH 0149/2502] fix errors detected by SonarQube analysis --- .../automation/tools/model/Pair.java | 6 ++-- .../tools/model/SrfServerSettingsModel.java | 12 ------- .../tools/model/SrfTestResultModel.java | 1 - .../tools/results/SrfDetailReport.java | 2 +- .../tools/results/SrfResultsReport.java | 32 +++++++++---------- .../tools/run/CreateTunnelBuilder.java | 4 +-- .../tools/run/RunFromSrfBuilder.java | 9 ++++-- 7 files changed, 28 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/model/Pair.java b/src/main/java/com/hpe/application/automation/tools/model/Pair.java index d50049c05f..a510ff2e91 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/Pair.java +++ b/src/main/java/com/hpe/application/automation/tools/model/Pair.java @@ -9,15 +9,15 @@ import org.kohsuke.stapler.QueryParameter; class Pair extends AbstractDescribableImpl { - + private String name; + private String value; @DataBoundConstructor public Pair(String name, String value) { this.name = name; this.value = value; } - private String name; - private String value; + @Extension public static class DescriptorImpl extends Descriptor { diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java index fc478f4dfb..78865b0b62 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java @@ -19,7 +19,6 @@ public class SrfServerSettingsModel { @DataBoundConstructor public SrfServerSettingsModel(String srfTunnelPath, String srfServerName, String srfProxyName,String srfAppName, String srfSecretName ) { - SrfServerSettingsBuilder mdl = new SrfServerSettingsBuilder(); this.srfTunnelPath = srfTunnelPath; this.srfServerName = srfServerName; this.srfProxyName = srfProxyName; @@ -47,15 +46,4 @@ public String getSrfProxyName() { return srfProxyName; } - private Properties getProperties() { - - Properties prop = new Properties(); - if (!StringUtils.isEmpty(srfProxyName)) { - prop.put("srfProxyName", srfProxyName); - } else { - prop.put("srfProxyName", ""); - } - - return prop; - } } diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java index 033ead5f52..5025ae1530 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java @@ -21,7 +21,6 @@ public class SrfTestResultModel extends AbstractDescribableImpl { public String getDisplayName() { diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java index 42f1ca07c1..f1f8c0796f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java @@ -30,7 +30,7 @@ public String getDisplayName() { return name; } - private AbstractBuild getBuild() { + public AbstractBuild getBuild() { return build; } diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index b3f85c1a5a..3736283257 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -50,16 +50,17 @@ public class SrfResultsReport extends Recorder implements Serializable { private static final long serialVersionUID = 1L; - private static Hashtable myHash = new Hashtable(); - + private static Hashtable myHash; @DataBoundConstructor public SrfResultsReport() { - + if(myHash == null) + myHash = new Hashtable(); } public class SrfTestResultAction extends TestResultAction { + private AbstractBuild _build; private JSONArray _buildInfo; private int _idx; private PrintStream _logger; @@ -105,9 +106,10 @@ public SrfTestResultAction(AbstractBuild owner, TestResult result, BuildListener } finally { try { - reader.close(); + if(reader != null) + reader.close(); } catch (IOException e) { - e.printStackTrace(); + } } _buildInfo = JSONArray.fromObject(data); @@ -137,7 +139,6 @@ public String getDeepLink(Object p){ String name = jTest.getString("name").toLowerCase(); if(name.compareTo(testName) != 0) continue; - JSONArray scriptRuns = jTest.getJSONArray("scriptRuns"); JSONObject jo = (JSONObject)_buildInfo.get(0); String y1 = jo.getString("yac"); @@ -145,7 +146,7 @@ public String getDeepLink(Object p){ int len = runs.size(); JSONObject run = runs.getJSONObject(len - idx ); String y2 = run.getString("yac"); - srfUrl = String.format("%1s/results/%1s/details/compare?script-runs=%1s", GetSrfServer(owner), y1, y2); + srfUrl = String.format("%1s/results/%1s/details/compare?script-runs=%1s", getSrfServer(owner), y1, y2); String tenant = jTest.getString("tenantid"); srfUrl = srfUrl.concat("&TENANTID=").concat(tenant); } @@ -190,8 +191,8 @@ private void setTarget(TestObject t, Hashtable h){ myHash.putAll(h); } } - AbstractBuild _build; - private String GetSrfServer(AbstractBuild build){ + + private String getSrfServer(AbstractBuild build){ String ftaasServerAddress = ""; try { String path = build.getProject().getParent().getRootDir().toString(); @@ -200,17 +201,14 @@ private String GetSrfServer(AbstractBuild build){ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.parse(file); - String app = document.getElementsByTagName("srfAppName").item(0).getTextContent(); - String secret = document.getElementsByTagName("srfSecretName").item(0).getTextContent(); ftaasServerAddress = document.getElementsByTagName("srfServerName").item(0).getTextContent(); - if((ftaasServerAddress.startsWith("http://")== false) && (ftaasServerAddress.startsWith("https://")== false)) + if( !ftaasServerAddress.startsWith("http://") && !ftaasServerAddress.startsWith("https://")) { String tmp = ftaasServerAddress; ftaasServerAddress="https://"; ftaasServerAddress = ftaasServerAddress.concat(tmp); } - if(ftaasServerAddress.startsWith("http://")) { - if (ftaasServerAddress.substring(6).contains(":") == false) + if(ftaasServerAddress.startsWith("http://") && !ftaasServerAddress.substring(6).contains(":") ){ ftaasServerAddress = ftaasServerAddress.concat(":8080"); } else if(ftaasServerAddress.startsWith("https://")) { @@ -242,7 +240,7 @@ else if(ftaasServerAddress.startsWith("https://")) { public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { final List mergedResultNames = new ArrayList(); - _build = build; + // TestNameTransformer.all().add(new TestNameTransformer() ); SrfTestResultAction action; Project project = RuntimeUtils.cast(build.getProject()); @@ -431,7 +429,8 @@ private void write2XML(Document document,String filename) ; } finally { - pw.close(); + if(pw != null) + pw.close(); } } @@ -469,7 +468,6 @@ public static class DescriptorImpl extends BuildStepDescriptor { public static DescriptorImpl _inst; public DescriptorImpl() { String s=this.getDescriptorUrl(); - load(); _inst = this; } diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index 74d5fb7d0a..62af02ab1e 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -33,7 +33,7 @@ public class CreateTunnelBuilder extends Builder implements SimpleBuildStep { private PrintStream logger; private String srfTunnelName; private AbstractBuild build; - public static final ArrayList Tunnels = new ArrayList(); + protected static final ArrayList Tunnels = new ArrayList(); @DataBoundConstructor public CreateTunnelBuilder( String srfTunnelName ){ @@ -159,7 +159,7 @@ public String getDisplayName() { return "Create Tunnel"; } } - class TestRunData implements java.io.Serializable { + static class TestRunData implements java.io.Serializable { public TestRunData(JSONObject obj) { try { diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java index 858abd418b..2841b9ab04 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java @@ -800,7 +800,8 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, logger.print(e.getMessage()); } finally { - fs.close(); + if(fs != null) + fs.close(); } String xmlReport = ""; try { @@ -818,7 +819,7 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, fs = new FileOutputStream(f); fs.write(xmlReport.getBytes()); - fs.close(); + if(_con != null) _con.disconnect(); } @@ -828,6 +829,10 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, eventSrc.close(); eventSrc = null; } + finally { + if(fs != null) + fs.close(); + } return _success; } private synchronized void dowait(long time) From 7626fc181b4f4a2a5ad502769616e9f4b2d5d831 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 25 Sep 2017 14:48:36 +0300 Subject: [PATCH 0150/2502] fix errors detected by SonarQube analysis --- .../automation/tools/model/SrfServerSettingsModel.java | 3 --- .../automation/tools/results/SrfResultsReport.java | 2 +- .../automation/tools/run/CreateTunnelBuilder.java | 8 ++++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java index 78865b0b62..49dd11452f 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java @@ -1,11 +1,8 @@ package com.hpe.application.automation.tools.model; -import com.hpe.application.automation.tools.settings.SrfServerSettingsBuilder; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; -import java.util.Properties; - /** * Created by shepshel on 20/07/2016. */ diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index 3736283257..4257f71a08 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -50,7 +50,7 @@ public class SrfResultsReport extends Recorder implements Serializable { private static final long serialVersionUID = 1L; - private static Hashtable myHash; + final static Hashtable myHash; @DataBoundConstructor public SrfResultsReport() { diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index 62af02ab1e..9d08dcb9e7 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -13,7 +13,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.w3c.dom.Document; + import org.xml.sax.SAXException; import javax.annotation.Nonnull; @@ -159,7 +159,7 @@ public String getDisplayName() { return "Create Tunnel"; } } - static class TestRunData implements java.io.Serializable { + static class TestRunData implements Serializable { public TestRunData(JSONObject obj) { try { @@ -203,6 +203,7 @@ public void merge(TestRunData newData) class TunnelTracker implements Runnable{ + static final long serialVersionUID=456; PrintStream logger; Process p; public TunnelTracker(PrintStream log, Process p){ @@ -231,8 +232,7 @@ public void run(){ p.waitFor(); logger.println("\n\nExit Value is " + exitValue); } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } } } From 6fbb51e69ee117724c6b718fe8c52005fd850294 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 25 Sep 2017 15:56:15 +0300 Subject: [PATCH 0151/2502] Fix errors --- .../application/automation/tools/results/SrfResultsReport.java | 2 +- .../application/automation/tools/run/CreateTunnelBuilder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index 4257f71a08..82d896a65f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -50,7 +50,7 @@ public class SrfResultsReport extends Recorder implements Serializable { private static final long serialVersionUID = 1L; - final static Hashtable myHash; + public static Hashtable myHash = new Hashtable(); @DataBoundConstructor public SrfResultsReport() { diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index 9d08dcb9e7..ddf7fcb2f2 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -202,7 +202,7 @@ public void merge(TestRunData newData) } - class TunnelTracker implements Runnable{ + private class TunnelTracker implements Runnable{ static final long serialVersionUID=456; PrintStream logger; Process p; From 8732860a92a6b1bf9d3f05cc52063d254c0aa194 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 26 Sep 2017 17:36:28 +0300 Subject: [PATCH 0152/2502] fix issues detected by analysis --- .../automation/tools/results/SrfResultsReport.java | 2 +- .../automation/tools/run/CreateTunnelBuilder.java | 8 +++++--- .../automation/tools/run/RunFromSrfBuilder.java | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index 82d896a65f..4e75cee75e 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -465,7 +465,7 @@ public ResultsPublisherModel getResultsPublisherModel() { @Extension public static class DescriptorImpl extends BuildStepDescriptor { - public static DescriptorImpl _inst; + public static DescriptorImpl _inst; public DescriptorImpl() { String s=this.getDescriptorUrl(); load(); diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index ddf7fcb2f2..825d8b857b 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -160,6 +160,7 @@ public String getDisplayName() { } } static class TestRunData implements Serializable { + static final long serialVersionUID=11; public TestRunData(JSONObject obj) { try { @@ -211,7 +212,7 @@ public TunnelTracker(PrintStream log, Process p){ this.p=p; } @Override - public void run(){ + public void run() { try{ //Read out dir output logger.println("In tracker!"); @@ -231,8 +232,9 @@ public void run(){ int exitValue =0; p.waitFor(); logger.println("\n\nExit Value is " + exitValue); - } catch (InterruptedException e) { - + } catch (final InterruptedException e) { + p.destroy(); + return; } } } diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java index 2841b9ab04..04c3330cf0 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java @@ -56,6 +56,7 @@ public class RunFromSrfBuilder extends Builder implements java.io.Serializable { + static final long serialVersionUID = 3; class TestRunData implements java.io.Serializable { public TestRunData(JSONObject obj) @@ -124,7 +125,7 @@ static EventSource openAsynch(WebTarget target, String auth) { new OpenThread(eventSource).start(); return eventSource; } - private PrintStream logger; + private transient PrintStream logger; private boolean _https; private AbstractBuild build; private String srfTestId; @@ -136,7 +137,7 @@ static EventSource openAsynch(WebTarget target, String auth) { private List srfTestParameters; private java.util.Hashtable _testRunData; private JSONArray tests ; - public Object srfTestArg = null; + public transient Object srfTestArg = null; @DataBoundConstructor public RunFromSrfBuilder( String srfTestId, String srfTagNames, @@ -196,7 +197,7 @@ public RunFromSrfBuilder.DescriptorImpl getDescriptor() { private String _secret; private boolean _success; private boolean _secretApplied; - private HttpURLConnection _con; + private transient HttpURLConnection _con; private static SrfTrustManager _trustMgr = new SrfTrustManager(); static SSLSocketFactory _factory; public static JSONObject GetSrfConnectionData(AbstractBuild build, PrintStream logger) { From d467e0debc638b54062d43848f2f6f3dc63373a7 Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Wed, 27 Sep 2017 14:07:08 +0300 Subject: [PATCH 0153/2502] Issue 44314 proxy user password --- .../automation/tools/pc/PcClient.java | 6 +- .../automation/tools/pc/PcRestProxy.java | 63 ++++++++++++++----- .../tools/run/PcBuilder/help-proxyOutURL.html | 2 +- 3 files changed, 52 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java index c41fbe3749..149cc62c83 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java @@ -56,6 +56,10 @@ public class PcClient { public PcClient(PcModel pcModel, PrintStream logger) { try { model = pcModel; + + if(model.getProxyOutURL() != null && !model.getProxyOutURL().isEmpty()){ + logger.println("Using proxy: " + model.getProxyOutURL()); + } restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(), model.getAlmDomain(), model.getAlmProject(),logger, model.getProxyOutURL()); this.logger = logger; }catch (PcException e){ @@ -345,7 +349,7 @@ public void waitForRunToPublishOnTrendReport(int runId, String trendReportId) th } } - }while (!publishEnded ); + }while (!publishEnded && counter < 120); } public boolean downloadTrendReportAsPdf(String trendReportId, String directory) throws PcException { diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java index 559ac58562..d68585b9c5 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java @@ -34,8 +34,12 @@ import org.apache.http.HttpHeaders; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.Credentials; +import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CookieStore; +import org.apache.http.client.CredentialsProvider; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; @@ -45,7 +49,9 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.BasicCookieStore; +import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingClientConnectionManager; import org.apache.http.impl.conn.SchemeRegistryFactory; import org.apache.http.protocol.BasicHttpContext; @@ -93,8 +99,10 @@ public class PcRestProxy { private String proxyScheme; private String proxyHostName; private int proxyPort; + private String proxyUser; + private String proxyPassword; - private HttpClient client; + private DefaultHttpClient client; private HttpContext context; private CookieStore cookieStore; // private PrintStream logger; @@ -120,35 +128,56 @@ public PcRestProxy(String webProtocolName, String pcServerName, String almDomain // PAC (proxy auto-config) or Automatic configuration script is not supported (for example our proxy: http://autocache.hpecorp.net/) getProxyDataFromURL(proxyOutURL); HttpHost proxy = new HttpHost(proxyHostName, proxyPort, proxyScheme); + + if (proxyUser != null && !proxyUser.isEmpty()) { + Credentials credentials = new UsernamePasswordCredentials(proxyUser, proxyPassword); + AuthScope authScope = new AuthScope(proxyHostName, proxyPort); + CredentialsProvider credsProvider = new BasicCredentialsProvider(); + client.getCredentialsProvider().setCredentials(authScope, credentials); + } client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); + } context = new BasicHttpContext(); cookieStore = new BasicCookieStore(); context.setAttribute(ClientContext.COOKIE_STORE, cookieStore); } - private void getProxyDataFromURL(String proxyURL) throws PcException{ - - try { - if (proxyURL != null && !proxyURL.isEmpty()){ - proxyScheme = proxyURL.split("://")[0]; - proxyHostName = proxyURL.split("://")[1].split(":")[0]; - if (proxyURL.split("://")[1].contains(":")){ - proxyPort = Integer.parseInt(proxyURL.split("://")[1].split(":")[1]); - }else{ - proxyPort = 80; - } + private void getProxyDataFromURL(String proxyURL) throws PcException{ + + try { + String mainStr = ""; + if (proxyURL != null && !proxyURL.isEmpty()){ + String[] urlSplit = proxyURL.split("://"); + + proxyScheme = urlSplit[0]; + if (urlSplit[1].indexOf("@") != -1){ + String Credentials = urlSplit[1].split("@")[0]; + mainStr = urlSplit[1].split("@")[1]; + proxyUser = Credentials.split(":")[0]; + proxyPassword = Credentials.split(":")[1]; + }else{ + mainStr = urlSplit[1]; + } + if (mainStr.contains(":")){ + //proxyPort = Integer.parseInt(proxyURL.split("://")[1].split(":")[1]); + proxyHostName = mainStr.split(":")[0]; + proxyPort = Integer.parseInt(mainStr.split(":")[1]); + }else{ + proxyHostName = mainStr; + proxyPort = 80; + } - } - } catch (Exception ex) { - throw new PcException("Error: Validating Proxy URL: " + ex + " Please add a proxy URL in this pattern: http(s)://: or leave blank"); - } + } + } catch (Exception ex) { + throw new PcException("Error: Validating Proxy URL: " + ex + " Please add a proxy URL in this pattern: http(s)://: or leave blank"); + } - } + } public boolean authenticate(String userName, String password) throws PcException, ClientProtocolException, IOException { String userNameAndPassword = userName + ":" + password; diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html index 34149e688b..3b93fe4a91 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html @@ -1,5 +1,5 @@
    - Add your local proxy as following: http(s)://<host>:<port>
    + Add your local proxy as following: http(s)://<host>:<port> or
    http(s)://<proxyuser>:<proxypassword>@<host>:<port>or Leave empty if not using a local proxy.
    PAC (proxy auto-config) or Automatic configuration script are not supported.
    \ No newline at end of file From d0b8a9cae6a42ebd212ae50d18d924693bcf9146 Mon Sep 17 00:00:00 2001 From: radislavB Date: Wed, 27 Sep 2017 15:10:48 +0300 Subject: [PATCH 0154/2502] restricting activation of contributor for UFT-related jobs only (#45) * restricting activation of contributor for UFT-related jobs only * fixing check for isExecutorJob * fixing getSharedCheckOutDirectory * fixing getSharedCheckOutDirectory --- .../CheckOutSubDirEnvContributor.java | 7 +++-- .../TestExecutionJobCreatorService.java | 30 ++++++++++++++----- .../tools/octane/executor/UftJobCleaner.java | 24 ++------------- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java index 3935b6f6d7..cc37ed95e6 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java @@ -16,6 +16,7 @@ package com.hpe.application.automation.tools.octane.executor; +import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; import hudson.EnvVars; import hudson.Extension; import hudson.model.EnvironmentContributor; @@ -34,7 +35,7 @@ @Extension public class CheckOutSubDirEnvContributor extends EnvironmentContributor { - public static final String CHECKOUT_SUBDIR_ENV_NAME = "CHECKOUT_SUBDIR"; + public static final String CHECKOUT_SUBDIR_ENV_NAME = "CHECKOUT_SUBDIR"; @Override public void buildEnvironmentFor(Job j, EnvVars envs, TaskListener listener) throws IOException, InterruptedException { @@ -45,7 +46,7 @@ public void buildEnvironmentFor(Job j, EnvVars envs, TaskListener listener) thro } public static String getSharedCheckOutDirectory(Job j) { - if (j instanceof FreeStyleProject) { + if (j instanceof FreeStyleProject && TestExecutionJobCreatorService.isExecutorJob((FreeStyleProject) j) && ConfigurationService.getServerConfiguration().isValid()) { SCM scm = ((FreeStyleProject) j).getScm(); if (scm != null && scm instanceof GitSCM) { GitSCM gitScm = (GitSCM) scm; @@ -54,8 +55,8 @@ public static String getSharedCheckOutDirectory(Job j) { return sharedCheckOutDirectory.getRelativeTargetDir(); } } - } + return null; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 8754a7a59b..9084ae569a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -63,8 +63,8 @@ public class TestExecutionJobCreatorService { private static final Logger logger = LogManager.getLogger(TestExecutionJobCreatorService.class); public static final String EXECUTOR_ID_PARAMETER_NAME = "Connection ID"; public static final String EXECUTOR_LOGICAL_NAME_PARAMETER_NAME = "Connection logical name"; - public static final String SUITE_ID_PARAMETER_NAME = "suiteId";//"Suite ID"; - public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId";//"Suite run ID"; + public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; + public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; public static final String FULL_SCAN_PARAMETER_NAME = "Full sync"; public static final String EXECUTION_JOB_MIDDLE_NAME = "test run job - Suite ID"; @@ -230,8 +230,7 @@ private static String prepareMtbxData(List tests) throws IOEx StringWriter writer = new StringWriter(); transformer.transform(new DOMSource(doc), new StreamResult(writer)); - String str = writer.toString(); - return str; + return writer.toString(); } catch (Exception e) { throw new IOException("Failed to build MTBX content : " + e.getMessage()); } @@ -325,8 +324,8 @@ private static String buildDiscoveryJobName(TestingToolType testingToolType, Str } private static void setBuildDiscarder(FreeStyleProject proj, int numBuildsToKeep) throws IOException { - int IRRELEVANT = -1; - BuildDiscarder bd = new LogRotator(IRRELEVANT, numBuildsToKeep, IRRELEVANT, IRRELEVANT); + int irrelevant = -1; + BuildDiscarder bd = new LogRotator(irrelevant, numBuildsToKeep, irrelevant, irrelevant); proj.setBuildDiscarder(bd); } @@ -337,7 +336,7 @@ private static void setBuildDiscarder(FreeStyleProject proj, int numBuildsToKeep * @param scmTrigger */ private static void delayPollingStart(final FreeStyleProject proj, final SCMTrigger scmTrigger) { - long delayStartPolling = 1000 * 60 * 5;//5 minute + long delayStartPolling = 1000L * 60 * 5;//5 minute Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override @@ -415,4 +414,21 @@ private static void addAssignedNode(FreeStyleProject proj) { logger.error("Failed to set addAssignedNode : " + e.getMessage()); } } + + public static boolean isExecutorJob(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + boolean isExecutorJob = job.getName().contains(TestExecutionJobCreatorService.EXECUTION_JOB_MIDDLE_NAME) && + parameters != null && + parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_ID_PARAMETER_NAME) != null; + + return isExecutorJob; + } + + public static boolean isDiscoveryJobJob(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + boolean isDiscoveryJob = job.getName().contains(TestExecutionJobCreatorService.DISCOVERY_JOB_MIDDLE_NAME) && + parameters != null && + parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_ID_PARAMETER_NAME) != null; + return isDiscoveryJob; + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java index 80a17d2ed4..3ae43abb44 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java @@ -84,7 +84,7 @@ private void clearExecutionJobs(List jobs) { long thresholdTimeInMillis = new Date().getTime() - PeriodicWork.DAY * getOutdateThreshold(); int clearCounter = 0; for (FreeStyleProject job : jobs) { - if (isExecutorJob(job) && job.getLastBuild() != null && !job.isBuilding()) { + if (TestExecutionJobCreatorService.isExecutorJob(job) && job.getLastBuild() != null && !job.isBuilding()) { if (thresholdTimeInMillis > job.getLastBuild().getTimeInMillis()) { try { logger.warn(String.format("Job %s is going to be deleted as outdated job, last build was executed at %s", job.getName(), job.getLastBuild().getTimestampString2())); @@ -101,24 +101,6 @@ private void clearExecutionJobs(List jobs) { logger.warn(String.format("Cleaner found %s outdated execution job", clearCounter)); } - private static boolean isExecutorJob(FreeStyleProject job) { - ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); - boolean isExecutorJob = job.getName().contains(TestExecutionJobCreatorService.EXECUTION_JOB_MIDDLE_NAME) && - parameters != null && - parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_ID_PARAMETER_NAME) != null && - parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_RUN_ID_PARAMETER_NAME) != null; - - return isExecutorJob; - } - - private static boolean isDiscoveryJobJob(FreeStyleProject job) { - ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); - boolean isDiscoveryJob = job.getName().contains(TestExecutionJobCreatorService.DISCOVERY_JOB_MIDDLE_NAME) && - parameters != null && - parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_ID_PARAMETER_NAME) != null; - return isDiscoveryJob; - } - private void clearDiscoveryJobs(List jobs) { //Generally, after deleting executor in Octane, relevant job in Jenkins is also deleted. But if jenkins was down during delete of executor, job remains @@ -130,7 +112,7 @@ private void clearDiscoveryJobs(List jobs) { Map> workspace2executorLogical2DiscoveryJobMap = new HashMap<>(); for (FreeStyleProject job : jobs) { - if (isDiscoveryJobJob(job)) { + if (TestExecutionJobCreatorService.isDiscoveryJobJob(job)) { String executorLogicalName = getExecutorLogicalName(job); Long workspaceId = getOctaneWorkspaceId(job); if (executorLogicalName != null && workspaceId != null) { @@ -225,7 +207,7 @@ public static void deleteExecutor(String id) { long executorToDelete = Long.parseLong(id); List jobs = Jenkins.getInstance().getAllItems(FreeStyleProject.class); for (FreeStyleProject proj : jobs) { - if (isDiscoveryJobJob(proj)) { + if (TestExecutionJobCreatorService.isDiscoveryJobJob(proj)) { Long executorId = getExecutorId(proj); if (executorId != null && executorId == executorToDelete) { boolean waitBeforeDelete = false; From 5df5001d7b6da116ec70f88ea0f5cd99e2f298f0 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 27 Sep 2017 15:17:22 +0300 Subject: [PATCH 0155/2502] use new execution api for srf --- .../tools/run/RunFromSrfBuilder.java | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java index 04c3330cf0..e41aa7f261 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java @@ -280,8 +280,7 @@ private JSONArray GetTestResults(JSONArray tests) throws IOException { url=url.concat(_token); url=url.concat("&"); - JSONObject obj = JSONObject.fromObject(tests.get(i)); - String runId = obj.getString("id"); + String runId = tests.get(i).toString(); url = url.concat(String.format("id=%1s", runId)); url = url.concat("&include=resource,script-runs,script-steps"); @@ -340,8 +339,7 @@ private HttpURLConnection Connect(String path, String method){ _token = LoginToSrf(); } reqUrl = reqUrl.concat("?access-token="); - reqUrl = reqUrl.concat(_token); - //.concat("&TENANTID="+_tenant); + reqUrl = reqUrl.concat(_token).concat("&TENANTID="+_tenant); URL srvUrl = new URL(reqUrl); HttpURLConnection con = (HttpURLConnection) srvUrl.openConnection(); @@ -382,10 +380,10 @@ private void FillExecutionReqBody() throws IOException{ String buildNumber = ApplyJobParams(srfBuildNumber); String releaseNumber = ApplyJobParams(srfReleaseNumber); if (buildNumber != null && buildNumber.length() > 0) { - ciProps.put("Build", buildNumber); + data.put("build", buildNumber); } if (releaseNumber != null && releaseNumber.length() > 0) - ciProps.put("Release", releaseNumber); + data.put("release", releaseNumber); this.logger.print(String.format("Required build & release: %1s %2s\n\r", buildNumber, releaseNumber)); HashMap paramObj = new HashMap(); @@ -402,18 +400,16 @@ private void FillExecutionReqBody() throws IOException{ logger.print(String.format("%1s : %2s\n\r", name, val)); } } - if (ciProps.size() > 0) { - testParams.put("ciParameters", ciProps); - } + if (cnt > 0) - testParams.put("parameters", paramObj); + data.put("params", paramObj); //add request header // con.setRequestProperty("session-context", context); try { OutputStream out = _con.getOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(out); - writer.write(testParams.toString()); + writer.write(data.toString()); writer.flush(); out.flush(); out.close(); @@ -426,7 +422,7 @@ private JSONArray GetTestsSet() throws MalformedURLException, AuthenticationExce StringBuffer response = new StringBuffer(); JSONArray ar = new JSONArray(); - _con = Connect("/rest/test-manager/executions", "POST"); + _con = Connect("/rest/jobmanager/v1/execution/jobs", "POST"); try { FillExecutionReqBody(); } @@ -457,11 +453,12 @@ private JSONArray GetTestsSet() throws MalformedURLException, AuthenticationExce if (responseCode != 200) { try{ - JSONArray tests = JSONArray.fromObject(response.toString()); + JSONArray tests = JSONObject.fromObject(response.toString()).getJSONArray("jobs"); + JSONArray.fromObject(response.toString()); int len = tests.size(); for (int i= 0; i < len; i++) { JSONObject jo = tests.getJSONObject(i); - if(jo.containsKey("id") && ( jo.size() == 1)) { + if(jo.containsKey("testId") && ( jo.size() == 1)) { ar.add(jo); } else { @@ -483,8 +480,13 @@ private JSONArray GetTestsSet() throws MalformedURLException, AuthenticationExce } } else - ar = JSONArray.fromObject(response.toString()); - return ar; + ar = JSONObject.fromObject(response.toString()).getJSONArray("jobs"); + JSONArray testAr = new JSONArray(); + int cnt = ar.size(); + for (int k = 0; k < cnt; k++ ){ + testAr.add(ar.getJSONObject(k).getString("jobId")); + } + return testAr; } @@ -618,7 +620,7 @@ public void onEvent(InboundEvent inboundEvent) { boolean skip = true; String id = obj.getJSONObject("testRun").getString("id"); for(int i = 0; i < testsCnt; i++){ - if(id.compareTo(tests.getJSONObject(i).getString("id") ) == 0){ + if(id.compareTo(tests.getString(i)) == 0){ skip = false; break; } @@ -836,10 +838,12 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, } return _success; } - private synchronized void dowait(long time) - { - try{ wait(time);} - catch (InterruptedException e){} + private synchronized void dowait(long time) throws InterruptedException { + try { + wait(time); + } catch (InterruptedException e) { + throw e; + } } String Convert2Xml(JSONArray report) throws ParserConfigurationException{ From e733255a0499cd594cee623cb5b7e1468e8c8ce4 Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Wed, 27 Sep 2017 16:08:30 +0300 Subject: [PATCH 0156/2502] second fix defect: Snippet Generator fails to create snippet fixing defect: https://issues.jenkins-ci.org/browse/JENKINS-46423 For the second time after another fix (45863) caused the same issue --- .../com/hpe/application/automation/tools/run/PcBuilder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index 3c23a54e40..a6401e97e8 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -691,6 +691,10 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } + public String getServerAndPort() + { + return getPcModel().getserverAndPort(); + } public String getPcServerName() { return getPcModel().getPcServerName(); From 795f0a91a10d6338202d453bd6b8b9d1830571ad Mon Sep 17 00:00:00 2001 From: radislavB Date: Thu, 28 Sep 2017 11:34:44 +0300 Subject: [PATCH 0157/2502] fixing getSharedCheckOutDirectory - separating classes that contains ref to GitScm to different classes (#47) --- .../CheckOutSubDirEnvContributor.java | 14 +---- .../executor/CheckOutSubDirEnvService.java | 46 ++++++++++++++++ .../TestExecutionJobCreatorService.java | 46 ++++------------ .../executor/UFTTestDetectionService.java | 2 +- .../tools/octane/executor/UftConstants.java | 31 +++++++++++ .../tools/octane/executor/UftJobCleaner.java | 10 ++-- .../octane/executor/UftJobRecognizer.java | 54 +++++++++++++++++++ 7 files changed, 150 insertions(+), 53 deletions(-) create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java index cc37ed95e6..e39ae58e0d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java @@ -23,9 +23,6 @@ import hudson.model.FreeStyleProject; import hudson.model.Job; import hudson.model.TaskListener; -import hudson.plugins.git.GitSCM; -import hudson.plugins.git.extensions.impl.RelativeTargetDirectory; -import hudson.scm.SCM; import java.io.IOException; @@ -46,15 +43,8 @@ public void buildEnvironmentFor(Job j, EnvVars envs, TaskListener listener) thro } public static String getSharedCheckOutDirectory(Job j) { - if (j instanceof FreeStyleProject && TestExecutionJobCreatorService.isExecutorJob((FreeStyleProject) j) && ConfigurationService.getServerConfiguration().isValid()) { - SCM scm = ((FreeStyleProject) j).getScm(); - if (scm != null && scm instanceof GitSCM) { - GitSCM gitScm = (GitSCM) scm; - RelativeTargetDirectory sharedCheckOutDirectory = gitScm.getExtensions().get(RelativeTargetDirectory.class); - if (sharedCheckOutDirectory != null) { - return sharedCheckOutDirectory.getRelativeTargetDir(); - } - } + if (j instanceof FreeStyleProject && UftJobRecognizer.isExecutorJob((FreeStyleProject) j) && !ConfigurationService.getServerConfiguration().isValid()) { + return CheckOutSubDirEnvService.getSharedCheckOutDirectory(j); } return null; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java new file mode 100644 index 0000000000..4eb2991cac --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java @@ -0,0 +1,46 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.executor; + +import hudson.model.FreeStyleProject; +import hudson.model.Job; +import hudson.plugins.git.GitSCM; +import hudson.plugins.git.extensions.impl.RelativeTargetDirectory; +import hudson.scm.SCM; + +/** + * Compute SharedCheckOutDirectory + */ + +public class CheckOutSubDirEnvService { + + + public static String getSharedCheckOutDirectory(Job j) { + SCM scm = ((FreeStyleProject) j).getScm(); + if (scm != null && scm instanceof GitSCM) { + GitSCM gitScm = (GitSCM) scm; + RelativeTargetDirectory sharedCheckOutDirectory = gitScm.getExtensions().get(RelativeTargetDirectory.class); + if (sharedCheckOutDirectory != null) { + return sharedCheckOutDirectory.getRelativeTargetDir(); + } + } + + return null; + } + +} + diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 9084ae569a..6ea2ce75e1 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -61,14 +61,7 @@ public class TestExecutionJobCreatorService { private static final Logger logger = LogManager.getLogger(TestExecutionJobCreatorService.class); - public static final String EXECUTOR_ID_PARAMETER_NAME = "Connection ID"; - public static final String EXECUTOR_LOGICAL_NAME_PARAMETER_NAME = "Connection logical name"; - public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; - public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; - public static final String FULL_SCAN_PARAMETER_NAME = "Full sync"; - public static final String EXECUTION_JOB_MIDDLE_NAME = "test run job - Suite ID"; - public static final String DISCOVERY_JOB_MIDDLE_NAME = "test discovery job - Connection ID"; /** * Create (if needed) and run test execution @@ -101,8 +94,8 @@ public static void runTestSuiteExecution(TestSuiteExecutionInfo suiteExecutionIn //start job if (proj != null) { - ParameterValue suiteRunIdParam = new StringParameterValue(SUITE_RUN_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteRunId()); - ParameterValue suiteIdParam = new StringParameterValue(SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId()); + ParameterValue suiteRunIdParam = new StringParameterValue(UftConstants.SUITE_RUN_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteRunId()); + ParameterValue suiteIdParam = new StringParameterValue(UftConstants.SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId()); ParametersAction parameters = new ParametersAction(suiteRunIdParam, suiteIdParam); Cause cause = StringUtils.isNotEmpty(suiteExecutionInfo.getSuiteRunId()) ? TriggeredBySuiteRunCause.create(suiteExecutionInfo.getSuiteRunId()) : new Cause.UserIdCause(); @@ -116,7 +109,7 @@ private static FreeStyleProject getExecutionJob(TestSuiteExecutionInfo suiteExec try { String projectName = String.format("%s %s %s", suiteExecutionInfo.getTestingToolType().toString(), - EXECUTION_JOB_MIDDLE_NAME, + UftConstants.EXECUTION_JOB_MIDDLE_NAME, suiteExecutionInfo.getSuiteId()); //validate creation of job @@ -129,8 +122,8 @@ private static FreeStyleProject getExecutionJob(TestSuiteExecutionInfo suiteExec setScmRepository(suiteExecutionInfo.getScmRepository(), suiteExecutionInfo.getScmRepositoryCredentialsId(), proj, true); setBuildDiscarder(proj, 40); - addConstantParameter(proj, SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId(), "ALM Octane test suite ID"); - addStringParameter(proj, SUITE_RUN_ID_PARAMETER_NAME, "", "The ID of the ALM Octane test suite run to associate with the test run results. Provided by ALM Octane when running a planned suite run.\nOtherwise, leave this parameter empty. ALM Octane creates a new test suite run for the new results."); + addConstantParameter(proj, UftConstants.SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId(), "ALM Octane test suite ID"); + addStringParameter(proj, UftConstants.SUITE_RUN_ID_PARAMETER_NAME, "", "The ID of the ALM Octane test suite run to associate with the test run results. Provided by ALM Octane when running a planned suite run.\nOtherwise, leave this parameter empty. ALM Octane creates a new test suite run for the new results."); addAssignedNode(proj); //add build action @@ -261,8 +254,8 @@ public static void runTestDiscovery(DiscoveryInfo discoveryInfo) { //start job if (proj != null) { - ParameterValue executorIdParam = new StringParameterValue(EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId()); - ParameterValue fullScanParam = new BooleanParameterValue(FULL_SCAN_PARAMETER_NAME, discoveryInfo.isForceFullDiscovery()); + ParameterValue executorIdParam = new StringParameterValue(UftConstants.EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId()); + ParameterValue fullScanParam = new BooleanParameterValue(UftConstants.FULL_SCAN_PARAMETER_NAME, discoveryInfo.isForceFullDiscovery()); ParametersAction parameters = new ParametersAction(executorIdParam, fullScanParam); Cause cause = new Cause.UserIdCause(); @@ -286,9 +279,9 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { setScmRepository(discoveryInfo.getScmRepository(), discoveryInfo.getScmRepositoryCredentialsId(), proj, false); setBuildDiscarder(proj, 20); - addConstantParameter(proj, EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId(), "ALM Octane testing tool connection ID"); - addConstantParameter(proj, EXECUTOR_LOGICAL_NAME_PARAMETER_NAME, discoveryInfo.getExecutorLogicalName(), "ALM Octane testing tool connection logical name"); - addBooleanParameter(proj, FULL_SCAN_PARAMETER_NAME, false, "Specify whether to synchronize the set of tests on ALM Octane with the whole SCM repository or to update the set of tests on ALM Octane based on the latest commits."); + addConstantParameter(proj, UftConstants.EXECUTOR_ID_PARAMETER_NAME, discoveryInfo.getExecutorId(), "ALM Octane testing tool connection ID"); + addConstantParameter(proj, UftConstants.EXECUTOR_LOGICAL_NAME_PARAMETER_NAME, discoveryInfo.getExecutorLogicalName(), "ALM Octane testing tool connection logical name"); + addBooleanParameter(proj, UftConstants.FULL_SCAN_PARAMETER_NAME, false, "Specify whether to synchronize the set of tests on ALM Octane with the whole SCM repository or to update the set of tests on ALM Octane based on the latest commits."); //set polling once in two minutes SCMTrigger scmTrigger = new SCMTrigger("H/2 * * * *");//H/2 * * * * : once in two minutes @@ -319,7 +312,7 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { } private static String buildDiscoveryJobName(TestingToolType testingToolType, String executorId, String executorLogicalName) { - String name = String.format("%s %s %s (%s)", testingToolType.toString(), DISCOVERY_JOB_MIDDLE_NAME, executorId, executorLogicalName); + String name = String.format("%s %s %s (%s)", testingToolType.toString(), UftConstants.DISCOVERY_JOB_MIDDLE_NAME, executorId, executorLogicalName); return name; } @@ -414,21 +407,4 @@ private static void addAssignedNode(FreeStyleProject proj) { logger.error("Failed to set addAssignedNode : " + e.getMessage()); } } - - public static boolean isExecutorJob(FreeStyleProject job) { - ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); - boolean isExecutorJob = job.getName().contains(TestExecutionJobCreatorService.EXECUTION_JOB_MIDDLE_NAME) && - parameters != null && - parameters.getParameterDefinition(TestExecutionJobCreatorService.SUITE_ID_PARAMETER_NAME) != null; - - return isExecutorJob; - } - - public static boolean isDiscoveryJobJob(FreeStyleProject job) { - ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); - boolean isDiscoveryJob = job.getName().contains(TestExecutionJobCreatorService.DISCOVERY_JOB_MIDDLE_NAME) && - parameters != null && - parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_ID_PARAMETER_NAME) != null; - return isDiscoveryJob; - } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java index ea01e15958..a4024cf20c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -144,7 +144,7 @@ private static void removeFalsePositiveDeletedDataTables(List del private static boolean isFullScan(AbstractBuild build) { ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { - ParameterValue parameterValue = parameters.getParameter(TestExecutionJobCreatorService.FULL_SCAN_PARAMETER_NAME); + ParameterValue parameterValue = parameters.getParameter(UftConstants.FULL_SCAN_PARAMETER_NAME); if (parameterValue != null) { return (Boolean) parameterValue.getValue(); } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java new file mode 100644 index 0000000000..09df5e8084 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.hpe.application.automation.tools.octane.executor; + +/** + * Constants for UFT executors jobs + */ +public class UftConstants { + + public static final String EXECUTOR_ID_PARAMETER_NAME = "Connection ID"; + public static final String EXECUTOR_LOGICAL_NAME_PARAMETER_NAME = "Connection logical name"; + public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; + public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; + public static final String FULL_SCAN_PARAMETER_NAME = "Full sync"; + + public static final String EXECUTION_JOB_MIDDLE_NAME = "test run job - Suite ID"; + public static final String DISCOVERY_JOB_MIDDLE_NAME = "test discovery job - Connection ID"; +} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java index 3ae43abb44..e53daa7f89 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java @@ -84,7 +84,7 @@ private void clearExecutionJobs(List jobs) { long thresholdTimeInMillis = new Date().getTime() - PeriodicWork.DAY * getOutdateThreshold(); int clearCounter = 0; for (FreeStyleProject job : jobs) { - if (TestExecutionJobCreatorService.isExecutorJob(job) && job.getLastBuild() != null && !job.isBuilding()) { + if (UftJobRecognizer.isExecutorJob(job) && job.getLastBuild() != null && !job.isBuilding()) { if (thresholdTimeInMillis > job.getLastBuild().getTimeInMillis()) { try { logger.warn(String.format("Job %s is going to be deleted as outdated job, last build was executed at %s", job.getName(), job.getLastBuild().getTimestampString2())); @@ -112,7 +112,7 @@ private void clearDiscoveryJobs(List jobs) { Map> workspace2executorLogical2DiscoveryJobMap = new HashMap<>(); for (FreeStyleProject job : jobs) { - if (TestExecutionJobCreatorService.isDiscoveryJobJob(job)) { + if (UftJobRecognizer.isDiscoveryJobJob(job)) { String executorLogicalName = getExecutorLogicalName(job); Long workspaceId = getOctaneWorkspaceId(job); if (executorLogicalName != null && workspaceId != null) { @@ -171,14 +171,14 @@ private Set getOctaneExecutorsLogicalNames(MqmRestClient client, Long wo private static Long getExecutorId(FreeStyleProject job) { ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); - ParameterDefinition pd = parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_ID_PARAMETER_NAME); + ParameterDefinition pd = parameters.getParameterDefinition(UftConstants.EXECUTOR_ID_PARAMETER_NAME); String value = (String) pd.getDefaultParameterValue().getValue(); return Long.valueOf(value); } private static String getExecutorLogicalName(FreeStyleProject job) { ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); - ParameterDefinition pd = parameters.getParameterDefinition(TestExecutionJobCreatorService.EXECUTOR_LOGICAL_NAME_PARAMETER_NAME); + ParameterDefinition pd = parameters.getParameterDefinition(UftConstants.EXECUTOR_LOGICAL_NAME_PARAMETER_NAME); String value = (String) pd.getDefaultParameterValue().getValue(); return value; } @@ -207,7 +207,7 @@ public static void deleteExecutor(String id) { long executorToDelete = Long.parseLong(id); List jobs = Jenkins.getInstance().getAllItems(FreeStyleProject.class); for (FreeStyleProject proj : jobs) { - if (TestExecutionJobCreatorService.isDiscoveryJobJob(proj)) { + if (UftJobRecognizer.isDiscoveryJobJob(proj)) { Long executorId = getExecutorId(proj); if (executorId != null && executorId == executorToDelete) { boolean waitBeforeDelete = false; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java new file mode 100644 index 0000000000..fe2e0dec52 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java @@ -0,0 +1,54 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.executor; + +import hudson.model.FreeStyleProject; +import hudson.model.ParametersDefinitionProperty; + + +/*** + * Recognizer for UFT related jobs + */ +public class UftJobRecognizer { + + /** + * Check if current jos is EXECUTOR + * @param job + * @return + */ + public static boolean isExecutorJob(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + boolean isExecutorJob = job.getName().contains(UftConstants.EXECUTION_JOB_MIDDLE_NAME) && + parameters != null && + parameters.getParameterDefinition(UftConstants.SUITE_ID_PARAMETER_NAME) != null; + + return isExecutorJob; + } + + /** + * + * @param job + * @return + */ + public static boolean isDiscoveryJobJob(FreeStyleProject job) { + ParametersDefinitionProperty parameters = job.getProperty(ParametersDefinitionProperty.class); + boolean isDiscoveryJob = job.getName().contains(UftConstants.DISCOVERY_JOB_MIDDLE_NAME) && + parameters != null && + parameters.getParameterDefinition(UftConstants.EXECUTOR_ID_PARAMETER_NAME) != null; + return isDiscoveryJob; + } +} From 26f467bad378bb131acfc72f5ebb15a551864a32 Mon Sep 17 00:00:00 2001 From: radislavB Date: Thu, 28 Sep 2017 14:35:26 +0300 Subject: [PATCH 0158/2502] fix errata (#48) --- .../tools/octane/executor/CheckOutSubDirEnvContributor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java index e39ae58e0d..cc6fc02e29 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java @@ -43,7 +43,7 @@ public void buildEnvironmentFor(Job j, EnvVars envs, TaskListener listener) thro } public static String getSharedCheckOutDirectory(Job j) { - if (j instanceof FreeStyleProject && UftJobRecognizer.isExecutorJob((FreeStyleProject) j) && !ConfigurationService.getServerConfiguration().isValid()) { + if (j instanceof FreeStyleProject && UftJobRecognizer.isExecutorJob((FreeStyleProject) j) && ConfigurationService.getServerConfiguration().isValid()) { return CheckOutSubDirEnvService.getSharedCheckOutDirectory(j); } From 96ec4b39663c2a8e36c4388251cc6048ee59f51e Mon Sep 17 00:00:00 2001 From: radislavB Date: Sun, 1 Oct 2017 13:23:36 +0300 Subject: [PATCH 0159/2502] When UFT execution job fails before the test runs - we don't see it on Octane and suite run stays in Progress (#49) * user story #444126 : When UFT execution job fails before the test runs - we don't see it on Octane and suite run stays in Progress instead of "Failed" status --- .../tools/octane/events/RunListenerImpl.java | 50 +++++++++++++++---- .../tools/octane/events/TestListenerImpl.java | 40 +++++++++++++++ .../tools/octane/tests/TestListener.java | 14 ++++-- .../octane/tests/junit/JUnitXmlIterator.java | 2 +- 4 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index c94e4f0c8a..2aaeec88a5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -16,10 +16,6 @@ package com.hpe.application.automation.tools.octane.events; -import com.google.inject.Inject; -import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; -import com.hpe.application.automation.tools.octane.tests.TestListener; -import com.hpe.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; import com.hp.octane.integrations.dto.events.CIEventType; @@ -27,10 +23,16 @@ import com.hp.octane.integrations.dto.pipelines.PipelineNode; import com.hp.octane.integrations.dto.pipelines.PipelinePhase; import com.hp.octane.integrations.dto.snapshots.CIBuildResult; +import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; +import com.hpe.application.automation.tools.octane.executor.UftJobRecognizer; import com.hpe.application.automation.tools.octane.model.CIEventCausesFactory; import com.hpe.application.automation.tools.octane.model.processors.builders.WorkFlowRunProcessor; import com.hpe.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; import com.hpe.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; +import com.hpe.application.automation.tools.octane.tests.HPRunnerType; +import com.hpe.application.automation.tools.octane.tests.MqmTestsExtension; +import com.hpe.application.automation.tools.octane.tests.TestResultContainer; +import com.hpe.application.automation.tools.octane.tests.build.BuildHandlerUtils; import hudson.Extension; import hudson.matrix.MatrixConfiguration; import hudson.matrix.MatrixRun; @@ -58,9 +60,6 @@ public final class RunListenerImpl extends RunListener { private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); - @Inject - private TestListener testListener; - @Override public void onStarted(final Run r, TaskListener listener) { if(!ConfigurationService.getServerConfiguration().isValid()){ @@ -129,8 +128,6 @@ public void onFinalized(Run r) return; } - boolean hasTests = testListener.processBuild(r); - CIBuildResult result; if (r.getResult() == Result.SUCCESS) { result = CIBuildResult.SUCCESS; @@ -152,8 +149,12 @@ public void onFinalized(Run r) .setEstimatedDuration(r.getEstimatedDuration()) .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) .setResult(result) - .setDuration(r.getDuration()) - .setTestResultExpected(hasTests); + .setDuration(r.getDuration()); + + if (r.getResult() == Result.FAILURE) { + boolean b = hasUftTests(r); + event.setTestResultExpected(b); + } if(r instanceof AbstractBuild){ event.setParameters(ParameterProcessors.getInstances(r)) @@ -205,6 +206,33 @@ private boolean isInternal(Run r) { return result; } + private static Boolean hasUftTests(Run build) { + if (build.getParent() instanceof FreeStyleProject && UftJobRecognizer.isExecutorJob((FreeStyleProject) build.getParent())) { + try { + boolean hasTests = false; + for (MqmTestsExtension ext : MqmTestsExtension.all()) { + if (ext.supports(build)) { + String jenkinsRootUrl = Jenkins.getInstance().getRootUrl(); + List buildsList = BuildHandlerUtils.getBuildPerWorkspaces(build); + + for (Run buildX : buildsList) { + TestResultContainer testResultContainer = ext.getTestResults(buildX, HPRunnerType.UFT, jenkinsRootUrl); + if (testResultContainer != null && testResultContainer.getIterator().hasNext()) { + hasTests = true; + } + } + } + } + return hasTests; + } catch (Exception e) { + //do nothing + } + + } + + return null; + } + private static TopLevelItem getJobFromFolder(String causeJobName) { String newJobRefId = causeJobName.substring(0, causeJobName.indexOf('/')); TopLevelItem item = Jenkins.getInstance().getItem(newJobRefId); diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java new file mode 100644 index 0000000000..970501cb36 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java @@ -0,0 +1,40 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.events; + +import com.google.inject.Inject; +import com.hpe.application.automation.tools.octane.tests.TestListener; +import hudson.Extension; +import hudson.model.*; +import hudson.model.listeners.RunListener; + +import javax.annotation.Nonnull; + +/** + * Listener on job complete event + */ +@Extension +public class TestListenerImpl extends RunListener { + + @Inject + private TestListener testListener; + + @Override + public void onCompleted(Run r, @Nonnull TaskListener listener) { + testListener.processBuild(r, listener); + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java index efbe6d409d..b4041d3f70 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java @@ -26,6 +26,7 @@ import hudson.FilePath; import hudson.model.Result; import hudson.model.Run; +import hudson.model.TaskListener; import hudson.tasks.Builder; import jenkins.model.Jenkins; import org.apache.logging.log4j.LogManager; @@ -43,13 +44,14 @@ public class TestListener { private static Logger logger = LogManager.getLogger(TestListener.class); public static final String TEST_RESULT_FILE = "mqmTests.xml"; - private static final String JENKINS_STORM_TEST_RUNNER_CLASS = "com.hpe.sr.plugins.jenkins.StormTestRunner"; - private static final String JENKINS_PERFORMANCE_CENTER_TEST_RUNNER_CLASS = "com.hpe.application.automation.tools.run.PcBuilder"; + public static final String JENKINS_STORM_TEST_RUNNER_CLASS = "com.hpe.sr.plugins.jenkins.StormTestRunner"; + public static final String JENKINS_PERFORMANCE_CENTER_TEST_RUNNER_CLASS = "com.hpe.application.automation.tools.run.PcBuilder"; private ResultQueue queue; - public boolean processBuild(Run build) { + public void processBuild(Run build, TaskListener listener) { + FilePath resultPath = new FilePath(new FilePath(build.getRootDir()), TEST_RESULT_FILE); TestResultXmlWriter resultWriter = new TestResultXmlWriter(resultPath, build); boolean success = false; @@ -89,16 +91,19 @@ public boolean processBuild(Run build) { } } } catch (IllegalArgumentException e) { - logger.error(e.getMessage()); + listener.error(e.getMessage()); if (!build.getResult().isWorseOrEqualTo(Result.UNSTABLE)) { build.setResult(Result.UNSTABLE); } + return; } catch (InterruptedException ie) { logger.error("Interrupted processing test results in " + ext.getClass().getName(), ie); Thread.currentThread().interrupt(); + return; } catch (Exception e) { // extensibility involved: catch both checked and RuntimeExceptions logger.error("Error processing test results in " + ext.getClass().getName(), e); + return; } } success = true; @@ -115,7 +120,6 @@ public boolean processBuild(Run build) { logger.error("Error processing test results", xmlse); } } - return success && hasTests;//test results expected } @Inject diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index 2cbb9b176d..e5bfe19030 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -256,7 +256,7 @@ private String jenkinsTestNameFormat(String testName) { if (StringUtils.isEmpty(testName)) { return testName; } - return testName.trim().replaceAll("[-:\\ ,()/\\[\\]]", "_").replace('#', '_').replace('\\', '_'); + return testName.trim().replaceAll("[-:\\ ,()/\\[\\]]", "_").replace('#', '_').replace('\\', '_').replace('.', '_'); } private String jenkinsTestClassFormat(String className) { From 36b74417002ae5259b42ceb1975ead7c7ea46882 Mon Sep 17 00:00:00 2001 From: radislavB Date: Mon, 2 Oct 2017 12:01:10 +0300 Subject: [PATCH 0160/2502] user story #444126 : When UFT execution job fails before the test runs - we don't see it on Octane and suite run stays in Progress instead of "Failed" status (#50) --- .../tools/octane/events/RunListenerImpl.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index 2aaeec88a5..1970985dfa 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -151,10 +151,16 @@ public void onFinalized(Run r) .setResult(result) .setDuration(r.getDuration()); - if (r.getResult() == Result.FAILURE) { - boolean b = hasUftTests(r); - event.setTestResultExpected(b); - } + try { + if (r.getResult() == Result.FAILURE) { + Boolean hasTests = hasUftTests(r); + if (hasTests != null) { + event.setTestResultExpected(hasTests); + } + } + } catch (Exception e) { + //do nothing + } if(r instanceof AbstractBuild){ event.setParameters(ParameterProcessors.getInstances(r)) From 9518b4769010fd4858c326c454af3d885c0e971a Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Mon, 2 Oct 2017 13:37:11 +0300 Subject: [PATCH 0161/2502] Supporting credentials for proxy. https://issues.jenkins-ci.org/browse/JENKINS-44314 --- .../automation/tools/model/PcModel.java | 15 ++- .../automation/tools/pc/PcClient.java | 2 +- .../automation/tools/pc/PcRestProxy.java | 18 +-- .../automation/tools/run/PcBuilder.java | 10 +- .../tools/run/PcBuilder/config.jelly | 103 +++++++++++++++++- .../tools/run/PcBuilder/help-proxyOutURL.html | 2 +- .../automation/tools/pc/MockPcModel.java | 2 +- .../automation/tools/pc/MockPcRestProxy.java | 2 +- .../tools/pc/MockPcRestProxyBadResponses.java | 2 +- 9 files changed, 134 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java index 4189190840..512a9f627a 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java @@ -31,12 +31,14 @@ public class PcModel { private String trendReportId; private final boolean HTTPSProtocol; private final String proxyOutURL; + private final String proxyOutUser; + private final String proxyOutPassword; @DataBoundConstructor public PcModel(String serverAndPort, String pcServerName, String almUserName, String almPassword, String almDomain, String almProject, String testId,String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, - PostRunAction postRunAction, boolean vudsMode, String description, String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL) { + PostRunAction postRunAction, boolean vudsMode, String description, String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, String proxyOutURL, String proxyOutUser, String proxyOutPassword) { this.serverAndPort = serverAndPort; this.pcServerName = pcServerName; @@ -55,6 +57,9 @@ public PcModel(String serverAndPort, String pcServerName, String almUserName, St this.HTTPSProtocol = HTTPSProtocol; this.trendReportId = trendReportId; this.proxyOutURL = proxyOutURL; + this.proxyOutUser = proxyOutUser; + this.proxyOutPassword = proxyOutPassword; + } protected SecretContainer setPassword(String almPassword) { @@ -134,6 +139,14 @@ public String getProxyOutURL(){ return this.proxyOutURL; } + public String getProxyOutUser(){ + return this.proxyOutUser; + } + + public String getProxyOutPassword(){ + return this.proxyOutPassword; + } + public static List getPostRunActions() { return Arrays.asList(PostRunAction.values()); } diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java index 149cc62c83..3d8d3cb384 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java @@ -60,7 +60,7 @@ public PcClient(PcModel pcModel, PrintStream logger) { if(model.getProxyOutURL() != null && !model.getProxyOutURL().isEmpty()){ logger.println("Using proxy: " + model.getProxyOutURL()); } - restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(), model.getAlmDomain(), model.getAlmProject(),logger, model.getProxyOutURL()); + restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(), model.getAlmDomain(), model.getAlmProject(),logger, model.getProxyOutURL(),model.getProxyOutUser(),model.getProxyOutPassword()); this.logger = logger; }catch (PcException e){ logger.println(e.getMessage()); diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java index d68585b9c5..8b358f62fe 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java @@ -107,7 +107,7 @@ public class PcRestProxy { private CookieStore cookieStore; // private PrintStream logger; - public PcRestProxy(String webProtocolName, String pcServerName, String almDomain, String almProject,PrintStream mainLogger, String proxyOutURL) throws PcException { + public PcRestProxy(String webProtocolName, String pcServerName, String almDomain, String almProject,PrintStream mainLogger, String proxyOutURL, String proxyUser, String proxyPassword) throws PcException { // logger = mainLogger; pcServer = pcServerName; @@ -127,6 +127,8 @@ public PcRestProxy(String webProtocolName, String pcServerName, String almDomain // we should get the full proxy URL from the user: http(s)://: // PAC (proxy auto-config) or Automatic configuration script is not supported (for example our proxy: http://autocache.hpecorp.net/) getProxyDataFromURL(proxyOutURL); + this.proxyUser = proxyUser; + this.proxyPassword = proxyPassword; HttpHost proxy = new HttpHost(proxyHostName, proxyPort, proxyScheme); if (proxyUser != null && !proxyUser.isEmpty()) { @@ -151,14 +153,14 @@ private void getProxyDataFromURL(String proxyURL) throws PcException{ String[] urlSplit = proxyURL.split("://"); proxyScheme = urlSplit[0]; - if (urlSplit[1].indexOf("@") != -1){ - String Credentials = urlSplit[1].split("@")[0]; - mainStr = urlSplit[1].split("@")[1]; - proxyUser = Credentials.split(":")[0]; - proxyPassword = Credentials.split(":")[1]; - }else{ +// if (urlSplit[1].indexOf("@") != -1){ +// String Credentials = urlSplit[1].split("@")[0]; +// mainStr = urlSplit[1].split("@")[1]; +// proxyUser = Credentials.split(":")[0]; +// proxyPassword = Credentials.split(":")[1]; +// }else{ mainStr = urlSplit[1]; - } +// } if (mainStr.contains(":")){ //proxyPort = Integer.parseInt(proxyURL.split("://")[1].split(":")[1]); proxyHostName = mainStr.split(":")[0]; diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index a6401e97e8..7d0bc981aa 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -125,7 +125,9 @@ public PcBuilder( String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, - String proxyOutURL) { + String proxyOutURL, + String proxyOutUser, + String proxyOutPassword) { this.almUserName = almUserName; this.almPassword = almPassword; this.timeslotDurationHours = timeslotDurationHours; @@ -151,7 +153,9 @@ public PcBuilder( addRunToTrendReport, trendReportId, HTTPSProtocol, - proxyOutURL); + proxyOutURL, + proxyOutUser, + proxyOutPassword); } @Override @@ -775,6 +779,8 @@ public boolean isStatusBySLA() { } public String getProxyOutURL(){ return getPcModel().getProxyOutURL();} + public String getProxyOutUser(){ return getPcModel().getProxyOutUser();} + public String getProxyOutPassword(){ return getPcModel().getProxyOutPassword();} // This indicates to Jenkins that this is an implementation of an extension // point diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly index b12bc30a1c..30420ef594 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.jelly @@ -34,6 +34,53 @@ .myClass{ border: 5px solid red; } + + + /* Tooltip container */ + .tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ + } + + /* Tooltip text */ + .tooltip .tooltiptext { + visibility: hidden; + width: 350px; + background-color: #555; + color: #fff; + padding: 5px; + border-radius: 6px; + + /* Position the tooltip text */ + position: absolute; + z-index: 1; + bottom: 125%; + left: 50%; + margin-left: -60px; + + /* Fade in tooltip */ + opacity: 0; + transition: opacity 1s; + } + + /* Tooltip arrow */ + .tooltip .tooltiptext::after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #555 transparent transparent transparent; + } + + /* Show the tooltip text when you mouse over the tooltip container */ + .tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; + } @@ -162,9 +210,52 @@ - - - + +
    + +
    + + + + + + + + + + + + + + + + + +
    + Local Proxy
    (?) Add your local proxy as following:
    http(s)://host:port
    or + Leave empty if not using a local proxy.
    + PAC (proxy auto-config) or Automatic configuration script are not supported.
    +
    + + + + + User:  + + + + Password:  + + + + +
    + + + + + +

    diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html index 3b93fe4a91..3574333a48 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html @@ -1,5 +1,5 @@
    - Add your local proxy as following: http(s)://<host>:<port> or
    http(s)://<proxyuser>:<proxypassword>@<host>:<port>or + Add your local proxy as following: http(s)://<host>:<port> or Leave empty if not using a local proxy.
    PAC (proxy auto-config) or Automatic configuration script are not supported.
    \ No newline at end of file diff --git a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java index 662431c1e9..679086a788 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/MockPcModel.java @@ -12,7 +12,7 @@ public MockPcModel(String serverAndPort, String pcServerName, String almUserName String almProject, String testId, String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, boolean webProtocol) { super(serverAndPort, pcServerName, almUserName, almPassword, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, - timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null + timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null,null,null ); } diff --git a/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxy.java b/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxy.java index b0b731c184..14d368b704 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxy.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxy.java @@ -26,7 +26,7 @@ public class MockPcRestProxy extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); public MockPcRestProxy(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) throws PcException { - super(webProtocol, pcServerName, almDomain, almProject,logger,null); + super(webProtocol, pcServerName, almDomain, almProject,logger,null,null,null); } @Override diff --git a/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxyBadResponses.java b/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxyBadResponses.java index 993f76c12d..411ef60953 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxyBadResponses.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/MockPcRestProxyBadResponses.java @@ -22,7 +22,7 @@ public class MockPcRestProxyBadResponses extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); public MockPcRestProxyBadResponses(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) throws PcException { - super(webProtocol, pcServerName, almDomain, almProject,logger,null); + super(webProtocol, pcServerName, almDomain, almProject,logger,null,null,null); } @Override From 97f341c1f30f36099acd3c7fefb9c33493f905e1 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Mon, 2 Oct 2017 15:37:34 +0300 Subject: [PATCH 0162/2502] sonar issues fix --- .../tools/octane/events/RunListenerImpl.java | 10 ++++++---- .../tools/octane/events/TestListenerImpl.java | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index 1970985dfa..f733d2ce7c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -33,12 +33,15 @@ import com.hpe.application.automation.tools.octane.tests.MqmTestsExtension; import com.hpe.application.automation.tools.octane.tests.TestResultContainer; import com.hpe.application.automation.tools.octane.tests.build.BuildHandlerUtils; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.Logger; import hudson.Extension; import hudson.matrix.MatrixConfiguration; import hudson.matrix.MatrixRun; import hudson.model.*; import hudson.model.listeners.RunListener; import jenkins.model.Jenkins; +import org.apache.logging.log4j.LogManager; import java.util.Collection; import java.util.List; @@ -59,7 +62,7 @@ public final class RunListenerImpl extends RunListener { private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); - + private static final Logger logger = LogManager.getLogger(RunListenerImpl.class); @Override public void onStarted(final Run r, TaskListener listener) { if(!ConfigurationService.getServerConfiguration().isValid()){ @@ -159,7 +162,7 @@ public void onFinalized(Run r) } } } catch (Exception e) { - //do nothing + logger.log(Level.WARN,"hasUftTests error",e); } if(r instanceof AbstractBuild){ @@ -231,9 +234,8 @@ private static Boolean hasUftTests(Run build) { } return hasTests; } catch (Exception e) { - //do nothing + logger.log(Level.WARN,"Could not check uft tests exists",e); } - } return null; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java index 970501cb36..2f5e69be0c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java @@ -30,6 +30,8 @@ @Extension public class TestListenerImpl extends RunListener { + public TestListenerImpl(){} + @Inject private TestListener testListener; From 774c75fd8a09106e1cce785d5a553494a345b2d8 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Mon, 2 Oct 2017 16:21:03 +0300 Subject: [PATCH 0163/2502] codacy fix --- .../automation/tools/octane/events/TestListenerImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java index 2f5e69be0c..e468c646c3 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java @@ -29,9 +29,6 @@ */ @Extension public class TestListenerImpl extends RunListener { - - public TestListenerImpl(){} - @Inject private TestListener testListener; From ca3abade51e3ddc821fe4e7ddd4ecf7031116e3f Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Tue, 3 Oct 2017 09:08:28 +0300 Subject: [PATCH 0164/2502] Removed unnecessary imports --- .../com/hpe/application/automation/tools/pc/PcRestProxy.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java index 8b358f62fe..01d2f5c98c 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java @@ -40,7 +40,6 @@ import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CookieStore; import org.apache.http.client.CredentialsProvider; -import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; @@ -51,7 +50,6 @@ import org.apache.http.impl.client.BasicCookieStore; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingClientConnectionManager; import org.apache.http.impl.conn.SchemeRegistryFactory; import org.apache.http.protocol.BasicHttpContext; From eed637a61ecf139aa5091fce0f936474a3a9c872 Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Tue, 3 Oct 2017 09:29:11 +0300 Subject: [PATCH 0165/2502] More SonarCube Fixes --- .../hpe/application/automation/tools/pc/PcRestProxy.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java index 01d2f5c98c..85843fd261 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java @@ -151,16 +151,8 @@ private void getProxyDataFromURL(String proxyURL) throws PcException{ String[] urlSplit = proxyURL.split("://"); proxyScheme = urlSplit[0]; -// if (urlSplit[1].indexOf("@") != -1){ -// String Credentials = urlSplit[1].split("@")[0]; -// mainStr = urlSplit[1].split("@")[1]; -// proxyUser = Credentials.split(":")[0]; -// proxyPassword = Credentials.split(":")[1]; -// }else{ mainStr = urlSplit[1]; -// } if (mainStr.contains(":")){ - //proxyPort = Integer.parseInt(proxyURL.split("://")[1].split(":")[1]); proxyHostName = mainStr.split(":")[0]; proxyPort = Integer.parseInt(mainStr.split(":")[1]); }else{ From 82fcd4f641d875b87355f7f2c4c3b2fbaff0c8f1 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 3 Oct 2017 14:33:58 +0300 Subject: [PATCH 0166/2502] Jenkins plugin should use the tunnel config file --- .../tools/run/CreateTunnelBuilder.java | 28 ++++++++----------- .../run/CreateTunnelBuilder/config.jelly | 2 +- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index 825d8b857b..e07820977c 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -5,18 +5,13 @@ import hudson.Launcher; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; -import hudson.model.Run; -import hudson.model.TaskListener; +import hudson.model.BuildListener; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; -import jenkins.tasks.SimpleBuildStep; import net.sf.json.JSONObject; -import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; - import org.xml.sax.SAXException; -import javax.annotation.Nonnull; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLSession; import javax.xml.parsers.DocumentBuilder; @@ -29,7 +24,7 @@ import java.util.Properties; import java.util.Timer; -public class CreateTunnelBuilder extends Builder implements SimpleBuildStep { +public class CreateTunnelBuilder extends Builder { private PrintStream logger; private String srfTunnelName; private AbstractBuild build; @@ -52,10 +47,10 @@ public CreateTunnelBuilder.DescriptorImpl getDescriptor() { @Override - public void perform( @Nonnull Run run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener ) throws InterruptedException, IOException { + public boolean perform(final AbstractBuild build, final Launcher launcher, BuildListener listener) + throws InterruptedException, IOException { logger = listener.getLogger(); - Run r = run.getParent().getBuild(run.getId()); - JSONObject connectionData = RunFromSrfBuilder.GetSrfConnectionData((AbstractBuild)r, logger); + JSONObject connectionData = RunFromSrfBuilder.GetSrfConnectionData(build, logger); String[] s = new String[5] ; URL url = new URL(connectionData.getString("server")); //check if tunnel exist @@ -73,7 +68,7 @@ public void perform( @Nonnull Run run, @Nonnull FilePath workspace, @Nonnu String name = "-name=" + srfTunnelName; - + String config = "\"-config="+srfTunnelName+"\""; URL proxyUrl ; try { @@ -88,8 +83,8 @@ public void perform( @Nonnull Run run, @Nonnull FilePath workspace, @Nonnu - ProcessBuilder pb = new ProcessBuilder(path, server, client, name, proxy, secret, "\"-log-level=INFO\"","\"-log=stdout\""); - logger.println("Launching "+path ); + ProcessBuilder pb = new ProcessBuilder(path, config, "\"-log-level=INFO\"","\"-log=stdout\""); + logger.println("Launching "+path + " " + config ); Process p = pb.start(); TunnelTracker tracker = new TunnelTracker(logger, p); @@ -109,7 +104,7 @@ public void perform( @Nonnull Run run, @Nonnull FilePath workspace, @Nonnu p.destroy(); logger.println("Failed to launch "+path); Tunnels.remove(p); - return ; + return false; } while ((line = br.readLine()) != null) { @@ -121,7 +116,7 @@ public void perform( @Nonnull Run run, @Nonnull FilePath workspace, @Nonnu if(diffSeconds > 30){ p.destroy(); logger.println("Failed to launch "+path); - return ; + return false; } } break; @@ -132,13 +127,12 @@ public void perform( @Nonnull Run run, @Nonnull FilePath workspace, @Nonnu - return ; + return true; } private JSONObject GetSrfConnectionData(){ return new JSONObject(); } @Extension - @Symbol("CreateTunnelBuilder") public static final class DescriptorImpl extends BuildStepDescriptor { private String srfTunnelName; @DataBoundConstructor diff --git a/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly index e47d00d15f..7c1976456e 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/CreateTunnelBuilder/config.jelly @@ -21,7 +21,7 @@ - + From 10f651590db21116b41e11f22f7cc3b66eefc96c Mon Sep 17 00:00:00 2001 From: Pavel Chuchma Date: Mon, 9 Oct 2017 17:56:00 +0200 Subject: [PATCH 0167/2502] - using SVConfigurator 4.10.1.4821 to fix connectivity to SV 4.10 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f64cdd68a1..726db61d86 100644 --- a/pom.xml +++ b/pom.xml @@ -370,7 +370,7 @@ com.hp.sv SVConfigurator - 4.00.1.46729 + 4.10.1.48219 commons-io From 34bde2a6cd463cec0501158ee8ea17fb16be68e0 Mon Sep 17 00:00:00 2001 From: "Hanan.Bem" Date: Sun, 15 Oct 2017 11:57:56 +0300 Subject: [PATCH 0168/2502] Additional fix for publishing trending timeout issue https://issues.jenkins-ci.org/browse/JENKINS-47135 --- .../com/hpe/application/automation/tools/pc/PcClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java index 3d8d3cb384..9eda3ecefc 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java @@ -343,8 +343,8 @@ public void waitForRunToPublishOnTrendReport(int runId, String trendReportId) th Thread.sleep(5000); counter++; if(counter >= 120){ - logger.println("Error: Publishing didn't ended after 10 minutes, aborting..."); - break; + String msg = "Error: Publishing didn't ended after 10 minutes, aborting..."; + throw new PcException(msg); } } } From 7f447c1363322fa898332a61177497bd8b06b41e Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 18 Oct 2017 12:53:10 +0300 Subject: [PATCH 0169/2502] SRF fix deep link in test results --- .../tools/results/SrfResultsReport.java | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index 4e75cee75e..de39115ada 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -11,6 +11,7 @@ import hudson.model.*; import hudson.remoting.VirtualChannel; import hudson.tasks.*; +import hudson.tasks.junit.CaseResult; import hudson.tasks.junit.TestResult; import hudson.tasks.junit.TestResultAction; import hudson.tasks.test.TestObject; @@ -84,7 +85,31 @@ public TestResult getResult(){ public Object getWrappedTarget(){ return _target; } + private void getBuildInfo(CaseResult p){ + String data = null; + BufferedReader reader = null; + try { + String path = p.getRun().getRootDir().getPath().concat("/report.json"); + reader = new BufferedReader(new FileReader(path)); + String line = null; + StringBuffer buf = new StringBuffer(); + while ( (line = reader.readLine() ) != null){ + buf.append(line); + } + data = buf.toString(); + } + catch (Exception e) { + } + finally { + try { + if(reader != null) + reader.close(); + } catch (IOException e) { + } + } + _buildInfo = JSONArray.fromObject(data); + } public SrfTestResultAction(AbstractBuild owner, TestResult result, BuildListener listener) { super(owner, result, listener); String data = null; @@ -120,18 +145,8 @@ public void startLoop(){ public String getDeepLink(Object p){ String testName = ""; int idx = ++_idx; - try{ - testName = p.getClass().getMethod("getClassName").invoke(p).toString().toLowerCase(); - } - catch (NoSuchMethodException e){ - return "NoSuchMethodException"; - } - catch (IllegalAccessException e){ - return "IllegalAccessException"; - } - catch(InvocationTargetException e){ - return "InvocationTargetException"; - } + testName = ((CaseResult) p).getClassName().toLowerCase(); + getBuildInfo((CaseResult)p); int cnt = _buildInfo.size(); String srfUrl = ""; for (int i = 0; i < cnt; i++) { @@ -150,6 +165,7 @@ public String getDeepLink(Object p){ String tenant = jTest.getString("tenantid"); srfUrl = srfUrl.concat("&TENANTID=").concat(tenant); } + _logger.println(srfUrl); return srfUrl; } public String getEnvString(Object p){ From b5d9589901bc18ee56b8ce776718a3320e3106eb Mon Sep 17 00:00:00 2001 From: Gennady Korpachev Date: Tue, 31 Oct 2017 20:00:53 +0200 Subject: [PATCH 0170/2502] Remove HPE Network Virtualization plugin --- pom.xml | 37 -- .../nv/common/NvNetworkProfileRegistry.java | 147 ------- .../tools/nv/common/NvTestUtils.java | 86 ---- .../tools/nv/common/NvValidatorUtils.java | 103 ----- .../tools/nv/model/BandwidthEnum.java | 57 --- .../automation/tools/nv/model/NvContext.java | 51 --- .../tools/nv/model/NvDataHolder.java | 50 --- .../automation/tools/nv/model/NvModel.java | 100 ----- .../tools/nv/model/NvNetworkProfile.java | 200 --------- .../tools/nv/model/NvProfileDTO.java | 74 ---- .../automation/tools/nv/model/NvServer.java | 173 -------- .../nv/plugin/NetworkProfileSelector.java | 130 ------ .../tools/nv/plugin/NvEmulationBuilder.java | 294 ------------- .../tools/nv/plugin/NvEmulationInvoker.java | 387 ------------------ .../nv/plugin/NvEmulationRunListener.java | 50 --- .../nv/plugin/VariableInjectionAction.java | 50 --- .../nv/plugin/results/CountableResult.java | 85 ---- .../plugin/results/CountableResultParent.java | 96 ----- .../nv/plugin/results/JUnitXmlConstants.java | 43 -- .../nv/plugin/results/NvClassResult.java | 40 -- .../nv/plugin/results/NvJUnitResult.java | 73 ---- .../plugin/results/NvJUnitResultsHandler.java | 68 --- .../nv/plugin/results/NvProfileResult.java | 40 -- .../nv/plugin/results/NvResultsBuilder.java | 134 ------ .../nv/plugin/results/NvResultsMerger.java | 170 -------- .../nv/plugin/results/NvTestCaseResult.java | 113 ----- .../nv/plugin/results/NvTestSuiteResult.java | 40 -- .../results/XmlTestCaseElementCreator.java | 69 ---- .../nv/model/NvNetworkProfile/config.jelly | 26 -- .../NvNetworkProfile/help-bandwidthIn.html | 1 - .../NvNetworkProfile/help-bandwidthOut.html | 1 - .../model/NvNetworkProfile/help-latency.html | 1 - .../model/NvNetworkProfile/help-packet.html | 1 - .../NvNetworkProfile/help-profileName.html | 1 - .../tools/nv/model/NvServer/config.jelly | 29 -- .../tools/nv/model/NvServer/help-nvPort.html | 1 - .../nv/model/NvServer/help-password.html | 1 - .../nv/model/NvServer/help-proxyPort.html | 1 - .../nv/model/NvServer/help-serverIp.html | 1 - .../nv/model/NvServer/help-serverName.html | 1 - .../nv/model/NvServer/help-username.html | 1 - .../NetworkProfileSelector/config.jelly | 31 -- .../nv/plugin/NvEmulationBuilder/config.jelly | 78 ---- .../nv/plugin/NvEmulationBuilder/global.jelly | 31 -- .../NvEmulationBuilder/help-envVariable.html | 1 - .../help-excludeServerIPs.html | 1 - .../help-includeClientIPs.html | 1 - .../NvEmulationBuilder/help-profileNames.html | 1 - .../NvEmulationBuilder/help-reportFiles.html | 1 - .../help-thresholdsFile.html | 3 - .../help-useProxyCheckbox.html | 1 - .../nv/plugin/NvEmulationBuilder/help.html | 1 - .../resources/lib/nv/default_profiles.txt | 39 -- 53 files changed, 3215 deletions(-) delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/common/NvTestUtils.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/model/BandwidthEnum.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/model/NvContext.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/model/NvDataHolder.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/model/NvModel.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/model/NvNetworkProfile.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/model/NvProfileDTO.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/model/NvServer.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationInvoker.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationRunListener.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/VariableInjectionAction.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResult.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResultParent.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/JUnitXmlConstants.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvClassResult.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResult.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResultsHandler.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvProfileResult.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsBuilder.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestCaseResult.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestSuiteResult.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/nv/plugin/results/XmlTestCaseElementCreator.java delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/config.jelly delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthIn.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthOut.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-latency.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-packet.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-profileName.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/config.jelly delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-nvPort.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-password.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-proxyPort.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverIp.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverName.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-username.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector/config.jelly delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/config.jelly delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/global.jelly delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-envVariable.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-excludeServerIPs.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-includeClientIPs.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-profileNames.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-reportFiles.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-thresholdsFile.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-useProxyCheckbox.html delete mode 100644 src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help.html delete mode 100644 src/main/resources/lib/nv/default_profiles.txt diff --git a/pom.xml b/pom.xml index 726db61d86..0c1e8a7285 100644 --- a/pom.xml +++ b/pom.xml @@ -30,10 +30,6 @@ 2.2 false 1.0.4a - 2.5 - 1.5.0 - 2.7.0 - 2.0.6 @@ -394,39 +390,6 @@ 1.4.13 - - - - com.hpe.nv - hpe-nv-java-api - 1.0.0 - - - com.google.code.gson - gson - ${google.gson.version} - - - commons-validator - commons-validator - ${apache.commons.validator.version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - mqm-rest-client diff --git a/src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java b/src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java deleted file mode 100644 index 3794780e38..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/common/NvNetworkProfileRegistry.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.common; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.hpe.application.automation.tools.nv.model.NvNetworkProfile; -import hudson.util.ListBoxModel; - -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.util.*; - -public class NvNetworkProfileRegistry { - public static final String DEFAULT_PROFILES_FILE_NAME = "lib/nv/default_profiles.txt"; - public static final String NONE_PROFILE_NAME = "No Emulation"; - - private static NvNetworkProfileRegistry instance; - private Map profiles = new HashMap<>(); - private Comparator profileNameComparator = new ProfileNameComparator(); - - public static NvNetworkProfileRegistry getInstance() { - if (null == instance) { - synchronized (NvNetworkProfileRegistry.class) { - if (null == instance) { - instance = new NvNetworkProfileRegistry(); - } - } - } - - return instance; - } - - private NvNetworkProfileRegistry() { - registerDefaultProfiles(); - } - - private void registerDefaultProfiles() { - InputStream is = NvNetworkProfileRegistry.class.getClassLoader().getResourceAsStream(DEFAULT_PROFILES_FILE_NAME); - try { - register(is); - } catch (IOException e) { - e.printStackTrace(); - } - } - - private void register(InputStream is) throws IOException { - List profiles = new ObjectMapper().readValue(is, new TypeReference>() { - }); - for (NvNetworkProfile profile : profiles) { - profile.setCustom(false); - this.profiles.put(profile.getProfileName(), profile); - } - } - - public synchronized void register(Collection profiles) { - if (null != profiles) { - NvNetworkProfile existing; - for (NvNetworkProfile profile : profiles) { - existing = getNetworkProfile(profile.getProfileName()); - if (null == existing || existing.isCustom()) { // make sure to override only custom profiles - profile.setCustom(true); - this.profiles.put(profile.getProfileName(), profile); - } - } - } - } - - public void unregisterCustom() { - List profilesToRemove = new ArrayList<>(); - for (NvNetworkProfile profile : profiles.values()) { - if (profile.isCustom()) { - profilesToRemove.add(profile.getProfileName()); - } - } - - for (String profileName : profilesToRemove) { - profiles.remove(profileName); - } - } - - public ListBoxModel getNetworkProfilesAsListModel() { - ListBoxModel items = new ListBoxModel(); - List names = new ArrayList<>(profiles.keySet()); - Collections.sort(names, profileNameComparator); - items.add(NONE_PROFILE_NAME, NONE_PROFILE_NAME); // adding None as first element - for (String name : names) { - if (!name.equals(NONE_PROFILE_NAME)) { - items.add(name, name); - } - } - - return items; - } - - public NvNetworkProfile getNetworkProfile(String profileName) { - return profiles.get(profileName); - } - - public List getNetworkProfiles(Collection profileNames) { - List result = new ArrayList<>(); - if (null != profileNames) { - for (String profileName : profileNames) { - result.add(profiles.get(profileName)); - } - - } - return result; - } - - public boolean exists(String profileName) { - return null != profiles.get(profileName); - } - - private static class ProfileNameComparator implements Comparator, Serializable { - private static final long serialVersionUID = 1; - @Override - public int compare(String o1, String o2) { - if (o1 == o2) { - return 0; - } - if (o1 == null) { - return -1; - } - if (o2 == null) { - return 1; - } - return o1.compareToIgnoreCase(o2); - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/common/NvTestUtils.java b/src/main/java/com/hpe/application/automation/tools/nv/common/NvTestUtils.java deleted file mode 100644 index cce23484a3..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/common/NvTestUtils.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.common; - -import com.hpe.nv.api.NVExceptions; -import com.hpe.nv.api.Test; -import com.hpe.nv.api.Transaction; -import hudson.AbortException; -import hudson.model.Run; -import hudson.model.TaskListener; -import com.hpe.application.automation.tools.nv.model.NvContext; -import com.hpe.application.automation.tools.nv.model.NvDataHolder; - -import java.io.IOException; - -public class NvTestUtils { - private static final String JOB_NAME = "JOB_NAME"; - - public static String getBuildKey(Run build) { - return build.getCharacteristicEnvVars().get(JOB_NAME) + "_" + build.getId(); - } - - public static String getNvTestId(Run build) { - return getBuildKey(build) + "_Test"; - } - - public static void stopTestEmulation(Run run, TaskListener listener) throws AbortException { - NvContext nvContext = NvDataHolder.getInstance().get(getBuildKey(run)); - if (null != nvContext) { - boolean txStopped = true; - boolean testStopped = true; - String errorMessage = ""; - - // stop the current transaction - Transaction transaction = nvContext.getTransaction(); - if (null != transaction) { - try { - transaction.stop(); - } catch (IOException | NVExceptions.ServerErrorException e) { - txStopped = false; - e.printStackTrace(listener.getLogger()); - errorMessage = "Failed to stop transaction. Error: " + e.getMessage() + "\n"; - } - if (txStopped) { - listener.getLogger().println("Successfully stopped transaction."); - } - } - - // stop the current test - Test test = nvContext.getTest(); - if (null != test) { - try { - test.stop(); - NvDataHolder.getInstance().clear(NvTestUtils.getBuildKey(run)); - } catch (IOException | NVExceptions.ServerErrorException e) { - testStopped = false; - e.printStackTrace(listener.getLogger()); - errorMessage += "Failed to stop Network Virtualization emulation. Error: " + e.getMessage(); - } - - if (testStopped) { - listener.getLogger().println("Network Virtualization emulation was stopped successfully."); - } - } - - if (!txStopped || !testStopped) { - throw new AbortException(errorMessage); - } - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java b/src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java deleted file mode 100644 index a57f02fd20..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/common/NvValidatorUtils.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.common; - -import org.apache.commons.validator.routines.InetAddressValidator; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Pattern; - -public class NvValidatorUtils { - private static final Pattern FQ_CLASS_NAME_PATTERN = Pattern.compile("" + - "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)*\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*"); - private static final Pattern POSITIVE_FLOATING_POINT_PATTERN = Pattern.compile("^[+]?[0-9]*\\.?[0-9]+$"); - private static final String DEFAULT_THRESHOLD = "default"; - - public static boolean isValidHostIp(String address) { - return InetAddressValidator.getInstance().isValidInet4Address(address); - } - - public static boolean validateClassName(String identifier) { - return FQ_CLASS_NAME_PATTERN.matcher(identifier).matches(); - } - - public static boolean validateFloatingPoint(String number) { - return POSITIVE_FLOATING_POINT_PATTERN.matcher(number).matches(); - } - - public static boolean validateFloatingPoint(String number, double maxValue) { - boolean isValid = validateFloatingPoint(number); - if(isValid) { - Double dVal = Double.parseDouble(number); - if(dVal < 0 || dVal > maxValue) { - isValid = false; - } - } - return isValid; - } - - public static boolean validateFile(String fileName) { - File thresholdFile = new File(fileName); - Path filePath = thresholdFile.toPath(); - - return Files.isReadable(filePath); - } - - public static Map readThresholdsFile(String fileName) throws IOException { - Map result = new HashMap<>(); - BufferedReader br = null; - try { - br = new BufferedReader(new FileReader(new File(fileName))); - String line; - String[] parts; - while (null != (line = br.readLine())) { - if (!isComment(line)) { - parts = line.split(","); - // default threshold - if (line.startsWith(DEFAULT_THRESHOLD)) { - if (parts.length != 2 || !NvValidatorUtils.validateFloatingPoint(parts[1])) { - return null; - } - result.put(parts[0], Float.parseFloat(parts[1])); - } else { // threshold per test - if (parts.length != 3 || !NvValidatorUtils.validateClassName(parts[0]) || parts[1].isEmpty() || !NvValidatorUtils.validateFloatingPoint(parts[2])) { - return null; - } - result.put(parts[0] + "." + parts[1], Float.parseFloat(parts[2])); - } - } - } - } finally { - if (br != null) { - br.close(); - } - } - return result; - } - - private static boolean isComment(String line) { - return line.startsWith("//") || line.startsWith("#"); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/model/BandwidthEnum.java b/src/main/java/com/hpe/application/automation/tools/nv/model/BandwidthEnum.java deleted file mode 100644 index 587ceb9e7f..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/model/BandwidthEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.model; - -public enum BandwidthEnum { - UNRESTRICTED(0, "Unrestricted"), - KBPS14_4(14.4, "14.4"), - KBPS28_8(28.8, "28.8"), - KBPS33_6(33.6, "33.6"), - KBPS56(56, "56"), - KBPS64(64, "64"), - KBPS128(128, "128"), - KBPS256(256, "256"), - KBPS512(512, "512"), - KBPS768(768, "768"), - KBPS1544(1544, "1544"), - KBPS2048(2048, "2048"), - KBPS4096(4096, "4096"), - KBPS6144(6144, "6144"), - KBPS8192(8192, "8192"), - KBPS10240(10240, "10240"), - KBPS34364(34364, "34364"), - KBPS44736(44736, "44736"), - KBPS54000(54000, "54000"), - KBPS100000(100000, "100000"); - - private double value; - private String displayText; - - private BandwidthEnum(double value, String displayText) { - this.value = value; - this.displayText = displayText; - } - - public double getValue() { - return value; - } - - public String getDisplayText() { - return displayText; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/model/NvContext.java b/src/main/java/com/hpe/application/automation/tools/nv/model/NvContext.java deleted file mode 100644 index 77ea10d9f7..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/model/NvContext.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.model; - -import com.hpe.nv.api.Test; -import com.hpe.nv.api.Transaction; - -public class NvContext { - private Test test; - private Transaction transaction; - private int run = 0; - - public Test getTest() { - return test; - } - - public void setTest(Test test) { - this.test = test; - } - - public Transaction getTransaction() { - return transaction; - } - - public void setTransaction(Transaction transaction) { - this.transaction = transaction; - } - - public int getRun() { - return run; - } - - public void increaseRun() { - run = run + 1; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/model/NvDataHolder.java b/src/main/java/com/hpe/application/automation/tools/nv/model/NvDataHolder.java deleted file mode 100644 index c235e9354d..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/model/NvDataHolder.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.model; - -import java.util.HashMap; -import java.util.Map; - -public class NvDataHolder { - private static NvDataHolder instance; - private Map dataMap; - - private NvDataHolder() { - dataMap = new HashMap<>(); - } - - public static synchronized NvDataHolder getInstance() { - if(null == instance) { - instance = new NvDataHolder(); - } - - return instance; - } - - public NvContext get(String key) { - return dataMap.get(key); - } - - public void put(String key, NvContext context) { - dataMap.put(key, context); - } - - public void clear(String key) { - dataMap.remove(key); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/model/NvModel.java b/src/main/java/com/hpe/application/automation/tools/nv/model/NvModel.java deleted file mode 100644 index d60bc927e7..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/model/NvModel.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.model; - -import hudson.tasks.BuildStep; -import org.kohsuke.stapler.DataBoundConstructor; - -import java.io.Serializable; -import java.util.List; - -public class NvModel implements Serializable { - private static final long serialVersionUID = 8642626061740581112L; - - private String serverName; - private String includeClientIPs; - private String excludeServerIPs; - private String envVariable; - private List steps; - private String reportFiles; - private String thresholdsFile; - private boolean useProxy; - private NvServer nvServer; - private List profiles; - - @DataBoundConstructor - public NvModel(String serverName, String includeClientIPs, String excludeServerIPs, String envVariable, String reportFiles, String thresholdsFile, List steps) { - this.serverName = serverName; - this.includeClientIPs = includeClientIPs; - this.excludeServerIPs = excludeServerIPs; - this.envVariable = envVariable; - this.steps = steps; - this.reportFiles = reportFiles; - this.thresholdsFile = thresholdsFile; - - this.useProxy = envVariable != null && !envVariable.isEmpty(); - } - - public String getServerName() { - return serverName; - } - - public String getIncludeClientIPs() { - return includeClientIPs; - } - - public String getExcludeServerIPs() { - return excludeServerIPs; - } - - public String getEnvVariable() { - return envVariable; - } - - public List getSteps() { - return steps; - } - - public String getReportFiles() { - return reportFiles; - } - - public String getThresholdsFile() { - return thresholdsFile; - } - - public boolean isUseProxy() { - return useProxy; - } - - public NvServer getNvServer() { - return nvServer; - } - - public void setNvServer(NvServer nvServer) { - this.nvServer = nvServer; - } - - public List getProfiles() { - return profiles; - } - - public void setProfiles(List profiles) { - this.profiles = profiles; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/model/NvNetworkProfile.java b/src/main/java/com/hpe/application/automation/tools/nv/model/NvNetworkProfile.java deleted file mode 100644 index 7153a5a317..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/model/NvNetworkProfile.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import hudson.Extension; -import hudson.model.AbstractDescribableImpl; -import hudson.model.Descriptor; -import hudson.util.FormValidation; -import hudson.util.ListBoxModel; -import net.sf.json.JSONObject; -import com.hpe.application.automation.tools.nv.common.NvValidatorUtils; -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.DataBoundSetter; -import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest; - -import javax.servlet.ServletException; -import java.io.IOException; -import java.io.Serializable; - -@JsonIgnoreProperties({"serialVersionUID", "dto"}) -public class NvNetworkProfile extends AbstractDescribableImpl implements Serializable { - private static final long serialVersionUID = 5600302656112810974L; - - private String profileName; - private String latency = "0"; - private String packet = "0"; - private String bandwidthIn = BandwidthEnum.UNRESTRICTED.getDisplayText(); - private String bandwidthOut = BandwidthEnum.UNRESTRICTED.getDisplayText(); - - private boolean custom = true; - private NvProfileDTO dto; - - @JsonCreator - @DataBoundConstructor - public NvNetworkProfile(@JsonProperty("profileName") String profileName) { - this.profileName = profileName; - } - - public String getProfileName() { - return profileName; - } - - private void setProfileName(String profileName) { - this.profileName = profileName; - } - - public String getLatency() { - return latency; - } - - @DataBoundSetter - public void setLatency(String latency) { - this.latency = latency; - } - - public String getPacket() { - return packet; - } - - @DataBoundSetter - public void setPacket(String packet) { - this.packet = packet; - } - - public String getBandwidthIn() { - return bandwidthIn; - } - - @DataBoundSetter - public void setBandwidthIn(String bandwidthIn) { - this.bandwidthIn = bandwidthIn; - } - - public String getBandwidthOut() { - return bandwidthOut; - } - - @DataBoundSetter - public void setBandwidthOut(String bandwidthOut) { - this.bandwidthOut = bandwidthOut; - } - - public boolean isCustom() { - return custom; - } - - public void setCustom(boolean custom) { - this.custom = custom; - } - - @Override - public String toString() { - return "Network Profile{" + - "profileName='" + profileName + '\'' + - ", latency='" + latency + '\'' + - ", packet='" + packet + '\'' + - ", bandwidthIn='" + bandwidthIn + '\'' + - ", bandwidthOut='" + bandwidthOut + '\'' + - '}' + "\n"; - } - - public NvProfileDTO toDTO() { - if (null == dto) { - dto = new NvProfileDTO(profileName); - dto.setLatency(Double.parseDouble(latency)); - dto.setPacket(Double.parseDouble(packet)); - dto.setBandwidthIn(BandwidthEnum.valueOf(bandwidthIn).getValue()); - dto.setBandwidthOut(BandwidthEnum.valueOf(bandwidthOut).getValue()); - } - - return dto; - } - - @Extension - public static class DescriptorImpl extends Descriptor { - public static final int MAX_LATENCY_VALUE = 8000; - public static final int MAX_PACKET_VALUE = 100; - - public DescriptorImpl() { - load(); - } - - @Override - public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { - save(); - return super.configure(req, formData); - } - - public FormValidation doCheckProfileName(@QueryParameter String value) throws IOException, ServletException { - if (value.length() == 0) { - return FormValidation.error("Please set a profile name"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckLatency(@QueryParameter String value) throws IOException, ServletException { - if (value.length() == 0) { - return FormValidation.error("Please set latency"); - } - if (!NvValidatorUtils.validateFloatingPoint(value, MAX_LATENCY_VALUE)) { - return FormValidation.error("Latency must be a positive number between 0 and " + MAX_LATENCY_VALUE); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckPacket(@QueryParameter String value) throws IOException, ServletException { - if (value.length() == 0) { - return FormValidation.error("Please set packet loss"); - } - if (!NvValidatorUtils.validateFloatingPoint(value, MAX_PACKET_VALUE)) { - return FormValidation.error("Packet loss must be a positive number between 0 and " + MAX_PACKET_VALUE); - } - - return FormValidation.ok(); - } - - public ListBoxModel doFillBandwidthInItems() { - return getBandwidthItems(); - } - - public ListBoxModel doFillBandwidthOutItems() { - return getBandwidthItems(); - } - - private ListBoxModel getBandwidthItems() { - ListBoxModel items = new ListBoxModel(); - for (BandwidthEnum bandwidthEnum : BandwidthEnum.values()) { - items.add(bandwidthEnum.getDisplayText(), bandwidthEnum.name()); - } - - return items; - } - - @Override - public String getDisplayName() { - return "Network Profile"; - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/model/NvProfileDTO.java b/src/main/java/com/hpe/application/automation/tools/nv/model/NvProfileDTO.java deleted file mode 100644 index e9982acc51..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/model/NvProfileDTO.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; - -public class NvProfileDTO implements Serializable { - private static final long serialVersionUID = -4508401911318397292L; - - private String profileName; - private double latency; - private double packet; - private double bandwidthIn; - private double bandwidthOut; - - @JsonCreator - public NvProfileDTO(@JsonProperty("profileName") String profileName) { - this.profileName = profileName; - } - - public String getProfileName() { - return profileName; - } - - public double getLatency() { - return latency; - } - - public void setLatency(double latency) { - this.latency = latency; - } - - public double getPacket() { - return packet; - } - - public void setPacket(double packet) { - this.packet = packet; - } - - public double getBandwidthIn() { - return bandwidthIn; - } - - public void setBandwidthIn(double bandwidthIn) { - this.bandwidthIn = bandwidthIn; - } - - public double getBandwidthOut() { - return bandwidthOut; - } - - public void setBandwidthOut(double bandwidthOut) { - this.bandwidthOut = bandwidthOut; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/model/NvServer.java b/src/main/java/com/hpe/application/automation/tools/nv/model/NvServer.java deleted file mode 100644 index c7be483e26..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/model/NvServer.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import hudson.Extension; -import hudson.model.AbstractDescribableImpl; -import hudson.model.Descriptor; -import hudson.util.FormValidation; -import net.sf.json.JSONObject; -import com.hpe.application.automation.tools.nv.common.NvValidatorUtils; -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest; - -import javax.servlet.ServletException; -import java.io.IOException; -import java.io.Serializable; - -@JsonIgnoreProperties({"serialVersionUID"}) -public class NvServer extends AbstractDescribableImpl implements Serializable { - private static final long serialVersionUID = -5822820278864676678L; - - private String serverName; - private String serverIp; - private String nvPort; - private String proxyPort; - private String username; - private String password; - - @DataBoundConstructor - public NvServer(String serverName, String serverIp, String nvPort, String proxyPort, String username, String password) { - this.serverName = serverName; - this.serverIp = serverIp; - this.nvPort = nvPort; - this.proxyPort = proxyPort; - this.username = username; - this.password = password; - } - - public String getServerName() { - return serverName; - } - - public String getServerIp() { - return serverIp; - } - - public String getNvPort() { - return nvPort; - } - - public String getProxyPort() { - return proxyPort; - } - - public String getUsername() { - return username; - } - - public String getPassword() { - return password; - } - - @Override - public String toString() { - return "NvServer{" + - "serverName='" + serverName + '\'' + - ", serverIp='" + serverIp + '\'' + - ", nvPort='" + nvPort + '\'' + - ", proxyPort='" + proxyPort + '\'' + - ", username='" + username + '\'' + - ", password='" + password + '\'' + - '}'; - } - - @Extension - public static class DescriptorImpl extends Descriptor { - - public DescriptorImpl() { - load(); - } - - @Override - public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { - save(); - return super.configure(req, formData); - } - - public FormValidation doCheckServerName(@QueryParameter String value) throws IOException, ServletException { - if (value.length() == 0) { - return FormValidation.error("Please set a server name"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckServerIp(@QueryParameter String value) throws IOException, ServletException { - value = value.trim(); - if (value.length() == 0) { - return FormValidation.error("Please set an IPv4 address"); - } else if (!NvValidatorUtils.isValidHostIp(value)) { - return FormValidation.error("Value must be a valid IPv4 address"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckNvPort(@QueryParameter String value) throws IOException, ServletException { - return validatePort(value, true); - } - - public FormValidation doCheckProxyPort(@QueryParameter String value) throws IOException, ServletException { - return validatePort(value, false); - } - - private FormValidation validatePort(String value, boolean isMandatory) { - value = value.trim(); - if (isMandatory && value.length() == 0) { - return FormValidation.error("Please set a port"); - } - try { - int port = 0; - if (value.length() > 0) { - port = Integer.parseInt(value); - if (port <= 0) { - return FormValidation.error("Port must be a positive integer"); - } - } - } catch (NumberFormatException e) { - return FormValidation.error("Port must be a positive integer"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckUsername(@QueryParameter String value) throws IOException, ServletException { - if (value.trim().length() == 0) { - return FormValidation.error("Please enter a username"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckPassword(@QueryParameter String value) throws IOException, ServletException { - if (value.trim().length() == 0) { - return FormValidation.error("Please enter a password"); - } - - return FormValidation.ok(); - } - - @Override - public String getDisplayName() { - return "NV Test Manager"; - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector.java deleted file mode 100644 index 8af3f65d18..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin; - -import hudson.Extension; -import hudson.model.AbstractDescribableImpl; -import hudson.model.Descriptor; -import hudson.util.FormValidation; -import hudson.util.ListBoxModel; -import net.sf.json.JSONObject; -import org.apache.commons.lang.StringUtils; -import com.hpe.application.automation.tools.nv.common.NvNetworkProfileRegistry; -import com.hpe.application.automation.tools.nv.model.BandwidthEnum; -import com.hpe.application.automation.tools.nv.model.NvNetworkProfile; -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.bind.JavaScriptMethod; - -import javax.servlet.ServletException; -import java.io.IOException; - -public class NetworkProfileSelector extends AbstractDescribableImpl { - private final String profileName; - - @DataBoundConstructor - public NetworkProfileSelector(final String profileName) { - super(); - - this.profileName = profileName; - } - - public String getProfileName() { - return profileName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof NetworkProfileSelector)) { - return false; - } - - NetworkProfileSelector that = (NetworkProfileSelector) o; - - return profileName.equals(that.profileName); - } - - @Override - public int hashCode() { - return profileName.hashCode(); - } - - @Extension - public static class DescriptorImpl extends Descriptor { - private final String TOOLTIP_FORMAT = "Latency (ms): %s\n" + - "Packet Loss (%%): %s\n" + - "Bandwidth In (Kbps): %s\n" + - "Bandwidth Out (Kbps): %s"; - - private String defaultProfileName; - private String selectedProfileName; - - public DescriptorImpl() { - load(); - // set default for the first usage - defaultProfileName = NvNetworkProfileRegistry.getInstance().getNetworkProfilesAsListModel().get(0).name; - } - - @Override - public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { - save(); - return super.configure(req, formData); - } - - /** - * Returns the available parsers. These values will be shown in the list - * box of the config.jelly view part. - * @return the model of the list box - */ - public ListBoxModel doFillProfileNameItems() { - // get model each time since model may be changed with custom profiles - return NvNetworkProfileRegistry.getInstance().getNetworkProfilesAsListModel(); - } - - public FormValidation doCheckProfileName(@QueryParameter String value) throws IOException, ServletException { - if(!NvNetworkProfileRegistry.getInstance().exists(value)) { - return FormValidation.error("Profile does not exist"); - } - - return FormValidation.ok(); - } - - public String getDefaultProfileName() { - return defaultProfileName; - } - - public String getSelectedProfileName() { - return selectedProfileName; - } - - @JavaScriptMethod - public String getTooltip(String profileName) { - NvNetworkProfile networkProfile = NvNetworkProfileRegistry.getInstance().getNetworkProfile(profileName); - return String.format(TOOLTIP_FORMAT, networkProfile.getLatency(), networkProfile.getPacket(), BandwidthEnum.valueOf(networkProfile.getBandwidthIn()).getValue(), BandwidthEnum.valueOf(networkProfile.getBandwidthOut()).getValue()); - } - - @Override - public String getDisplayName() { - return StringUtils.EMPTY; - } - } -} \ No newline at end of file diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder.java deleted file mode 100644 index ae68e7616a..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin; - -import com.hpe.application.automation.tools.nv.common.NvNetworkProfileRegistry; -import com.hpe.application.automation.tools.nv.common.NvValidatorUtils; -import com.hpe.application.automation.tools.nv.model.NvModel; -import com.hpe.application.automation.tools.nv.model.NvNetworkProfile; -import com.hpe.application.automation.tools.nv.model.NvServer; -import hudson.Extension; -import hudson.FilePath; -import hudson.Launcher; -import hudson.model.AbstractBuild; -import hudson.model.AbstractProject; -import hudson.model.BuildListener; -import hudson.model.Descriptor; -import hudson.tasks.BuildStep; -import hudson.tasks.BuildStepDescriptor; -import hudson.tasks.Builder; -import hudson.util.FormValidation; -import hudson.util.ListBoxModel; -import net.sf.json.JSONObject; -import org.kohsuke.stapler.*; - -import javax.servlet.ServletException; -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.util.*; - -public class NvEmulationBuilder extends Builder { - - private final NvModel nvModel; - private Set profileNames = new HashSet<>(); - - // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" - @DataBoundConstructor - public NvEmulationBuilder(String serverName, String includeClientIPs, String excludeServerIPs, String reportFiles, String thresholdsFile, UseProxyCheckbox useProxyCheckbox, List steps) { - String envVariable = useProxyCheckbox == null ? null : useProxyCheckbox.getEnvVariable(); - - nvModel = new NvModel(serverName, includeClientIPs, excludeServerIPs, envVariable, reportFiles, thresholdsFile, steps); - nvModel.setNvServer(getNvServer(serverName)); - } - - public NvModel getNvModel() { - return nvModel; - } - - public String getServerName() { - return nvModel.getServerName(); - } - - public NetworkProfileSelector[] getProfileNames() { - if (null == profileNames) { - profileNames = new HashSet<>(); - } - return profileNames.toArray(new NetworkProfileSelector[profileNames.size()]); - } - - @DataBoundSetter - public void setProfileNames(final NetworkProfileSelector[] profileNames) { - if (profileNames != null) { - this.profileNames.addAll(Arrays.asList(profileNames)); - - List profileNamesList = new ArrayList<>(); - for (NetworkProfileSelector profileName : profileNames) { - profileNamesList.add(profileName.getProfileName()); - } - - nvModel.setProfiles(NvNetworkProfileRegistry.getInstance().getNetworkProfiles(profileNamesList)); - } - } - - private NvServer getNvServer(String serverName) { - return getDescriptor().getNvServer(serverName); - } - - @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { - return new NvEmulationInvoker(nvModel, build, launcher, listener).invoke(); - } - - @Override - public DescriptorImpl getDescriptor() { - return (DescriptorImpl) super.getDescriptor(); - } - - @Extension // This indicates to Jenkins that this is an implementation of an extension point. - public static final class DescriptorImpl extends BuildStepDescriptor { - private List customProfiles = new ArrayList<>(); - private List nvServers = new ArrayList<>(); - - /** - * In order to load the persisted global configuration, you have to - * call load() in the constructor. - */ - public DescriptorImpl() { - load(); - registerCustomProfiles(); - } - - @Override - public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { - customProfiles = new ArrayList<>(req.bindJSONToList(NvNetworkProfile.class, formData.get("customProfiles"))); - unregisterCustomProfiles(); - registerCustomProfiles(); - - nvServers = new ArrayList<>(req.bindJSONToList(NvServer.class, formData.get("nvServers"))); - - save(); - return super.configure(req, formData); - } - - private void registerCustomProfiles() { - NvNetworkProfileRegistry.getInstance().register(customProfiles); - } - - private void unregisterCustomProfiles() { - NvNetworkProfileRegistry.getInstance().unregisterCustom(); - } - - public NvNetworkProfile[] getCustomProfiles() { - return customProfiles.toArray(new NvNetworkProfile[customProfiles.size()]); - } - - public NvServer[] getNvServers() { - return nvServers.toArray(new NvServer[nvServers.size()]); - } - - public NvServer getNvServer(String serverName) { - NvServer result = null; - for (NvServer nvServer : nvServers) { - if (serverName.equals(nvServer.getServerName())) { - result = nvServer; - break; - } - } - - return result; - } - - public ListBoxModel doFillServerNameItems() { - ListBoxModel items = new ListBoxModel(); - for (NvServer nvServer : nvServers) { - items.add(nvServer.getServerName(), nvServer.getServerName()); - } - - return items; - } - - public FormValidation doCheckIncludeClientIPs(@QueryParameter String value) throws IOException, ServletException { - return validateIPs(value); - } - - public FormValidation doCheckExcludeServerIPs(@QueryParameter String value) throws IOException, ServletException { - return validateIPs(value); - } - - private FormValidation validateIPs(String value) { - value = value.replace(" ", ""); - String[] ips = value.split(";"); - for (String ip : ips) { - if (!ip.isEmpty()) { - if (ip.contains("-")) { - String[] ranges = ip.split("-"); - if (!NvValidatorUtils.isValidHostIp(ranges[0]) || !NvValidatorUtils.isValidHostIp(ranges[1])) { - return FormValidation.error("IP range must contain valid IPv4 addresses"); - } - } else { - if (!NvValidatorUtils.isValidHostIp(ip)) { - return FormValidation.error("IP must be a valid IPv4 address"); - } - } - } - } - - return FormValidation.ok(); - } - - public FormValidation doCheckUseProxyCheckbox(@QueryParameter String value, @QueryParameter String serverName) throws IOException, ServletException { - NvServer nvServer = getNvServer(serverName); - if(null != nvServer) { - boolean isProxyChecked = Boolean.parseBoolean(value); - if(isProxyChecked) { - if(nvServer.getProxyPort().isEmpty()) { - return FormValidation.error("The proxy port for the selected NV Test Manager was not configured"); - } - } - } - - return FormValidation.ok(); - } - - public FormValidation doCheckEnvVariable(@QueryParameter String value) throws IOException, ServletException { - if (value.trim().length() == 0) { - return FormValidation.error("Please set an environment variable name"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckReportFiles(@AncestorInPath AbstractProject project, @QueryParameter String value) throws IOException, ServletException { - if (value.trim().length() == 0) { - return FormValidation.error("Please set pattern for test report XMLs"); - } - - return FilePath.validateFileMask(project.getSomeWorkspace(), value); - } - - public FormValidation doCheckThresholdsFile(@QueryParameter String value) throws IOException, ServletException { - if (value.trim().length() == 0) { - return FormValidation.error("Please set file location"); - } - - if (!NvValidatorUtils.validateFile(value)) { - return FormValidation.error("File can not be read. Check that the file exists and can be accessed"); - } - try { - if (null == NvValidatorUtils.readThresholdsFile(value)) { - return FormValidation.error("File must contain valid threshold records. Please check the help tooltip"); - } - } catch (IOException e) { - return FormValidation.error("An error occurred while trying to read the specified file"); - } - - return FormValidation.ok(); - } - - public boolean isApplicable(Class aClass) { - // Indicates that this builder can be used with all kinds of project types - return true; - } - - /** - * This human readable name is used in the configuration screen. - */ - public String getDisplayName() { - return "HPE Network Virtualization"; - } - - public List> getSteps(AbstractProject project) { - final List> builders = new ArrayList>(); - if (null == project) { - return builders; - } - for (Descriptor descriptor : Builder.all()) { - if (descriptor instanceof NvEmulationBuilder.DescriptorImpl) { - continue; - } - BuildStepDescriptor buildStepDescriptor = (BuildStepDescriptor) descriptor; - if (buildStepDescriptor.isApplicable(project.getClass()) && hasDbc(buildStepDescriptor.clazz)) { - builders.add(buildStepDescriptor); - } - } - return builders; - } - - private boolean hasDbc(final Class clazz) { - for (Constructor constructor : clazz.getConstructors()) { - if (constructor.isAnnotationPresent(DataBoundConstructor.class)) { - return true; - } - } - return false; - } - } - - public static class UseProxyCheckbox { - private String envVariable; - - @DataBoundConstructor - public UseProxyCheckbox(String envVariable) { - this.envVariable = envVariable; - } - - public String getEnvVariable() { - return envVariable; - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationInvoker.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationInvoker.java deleted file mode 100644 index 3bc6a1194b..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationInvoker.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin; - -import com.hpe.nv.api.*; -import hudson.Launcher; -import hudson.model.AbstractBuild; -import hudson.model.BuildListener; -import hudson.remoting.Callable; -import hudson.tasks.BuildStep; -import com.hpe.application.automation.tools.nv.common.NvTestUtils; -import com.hpe.application.automation.tools.nv.common.NvValidatorUtils; -import com.hpe.application.automation.tools.nv.model.*; -import com.hpe.application.automation.tools.nv.plugin.results.NvJUnitResultsHandler; -import org.jenkinsci.remoting.RoleChecker; - -import java.io.IOException; -import java.net.ConnectException; -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.util.*; - -public class NvEmulationInvoker { - private static final String SCENARIO_PREFIX = "Network Scenario "; - private static final String DEFAULT_FLOW = "Flow_1"; - private static final String DEFAULT_TRANSACTION = "Transaction"; - - private final NvModel nvModel; - private AbstractBuild build; - private Launcher launcher; - private BuildListener listener; - - private List possibleIps; - private NvNetworkProfile currentProfile; - private NvJUnitResultsHandler jUnitHandler = null; - - public NvEmulationInvoker(NvModel nvModel, AbstractBuild build, Launcher launcher, BuildListener listener) { - this.nvModel = nvModel; - this.build = build; - this.launcher = launcher; - this.listener = listener; - } - - public boolean invoke() throws InterruptedException, IOException { - List profiles = nvModel.getProfiles(); - if (null == profiles || profiles.size() == 0) { - return invokeBuildSteps(build, launcher, listener); - } else { - Map thresholdsMap = readThresholds(); - if (null == thresholdsMap) { - listener.getLogger().println("Thresholds file is not valid. Tests will not be affected by thresholds. Check that the file exists and is readable. Check file contents correctness."); - } - - if (null != nvModel.getReportFiles() && !nvModel.getReportFiles().isEmpty()) { - jUnitHandler = new NvJUnitResultsHandler(thresholdsMap, nvModel.getReportFiles()); - } else { - listener.getLogger().println("JUnit test xmls pattern is null or empty. Thresholds will not be imposed on tests."); - } - - possibleIps = getPossibleIpAddresses(); - initProxy(); - - Iterator profilesIter = profiles.iterator(); - NvContext context = new NvContext(); - NvDataHolder.getInstance().put(NvTestUtils.getBuildKey(build), context); - - Test test = initAndStartTest(profilesIter); - context.setTest(test); - - Transaction transaction = initTransaction(test); - context.setTransaction(transaction); - - context.increaseRun(); - - return invokePerProfile(context, profilesIter); - } - } - - private Map readThresholds() throws IOException { - if (null == nvModel.getThresholdsFile() || nvModel.getThresholdsFile().isEmpty() || !NvValidatorUtils.validateFile(nvModel.getThresholdsFile())) { - return null; - } - - return NvValidatorUtils.readThresholdsFile(nvModel.getThresholdsFile()); - } - - private boolean invokePerProfile(NvContext context, Iterator profilersIter) throws IOException, InterruptedException { - if (context.getRun() > 1) { - currentProfile = profilersIter.next(); - listener.getLogger().print(currentProfile); - Flow flow = createFlow(currentProfile); - List flows = new ArrayList<>(); - flows.add(flow); - - try { - context.getTest().realTimeUpdate(SCENARIO_PREFIX + currentProfile.getProfileName(), null, flows); - } catch (NVExceptions.IllegalActionException | NVExceptions.ServerErrorException e) { - throw new IOException("Failed to update network profile for profile: " + currentProfile.getProfileName() + ". Error: " + e.getMessage(), e); - } - listener.getLogger().println("Successfully updated network profile for profile: " + currentProfile.getProfileName()); - } - - try { - context.getTransaction().start(); - } catch (NVExceptions.ServerErrorException | NVExceptions.IllegalActionException e) { - throw new IOException("Failed to start transaction. Error: " + e.getMessage(), e); - } - listener.getLogger().println("Successfully started transaction."); - - invokeBuildSteps(build, launcher, listener); - - // if user steps fail, do not continue -// if (!result) { -// return false; -// } else { - if (profilersIter.hasNext()) { // recursive call to run again with next profile - try { - context.getTransaction().stop(); - } catch (NVExceptions.ServerErrorException e) { - throw new IOException("Failed to stop transaction. Error: " + e.getMessage(), e); - } - - listener.getLogger().println("Successfully stopped transaction."); - - context.increaseRun(); - - handleTestResults(false); - - return invokePerProfile(context, profilersIter); - } else { // last profile, finish - NvTestUtils.stopTestEmulation(build, listener); - - handleTestResults(true); - - return true; - } -// } - } - - private void handleTestResults(boolean finalize) throws IOException, InterruptedException { - if (jUnitHandler != null) { - jUnitHandler.handle(build, launcher, listener, currentProfile); - if (finalize) { - jUnitHandler.finalizeResults(build); - } - } - } - - private Transaction initTransaction(Test test) throws IOException { - try { - test.connectToTransactionManager(); - } catch (NVExceptions.ServerErrorException e) { - throw new IOException("Failed to connect to transaction manager. Error: " + e.getMessage(), e); - } - listener.getLogger().println("Successfully connected to transaction manager."); - - Transaction transaction = new Transaction(DEFAULT_TRANSACTION); - try { - transaction.addToTest(test); - } catch (NVExceptions.ServerErrorException e) { - throw new IOException("Failed to add transaction. Error: " + e.getMessage(), e); - } - listener.getLogger().println("Successfully added transaction."); - - return transaction; - } - - private void initProxy() throws IOException, InterruptedException { - if (nvModel.isUseProxy()) { - if(nvModel.getNvServer().getProxyPort().isEmpty()) { - throw new ConnectException("Proxy port was not configured for the selected NV Test Manager"); - } - VariableInjectionAction action = new VariableInjectionAction(nvModel.getEnvVariable(), - nvModel.getNvServer().getServerIp() + ":" + nvModel.getNvServer().getProxyPort()); - build.addAction(action); - } - } - - private Test initAndStartTest(Iterator profilersIter) throws IOException { - TestManager tm = new TestManager(nvModel.getNvServer().getServerIp(), Integer.parseInt(nvModel.getNvServer().getNvPort()), nvModel.getNvServer().getUsername(), nvModel.getNvServer().getPassword()); - try { - tm.init(); - } catch (NVExceptions.MissingPropertyException | NVExceptions.ServerErrorException e) { - throw new IOException("Failed to start Network Virtualization emulation on host. Error: " + e.getMessage(), e); - } - - listener.getLogger().println("Created Network Virtualization emulation."); - - currentProfile = profilersIter.next(); - listener.getLogger().print(currentProfile); - - String testId = NvTestUtils.getNvTestId(build); - Test test; - try { - test = new Test(tm, testId, SCENARIO_PREFIX + currentProfile.getProfileName()); - test.setTestMode(Test.Mode.CUSTOM); - if (nvModel.isUseProxy()) { - test.setUseNVProxy(true); - } - } catch (NVExceptions.MissingPropertyException e) { - throw new IOException("Failed to create Network Virtualiation test", e); - } - listener.getLogger().println("Created Network Virtualization test."); - - // handle first profile - try { - Flow flow = createFlow(currentProfile); - test.addFlow(flow); - } catch (NVExceptions.NotSupportedException | NVExceptions.MissingPropertyException e) { - throw new IOException("Failed to add Network Virtualiation flow to test.", e); - } - - try { - test.start(); - } catch (NVExceptions.IllegalActionException | NVExceptions.ServerErrorException | NVExceptions.NotSupportedException e) { - throw new IOException("Failed to start Network Virtualization test. Error: " + e.getMessage(), e); - } - - listener.getLogger().println("Network Virtualization test was started successfully."); - return test; - } - - private Flow createFlow(NvNetworkProfile nvProfile) throws IOException { - try { - double bandwidthIn = BandwidthEnum.valueOf(nvProfile.getBandwidthIn()).getValue(); - double bandwidthOut = BandwidthEnum.valueOf(nvProfile.getBandwidthOut()).getValue(); - Flow flow = new Flow(DEFAULT_FLOW, Double.parseDouble(nvProfile.getLatency()), Double.parseDouble(nvProfile.getPacket()), bandwidthIn, bandwidthOut); - - // add all IPs to destinations include - flow.includeDestIPRange(new IPRange(null, null, 0, IPRange.Protocol.ALL.getId())); - - // add user defined IPs - addIncludeClientIPs(flow); - addCustomExcludeServerIPs(flow); - - // add NV server as exclude - if (nvModel.isUseProxy()) { - flow.excludeDestIPRange(new IPRange(nvModel.getNvServer().getServerIp(), nvModel.getNvServer().getServerIp(), 0, IPRange.Protocol.ALL.getId())); - } - - return flow; - } catch (NVExceptions.MissingPropertyException | NVExceptions.IllegalArgumentException | NVExceptions.NotSupportedException e) { - throw new IOException("Failed to create Network Virtualiation flow.", e); - } - } - - private void addIncludeClientIPs(Flow flow) throws NVExceptions.NotSupportedException, NVExceptions.IllegalArgumentException { - // add possible ips to the list (host network interfaces) - Set ips = new HashSet<>(possibleIps); - // add included ips provided by the user - boolean invalidIpsFound = false; - if (null != nvModel.getIncludeClientIPs() && !nvModel.getIncludeClientIPs().isEmpty()) { - String[] includedIps = nvModel.getIncludeClientIPs().split(";"); - for (String ip : includedIps) { - if (!ip.isEmpty()) { - if (isIpValid(ip)) { - ips.add(ip); - } else { - invalidIpsFound = true; - } - } - } - - if (invalidIpsFound) { - listener.getLogger().println("Invalid IPs were found in \"Include Client IPs\" section. It might affect network emulation"); - } - } - - String[] ranges; - for (String includedIp : ips) { - if (!includedIp.isEmpty()) { - if (includedIp.contains("-")) { // handle IP range - ranges = includedIp.split("-"); - flow.includeSourceIPRange(new IPRange(ranges[0], ranges[1], 0, IPRange.Protocol.ALL.getId())); - flow.excludeDestIPRange(new IPRange(ranges[0], ranges[1], 0, IPRange.Protocol.ALL.getId())); - } else { - flow.includeSourceIPRange(new IPRange(includedIp, includedIp, 0, IPRange.Protocol.ALL.getId())); - flow.excludeDestIPRange(new IPRange(includedIp, includedIp, 0, IPRange.Protocol.ALL.getId())); - } - } - } - } - - private boolean isIpValid(String ip) { - if (ip.contains("-")) { - String[] ranges = ip.split("-"); - if (!NvValidatorUtils.isValidHostIp(ranges[0]) || !NvValidatorUtils.isValidHostIp(ranges[1])) { - listener.getLogger().println("IP range: " + ip + " contains an invalid IPv4 address"); - return false; - } - } else { - if (!NvValidatorUtils.isValidHostIp(ip)) { - listener.getLogger().println("IP: " + ip + " is an invalid IPv4 address"); - return false; - } - } - return true; - } - - private void addCustomExcludeServerIPs(Flow flow) throws NVExceptions.NotSupportedException, NVExceptions.IllegalArgumentException { - if (null != nvModel.getExcludeServerIPs() && !nvModel.getExcludeServerIPs().isEmpty()) { - String[] excludedIps = nvModel.getExcludeServerIPs().split(";"); - String[] ranges; - boolean invalidIpsFound = false; - for (String excludedIp : excludedIps) { - if (!excludedIp.isEmpty()) { - if (isIpValid(excludedIp)) { - if (excludedIp.contains("-")) { // handle IP range - ranges = excludedIp.split("-"); - flow.excludeDestIPRange(new IPRange(ranges[0], ranges[1], 0, IPRange.Protocol.ALL.getId())); - } else { - flow.excludeDestIPRange(new IPRange(excludedIp, excludedIp, 0, IPRange.Protocol.ALL.getId())); - } - } else { - invalidIpsFound = true; - } - } - } - - if (invalidIpsFound) { - listener.getLogger().println("Invalid IPs were found in \"Exclude Server IPs\" section"); - } - } - } - - private List getPossibleIpAddresses() throws IOException, InterruptedException { - // Get a "channel" to the build machine and run the task there - return launcher.getChannel().call(new HostIpRetrieverCallable()); - } - - private boolean invokeBuildSteps(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException { - if (nvModel.getSteps() == null) { - return true; - } - boolean result = true; - for (BuildStep step : nvModel.getSteps()) { - result = step.perform(build, launcher, listener); -// if (!result) { -// break; -// } - } - - return result; - } - - // Extract the possible IPv4 addresses from the host where the build runs - public static class HostIpRetrieverCallable implements Callable, IOException> { - private static final long serialVersionUID = 3959091053778932297L; - - @Override - public List call() throws IOException { - ArrayList result = new ArrayList<>(); - Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); - InetAddress inetAddress; - while (networkInterfaces.hasMoreElements()) { - Enumeration inetAddresses = networkInterfaces.nextElement().getInetAddresses(); - while (inetAddresses.hasMoreElements()) { - inetAddress = inetAddresses.nextElement(); - if (!inetAddress.isLoopbackAddress() && inetAddress instanceof Inet4Address) { - result.add(inetAddress.getHostAddress()); - } - } - } - return result; - } - - @Override - public void checkRoles(RoleChecker roleChecker) throws SecurityException { - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationRunListener.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationRunListener.java deleted file mode 100644 index d6d95c854f..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/NvEmulationRunListener.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin; - -import hudson.AbortException; -import hudson.Extension; -import hudson.model.Result; -import hudson.model.Run; -import hudson.model.TaskListener; -import hudson.model.listeners.RunListener; -import com.hpe.application.automation.tools.nv.common.NvTestUtils; -import com.hpe.application.automation.tools.nv.model.NvDataHolder; - -import javax.annotation.Nonnull; - -@Extension -public class NvEmulationRunListener extends RunListener { - @Override - public void onCompleted(R r, @Nonnull TaskListener listener) { - super.onCompleted(r, listener); - - try { - // stop emulation in case of failure - if (r.getResult().isWorseOrEqualTo(Result.FAILURE)) { - if (null != NvDataHolder.getInstance().get(NvTestUtils.getBuildKey(r))) { - listener.getLogger().println("Build was not completed. Stopping Network Virtualization emulation."); - - NvTestUtils.stopTestEmulation(r, listener); - } - } - } catch (AbortException e) { - // do nothing - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/VariableInjectionAction.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/VariableInjectionAction.java deleted file mode 100644 index 79e4310aa0..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/VariableInjectionAction.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin; - -import hudson.EnvVars; -import hudson.model.AbstractBuild; -import hudson.model.EnvironmentContributingAction; - -public class VariableInjectionAction implements EnvironmentContributingAction { - private String key; - private String value; - - public VariableInjectionAction(String key, String value) { - this.key = key; - this.value = value; - } - - public void buildEnvVars(AbstractBuild abstractBuild, EnvVars envVars) { - if (envVars != null && key != null && value != null) { - envVars.put(key, value); - } - } - - public String getDisplayName() { - return "VariableInjectionAction"; - } - - public String getIconFileName() { - return null; - } - - public String getUrlName() { - return null; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResult.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResult.java deleted file mode 100644 index 9ba8ccce64..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResult.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import java.io.Serializable; - -public abstract class CountableResult implements Serializable { - private static final long serialVersionUID = 4241420464035239390L; - - private String name; - private float duration; - private int passCount; - private int failCount; - private int errorCount; - private int skipCount; - - protected CountableResult() { - } - - protected CountableResult(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public float getDuration() { - return duration; - } - - public void setDuration(float duration) { - this.duration = duration; - } - - public int getPassCount() { - return passCount; - } - - public void setPassCount(int passCount) { - this.passCount = passCount; - } - - public int getFailCount() { - return failCount; - } - - public void setFailCount(int failCount) { - this.failCount = failCount; - } - - public int getErrorCount() { - return errorCount; - } - - public void setErrorCount(int errorCount) { - this.errorCount = errorCount; - } - - public int getSkipCount() { - return skipCount; - } - - public void setSkipCount(int skipCount) { - this.skipCount = skipCount; - } - - public void tally() { - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResultParent.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResultParent.java deleted file mode 100644 index 55c85be359..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/CountableResultParent.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSetter; - -import java.io.Serializable; -import java.util.*; - -public abstract class CountableResultParent extends CountableResult implements Serializable { - private static final long serialVersionUID = -4125396948358407713L; - - @JsonIgnore - private Map results = new HashMap<>(); - - protected CountableResultParent() { - } - - protected CountableResultParent(String name) { - super(name); - } - - public List getResults() { - Collection values = results.values(); - if (values instanceof List) { - return (List) values; - } else { - return new ArrayList<>(values); - } - } - - @JsonSetter - public void setResults(List results) { - if (null != results) { - for (T result : results) { - this.results.put(result.getName(), result); - } - } - } - - protected T getResult(String name) { - return results.get(name); - } - - protected void addResult(T result) { - results.put(result.getName(), result); - } - - protected void addDuration(float duration) { - setDuration(getDuration() + duration); - } - - protected void addFailCount(int failCount) { - setFailCount(getFailCount() + failCount); - } - - protected void addErrorCount(int errorCount) { - setErrorCount(getErrorCount() + errorCount); - } - - protected void addSkipCount(int skipCount) { - setSkipCount(getSkipCount() + skipCount); - } - - protected void addPassCount(int passCount) { - setPassCount(getPassCount() + passCount); - } - - public void tally() { - for (T result : results.values()) { - result.tally(); - addDuration(result.getDuration()); - addFailCount(result.getFailCount()); - addErrorCount(result.getErrorCount()); - addSkipCount(result.getSkipCount()); - addPassCount(result.getPassCount()); - } - } - -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/JUnitXmlConstants.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/JUnitXmlConstants.java deleted file mode 100644 index f9a02b2861..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/JUnitXmlConstants.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -public class JUnitXmlConstants { - public static final String SUITE_ELEMENT = "testsuite"; - public static final String SUITE_ELEMENT_ATTR_NAME = "name"; - public static final String SUITE_ELEMENT_ATTR_TIME = "time"; - public static final String SUITE_ELEMENT_ATTR_TESTS = "tests"; - public static final String SUITE_ELEMENT_ATTR_ERRORS = "errors"; - public static final String SUITE_ELEMENT_ATTR_SKIPS = "skipped"; - public static final String SUITE_ELEMENT_ATTR_FAILS = "failures"; - - public static final String TEST_ELEMENT = "testcase"; - public static final String TEST_ELEMENT_ATTR_NAME = "name"; - public static final String TEST_ELEMENT_ATTR_CLASS = "classname"; - public static final String TEST_ELEMENT_ATTR_TIME = "time"; - - public static final String TEST_ERROR_ELEMENT = "error"; - public static final String TEST_ERROR_ELEMENT_ATTR_MESSAGE = "message"; - public static final String TEST_ERROR_ELEMENT_ATTR_TYPE = "type"; - - public static final String TEST_FAILURE_ELEMENT = "failure"; - public static final String TEST_FAILURE_ELEMENT_ATTR_MESSAGE = "message"; - public static final String TEST_FAILURE_ELEMENT_ATTR_TYPE = "type"; - - public static final String TEST_SKIP_ELEMENT = "skipped"; -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvClassResult.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvClassResult.java deleted file mode 100644 index be844209ba..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvClassResult.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; -import java.util.List; - -public class NvClassResult extends CountableResultParent implements Serializable { - private static final long serialVersionUID = -6467238911654770388L; - - @JsonCreator - public NvClassResult(@JsonProperty("name") String name) { - super(name); - } - - @Override - @JsonGetter("profiles") - public List getResults() { - return super.getResults(); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResult.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResult.java deleted file mode 100644 index 48dbed6f6e..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResult.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.hpe.application.automation.tools.nv.model.NvProfileDTO; - -import java.io.Serializable; -import java.util.*; - -public class NvJUnitResult implements Serializable { - private static final long serialVersionUID = 74133989369447160L; - - private ArrayList profiles = new ArrayList<>(); - private Map results = new HashMap<>(); - - public ArrayList getProfiles() { - return profiles; - } - - public void setProfiles(ArrayList profiles) { - this.profiles = profiles; - } - - @JsonGetter("suites") - public List getResults() { - Collection values = results.values(); - if(values instanceof List) { - return (List)values; - } else { - return new ArrayList<>(values); - } - } - - @JsonSetter - public void setResults(List results) { - if (null != results) { - for (NvTestSuiteResult result : results) { - this.results.put(result.getName(), result); - } - } - } - - protected NvTestSuiteResult getNvTestSuiteResult(String testSuiteName) { - return results.get(testSuiteName); - } - - protected void addNvTestSuiteResult(NvTestSuiteResult testSuiteResult) { - results.put(testSuiteResult.getName(), testSuiteResult); - } - - public void tally() { - for (NvTestSuiteResult testSuiteResult : results.values()) { - testSuiteResult.tally(); - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResultsHandler.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResultsHandler.java deleted file mode 100644 index ce74dba18c..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvJUnitResultsHandler.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import com.fasterxml.jackson.databind.ObjectMapper; -import hudson.Launcher; -import hudson.model.AbstractBuild; -import hudson.model.BuildListener; -import hudson.tasks.junit.JUnitParser; -import hudson.tasks.junit.TestResult; -import com.hpe.application.automation.tools.nv.model.NvNetworkProfile; - -import java.io.File; -import java.io.IOException; -import java.util.Map; - -public class NvJUnitResultsHandler { - private final String JSON_FILE_NAME = "nvResult.json"; - - private String reportFilesPattern; - - private JUnitParser parser; - private NvResultsBuilder aggregator; - private ObjectMapper objectMapper; - - public NvJUnitResultsHandler(Map thresholdsMap, String reportFilesPattern) { - this.reportFilesPattern = reportFilesPattern; - - parser = new JUnitParser(true, true); - aggregator = new NvResultsBuilder(thresholdsMap); - objectMapper = new ObjectMapper(); - } - - public void handle(AbstractBuild build, Launcher launcher, BuildListener listener, NvNetworkProfile profile) throws IOException, InterruptedException { - TestResult testResult = parser.parseResult(reportFilesPattern, build, build.getWorkspace(), launcher, listener); - aggregator.aggregate(testResult, profile); - } - - public void finalizeResults(AbstractBuild build) throws IOException, InterruptedException { - NvJUnitResult result = aggregator.finalizeResults(); - writeResultToFile(build.getRootDir(), result); - mergeResults(build, result); - } - - private void writeResultToFile(File rootDir, NvJUnitResult result) throws IOException { - File resultFile = new File(rootDir, JSON_FILE_NAME); - objectMapper.writeValue(resultFile, result); - } - - private void mergeResults(AbstractBuild build, NvJUnitResult result) throws IOException, InterruptedException { - NvResultsMerger.mergeResults(build, reportFilesPattern, result); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvProfileResult.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvProfileResult.java deleted file mode 100644 index 46ddfbadb4..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvProfileResult.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; -import java.util.List; - -public class NvProfileResult extends CountableResultParent implements Serializable { - private static final long serialVersionUID = 3715288208838494758L; - - @JsonCreator - public NvProfileResult(@JsonProperty("name") String name) { - super(name); - } - - @Override - @JsonGetter("tests") - public List getResults() { - return super.getResults(); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsBuilder.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsBuilder.java deleted file mode 100644 index f36214859d..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsBuilder.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import hudson.tasks.junit.CaseResult; -import hudson.tasks.junit.SuiteResult; -import hudson.tasks.junit.TestResult; -import com.hpe.application.automation.tools.nv.model.NvNetworkProfile; - -import java.util.Map; - -public class NvResultsBuilder { - private static final String ERROR_MESSAGE = "Failed by HPE Network Virtualization. Reason: duration (%s) > threshold (%s)"; - private static final String ASSERTION_EXCEPTION_CLASS_NAME = AssertionError.class.getName(); - - private Map thresholdsMap; - private NvJUnitResult result = new NvJUnitResult(); - private boolean finalized; - - public NvResultsBuilder(Map thresholdsMap) { - this.thresholdsMap = thresholdsMap; - } - - public void aggregate(TestResult testResult, NvNetworkProfile profile) { - result.getProfiles().add(profile.toDTO()); - - Float threshold; - for (SuiteResult suiteResult : testResult.getSuites()) { - for (CaseResult caseResult : suiteResult.getCases()) { - NvTestCaseResult testCaseResult = new NvTestCaseResult(caseResult.getName()); - testCaseResult.setDuration(caseResult.getDuration()); - threshold = getThreshold(caseResult.getClassName(), caseResult.getName()); - if (null != threshold && caseResult.isPassed()) { - testCaseResult.setThreshold(threshold); - if (caseResult.getDuration() > threshold) { - testCaseResult.setFailed(); - testCaseResult.setErrorMessage(String.format(ERROR_MESSAGE, caseResult.getDuration(), threshold)); - testCaseResult.setErrorStackTrace(""); - } else { - testCaseResult.setPassed(); - } - } else { - if (caseResult.isFailed()) { - if (checkFailedException(caseResult.getErrorStackTrace())) { - testCaseResult.setFailed(); - } else { - testCaseResult.setError(); - } - testCaseResult.setErrorMessage(caseResult.getErrorDetails()); - testCaseResult.setErrorStackTrace(caseResult.getErrorStackTrace()); - } else if (caseResult.isSkipped()) { - testCaseResult.setSkipped(); - } else { - testCaseResult.setPassed(); - } - } - - NvProfileResult profileResult = getTestCaseParent(suiteResult.getName(), caseResult.getClassName(), profile.getProfileName()); - profileResult.addResult(testCaseResult); - } - } - } - - public NvJUnitResult finalizeResults() { - if (!finalized) { - result.tally(); - finalized = true; - } - - return result; - } - - private NvProfileResult getTestCaseParent(String testSuiteName, String className, String profileName) { - NvTestSuiteResult nvTestSuiteResult = result.getNvTestSuiteResult(testSuiteName); - if (null == nvTestSuiteResult) { - nvTestSuiteResult = new NvTestSuiteResult(testSuiteName); - result.addNvTestSuiteResult(nvTestSuiteResult); - NvClassResult nvClassResult = new NvClassResult(className); - nvTestSuiteResult.addResult(nvClassResult); - NvProfileResult nvProfileResult = new NvProfileResult(profileName); - nvClassResult.addResult(nvProfileResult); - return nvProfileResult; - } - - NvClassResult nvClassResult = nvTestSuiteResult.getResult(className); - if (null == nvClassResult) { - nvClassResult = new NvClassResult(className); - nvTestSuiteResult.addResult(nvClassResult); - NvProfileResult nvProfileResult = new NvProfileResult(profileName); - nvClassResult.addResult(nvProfileResult); - return nvProfileResult; - } - - NvProfileResult nvProfileResult = nvClassResult.getResult(profileName); - if (null == nvProfileResult) { - nvProfileResult = new NvProfileResult(profileName); - nvClassResult.addResult(nvProfileResult); - return nvProfileResult; - } - - return nvProfileResult; - } - - private Float getThreshold(String className, String testCaseName) { - if (null == thresholdsMap) { - return null; - } else { - Float threshold = thresholdsMap.get(className + "." + testCaseName); - if(null == threshold) { // fetch default threshold if exists, null otherwise - threshold = thresholdsMap.get("default"); - } - return threshold; - } - } - - private boolean checkFailedException(String stackTrace) { - return stackTrace.startsWith(ASSERTION_EXCEPTION_CLASS_NAME); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java deleted file mode 100644 index 6e2703d87b..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvResultsMerger.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import hudson.FilePath; -import hudson.model.AbstractBuild; -import hudson.remoting.VirtualChannel; -import org.jdom2.Document; -import org.jdom2.Element; -import org.jdom2.JDOMException; -import org.jdom2.input.SAXBuilder; -import org.jdom2.output.Format; -import org.jdom2.output.XMLOutputter; -import org.jenkinsci.remoting.RoleChecker; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.*; - -public class NvResultsMerger { - - public static void mergeResults(AbstractBuild build, String reportFilesPattern, NvJUnitResult result) throws IOException, InterruptedException { - FilePath workspace = build.getWorkspace(); - FilePath[] files = workspace.list(reportFilesPattern); - //TODO- itay: filter files according build time - for (FilePath file : files) { - file.act(new MergeFileCallable(result)); - } - } - - public static class MergeFileCallable implements FilePath.FileCallable { - private static final long serialVersionUID = 1498088030227367799L; - - private NvJUnitResult result; - - public MergeFileCallable(NvJUnitResult result) { - this.result = result; - } - - @Override - public Void invoke(File file, VirtualChannel channel) throws IOException, InterruptedException { - SAXBuilder saxBuilder = new SAXBuilder(); - Document document; - try { - document = saxBuilder.build(file); - } catch (JDOMException e) { - e.printStackTrace(); - return null; - } - Element rootElement = document.getRootElement(); - - for (Element suiteElement : getSuiteElements(rootElement)) { - updateSuiteElement(suiteElement); - replaceTestCaseElements(suiteElement); - } - - document.setContent(rootElement); - - FileWriter writer = null; - try { - writer = new FileWriter(file); - XMLOutputter xmlOutputter = new XMLOutputter(); - xmlOutputter.setFormat(Format.getPrettyFormat()); - xmlOutputter.output(document, writer); - writer.close(); - } catch (IOException e) { - e.printStackTrace(); - - if(null != writer) { - writer.close(); - } - } finally { - if (writer != null) { - writer.close(); - } - } - - return null; - } - - @Override - public void checkRoles(RoleChecker roleChecker) throws SecurityException { - // do nothing - } - - private Collection getSuiteElements(Element rootElement) { - Collection result = new ArrayList<>(); - - if (isSuiteElement(rootElement)) { - result.add(rootElement); - } else { - for (Element element : rootElement.getChildren()) { - if (isSuiteElement(element)) { - result.add(element); - } - } - } - - return result; - } - - private void replaceTestCaseElements(Element suiteElement) { - suiteElement.removeChildren(JUnitXmlConstants.TEST_ELEMENT); - - List newTcElements = new ArrayList<>(); - for (NvClassResult classResult : result.getNvTestSuiteResult(suiteElement.getAttribute(JUnitXmlConstants.SUITE_ELEMENT_ATTR_NAME).getValue()).getResults()) { - for (NvProfileResult profileResult : classResult.getResults()) { - for (NvTestCaseResult testCaseResult : profileResult.getResults()) { - newTcElements.add(XmlTestCaseElementCreator.create(classResult.getName(), profileResult.getName(), testCaseResult)); - } - } - } - - Collections.sort(newTcElements, new Comparator() { - @Override - public int compare(Element o1, Element o2) { - if (o1 == o2) { - return 0; - } - if (o1 == null) { - return -1; - } - if (o2 == null) { - return 1; - } - int classComp = o1.getAttribute(JUnitXmlConstants.TEST_ELEMENT_ATTR_CLASS).getValue().compareToIgnoreCase(o2.getAttribute(JUnitXmlConstants.TEST_ELEMENT_ATTR_CLASS).getValue()); - if (classComp == 0) { - return o1.getAttribute(JUnitXmlConstants.TEST_ELEMENT_ATTR_NAME).getValue().compareToIgnoreCase(o2.getAttribute(JUnitXmlConstants.TEST_ELEMENT_ATTR_NAME).getValue()); - } - return classComp; - } - }); - - suiteElement.addContent(newTcElements); - } - - private boolean isSuiteElement(Element element) { - return element.getName().equals(JUnitXmlConstants.SUITE_ELEMENT); - } - - private void updateSuiteElement(Element suiteElement) { - String suiteName = suiteElement.getAttribute(JUnitXmlConstants.SUITE_ELEMENT_ATTR_NAME).getValue(); - NvTestSuiteResult nvSuiteResult = result.getNvTestSuiteResult(suiteName); - if (null != nvSuiteResult) { - suiteElement.setAttribute(JUnitXmlConstants.SUITE_ELEMENT_ATTR_TIME, String.valueOf(nvSuiteResult.getDuration())); - suiteElement.setAttribute(JUnitXmlConstants.SUITE_ELEMENT_ATTR_SKIPS, String.valueOf(nvSuiteResult.getSkipCount())); - suiteElement.setAttribute(JUnitXmlConstants.SUITE_ELEMENT_ATTR_FAILS, String.valueOf(nvSuiteResult.getFailCount())); - suiteElement.setAttribute(JUnitXmlConstants.SUITE_ELEMENT_ATTR_ERRORS, String.valueOf(nvSuiteResult.getErrorCount())); - suiteElement.setAttribute(JUnitXmlConstants.SUITE_ELEMENT_ATTR_TESTS, String.valueOf( - nvSuiteResult.getSkipCount() + nvSuiteResult.getFailCount() + nvSuiteResult.getErrorCount() + nvSuiteResult.getPassCount())); - } - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestCaseResult.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestCaseResult.java deleted file mode 100644 index 396f2404c4..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestCaseResult.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; - -public class NvTestCaseResult extends CountableResult implements Serializable { - private static final long serialVersionUID = -5125059428661210112L; - - private float threshold; - private String errorMessage; - private String errorStackTrace; - - @JsonCreator - public NvTestCaseResult(@JsonProperty("name") String name) { - super(name); - } - - public float getThreshold() { - return threshold; - } - - public void setThreshold(float threshold) { - this.threshold = threshold; - } - - @JsonIgnore - public boolean isSkipped() { - return getSkipCount() > 0; - } - - @JsonIgnore - public void setSkipped() { - setSkipCount(1); - setFailCount(0); - setErrorCount(0); - setPassCount(0); - } - - @JsonIgnore - public boolean isFail() { - return getFailCount() > 0; - } - - @JsonIgnore - public void setFailed() { - setSkipCount(0); - setFailCount(1); - setErrorCount(0); - setPassCount(0); - } - - @JsonIgnore - public boolean isError() { - return getErrorCount() > 0; - } - - @JsonIgnore - public void setError() { - setSkipCount(0); - setFailCount(0); - setErrorCount(1); - setPassCount(0); - } - - @JsonIgnore - public boolean isPass() { - return getPassCount() > 0; - } - - @JsonIgnore - public void setPassed() { - setSkipCount(0); - setFailCount(0); - setErrorCount(0); - setPassCount(1); - } - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public String getErrorStackTrace() { - return errorStackTrace; - } - - public void setErrorStackTrace(String errorStackTrace) { - this.errorStackTrace = errorStackTrace; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestSuiteResult.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestSuiteResult.java deleted file mode 100644 index 4c1d7a57d7..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/NvTestSuiteResult.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; -import java.util.List; - -public class NvTestSuiteResult extends CountableResultParent implements Serializable { - private static final long serialVersionUID = 1938573757635316573L; - - @JsonCreator - public NvTestSuiteResult(@JsonProperty("name") String name) { - super(name); - } - - @Override - @JsonGetter("classes") - public List getResults() { - return super.getResults(); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/XmlTestCaseElementCreator.java b/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/XmlTestCaseElementCreator.java deleted file mode 100644 index d897e82531..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/nv/plugin/results/XmlTestCaseElementCreator.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - (c) Copyright [2016] Hewlett Packard Enterprise Development LP - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.hpe.application.automation.tools.nv.plugin.results; - -import org.jdom2.Element; - -public class XmlTestCaseElementCreator { - - public static Element create(String className, String profileName, NvTestCaseResult testCaseResult) { - Element element = new Element(JUnitXmlConstants.TEST_ELEMENT); - element.setAttribute(JUnitXmlConstants.TEST_ELEMENT_ATTR_NAME, testCaseResult.getName() + "_" + profileName.replace(" ", "")); - element.setAttribute(JUnitXmlConstants.TEST_ELEMENT_ATTR_CLASS, className); - element.setAttribute(JUnitXmlConstants.TEST_ELEMENT_ATTR_TIME, String.valueOf(testCaseResult.getDuration())); - if(testCaseResult.isSkipped()) { - element.addContent(createSkipped()); - } else if(testCaseResult.isFail()) { - element.addContent(createFailure(testCaseResult)); - } else if(testCaseResult.isError()) { - element.addContent(createError(testCaseResult)); - } - - return element; - } - - private static Element createSkipped() { - return new Element(JUnitXmlConstants.TEST_SKIP_ELEMENT); - } - - private static Element createFailure(NvTestCaseResult testCaseResult) { - Element element = new Element(JUnitXmlConstants.TEST_FAILURE_ELEMENT); - element.setAttribute(JUnitXmlConstants.TEST_FAILURE_ELEMENT_ATTR_MESSAGE, testCaseResult.getErrorMessage()); - element.setAttribute(JUnitXmlConstants.TEST_FAILURE_ELEMENT_ATTR_TYPE, extractErrorType(testCaseResult.getErrorStackTrace())); - element.setText(testCaseResult.getErrorStackTrace()); - - return element; - } - - private static Element createError(NvTestCaseResult testCaseResult) { - Element element = new Element(JUnitXmlConstants.TEST_ERROR_ELEMENT); - element.setAttribute(JUnitXmlConstants.TEST_ERROR_ELEMENT_ATTR_MESSAGE, testCaseResult.getErrorMessage()); - element.setAttribute(JUnitXmlConstants.TEST_ERROR_ELEMENT_ATTR_TYPE, extractErrorType(testCaseResult.getErrorStackTrace())); - element.setText(testCaseResult.getErrorStackTrace()); - - return element; - } - - private static String extractErrorType(String errorStack) { - if (null != errorStack && !errorStack.isEmpty()) { - return errorStack.substring(0, errorStack.indexOf(":")); - } else { - return ""; - } - } -} diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/config.jelly b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/config.jelly deleted file mode 100644 index 02e7d65ac1..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/config.jelly +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - -
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthIn.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthIn.html deleted file mode 100644 index 4307f037e3..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthIn.html +++ /dev/null @@ -1 +0,0 @@ -
    The maximum throughput through the network [in Kb per second], for data traveling from the server to the client.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthOut.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthOut.html deleted file mode 100644 index adbf18683e..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-bandwidthOut.html +++ /dev/null @@ -1 +0,0 @@ -
    The maximum throughput through the network [in Kb per second], for data traveling from the client to the server.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-latency.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-latency.html deleted file mode 100644 index 18ecf7b5e4..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-latency.html +++ /dev/null @@ -1 +0,0 @@ -
    The amount of time that it takes for an IP packet to travel across the network, from the client to the server, or from the server to a client. The actual network latency is the emulated latency plus any latency that exists in the actual network. The valid range is 0 to 8,000 msec.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-packet.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-packet.html deleted file mode 100644 index 074f9a0f16..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-packet.html +++ /dev/null @@ -1 +0,0 @@ -
    The percentage of IP packets that are sent through the network, but do not reach their destination. The valid range is 0 to 100%.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-profileName.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-profileName.html deleted file mode 100644 index f0612c5820..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvNetworkProfile/help-profileName.html +++ /dev/null @@ -1 +0,0 @@ -
    A unique name for the Network Profile, which is a set of parameters that define network impairments and conditions.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/config.jelly b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/config.jelly deleted file mode 100644 index 7a997e8561..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/config.jelly +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - -
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-nvPort.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-nvPort.html deleted file mode 100644 index 469a628cd6..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-nvPort.html +++ /dev/null @@ -1 +0,0 @@ -
    The port configured for the NV Test Manager host. Default: 8182
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-password.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-password.html deleted file mode 100644 index 472d005796..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-password.html +++ /dev/null @@ -1 +0,0 @@ -
    The password for connecting to the NV Test Manager host.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-proxyPort.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-proxyPort.html deleted file mode 100644 index bedf2fc658..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-proxyPort.html +++ /dev/null @@ -1 +0,0 @@ -
    If NV Test Manager proxy feature was enabled, set this port as the proxy port in the NV Test Manager host. Default: 8888
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverIp.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverIp.html deleted file mode 100644 index adae174c08..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverIp.html +++ /dev/null @@ -1 +0,0 @@ -
    The IP of the NV Test Manager host. The value must be a valid IPv4 address.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverName.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverName.html deleted file mode 100644 index 9050333205..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-serverName.html +++ /dev/null @@ -1 +0,0 @@ -
    A unique name for the NV Test Manager host.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-username.html b/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-username.html deleted file mode 100644 index b8d565ea30..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/model/NvServer/help-username.html +++ /dev/null @@ -1 +0,0 @@ -
    The username for connecting to the NV Test Manager host.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector/config.jelly b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector/config.jelly deleted file mode 100644 index 56f00c832e..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NetworkProfileSelector/config.jelly +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - -
    - -
    -
    - - -
    - -
    -
    - -
    diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/config.jelly deleted file mode 100644 index 2d50168151..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/config.jelly +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - -
    - - - -
    -
    - -
    - - - -
    -
    -
    - -
    - - - - - -
    -
    -
    - - -
    - - - - - - -
    -
    - - -
    -
    - Network Profiles - - - - -
    -
    -
    -
    - - -
    -
    - Steps to Run - - - - - - -
    -
    -
    -
    -
    - diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/global.jelly deleted file mode 100644 index d3880614e7..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/global.jelly +++ /dev/null @@ -1,31 +0,0 @@ - - - - - -
    -
    - NV Test Manager Hosts - - - - -
    -
    -
    -
    -
    - Custom Network Profiles - - - - -
    -
    -
    -
    -
    - -
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-envVariable.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-envVariable.html deleted file mode 100644 index 2eaa66ec5a..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-envVariable.html +++ /dev/null @@ -1 +0,0 @@ -
    Configure the proxy environment variable. It is the testing framework responsibility to configure the proxy accordingly
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-excludeServerIPs.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-excludeServerIPs.html deleted file mode 100644 index 416d81156d..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-excludeServerIPs.html +++ /dev/null @@ -1 +0,0 @@ -
    The associated network impairments and constraints will not be applied to network traffic between the client and the specified server IP addresses. Separate multiple IPs using a semi-colon ';'. Define an IP range of IPs using the minus sign '-', for example, 192.198.0.1-192.198.0.5.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-includeClientIPs.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-includeClientIPs.html deleted file mode 100644 index 101eb34dcd..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-includeClientIPs.html +++ /dev/null @@ -1 +0,0 @@ -
    The associated network impairments and constraints will be applied to network traffic between the specified client IP addresses. Separate multiple IPs using a semi-colon ';'. Define an IP range of IPs using the minus sign '-', for example, 192.198.0.1-192.198.0.5.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-profileNames.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-profileNames.html deleted file mode 100644 index ccab875651..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-profileNames.html +++ /dev/null @@ -1 +0,0 @@ -
    Specify
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-reportFiles.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-reportFiles.html deleted file mode 100644 index c8e1140318..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-reportFiles.html +++ /dev/null @@ -1 +0,0 @@ -
    Specify the path to the JUnit report files, relative to the workspace root. Value must be an Ant 'fileset' pattern. Default: **/TEST-*.xml
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-thresholdsFile.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-thresholdsFile.html deleted file mode 100644 index 1655716340..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-thresholdsFile.html +++ /dev/null @@ -1,3 +0,0 @@ -
    Specify the path to a text file containing the tests' thresholds. Each line represents a threshold for a specific test. - The structure of each line should be: <fully qualified class name>,<test name>,<positive floating number threshold>. A default value can also be provided for all the tests. - The plugin will use the contents of this file to mark tests as failed. The plugin will fail a test if the duration of the test is greater than the specified threshold (or the default threshold, if none was provided).
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-useProxyCheckbox.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-useProxyCheckbox.html deleted file mode 100644 index ab4f3531ed..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help-useProxyCheckbox.html +++ /dev/null @@ -1 +0,0 @@ -
    Select this check box if the NV Test Manager host should be used as a proxy, for example, if NV Test Manager is installed on a remote machine and/or uses a secure connection.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help.html b/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help.html deleted file mode 100644 index 21cd7f885a..0000000000 --- a/src/main/resources/com/hpe/application/automation/tools/nv/plugin/NvEmulationBuilder/help.html +++ /dev/null @@ -1 +0,0 @@ -
    Use HPE Network Virtualization to apply network profiles that emulate real-world network environments when testing your app.
    \ No newline at end of file diff --git a/src/main/resources/lib/nv/default_profiles.txt b/src/main/resources/lib/nv/default_profiles.txt deleted file mode 100644 index 98d53aa0b1..0000000000 --- a/src/main/resources/lib/nv/default_profiles.txt +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "profileName" : "No Emulation", - "latency" : "0", - "packet" : "0", - "bandwidthIn" : "UNRESTRICTED", - "bandwidthOut" : "UNRESTRICTED" - }, { - "profileName" : "2.5G Busy", - "latency" : "300", - "packet" : "0.5", - "bandwidthIn" : "KBPS128", - "bandwidthOut" : "KBPS56" - }, { - "profileName" : "3G Busy", - "latency" : "200", - "packet" : "0.5", - "bandwidthIn" : "KBPS512", - "bandwidthOut" : "KBPS128" - }, { - "profileName" : "3G Good", - "latency" : "80", - "packet" : "0", - "bandwidthIn" : "KBPS2048", - "bandwidthOut" : "KBPS512" - }, { - "profileName" : "3G Typical", - "latency" : "120", - "packet" : "0.5", - "bandwidthIn" : "KBPS512", - "bandwidthOut" : "KBPS256" - }, { - "profileName" : "4G Good", - "latency" : "40", - "packet" : "0", - "bandwidthIn" : "KBPS10240", - "bandwidthOut" : "KBPS8192" - } -] From e7559b7bfb2e2525c202eda338bbabbe56d6f613 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 1 Nov 2017 17:05:08 +0200 Subject: [PATCH 0171/2502] SRF tunnel fix --- .../tools/run/CreateTunnelBuilder.java | 115 ++++++++---------- .../tools/run/RunFromSrfBuilder.java | 2 +- .../SrfServerSettingsBuilder/global.jelly | 5 +- 3 files changed, 55 insertions(+), 67 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index e07820977c..1ff9c3a9cb 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -51,84 +51,71 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, throws InterruptedException, IOException { logger = listener.getLogger(); JSONObject connectionData = RunFromSrfBuilder.GetSrfConnectionData(build, logger); - String[] s = new String[5] ; - URL url = new URL(connectionData.getString("server")); - //check if tunnel exist - String server = url.getHost() + ":443" ; + JSONObject configData; + String client = "\"" +"-client=" + connectionData.getString("app") +"\""; - if(server.indexOf("-ftaas") < 0) - server= "opb-" + server; - else - server = server.replaceFirst("-ftaas", "-tunnel-ftaas"); - server ="\"" +"-server=wss://" + server + "/opb\"" ; - String client = "\"" +"-client=" + connectionData.getString("app") +"\""; - String secret ="\"" + "-secret="+ connectionData.getString("secret")+"\""; - s[2]=secret; + String path =connectionData.getString("tunnel"); + String config = String.format("-\"config=%s\"", srfTunnelName); - String name = "-name=" + srfTunnelName; - - String config = "\"-config="+srfTunnelName+"\""; - - URL proxyUrl ; - try { - proxyUrl =new URL(connectionData.getString("proxy")); - } - catch (MalformedURLException e){ - proxyUrl = new URL("http://"+connectionData.getString("proxy")); - } - String proxy = "\"" + "-http-proxy=" + proxyUrl.toString() +"\"" ; - s[4] = proxy; - String path =connectionData.getString("tunnel"); + ProcessBuilder pb = new ProcessBuilder(path, config, "-reconnect-attempts=3", "-log-level=info", "-log=stdout"); + pb.redirectOutput(); + logger.println("Launching "+path + " " + config ); + Process p = pb.start(); + TunnelTracker tracker = new TunnelTracker(logger, p); + java.lang.Thread th = new Thread(tracker, "trackeer"); + Tunnels.add(p); + InputStream is = p.getInputStream(); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + String line; - ProcessBuilder pb = new ProcessBuilder(path, config, "\"-log-level=INFO\"","\"-log=stdout\""); - logger.println("Launching "+path + " " + config ); + while(true){ - Process p = pb.start(); - TunnelTracker tracker = new TunnelTracker(logger, p); - java.lang.Thread th = new Thread(tracker, "trackeer"); - Tunnels.add(p); + while ((line = br.readLine()) != null) { + logger.println(line); + if(line.indexOf("established at") >=0){ + th.start(); + logger.println("Launched "+path); + return true; + } + Thread.sleep(100); + if(p.isAlive()) { + continue; + } + switch (p.exitValue()) { + case 0: + logger.println("Tunnel client terminated by the user or the server"); + return true; + case 1: + logger.println("Failed to launch tunnel client : unplanned failure"); + break; + case 2: + logger.println("Failed to launch tunnel client : Authentication with client/secret failed"); + break; + case 3: + logger.println("Failed to launch tunnel client : Max connection attempts acceded "); + break; + case 4: + logger.println("Failed to launch tunnel client : Allocation of tunnel filed E.g. Tunnel name is not unique."); + break; + default: + logger.println(String.format("Failed to launch tunnel client : Unknown reason(Exit code =%d", p.exitValue())); + break; - InputStream is = p.getInputStream(); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - String line; - Timer t = new Timer(); - Date date = new Date(); - while(true){ - Date current = new Date(); - long diffSeconds = (current.getTime() - date.getTime())/1000; - if(diffSeconds > 30){ - p.destroy(); - logger.println("Failed to launch "+path); - Tunnels.remove(p); - return false; - } + } - while ((line = br.readLine()) != null) { - logger.println(line); - if(line.indexOf("established at") >=0) - break; - Thread.sleep(100); - diffSeconds = (current.getTime() - date.getTime())/1000; - if(diffSeconds > 30){ p.destroy(); - logger.println("Failed to launch "+path); return false; - } - } - break; - } - - th.start(); + } + } - return true; -} + } private JSONObject GetSrfConnectionData(){ return new JSONObject(); } @@ -235,4 +222,4 @@ public void run() { -} +} \ No newline at end of file diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java index e41aa7f261..a15d4d0378 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java @@ -368,7 +368,7 @@ private void FillExecutionReqBody() throws IOException{ } if (srfTunnelName != null && srfTunnelName.length() > 0) { - testParams.put("tunnelName", srfTunnelName); + data.put("tunnelName", srfTunnelName); } if(data.size() == 0){ throw new IOException("Wrong filter"); diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly index d4b95e5143..81e33c801b 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly @@ -74,8 +74,6 @@ else btn.disabled=false; anchor.innerText = btn.id; -// if (btn.onclick == undefined) -// btn.addEventListener("click", srfClick); window.srfAddButton = btn; } @@ -161,3 +159,6 @@ + + + From e04137c313a7618c1561ba3d758e2b4c60f75607 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 2 Nov 2017 10:40:30 +0200 Subject: [PATCH 0172/2502] SRF tunnel fix --- .../tools/run/CreateTunnelBuilder.java | 59 +++++++++++-------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index 1ff9c3a9cb..ec7583233f 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -82,10 +82,15 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, return true; } Thread.sleep(100); - if(p.isAlive()) { + int exitVal = 0; + try{ + exitVal = p.exitValue(); + } + catch (Exception e){ continue; } - switch (p.exitValue()) { + + switch (exitVal) { case 0: logger.println("Tunnel client terminated by the user or the server"); return true; @@ -194,28 +199,36 @@ public TunnelTracker(PrintStream log, Process p){ } @Override public void run() { - try{ - //Read out dir output - logger.println("In tracker!"); - InputStream is = p.getInputStream(); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - String line; - while ((line = br.readLine())!= null){ - // logger.println(line); + logger.println("In tracker!"); + int exitValue =0; + while(true) { + try { + //Read out dir output + InputStream is = p.getInputStream(); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + String line; + while ((line = br.readLine()) != null) { + // logger.println(line); + } + try { + exitValue = p.exitValue(); + break; + } catch (Exception e) { + continue; + } + } catch (Exception e) { + logger.print(e.getMessage()); + } + //Wait to get exit value + try { + + p.waitFor(); + logger.println("\n\nExit Value is " + exitValue); + } catch (final InterruptedException e) { + p.destroy(); + return; } - } - catch (Exception e){ - logger.print(e.getMessage()); - } - //Wait to get exit value - try { - int exitValue =0; - p.waitFor(); - logger.println("\n\nExit Value is " + exitValue); - } catch (final InterruptedException e) { - p.destroy(); - return; } } } From 2c5a3d6d1b2d82a27db3d2010e7031e6b9c4c55e Mon Sep 17 00:00:00 2001 From: Noam Doron Date: Thu, 2 Nov 2017 11:05:32 +0200 Subject: [PATCH 0173/2502] Fixed defect #39019 [Jenkins Plugin]: executing a test using test ID stopped working - Test aborted, no env found (Reviewed by Vlad) --- .../hpe/application/automation/tools/run/RunFromSrfBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java index e41aa7f261..77788413f8 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java @@ -361,7 +361,7 @@ private void FillExecutionReqBody() throws IOException{ JSONObject testParams = new JSONObject(); JSONObject ciParameters = new JSONObject(); if (srfTestId != null && srfTestId.length() > 0) { - data.put("yac", ApplyJobParams(srfTestId)); + data.put("testYac", ApplyJobParams(srfTestId)); } else { String[] tagNames = ApplyJobParams(srfTagNames).split(","); data.put("tags", tagNames); From 358da32cc929bc67e19bec0f0860eb2ba550b56c Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 31 Oct 2017 14:51:40 +0200 Subject: [PATCH 0174/2502] Integration improvements (#53) * user story #476010 : Improve integration with StormRunnerLoad - add external report * defect #477085 : Octane-UFT integration : if data table file extension is in upper case - it is not discovered by discovery job * defect 476068 : localized UFT test cannot be discovered --- pom.xml | 2 +- .../octane/executor/UFTTestDetectionService.java | 3 ++- .../tools/octane/tests/junit/JUnitExtension.java | 14 ++++++++++++++ .../octane/tests/junit/JUnitXmlIterator.java | 15 ++++++++++++--- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 726db61d86..d23b0e620d 100644 --- a/pom.xml +++ b/pom.xml @@ -431,7 +431,7 @@ mqm-rest-client com.hpe.adm.octane.ciplugins - 1.4.20 + 1.4.22 diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java index a4024cf20c..ec33f6fb34 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -359,7 +359,8 @@ private static ScmResourceFile createDataTable(FilePath root, FilePath path) { } private static boolean isUftDataTableFile(String path) { - return path.endsWith(XLSXExtention) || path.endsWith(XLSExtention); + String loweredPath = path.toLowerCase(); + return loweredPath.endsWith(XLSXExtention) || loweredPath.endsWith(XLSExtention); } private static UftTestType isUftTestFolder(List paths) { diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java index c0d3640a15..4dfa1faa5a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java @@ -42,6 +42,10 @@ import javax.xml.stream.XMLStreamException; import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.*; /** @@ -201,6 +205,16 @@ public GetJUnitTestResults( Run build, List reports, boolean str } additionalContext = testFolderNames; } + if (HPRunnerType.StormRunner.equals(hpRunnerType)) { + try { + File file = new File(build.getRootDir(), "log"); + Path path = Paths.get(file.getPath()); + List lines = Files.readAllLines(path, StandardCharsets.UTF_8); + additionalContext = lines; + } catch (Exception e) { + logger.error("Failed to add log file for StormRunner :" + e.getMessage()); + } + } } @Override diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index e5bfe19030..0536c4af49 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -37,6 +37,7 @@ import java.io.InputStream; import java.text.DecimalFormat; import java.text.ParseException; +import java.util.Collection; import java.util.List; import java.util.Set; @@ -192,11 +193,19 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I //if UFT didn't created test results page - add reference to Jenkins test results page externalURL = jenkinsRootUrl + "job/" + jobName + "/" + buildId + "/testReport/" + myPackageName + "/" + jenkinsTestClassFormat(myClassName) + "/" + jenkinsTestNameFormat(myTestName) + "/"; } - } else if (hpRunnerType.equals(HPRunnerType.PerformanceCenter)) { externalURL = jenkinsRootUrl + "job/" + jobName + "/" + buildId + "/artifact/performanceTestsReports/pcRun/Report.html"; - } - } else if ("duration".equals(localName)) { // NON-NLS + } else if (hpRunnerType.equals(HPRunnerType.StormRunner)) { + String VIEW_REPORT_PREFIX = "View Report: "; + if (additionalContext != null && additionalContext instanceof Collection) { + for (Object str : (Collection) additionalContext) { + if (str != null && str instanceof String && ((String) str).startsWith(VIEW_REPORT_PREFIX)) { + externalURL = str.toString().replace(VIEW_REPORT_PREFIX, ""); + } + } + } + } + } else if ("duration".equals(localName)) { // NON-NLS duration = parseTime(readNextValue()); } else if ("skipped".equals(localName)) { // NON-NLS if ("true".equals(readNextValue())) { // NON-NLS From b560d4740eec1621f3b12e4072184ab4c63e1dc8 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 12 Nov 2017 13:35:51 +0200 Subject: [PATCH 0175/2502] Fix command line when launching the tunnel client --- .../automation/tools/run/CreateTunnelBuilder.java | 10 +++++++--- .../settings/SrfServerSettingsBuilder/global.jelly | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index ec7583233f..95a55fe51b 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -52,17 +52,21 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, logger = listener.getLogger(); JSONObject connectionData = RunFromSrfBuilder.GetSrfConnectionData(build, logger); JSONObject configData; - String client = "\"" +"-client=" + connectionData.getString("app") +"\""; + String client = "-client=" + connectionData.getString("app") ; String path =connectionData.getString("tunnel"); - String config = String.format("-\"config=%s\"", srfTunnelName); + String config = String.format("-config=\"%s\"", srfTunnelName); ProcessBuilder pb = new ProcessBuilder(path, config, "-reconnect-attempts=3", "-log-level=info", "-log=stdout"); pb.redirectOutput(); logger.println("Launching "+path + " " + config ); + String[] cmdArray = { path, config, "-reconnect-attempts=3", "-log-level=info", "-log=stdout"}; + //Process p = pb.start(); + Process p = Runtime.getRuntime().exec(cmdArray); + + - Process p = pb.start(); TunnelTracker tracker = new TunnelTracker(logger, p); java.lang.Thread th = new Thread(tracker, "trackeer"); Tunnels.add(p); diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly index 81e33c801b..3ba9c71f6c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly @@ -142,7 +142,7 @@
    - +
    From 3eaaaeb50785f5a43c55441cea26b24af3284e4f Mon Sep 17 00:00:00 2001 From: Tom V Date: Sun, 12 Nov 2017 14:45:55 +0200 Subject: [PATCH 0176/2502] u.s #450005 - [tech] Collect coverage report of JaCoCo from Jenkins and send them to Octane (+including remote such as slaves) + queue in Jenkins. (#56) --- pom.xml | 4 +- .../tools/octane/AbstractResultQueueImpl.java | 12 +- .../automation/tools/octane/ResultQueue.java | 19 +- .../octane/actions/CoveragePublisher.java | 166 +++++++++++++ .../coverage/CoveragePublisherAction.java | 97 ++++++++ .../actions/coverage/CoverageService.java | 131 ++++++++++ .../octane/executor/CoverageReportsQueue.java | 41 ++++ .../tests/CoverageReportsDispatcher.java | 229 ++++++++++++++++++ .../tools/octane/Messages.properties | 3 + .../actions/CoveragePublisher/config.jelly | 24 ++ .../CoveragePublisher/config.properties | 25 ++ .../tools/octane/tests/TestQueue.java | 11 + 12 files changed, 758 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/CoveragePublisher.java create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoveragePublisherAction.java create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoverageService.java create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/executor/CoverageReportsQueue.java create mode 100644 src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java create mode 100644 src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.properties diff --git a/pom.xml b/pom.xml index d23b0e620d..a57e30f424 100644 --- a/pom.xml +++ b/pom.xml @@ -393,9 +393,9 @@ com.hpe.adm.octane.ciplugins 1.4.13 - + - + com.hpe.nv hpe-nv-java-api diff --git a/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java index 6bc4cc3b48..7dd1b0846c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java @@ -92,6 +92,11 @@ public synchronized void add(String projectName, int buildNumber) { queue.add(new QueueItem(projectName, buildNumber)); } + @Override + public synchronized void add(String projectName, String type, int buildNumber) { + queue.add(new QueueItem(projectName, type, buildNumber)); + } + public int size() { return queue.size(); } @@ -126,7 +131,7 @@ public void toStream(QueueItem item, OutputStream bytes) throws IOException { } private static QueueItem objectFromJson(JSONObject json) { - return json.containsKey("workspace") ? + QueueItem queueItem = json.containsKey("workspace") ? new QueueItem( json.getString("project"), json.getInt("build"), @@ -136,6 +141,10 @@ private static QueueItem objectFromJson(JSONObject json) { json.getString("project"), json.getInt("build"), json.getInt("count")); + if (json.containsKey("type")) { + queueItem.setType(json.getString("type")); + } + return queueItem; } private static JSONObject jsonFromObject(QueueItem item) { @@ -144,6 +153,7 @@ private static JSONObject jsonFromObject(QueueItem item) { json.put("build", item.buildNumber); json.put("count", item.failCount); json.put("workspace", item.workspace); + json.put("type", item.type); return json; } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java b/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java index 2e71aa50d8..8c716df536 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java @@ -29,22 +29,35 @@ public interface ResultQueue { void add(String projectName, int buildNumber); + void add(String projectName, String type, int buildNumber); + void add(String projectName, int buildNumber, String workspace); void clear(); class QueueItem implements Serializable { private static final long serialVersionUID = 1; - + public String type; String projectName; int buildNumber; String workspace; int failCount; + + public void setType(String type) { + this.type = type; + } + + public QueueItem(String projectName, int buildNumber) { this(projectName, buildNumber, 0); } + public QueueItem(String projectName, String type, int buildNumber) { + this(projectName, buildNumber, 0); + this.type = type; + } + public QueueItem(String projectName, int buildNumber, String workspace) { this(projectName, buildNumber, 0); this.workspace = workspace; @@ -63,6 +76,10 @@ public QueueItem(String projectName, int buildNumber, String workspace) { this.workspace = workspace; } + public String getType() { + return type; + } + public int incrementFailCount() { return this.failCount++; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/CoveragePublisher.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/CoveragePublisher.java new file mode 100644 index 0000000000..3bfeb56206 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/CoveragePublisher.java @@ -0,0 +1,166 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.actions; +import com.hpe.application.automation.tools.octane.Messages; +import com.hpe.application.automation.tools.octane.actions.coverage.CoveragePublisherAction; +import com.hpe.application.automation.tools.octane.actions.coverage.CoverageService; +import com.hpe.application.automation.tools.octane.tests.CoverageReportsDispatcher; +import hudson.Extension; +import hudson.ExtensionList; +import hudson.FilePath; +import hudson.Launcher; +import hudson.model.AbstractBuild; +import hudson.model.AbstractProject; +import hudson.model.BuildListener; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.BuildStepMonitor; +import hudson.tasks.Publisher; +import hudson.tasks.Recorder; +import hudson.util.FormValidation; +import jenkins.model.Jenkins; +import org.kohsuke.stapler.AncestorInPath; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; + +import javax.servlet.ServletException; +import java.io.IOException; + +/** + * Post-build action that collects the coverage reports from workspace + * the reports that matches a specified regular expression path, are copied to + * the build folder for future upload. + */ +public class CoveragePublisher extends Recorder { + private final String jacocoPathPattern; + private final String lcovPathPattern; + /** + * this ctor is being called from configuration page. + * the jacocoPathPattern is being injected from the web page text box + * @param jacocoPathPattern regular expression path for coverage reports + */ + @DataBoundConstructor + public CoveragePublisher(String jacocoPathPattern, String lcovPathPattern) { + // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" + this.jacocoPathPattern = jacocoPathPattern == null || jacocoPathPattern.isEmpty() ? CoverageService.Jacoco.JACOCO_DEFAULT_PATH : jacocoPathPattern; + this.lcovPathPattern = lcovPathPattern == null || lcovPathPattern.isEmpty() ? CoverageService.Lcov.LCOV_DEFAULT_PATH : lcovPathPattern; + } + + /** + * this method used for serialization & deserialization of path + * @return jacoco path + */ + public String getJacocoPathPattern() { + return jacocoPathPattern; + } + + /** + * this method used for serialization & deserialization of path + * @return lcov path + */ + public String getLcovPathPattern() { + return lcovPathPattern; + } + + /** + * this is where we build the project. this method is being called when we run the build + * @param build instance + * @param launcher instance + * @param listener for action attachment + * @return status + */ + @Override + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { + boolean copyReportsToBuildFolderStatus = false; + ExtensionList extensionList = Jenkins.getInstance().getExtensionList(CoverageReportsDispatcher.class); + if (extensionList == null || extensionList.size() == 0) { + return false; + } + // copy coverage reports + CoveragePublisherAction action = new CoveragePublisherAction(build, listener); + build.addAction(action); + if (action.copyCoverageReportsToBuildFolder(jacocoPathPattern, CoverageService.Jacoco.JACOCO_DEFAULT_FILE_NAME)) { + extensionList.get(0).enqueueTask(build.getProject().getFullName(), build.getNumber(), CoverageService.Jacoco.JACOCO_TYPE); + copyReportsToBuildFolderStatus = true; + } + if (action.copyCoverageReportsToBuildFolder(lcovPathPattern, CoverageService.Lcov.LCOV_DEFAULT_FILE_NAME)) { + extensionList.get(0).enqueueTask(build.getProject().getFullName(), build.getNumber(), CoverageService.Lcov.LCOV_TYPE); + copyReportsToBuildFolderStatus |= true; + } + // add upload task to queue + return copyReportsToBuildFolderStatus; + } + + /** + * bound between descriptor to publisher + * @return descriptor + */ + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl) super.getDescriptor(); + } + + /** + * Returns BuildStepMonitor.NONE by default, as Builders normally don't depend on its previous result + * @return monitor + */ + @Override + public BuildStepMonitor getRequiredMonitorService() { + return BuildStepMonitor.NONE; + } + + /** + * The Publisher object or Recorder is the base. + * It needs a BuildStepDescriptor to provide certain information to Jenkins + */ + @Extension + public static final class DescriptorImpl extends BuildStepDescriptor { + + public DescriptorImpl() { + load(); + } + + /** + * Indicates that this builder can be used with all kinds of project types + * @param aClass that describe the job + * @return always true, indicate that this post build action suitable for all jenkins jobs + */ + public boolean isApplicable(Class aClass) { + return true; // so that it will also be available for maven & other projects + } + + public String getDisplayName() { + return "HPE ALM Octane code coverage publisher"; + } + + public FormValidation doCheckJacocoPathPattern(@AncestorInPath AbstractProject project, @QueryParameter String value) throws IOException, ServletException { + if (value == null || value.isEmpty()) { + return FormValidation.warning(Messages.CoverageResultsActionEmptyConfigurationWarning(), CoverageService.Jacoco.JACOCO_DEFAULT_PATH); + } else if (project == null) { + return FormValidation.ok(); + } + return FilePath.validateFileMask(project.getSomeWorkspace(), value); + } + public FormValidation doCheckLcovPathPattern(@AncestorInPath AbstractProject project, @QueryParameter String value) throws IOException, ServletException { + if (value == null || value.isEmpty()) { + return FormValidation.warning(Messages.CoverageResultsActionEmptyConfigurationWarning(), CoverageService.Lcov.LCOV_DEFAULT_PATH); + } else if (project == null) { + return FormValidation.ok(); + } + return FilePath.validateFileMask(project.getSomeWorkspace(), value); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoveragePublisherAction.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoveragePublisherAction.java new file mode 100644 index 0000000000..f3ae2d19bd --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoveragePublisherAction.java @@ -0,0 +1,97 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.actions.coverage; + +import hudson.model.AbstractBuild; +import hudson.model.Action; +import hudson.model.BuildListener; + +import java.io.File; +import java.util.ArrayList; + +/** + * this action initiate a copy of all coverage reports from workspace to build folder. + * the files are calculated by a pattern that the user enters in job configuration page + */ +public class CoveragePublisherAction implements Action { + private final AbstractBuild build; + + public CoveragePublisherAction(AbstractBuild build, BuildListener listener) { + this.build = build; + CoverageService.setListener(listener); + } + + /** + * this method copy all reports from specified path pattern + * @return true if files have been copied, otherwise return false + */ + public boolean copyCoverageReportsToBuildFolder(String filePattern, String defaultFileName) { + try { + CoverageService.log("start copying coverage report to build folder, using file patten of " + filePattern); + String[] files = CoverageService.getCoverageFiles(build.getWorkspace(), filePattern); + ArrayList filteredFiles = filterFilesByFileExtension(files); + boolean found = filteredFiles.size() > 0; + int index = 0; + + for (String fileName : filteredFiles) { + File resultFile = new File(build.getWorkspace().child(fileName).toURI()); + File targetReportFile = new File(build.getRootDir(), CoverageService.getCoverageReportFileName(index++, defaultFileName)); + CoverageService.copyCoverageFile(resultFile, targetReportFile, build.getWorkspace()); + } + + if (!found) { + // most likely a configuration error in the job - e.g. false pattern to match the cucumber result files + CoverageService.log("No coverage file that matched the specified pattern was found in workspace"); + } + return found; + + } catch (Exception e) { + CoverageService.log("Copying coverage files to build folder failed because of " + e.toString()); + return false; + } + } + + /** + * pre validation of coverage files by file extension. + * @param files to validate + * @return filtered list of files + */ + private ArrayList filterFilesByFileExtension(String[] files) { + ArrayList filteredList = new ArrayList<>(); + for (String fileFullPath : files) { + if (fileFullPath.endsWith(CoverageService.Lcov.LCOV_FILE_EXTENSION) || fileFullPath.endsWith(CoverageService.Jacoco.JACOCO_FILE_EXTENSION)) { + filteredList.add(fileFullPath); + } + } + return filteredList; + } + + @Override + public String getIconFileName() { + return null; + } + + @Override + public String getDisplayName() { + return null; + } + + @Override + public String getUrlName() { + return null; + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoverageService.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoverageService.java new file mode 100644 index 0000000000..1484b6a2b1 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/coverage/CoverageService.java @@ -0,0 +1,131 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.actions.coverage; + +import hudson.FilePath; +import hudson.Util; +import hudson.model.BuildListener; +import hudson.remoting.VirtualChannel; +import jenkins.MasterToSlaveFileCallable; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.types.FileSet; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; + +/** + * Helper Service for coverage publisher + */ +public class CoverageService { + private static final String COVERAGE_REPORT_FILE_NAME_PREFIX = "coverage_report"; + private static BuildListener listener; + + public static class Jacoco { + public static final String JACOCO_TYPE = "JACOCOXML"; + public static final String JACOCO_FILE_EXTENSION = ".xml"; + public static final String JACOCO_DEFAULT_FILE_NAME = "jacoco" + JACOCO_FILE_EXTENSION; + public static final String JACOCO_DEFAULT_PATH = "**/target/site/*/" + JACOCO_DEFAULT_FILE_NAME; + + } + public static class Lcov { + public static final String LCOV_TYPE = "LCOV"; + public static final String LCOV_FILE_EXTENSION = ".info"; + public static final String LCOV_DEFAULT_FILE_NAME = "lcov" + LCOV_FILE_EXTENSION; + public static final String LCOV_DEFAULT_PATH = "**/coverage/" + LCOV_DEFAULT_FILE_NAME; + + } + + public static String getCoverageReportFileName(int index, String fileSuffix) { + return COVERAGE_REPORT_FILE_NAME_PREFIX + index + "-" + fileSuffix; + } + + public static String[] getCoverageFiles(final FilePath workspace, String glob) throws IOException, InterruptedException { + log(String.format("Looking for files that match the pattern %s in root directory %s", glob, workspace.getName())); + return workspace.act(new ResultFilesCallable(glob)); + } + + public static void copyCoverageFile(File resultFile, File targetReportFile, final FilePath workspace) throws IOException, InterruptedException { + log(String.format("Copying %s to %s", resultFile.getPath(), targetReportFile)); + + byte[] content = workspace.act(new FileContentCallable(resultFile)); + + if (validateContent(content)) { + log("Got coverage file content"); + + try (FileOutputStream os = new FileOutputStream(targetReportFile)) { + os.write(content); + } + log(String.format("coverage file copied successfully to %s", targetReportFile.getPath())); + } else { + log("coverage file content corrupted, failed to copy the file to target destination"); + } + } + + /** + * most of the validations will be done in octane side + * this is a place holder to do more validations if needed + * @param content of the file + * @return status + */ + private static boolean validateContent(byte[] content) { + return content.length > 0; + } + + public static void log(final String message) { + if(listener != null) { + listener.getLogger().println(message); + } + } + + public static void setListener(BuildListener l) { + listener = l; + } + + /** + * this class searched for files that match specific pattern + */ + private static final class ResultFilesCallable extends MasterToSlaveFileCallable { + private final String glob; + + private ResultFilesCallable(String glob) { + this.glob = glob; + } + + @Override + public String[] invoke(File rootDir, VirtualChannel channel) throws IOException { + FileSet fs = Util.createFileSet(rootDir, glob); + DirectoryScanner ds = fs.getDirectoryScanner(); + return ds.getIncludedFiles(); + } + } + + private static final class FileContentCallable extends MasterToSlaveFileCallable { + private final File file; + + private FileContentCallable(File file) { + this.file = file; + } + + @Override + public byte[] invoke(File rootDir, VirtualChannel channel) throws IOException { + return Files.readAllBytes(file.toPath()); + } + } + +} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CoverageReportsQueue.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CoverageReportsQueue.java new file mode 100644 index 0000000000..592d118dca --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CoverageReportsQueue.java @@ -0,0 +1,41 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.executor; + +import com.hpe.application.automation.tools.octane.AbstractResultQueueImpl; +import jenkins.model.Jenkins; + +import java.io.File; +import java.io.IOException; + +/** + * Queue for jenkins coverage reports before dispatching + */ +public class CoverageReportsQueue extends AbstractResultQueueImpl { + + public CoverageReportsQueue(int maxRetries) throws IOException { + super(maxRetries); + Jenkins jenkinsContainer = Jenkins.getInstance(); + if (jenkinsContainer != null) { + File queueFile = new File(jenkinsContainer.getRootDir(), "coverage-reports-queue.dat"); + init(queueFile); + } else { + throw new IllegalStateException("Jenkins container not initialized properly"); + } + } + +} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java new file mode 100644 index 0000000000..0e896b98b5 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java @@ -0,0 +1,229 @@ +/* + * Copyright 2017 Hewlett-Packard Development Company, L.P. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.hpe.application.automation.tools.octane.tests; + +import com.google.common.primitives.Longs; +import com.google.inject.Inject; +import com.hp.mqm.client.MqmRestClient; +import com.hp.mqm.client.exception.RequestErrorException; +import com.hpe.application.automation.tools.octane.ResultQueue; +import com.hpe.application.automation.tools.octane.actions.coverage.CoverageService; +import com.hpe.application.automation.tools.octane.client.JenkinsInsightEventPublisher; +import com.hpe.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; +import com.hpe.application.automation.tools.octane.client.JenkinsMqmRestClientFactoryImpl; +import com.hpe.application.automation.tools.octane.client.RetryModel; +import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; +import com.hpe.application.automation.tools.octane.configuration.ServerConfiguration; +import com.hpe.application.automation.tools.octane.executor.CoverageReportsQueue; +import com.hpe.application.automation.tools.octane.tests.build.BuildHandlerUtils; +import hudson.Extension; +import hudson.model.Job; +import hudson.model.Run; +import hudson.model.TaskListener; +import hudson.util.TimeUnit2; +import jenkins.model.Jenkins; +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * this class manages a queue of coverage report upload tasks + */ +@Extension +public class CoverageReportsDispatcher extends AbstractSafeLoggingAsyncPeriodWork { + private static final Logger logger = LogManager.getLogger(CoverageReportsDispatcher.class); + + private static final int MAX_RETRIES = 6; + + private static final double BASE = 2; + private static final double EXPONENT = 0; + @Inject + private RetryModel retryModel; + private JenkinsMqmRestClientFactory clientFactory; + private final ResultQueue reportsQueue; + @Inject + public CoverageReportsDispatcher() throws IOException { + super("Octane coverage reports dispatcher"); + reportsQueue = new CoverageReportsQueue(MAX_RETRIES); + } + + private long[] getQuietPeriodsInMinutes(double retries) { + double exponent = EXPONENT; + List quietPeriods = new ArrayList<>(); + while (exponent <= retries) { + quietPeriods.add(TimeUnit2.MINUTES.toMillis((long) Math.pow(BASE, exponent))); + exponent++; + } + return Longs.toArray(quietPeriods); + } + + @Override + protected void doExecute(TaskListener listener) { + if (reportsQueue.peekFirst() == null) { + return; + } + + MqmRestClient mqmRestClient = initMqmRestClient(); + if (mqmRestClient == null) { + logger.warn("There are pending coverage reports, but MQM server location is not specified, reports can't be submitted"); + reportsQueue.remove(); + return; + } + + ResultQueue.QueueItem item; + + while ((item = reportsQueue.peekFirst()) != null) { + + if (retryModel.isQuietPeriod()) { + logger.debug("There are pending coverage reports, but we are in quiet period"); + return; + } + + Run build = getBuildFromQueueItem(item); + if (build == null) { + logger.warn("Build and/or Project [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer exists, pending coverage reports can't be submitted"); + reportsQueue.remove(); + continue; + } + if (item.getType().equals(CoverageService.Jacoco.JACOCO_TYPE)) { + transferCoverageReports(build, mqmRestClient, item, CoverageService.Jacoco.JACOCO_DEFAULT_FILE_NAME); + } else if (item.getType().equals(CoverageService.Lcov.LCOV_TYPE)) { + transferCoverageReports(build, mqmRestClient, item, CoverageService.Lcov.LCOV_DEFAULT_FILE_NAME); + } + } + } + + private void transferCoverageReports(Run build, MqmRestClient mqmRestClient, ResultQueue.QueueItem item, String coverageReportFileSuffix) { + long index = 0; + File coverageFile = getCoverageFile(build, index, coverageReportFileSuffix); + try { + // iterate all coverage reports in build folder + while (coverageFile.exists()) { + // send each report as IS to octane using rest client + boolean status = mqmRestClient.postCoverageReports( + ConfigurationService.getModel().getIdentity(), + BuildHandlerUtils.getJobCiId(build), + String.valueOf(build.getNumber()), + new FileInputStream(coverageFile), + coverageFile.length(), item.getType()); + if (status) { + logger.info("Successfully sent coverage report " + coverageFile.getName() + " for job " + item.getProjectName() + " with build #" + item.getBuildNumber()); + } else { + logger.error("failed to send coverage report " + coverageFile.getName() + " for job " + item.getProjectName() + " with build #" + item.getBuildNumber()); + reAttemptTask(item.getProjectName(), item.getBuildNumber(), item.getType()); + return; + } + // get next file + index++; + coverageFile = getCoverageFile(build, index, coverageReportFileSuffix); + } + reportsQueue.remove(); + } catch (RequestErrorException ree) { + logger.error("failed to send coverage reports (of type " + item.getType() + ") for job " + item.getProjectName() + " #" + item.getBuildNumber(), ree); + reAttemptTask(item.getProjectName(), item.getBuildNumber(), item.getType()); + } catch (Exception e) { + logger.error("fatally failed to send coverage reports (of type " + item.getType() + ") for build " + item.getProjectName() + " #" + item.getBuildNumber() + ", will not retry this one", e); + retryModel.success(); + reportsQueue.remove(); + } + } + + private File getCoverageFile(Run build, long index, String coverageReportFileSuffix) { + String coverageReportFilePath = build.getRootDir() + File.separator + CoverageService.getCoverageReportFileName((int) index, coverageReportFileSuffix); + return new File(coverageReportFilePath); + } + + private void reAttemptTask(String projectName, int buildNumber, String itemReportType) { + if (!reportsQueue.failed()) { // add task to queue and return true if max attempts not reached, else return false + logger.warn("maximum number of attempts reached (" + MAX_RETRIES + "), " + + "operation will not be re-attempted for build "+ projectName + " #" + buildNumber + " of type " + itemReportType); + retryModel.success(); + } else { + logger.info("There are pending logs, but we are in quiet period"); + retryModel.failure(); + } + } + + private MqmRestClient initMqmRestClient() { + MqmRestClient result = null; + ServerConfiguration configuration = ConfigurationService.getServerConfiguration(); + if (configuration.isValid()) { + result = clientFactory.obtain( + configuration.location, + configuration.sharedSpace, + configuration.username, + configuration.password); + } + return result; + } + + private Run getBuildFromQueueItem(ResultQueue.QueueItem item) { + Run result = null; + Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + if (project != null) { + result = project.getBuildByNumber(item.getBuildNumber()); + } + return result; + } + + @Override + public long getRecurrencePeriod() { + String value = System.getProperty("Octane.LogDispatcher.Period"); // let's us config the recurrence period. default is 10 seconds. + if (!StringUtils.isEmpty(value)) { + return Long.valueOf(value); + } + return TimeUnit2.SECONDS.toMillis(10); + } + + public void enqueueTask(String projectName, int buildNumber, String fileType) { + reportsQueue.add(projectName, fileType, buildNumber); + } + + @Inject + public void setEventPublisher(JenkinsInsightEventPublisher eventPublisher) { + this.retryModel = new RetryModel(eventPublisher, getQuietPeriodsInMinutes(MAX_RETRIES)); + } + + @Inject + public void setMqmRestClientFactory(JenkinsMqmRestClientFactoryImpl clientFactory) { + this.clientFactory = clientFactory; + } + + private static final class NamedThreadFactory implements ThreadFactory { + + private AtomicInteger threadNumber = new AtomicInteger(1); + private final String namePrefix; + + private NamedThreadFactory(String namePrefix) { + this.namePrefix = namePrefix; + } + + public Thread newThread(Runnable runnable) { + Thread result = new Thread(runnable, this.namePrefix + " thread-" + threadNumber.getAndIncrement()); + result.setDaemon(true); + return result; + } + } +} diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties b/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties index 1261388fe9..5b2504249a 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties +++ b/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties @@ -42,3 +42,6 @@ CucumberResultsActionCollecting=Collecting Cucumber results to send to Octane. CucumberResultsActionNotFound=Cucumber result XMLs for Octane were not found. Configuration error? CucumberResultsActionError=Error while collecting Cucumber result XMLs: %s CucumberResultsActionEmptyConfigurationWarning=Leaving this field empty will result in searching for %s + + +CoverageResultsActionEmptyConfigurationWarning=Leaving this field empty will result in searching for %s diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.jelly b/src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.jelly new file mode 100644 index 0000000000..e60fd2015d --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.jelly @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.properties b/src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.properties new file mode 100644 index 0000000000..7633e21fcd --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/octane/actions/CoveragePublisher/config.properties @@ -0,0 +1,25 @@ +# +# Copyright 2017 Hewlett-Packard Development Company, L.P. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +descriptionJacoco=\ +Fileset \u2018includes\u2019 \ +setting that specifies the location of the Jacoco files from which to pull coverage data. \ +Basedir of the fileset is the workspace root. + +descriptionLcov=\ +Fileset \u2018includes\u2019 \ +setting that specifies the location of the Jacoco files from which to pull coverage data. \ +Basedir of the fileset is the workspace root. \ No newline at end of file diff --git a/src/test/java/com/hpe/application/automation/tools/octane/tests/TestQueue.java b/src/test/java/com/hpe/application/automation/tools/octane/tests/TestQueue.java index 66d25ab765..3967000966 100644 --- a/src/test/java/com/hpe/application/automation/tools/octane/tests/TestQueue.java +++ b/src/test/java/com/hpe/application/automation/tools/octane/tests/TestQueue.java @@ -61,6 +61,17 @@ public synchronized void add(String projectName, int buildNumber) { queue.add(new QueueItem(projectName, buildNumber)); } + /** + * add task to queue, type is not relevant to to test queue + * @param projectName + * @param type + * @param buildNumber + */ + @Override + public void add(String projectName, String type, int buildNumber) { + queue.add(new QueueItem(projectName, buildNumber)); + } + @Override public void add(String projectName, int buildNumber, String workspace) { queue.add(new QueueItem(projectName, buildNumber, workspace)); From 8ab42e8bcb4fe88cc0011687a4a3a6ad950ad7ad Mon Sep 17 00:00:00 2001 From: Michael S Date: Mon, 13 Nov 2017 11:15:49 +0200 Subject: [PATCH 0177/2502] update dependencies merge --- pom.xml | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index 4face0afe3..5ad34e4658 100644 --- a/pom.xml +++ b/pom.xml @@ -389,40 +389,7 @@ com.hpe.adm.octane.ciplugins 1.4.13 - - - - - com.hpe.nv - hpe-nv-java-api - 1.0.0 - - - com.google.code.gson - gson - ${google.gson.version} - - - commons-validator - commons-validator - ${apache.commons.validator.version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - + mqm-rest-client From 60c1ff40a94a19de2136402cf201556ebf3f627c Mon Sep 17 00:00:00 2001 From: radislavB Date: Mon, 13 Nov 2017 11:48:29 +0200 Subject: [PATCH 0178/2502] set setTestResultExpected for all tests (#57) --- .../tools/octane/events/RunListenerImpl.java | 55 ++++--------------- .../tools/octane/events/TestListenerImpl.java | 39 ------------- .../tools/octane/tests/TestListener.java | 18 +++--- 3 files changed, 22 insertions(+), 90 deletions(-) delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index f733d2ce7c..a18ec6156f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -16,6 +16,7 @@ package com.hpe.application.automation.tools.octane.events; +import com.google.inject.Inject; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.events.CIEvent; import com.hp.octane.integrations.dto.events.CIEventType; @@ -24,17 +25,12 @@ import com.hp.octane.integrations.dto.pipelines.PipelinePhase; import com.hp.octane.integrations.dto.snapshots.CIBuildResult; import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; -import com.hpe.application.automation.tools.octane.executor.UftJobRecognizer; import com.hpe.application.automation.tools.octane.model.CIEventCausesFactory; import com.hpe.application.automation.tools.octane.model.processors.builders.WorkFlowRunProcessor; import com.hpe.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; import com.hpe.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; -import com.hpe.application.automation.tools.octane.tests.HPRunnerType; -import com.hpe.application.automation.tools.octane.tests.MqmTestsExtension; -import com.hpe.application.automation.tools.octane.tests.TestResultContainer; +import com.hpe.application.automation.tools.octane.tests.TestListener; import com.hpe.application.automation.tools.octane.tests.build.BuildHandlerUtils; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.Logger; import hudson.Extension; import hudson.matrix.MatrixConfiguration; import hudson.matrix.MatrixRun; @@ -42,6 +38,7 @@ import hudson.model.listeners.RunListener; import jenkins.model.Jenkins; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.util.Collection; import java.util.List; @@ -63,6 +60,10 @@ public final class RunListenerImpl extends RunListener { private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); private static final Logger logger = LogManager.getLogger(RunListenerImpl.class); + + @Inject + private TestListener testListener; + @Override public void onStarted(final Run r, TaskListener listener) { if(!ConfigurationService.getServerConfiguration().isValid()){ @@ -131,6 +132,8 @@ public void onFinalized(Run r) return; } + boolean hasTests = testListener.processBuild(r); + CIBuildResult result; if (r.getResult() == Result.SUCCESS) { result = CIBuildResult.SUCCESS; @@ -152,18 +155,8 @@ public void onFinalized(Run r) .setEstimatedDuration(r.getEstimatedDuration()) .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) .setResult(result) - .setDuration(r.getDuration()); - - try { - if (r.getResult() == Result.FAILURE) { - Boolean hasTests = hasUftTests(r); - if (hasTests != null) { - event.setTestResultExpected(hasTests); - } - } - } catch (Exception e) { - logger.log(Level.WARN,"hasUftTests error",e); - } + .setDuration(r.getDuration()) + .setTestResultExpected(hasTests); if(r instanceof AbstractBuild){ event.setParameters(ParameterProcessors.getInstances(r)) @@ -215,32 +208,6 @@ private boolean isInternal(Run r) { return result; } - private static Boolean hasUftTests(Run build) { - if (build.getParent() instanceof FreeStyleProject && UftJobRecognizer.isExecutorJob((FreeStyleProject) build.getParent())) { - try { - boolean hasTests = false; - for (MqmTestsExtension ext : MqmTestsExtension.all()) { - if (ext.supports(build)) { - String jenkinsRootUrl = Jenkins.getInstance().getRootUrl(); - List buildsList = BuildHandlerUtils.getBuildPerWorkspaces(build); - - for (Run buildX : buildsList) { - TestResultContainer testResultContainer = ext.getTestResults(buildX, HPRunnerType.UFT, jenkinsRootUrl); - if (testResultContainer != null && testResultContainer.getIterator().hasNext()) { - hasTests = true; - } - } - } - } - return hasTests; - } catch (Exception e) { - logger.log(Level.WARN,"Could not check uft tests exists",e); - } - } - - return null; - } - private static TopLevelItem getJobFromFolder(String causeJobName) { String newJobRefId = causeJobName.substring(0, causeJobName.indexOf('/')); TopLevelItem item = Jenkins.getInstance().getItem(newJobRefId); diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java deleted file mode 100644 index e468c646c3..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package com.hpe.application.automation.tools.octane.events; - -import com.google.inject.Inject; -import com.hpe.application.automation.tools.octane.tests.TestListener; -import hudson.Extension; -import hudson.model.*; -import hudson.model.listeners.RunListener; - -import javax.annotation.Nonnull; - -/** - * Listener on job complete event - */ -@Extension -public class TestListenerImpl extends RunListener { - @Inject - private TestListener testListener; - - @Override - public void onCompleted(Run r, @Nonnull TaskListener listener) { - testListener.processBuild(r, listener); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java index b4041d3f70..9e636e60c4 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java @@ -50,11 +50,11 @@ public class TestListener { private ResultQueue queue; - public void processBuild(Run build, TaskListener listener) { + public boolean processBuild(Run build) { FilePath resultPath = new FilePath(new FilePath(build.getRootDir()), TEST_RESULT_FILE); TestResultXmlWriter resultWriter = new TestResultXmlWriter(resultPath, build); - boolean success = false; + boolean success = true; boolean hasTests = false; String jenkinsRootUrl = Jenkins.getInstance().getRootUrl(); HPRunnerType hpRunnerType = HPRunnerType.NONE; @@ -91,22 +91,24 @@ public void processBuild(Run build, TaskListener listener) { } } } catch (IllegalArgumentException e) { - listener.error(e.getMessage()); + success = false; + logger.error(e.getMessage()); if (!build.getResult().isWorseOrEqualTo(Result.UNSTABLE)) { build.setResult(Result.UNSTABLE); } - return; + break; } catch (InterruptedException ie) { + success = false; logger.error("Interrupted processing test results in " + ext.getClass().getName(), ie); Thread.currentThread().interrupt(); - return; + break; } catch (Exception e) { + success = false; // extensibility involved: catch both checked and RuntimeExceptions logger.error("Error processing test results in " + ext.getClass().getName(), e); - return; + break; } } - success = true; } finally { try { resultWriter.close(); @@ -118,8 +120,10 @@ public void processBuild(Run build, TaskListener listener) { } } catch (XMLStreamException xmlse) { logger.error("Error processing test results", xmlse); + success = false; } } + return success && hasTests;//test results expected } @Inject From 7d59553b60b43daf14c8b8b4f4ebcd32bb0c7924 Mon Sep 17 00:00:00 2001 From: ido gadiel Date: Tue, 14 Nov 2017 11:57:24 +0200 Subject: [PATCH 0179/2502] Enable/disable reporting from CI server (#58) --- pom.xml | 4 ++-- .../tools/model/OctaneServerSettingsModel.java | 10 ++++++++++ .../tools/octane/CIJenkinsServicesImpl.java | 12 +++++++++++- .../automation/tools/octane/bridge/BridgeClient.java | 7 ++++--- .../tools/octane/buildLogs/RunListenerForLogs.java | 5 +++++ .../octane/configuration/ServerConfiguration.java | 12 +++++++++++- .../automation/tools/octane/events/EventsClient.java | 4 ++-- .../tools/octane/events/RunListenerImpl.java | 7 +++++++ .../tools/octane/events/SCMListenerImpl.java | 4 ++++ .../tools/settings/OctaneServerSettingsBuilder.java | 3 ++- .../OctaneServerSettingsBuilder/global.jelly | 6 ++++++ .../OctaneServerSettingsBuilder/global.properties | 1 + 12 files changed, 65 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 5ad34e4658..996ebc602e 100644 --- a/pom.xml +++ b/pom.xml @@ -387,14 +387,14 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.4.13 + 1.4.14 mqm-rest-client com.hpe.adm.octane.ciplugins - 1.4.22 + 1.4.23 diff --git a/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java index e9560c947a..d1ac2315a1 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java @@ -8,6 +8,7 @@ import hudson.util.Secret; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; import java.util.Date; @@ -20,6 +21,7 @@ public class OctaneServerSettingsModel { private String username; private Secret password; private String impersonatedUser; + private boolean suspend; // inferred from uiLocation private String location; @@ -38,6 +40,14 @@ public OctaneServerSettingsModel(String uiLocation, String username, Secret pass this.impersonatedUser = impersonatedUser; } + public boolean isSuspend(){ + return this.suspend; + } + + @DataBoundSetter + public void setSuspend(boolean suspend){ + this.suspend = suspend; + } public String getUiLocation() { return uiLocation; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java index 0478654201..b924761919 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -95,10 +95,20 @@ public CIServerInfo getServerInfo() { .setInstanceId(model.getIdentity()) .setInstanceIdFrom(model.getIdentityFrom()) .setSendingTime(System.currentTimeMillis()) - .setImpersonatedUser(model.getImpersonatedUser()); + .setImpersonatedUser(model.getImpersonatedUser()) + .setSuspended(model.isSuspend()); + return result; } + @Override + public void suspendCiEvents(boolean suspend) { + OctaneServerSettingsModel model = ConfigurationService.getModel(); + model.setSuspend(suspend); + ConfigurationService.configurePlugin(model); + logger.info("suspend ci event: "+suspend); + } + @Override public CIPluginInfo getPluginInfo() { CIPluginInfo result = dtoFactory.newDTO(CIPluginInfo.class); diff --git a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java index a2dcff9000..fea2d81916 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java @@ -53,7 +53,7 @@ public class BridgeClient { public BridgeClient(ServerConfiguration mqmConfig, JenkinsMqmRestClientFactory clientFactory, String serverIdentity) { this.serverInstanceId = serverIdentity; - this.mqmConfig = new ServerConfiguration(mqmConfig.location, mqmConfig.sharedSpace, mqmConfig.username, mqmConfig.password, mqmConfig.impersonatedUser); + this.mqmConfig = new ServerConfiguration(mqmConfig.location, mqmConfig.sharedSpace, mqmConfig.username, mqmConfig.password, mqmConfig.impersonatedUser, mqmConfig.suspend); restClientFactory = clientFactory; connect(); logger.info("client initialized for '" + this.mqmConfig.location + "'; SP: " + this.mqmConfig.sharedSpace + "; access key: " + this.mqmConfig.username); @@ -61,7 +61,7 @@ public BridgeClient(ServerConfiguration mqmConfig, JenkinsMqmRestClientFactory c public void update(ServerConfiguration newConfig, String serverIdentity) { this.serverInstanceId = serverIdentity; - mqmConfig = new ServerConfiguration(newConfig.location, newConfig.sharedSpace, newConfig.username, newConfig.password, newConfig.impersonatedUser); + mqmConfig = new ServerConfiguration(newConfig.location, newConfig.sharedSpace, newConfig.username, newConfig.password, newConfig.impersonatedUser, mqmConfig.suspend); logger.info("client updated to '" + mqmConfig.location + "'; SP: " + mqmConfig.sharedSpace + "; access key: " + newConfig.username); restClientFactory.updateMqmRestClient(mqmConfig.location, mqmConfig.sharedSpace, mqmConfig.username, mqmConfig.password); connect(); @@ -85,7 +85,8 @@ public void run() { .setSdkVersion(OctaneSDK.SDK_VERSION) .setPluginVersion(OctaneSDK.getInstance().getPluginServices().getPluginInfo().getVersion()) .setOctaneUser(pluginServices.getOctaneConfiguration().getApiKey()) - .setCiServerUser(ConfigurationService.getModel().getImpersonatedUser()); + .setCiServerUser(ConfigurationService.getModel().getImpersonatedUser()) + .setSuspend(pluginServices.getServerInfo().isSuspended()); tasksJSON = restClient.getAbridgedTasks(info); isConnected = false; connect(); diff --git a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java index d1351590c3..2447e7021f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java @@ -42,6 +42,11 @@ public class RunListenerForLogs extends RunListener { @Override public void onCompleted(Run r, @Nonnull TaskListener listener) { + + if(ConfigurationService.getModel().isSuspend()){ + return; + } + if (r instanceof AbstractBuild && ConfigurationService.getServerConfiguration().isValid()) { AbstractBuild build = (AbstractBuild) r; logger.info(String.format("Enqueued job [%s#%d]", build.getProject().getFullName(), build.getNumber())); diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java index e9142f2a66..2ec8ddd46c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java @@ -32,13 +32,15 @@ final public class ServerConfiguration { public String username; public Secret password; public String impersonatedUser; + public boolean suspend; - public ServerConfiguration(String location, String sharedSpace, String username, Secret password, String impersonatedUser) { + public ServerConfiguration(String location, String sharedSpace, String username, Secret password, String impersonatedUser, boolean suspend) { this.location = location; this.sharedSpace = sharedSpace; this.username = username; this.password = password; this.impersonatedUser = impersonatedUser; + this.suspend = suspend; } @Override @@ -84,6 +86,14 @@ public boolean isValid() { return result; } + public boolean isSuspend(){ + return this.suspend; + } + + public void setSuspend(boolean suspend){ + this.suspend = suspend; + } + @Override public String toString() { return "{ url: " + location + diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java b/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java index 1c09d55c70..6d8d12e37d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java @@ -60,14 +60,14 @@ private static final class WaitMonitor { private Date lastErrorTime; public EventsClient(ServerConfiguration mqmConfig, JenkinsMqmRestClientFactory clientFactory) { - this.mqmConfig = new ServerConfiguration(mqmConfig.location, mqmConfig.sharedSpace, mqmConfig.username, mqmConfig.password, mqmConfig.impersonatedUser); + this.mqmConfig = new ServerConfiguration(mqmConfig.location, mqmConfig.sharedSpace, mqmConfig.username, mqmConfig.password, mqmConfig.impersonatedUser, mqmConfig.suspend); this.restClientFactory = clientFactory; activate(); logger.info("client initialized for '" + this.mqmConfig.location + "'; SP: " + this.mqmConfig.sharedSpace + "; access key: " + mqmConfig.username); } public void update(ServerConfiguration newConfig) { - mqmConfig = new ServerConfiguration(newConfig.location, newConfig.sharedSpace, newConfig.username, newConfig.password, newConfig.impersonatedUser); + mqmConfig = new ServerConfiguration(newConfig.location, newConfig.sharedSpace, newConfig.username, newConfig.password, newConfig.impersonatedUser, newConfig.suspend); activate(); logger.info("client updated to '" + mqmConfig.location + "'; SP: " + mqmConfig.sharedSpace + "; access key: " + newConfig.username); } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index a18ec6156f..5fc44b319d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -70,6 +70,9 @@ public void onStarted(final Run r, TaskListener listener) { return; } + if(ConfigurationService.getModel().isSuspend()){ + return; + } CIEvent event; if (r.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowRun")) { event = dtoFactory.newDTO(CIEvent.class) @@ -132,6 +135,10 @@ public void onFinalized(Run r) return; } + if(ConfigurationService.getModel().isSuspend()){ + return; + } + boolean hasTests = testListener.processBuild(r); CIBuildResult result; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 294fea8ef2..79019035d5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -69,6 +69,10 @@ public void onChangeLogParsed(Run r, SCM scm, TaskListener listener, Chang return; } + if(ConfigurationService.getModel().isSuspend()){ + return; + } + CIEvent event; if (r.getParent() instanceof MatrixConfiguration || r instanceof AbstractBuild) { AbstractBuild build = (AbstractBuild) r; diff --git a/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java index ce27c79943..c31622010a 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java @@ -122,7 +122,8 @@ private static ServerConfiguration convertToServerConfiguration(OctaneServerSett model.getSharedSpace(), model.getUsername(), model.getPassword(), - model.getImpersonatedUser()); + model.getImpersonatedUser(), + model.isSuspend()); } @Override diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly index 4640bf2385..cc0d47a13a 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly @@ -43,6 +43,12 @@ + + + + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties index 7fb02ae20e..364033bd19 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties +++ b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties @@ -16,5 +16,6 @@ global.config.impersonatedUser.title=Jenkins user global.config.impersonatedUser.description=The user to impersonate (Jobs will be executed on behalf of this user) global.config.dynamic.instanceId.title=Show plugin instance ID +global.config.suspend.title=Suspend Octane events global.config.instanceId.title=Instance id global.config.instanceId.description=An ID to uniquely identify this instance of the plugin. \ No newline at end of file From 33b3a7c2dd0885822199b47c54d21f0fe9fe136e Mon Sep 17 00:00:00 2001 From: Yuri Guller Date: Wed, 22 Nov 2017 15:00:18 +0200 Subject: [PATCH 0180/2502] tech: handling the reset build id cases and some code adjustements (#60) --- .../tools/octane/buildLogs/LogDispatcher.java | 14 +- .../tools/octane/events/ItemListenerImpl.java | 40 ----- .../octane/events/QueueListenerImpl.java | 59 -------- .../tools/octane/events/RunListenerImpl.java | 78 +++++----- .../tools/octane/events/SCMListenerImpl.java | 138 +++++++++-------- .../processors/scm/GenericSCMProcessor.java | 140 +++++++++--------- .../model/processors/scm/SCMProcessor.java | 2 + .../tests/CoverageReportsDispatcher.java | 12 +- .../octane/tests/build/BuildHandlerUtils.java | 90 +++++------ .../tests/build/MatrixBuildExtension.java | 24 +-- .../tests/build/MavenBuildExtension.java | 26 ++-- .../octane/tests/junit/JUnitExtension.java | 70 ++++----- .../octane/tests/xml/TestResultXmlWriter.java | 30 +--- 13 files changed, 302 insertions(+), 421 deletions(-) delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java diff --git a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java index 1f3525ba74..7f66c29901 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java @@ -163,8 +163,8 @@ private void transferBuildLogs(Run build, MqmRestClient mqmRestClient, ResultQue boolean status = mqmRestClient.postLogs( parseLong(item.getWorkspace()), ConfigurationService.getModel().getIdentity(), - build.getParent().getName(), - String.valueOf(build.getNumber()), + BuildHandlerUtils.getJobCiId(build), + BuildHandlerUtils.getBuildCiId(build), octaneLog.getLogStream(), octaneLog.getFileLength()); if (status) { @@ -186,7 +186,7 @@ private void transferBuildLogs(Run build, MqmRestClient mqmRestClient, ResultQue private void reAttempt(String projectName, int buildNumber) { if (!logsQueue.failed()) { - logger.warn("maximum number of attempts reached, operation will not be re-attempted for build "+ projectName + " #" + buildNumber); + logger.warn("maximum number of attempts reached, operation will not be re-attempted for build " + projectName + " #" + buildNumber); retryModel.success(); } else { logger.info("There are pending logs, but we are in quiet period"); @@ -223,7 +223,11 @@ private OctaneLog getOctaneLogFile(Run build) throws IOException { private Run getBuildFromQueueItem(ResultQueue.QueueItem item) { Run result = null; - Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + Jenkins jenkins = Jenkins.getInstance(); + if (jenkins == null) { + throw new IllegalStateException("failed to obtain Jenkins' instance"); + } + Job project = (Job) jenkins.getItemByFullName(item.getProjectName()); if (project != null) { result = project.getBuildByNumber(item.getBuildNumber()); } @@ -300,7 +304,7 @@ public void run() { parseLong(workspaceId), ConfigurationService.getModel().getIdentity(), BuildHandlerUtils.getJobCiId(build), - String.valueOf(build.getNumber()), + BuildHandlerUtils.getBuildCiId(build), octaneLog.getLogStream(), octaneLog.getFileLength()); if (status) { diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java deleted file mode 100644 index 2639bfe311..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package com.hpe.application.automation.tools.octane.events; - -import hudson.Extension; -import hudson.model.Item; -import hudson.model.listeners.ItemListener; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -/** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 24/08/14 - * Time: 17:21 - * To change this template use File | Settings | File Templates. - */ - -@Extension -public final class ItemListenerImpl extends ItemListener { - private static final Logger logger = LogManager.getLogger(ItemListenerImpl.class); - - public void onRenamed(Item item, String oldName, String newName) { - logger.info("Renamed for: " + oldName + " => " + newName); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java deleted file mode 100644 index 6416093d64..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package com.hpe.application.automation.tools.octane.events; - -import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; -import com.hp.octane.integrations.dto.DTOFactory; -import com.hp.octane.integrations.dto.events.CIEvent; -import com.hp.octane.integrations.dto.events.CIEventType; -import com.hpe.application.automation.tools.octane.model.CIEventCausesFactory; -import hudson.Extension; -import hudson.model.AbstractProject; -import hudson.model.Queue; -import hudson.model.queue.QueueListener; - -/** - * Created with IntelliJ IDEA. - * User: gullery - * Date: 31/08/14 - * Time: 13:25 - * To change this template use File | Settings | File Templates. - */ - -@Extension -public final class QueueListenerImpl extends QueueListener { - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - - @Override - public void onEnterWaiting(Queue.WaitingItem wi) { - if(!ConfigurationService.getServerConfiguration().isValid()){ - return; - } - - AbstractProject project; - if (wi.task instanceof AbstractProject) { - project = (AbstractProject) wi.task; - CIEvent event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.QUEUED) - .setProject(project.getName()) - .setProjectDisplayName(project.getName()) - .setCauses(CIEventCausesFactory.processCauses(wi.getCauses())); - // REMARK: temporary decided to not send QUEUED event - //EventsDispatcher.getExtensionInstance().dispatchEvent(event); - } - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index 5fc44b319d..9180d93e31 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -48,37 +48,37 @@ import java.util.concurrent.TimeUnit; /** - * Created with IntelliJ IDEA. + * Run Listener that handles basic CI events and dispatches notifications to the Octane server * User: gullery * Date: 24/08/14 * Time: 17:21 */ @Extension -@SuppressWarnings({"squid:S2259","squid:S1872","squid:S1698","squid:S1132"}) +@SuppressWarnings({"squid:S2259", "squid:S1872", "squid:S1698", "squid:S1132"}) public final class RunListenerImpl extends RunListener { + private static final Logger logger = LogManager.getLogger(RunListenerImpl.class); private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); - private static final Logger logger = LogManager.getLogger(RunListenerImpl.class); @Inject private TestListener testListener; @Override public void onStarted(final Run r, TaskListener listener) { - if(!ConfigurationService.getServerConfiguration().isValid()){ + if (!ConfigurationService.getServerConfiguration().isValid()) { return; } - - if(ConfigurationService.getModel().isSuspend()){ + if (ConfigurationService.getModel().isSuspend()) { return; } + CIEvent event; if (r.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowRun")) { event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.STARTED) .setProject(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(String.valueOf(r.getNumber())) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) .setNumber(String.valueOf(r.getNumber())) .setStartTime(r.getStartTimeInMillis()) .setPhaseType(PhaseType.POST) @@ -89,17 +89,16 @@ public void onStarted(final Run r, TaskListener listener) { workFlowRunProcessor.registerEvents(executor); } else { if (r.getParent() instanceof MatrixConfiguration) { - AbstractBuild build = (AbstractBuild) r; event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.STARTED) .setProject(BuildHandlerUtils.getJobCiId(r)) .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(String.valueOf(build.getNumber())) - .setNumber(String.valueOf(build.getNumber())) - .setStartTime(build.getStartTimeInMillis()) - .setEstimatedDuration(build.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(build))) - .setParameters(ParameterProcessors.getInstances(build)); + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setNumber(String.valueOf(r.getNumber())) + .setStartTime(r.getStartTimeInMillis()) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setParameters(ParameterProcessors.getInstances(r)); if (isInternal(r)) { event.setPhaseType(PhaseType.INTERNAL); } else { @@ -107,17 +106,16 @@ public void onStarted(final Run r, TaskListener listener) { } EventsService.getExtensionInstance().dispatchEvent(event); } else if (r instanceof AbstractBuild) { - AbstractBuild build = (AbstractBuild) r; event = dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.STARTED) .setProject(BuildHandlerUtils.getJobCiId(r)) .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(String.valueOf(build.getNumber())) - .setNumber(String.valueOf(build.getNumber())) - .setStartTime(build.getStartTimeInMillis()) - .setEstimatedDuration(build.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(build))) - .setParameters(ParameterProcessors.getInstances(build)); + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setNumber(String.valueOf(r.getNumber())) + .setStartTime(r.getStartTimeInMillis()) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setParameters(ParameterProcessors.getInstances(r)); if (isInternal(r)) { event.setPhaseType(PhaseType.INTERNAL); } else { @@ -129,13 +127,11 @@ public void onStarted(final Run r, TaskListener listener) { } @Override - public void onFinalized(Run r) - { - if(!ConfigurationService.getServerConfiguration().isValid()){ + public void onFinalized(Run r) { + if (!ConfigurationService.getServerConfiguration().isValid()) { return; } - - if(ConfigurationService.getModel().isSuspend()){ + if (ConfigurationService.getModel().isSuspend()) { return; } @@ -153,21 +149,21 @@ public void onFinalized(Run r) } else { result = CIBuildResult.UNAVAILABLE; } - CIEvent event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.FINISHED) - .setBuildCiId(String.valueOf(r.getNumber())) - .setNumber(String.valueOf(r.getNumber())) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setStartTime(r.getStartTimeInMillis()) - .setEstimatedDuration(r.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setResult(result) - .setDuration(r.getDuration()) - .setTestResultExpected(hasTests); - - if(r instanceof AbstractBuild){ + CIEvent event = dtoFactory.newDTO(CIEvent.class) + .setEventType(CIEventType.FINISHED) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setNumber(String.valueOf(r.getNumber())) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setStartTime(r.getStartTimeInMillis()) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setResult(result) + .setDuration(r.getDuration()) + .setTestResultExpected(hasTests); + + if (r instanceof AbstractBuild) { event.setParameters(ParameterProcessors.getInstances(r)) - .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)); + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)); } EventsService.getExtensionInstance().dispatchEvent(event); } @@ -211,7 +207,6 @@ private boolean isInternal(Run r) { } } } - return result; } @@ -234,7 +229,6 @@ private static List extractCauses(Run r) { if (r.getParent() instanceof MatrixConfiguration) { return ((MatrixRun) r).getParentBuild().getCauses(); } - return r.getCauses(); } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 79019035d5..80e9870c7d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -46,87 +46,85 @@ import java.util.List; /** + * Run Listener that handles SCM CI events and dispatches notifications to the Octane server * Created by gullery on 10/07/2016. */ @Extension @SuppressWarnings("squid:S1872") public class SCMListenerImpl extends SCMListener { - private static final Logger logger = LogManager.getLogger(SCMListenerImpl.class); - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + private static final Logger logger = LogManager.getLogger(SCMListenerImpl.class); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - @Override - public void onCheckout(Run build, SCM scm, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState pollingBaseline) throws Exception { - super.onCheckout(build, scm, workspace, listener, changelogFile, pollingBaseline); - } + @Override + public void onCheckout(Run build, SCM scm, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState pollingBaseline) throws Exception { + super.onCheckout(build, scm, workspace, listener, changelogFile, pollingBaseline); + } - @Override - public void onChangeLogParsed(Run r, SCM scm, TaskListener listener, ChangeLogSet changelog) throws Exception { - super.onChangeLogParsed(r, scm, listener, changelog); + @Override + public void onChangeLogParsed(Run r, SCM scm, TaskListener listener, ChangeLogSet changelog) throws Exception { + super.onChangeLogParsed(r, scm, listener, changelog); - if(!ConfigurationService.getServerConfiguration().isValid()){ - return; - } + if (!ConfigurationService.getServerConfiguration().isValid()) { + return; + } + if (ConfigurationService.getModel().isSuspend()) { + return; + } - if(ConfigurationService.getModel().isSuspend()){ - return; - } + CIEvent event; + if (r.getParent() instanceof MatrixConfiguration || r instanceof AbstractBuild) { + AbstractBuild build = (AbstractBuild) r; + if (changelog != null && !changelog.isEmptySet()) { // if there are any commiters + SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); + if (scmProcessor != null) { + createSCMData(r, build, scmProcessor); + } else { + logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); + } + } + } else if (r.getParent() instanceof WorkflowJob) { + WorkflowRun wRun = (WorkflowRun) r; + if (changelog != null && !changelog.isEmptySet() || !wRun.getChangeSets().isEmpty()) { + SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); + if (scmProcessor != null) { + List scmDataList = scmProcessor.getSCMData(wRun); + for (SCMData scmData : scmDataList) { + event = dtoFactory.newDTO(CIEvent.class) + .setEventType(CIEventType.SCM) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setNumber(String.valueOf(r.getNumber())) + .setScmData(scmData); + EventsService.getExtensionInstance().dispatchEvent(event); + } + } else { + logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); + } + } + } + } - CIEvent event; - if (r.getParent() instanceof MatrixConfiguration || r instanceof AbstractBuild) { - AbstractBuild build = (AbstractBuild) r; - if (changelog != null && !changelog.isEmptySet()) { // if there are any commiters - SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); - if (scmProcessor != null) { - createSCMData(r, build, scmProcessor); - } else { - logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); - } - } - } + private void createSCMData(Run run, AbstractBuild build, SCMProcessor scmProcessor) { + CIEvent event; + SCMData scmData = scmProcessor.getSCMData(build); + event = dtoFactory.newDTO(CIEvent.class) + .setEventType(CIEventType.SCM) + .setProject(BuildHandlerUtils.getJobCiId(run)) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(run)) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(run))) + .setNumber(String.valueOf(run.getNumber())) + .setScmData(scmData); + EventsService.getExtensionInstance().dispatchEvent(event); + } - else if (r.getParent() instanceof WorkflowJob) { - WorkflowRun wRun = (WorkflowRun)r; - if (changelog != null && !changelog.isEmptySet() || !wRun.getChangeSets().isEmpty()) { - SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); - if (scmProcessor != null) { - List scmDataList = scmProcessor.getSCMData(wRun); - for (SCMData scmData : scmDataList) { - event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.SCM) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(String.valueOf(r.getNumber())) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setNumber(String.valueOf(r.getNumber())) - .setScmData(scmData); - EventsService.getExtensionInstance().dispatchEvent(event); - } - } else { - logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); - } - } - } - } - - private void createSCMData(Run r, AbstractBuild build, SCMProcessor scmProcessor) { - CIEvent event; - SCMData scmData = scmProcessor.getSCMData(build); - event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.SCM) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(String.valueOf(r.getNumber())) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setNumber(String.valueOf(r.getNumber())) - .setScmData(scmData); - EventsService.getExtensionInstance().dispatchEvent(event); - } - - private List extractCauses(Run r) { - if (r.getParent() instanceof MatrixConfiguration) { - return ((MatrixRun) r).getParentBuild().getCauses(); - } else { - return r.getCauses(); - } - } + private List extractCauses(Run r) { + if (r.getParent() instanceof MatrixConfiguration) { + return ((MatrixRun) r).getParentBuild().getCauses(); + } else { + return r.getCauses(); + } + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java index f417e0b42f..4f0fb2b927 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java @@ -39,74 +39,74 @@ */ public class GenericSCMProcessor implements SCMProcessor { - private static final Logger logger = LogManager.getLogger(GenericSCMProcessor.class); - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - - GenericSCMProcessor(){ - } - - @Override - public SCMData getSCMData(AbstractBuild build) { - SCMData result; - SCMRepository repository = buildScmRepository(); - - ChangeLogSet changes = build.getChangeSet(); - ArrayList tmpCommits = buildScmCommits(changes); - - result = dtoFactory.newDTO(SCMData.class) - .setCommits(tmpCommits) - .setRepository(repository); - - return result; - } - - @Override - public List getSCMData(WorkflowRun run) { - // todo: implement default - yanivl - return null; - } - - private ArrayList buildScmCommits(ChangeLogSet changes) { - ArrayList tmpCommits = new ArrayList<>(); - ArrayList tmpChanges; - SCMChange tmpChange; - - for (ChangeLogSet.Entry c : changes) { - User user = c.getAuthor(); - String userEmail = null; - - tmpChanges = new ArrayList<>(); - - for (ChangeLogSet.AffectedFile item : c.getAffectedFiles()) { - tmpChange = dtoFactory.newDTO(SCMChange.class) - .setType(item.getEditType().getName()) - .setFile(item.getPath()); - tmpChanges.add(tmpChange); - } - - for (UserProperty property : user.getAllProperties()) { - if (property instanceof Mailer.UserProperty) { - userEmail = ((Mailer.UserProperty) property).getAddress(); - } - } - SCMCommit tmpCommit = buildScmCommit(tmpChanges, c, userEmail); - tmpCommits.add(tmpCommit); - } - return tmpCommits; - } - - private SCMCommit buildScmCommit(ArrayList tmpChanges, ChangeLogSet.Entry commit, String userEmail) { - return dtoFactory.newDTO(SCMCommit.class) - .setTime(commit.getTimestamp()) - .setUser(commit.getAuthor().getId()) - .setUserEmail(userEmail) - .setRevId(commit.getCommitId()) - .setComment(commit.getMsg().trim()) - .setChanges(tmpChanges); - } - - private SCMRepository buildScmRepository() { - return dtoFactory.newDTO(SCMRepository.class) - .setType(SCMType.UNKNOWN); - } + private static final Logger logger = LogManager.getLogger(GenericSCMProcessor.class); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + + GenericSCMProcessor() { + } + + @Override + public SCMData getSCMData(AbstractBuild build) { + SCMData result; + SCMRepository repository = buildScmRepository(); + + ChangeLogSet changes = build.getChangeSet(); + ArrayList tmpCommits = buildScmCommits(changes); + + result = dtoFactory.newDTO(SCMData.class) + .setCommits(tmpCommits) + .setRepository(repository); + + return result; + } + + @Override + public List getSCMData(WorkflowRun run) { + // todo: implement default - yanivl + return null; + } + + private ArrayList buildScmCommits(ChangeLogSet changes) { + ArrayList tmpCommits = new ArrayList<>(); + ArrayList tmpChanges; + SCMChange tmpChange; + + for (ChangeLogSet.Entry c : changes) { + User user = c.getAuthor(); + String userEmail = null; + + tmpChanges = new ArrayList<>(); + + for (ChangeLogSet.AffectedFile item : c.getAffectedFiles()) { + tmpChange = dtoFactory.newDTO(SCMChange.class) + .setType(item.getEditType().getName()) + .setFile(item.getPath()); + tmpChanges.add(tmpChange); + } + + for (UserProperty property : user.getAllProperties()) { + if (property instanceof Mailer.UserProperty) { + userEmail = ((Mailer.UserProperty) property).getAddress(); + } + } + SCMCommit tmpCommit = buildScmCommit(tmpChanges, c, userEmail); + tmpCommits.add(tmpCommit); + } + return tmpCommits; + } + + private SCMCommit buildScmCommit(ArrayList tmpChanges, ChangeLogSet.Entry commit, String userEmail) { + return dtoFactory.newDTO(SCMCommit.class) + .setTime(commit.getTimestamp()) + .setUser(commit.getAuthor().getId()) + .setUserEmail(userEmail) + .setRevId(commit.getCommitId()) + .setComment(commit.getMsg().trim()) + .setChanges(tmpChanges); + } + + private SCMRepository buildScmRepository() { + return dtoFactory.newDTO(SCMRepository.class) + .setType(SCMType.UNKNOWN); + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java index 740e5ee36d..826cd38039 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java @@ -7,10 +7,12 @@ import java.util.List; /** + * API definition for SCM content processor/transformer for an Octane context * Created by gullery on 31/03/2015. */ public interface SCMProcessor { SCMData getSCMData(AbstractBuild build); + List getSCMData(WorkflowRun run); } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java index 0e896b98b5..60e75e0bc9 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/CoverageReportsDispatcher.java @@ -51,6 +51,7 @@ /** * this class manages a queue of coverage report upload tasks */ + @Extension public class CoverageReportsDispatcher extends AbstractSafeLoggingAsyncPeriodWork { private static final Logger logger = LogManager.getLogger(CoverageReportsDispatcher.class); @@ -63,6 +64,7 @@ public class CoverageReportsDispatcher extends AbstractSafeLoggingAsyncPeriodWor private RetryModel retryModel; private JenkinsMqmRestClientFactory clientFactory; private final ResultQueue reportsQueue; + @Inject public CoverageReportsDispatcher() throws IOException { super("Octane coverage reports dispatcher"); @@ -125,7 +127,7 @@ private void transferCoverageReports(Run build, MqmRestClient mqmRestClient, Res boolean status = mqmRestClient.postCoverageReports( ConfigurationService.getModel().getIdentity(), BuildHandlerUtils.getJobCiId(build), - String.valueOf(build.getNumber()), + BuildHandlerUtils.getBuildCiId(build), new FileInputStream(coverageFile), coverageFile.length(), item.getType()); if (status) { @@ -158,7 +160,7 @@ private File getCoverageFile(Run build, long index, String coverageReportFileSuf private void reAttemptTask(String projectName, int buildNumber, String itemReportType) { if (!reportsQueue.failed()) { // add task to queue and return true if max attempts not reached, else return false logger.warn("maximum number of attempts reached (" + MAX_RETRIES + "), " + - "operation will not be re-attempted for build "+ projectName + " #" + buildNumber + " of type " + itemReportType); + "operation will not be re-attempted for build " + projectName + " #" + buildNumber + " of type " + itemReportType); retryModel.success(); } else { logger.info("There are pending logs, but we are in quiet period"); @@ -181,7 +183,11 @@ private MqmRestClient initMqmRestClient() { private Run getBuildFromQueueItem(ResultQueue.QueueItem item) { Run result = null; - Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + Jenkins jenkins = Jenkins.getInstance(); + if (jenkins == null) { + throw new IllegalStateException("failed to obtain Jenkins' instance"); + } + Job project = (Job) jenkins.getItemByFullName(item.getProjectName()); if (project != null) { result = project.getBuildByNumber(item.getBuildNumber()); } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java index 88509f2ad5..39d8a565ca 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java @@ -15,78 +15,70 @@ import java.util.ArrayList; import java.util.List; +/** + * Generic utilities handling Job/Run metadata extraction/transformation/processing + */ + public class BuildHandlerUtils { - public static BuildDescriptor getBuildType(Run build) { + public static BuildDescriptor getBuildType(Run run) { for (BuildHandlerExtension ext : BuildHandlerExtension.all()) { - if (ext.supports(build)) { - return ext.getBuildType(build); + if (ext.supports(run)) { + return ext.getBuildType(run); } } return new BuildDescriptor( - BuildHandlerUtils.getJobCiId(build), - build.getParent().getName(), - String.valueOf(build.getNumber()), - String.valueOf(build.getNumber()), + BuildHandlerUtils.getJobCiId(run), + run.getParent().getName(), + BuildHandlerUtils.getBuildCiId(run), + String.valueOf(run.getNumber()), ""); } - public static String getProjectFullName(Run build) { + public static String getProjectFullName(Run run) { for (BuildHandlerExtension ext : BuildHandlerExtension.all()) { - if (ext.supports(build)) { - return ext.getProjectFullName(build); + if (ext.supports(run)) { + return ext.getProjectFullName(run); } } - return build.getParent().getFullName(); - } - - public static FilePath getWorkspace(Run build){ - //this.buildId =/*build.getProject()*/((AbstractProject)build.getParent()).getBuilds().getLastBuild().getId(); - if(build.getExecutor()!=null && build.getExecutor().getCurrentWorkspace()!=null){ - return build.getExecutor().getCurrentWorkspace(); - } - if (build instanceof AbstractBuild){ - return ((AbstractBuild) build).getWorkspace(); - } - if(build instanceof WorkflowBuildAdapter){ - return ((WorkflowBuildAdapter)build).getWorkspace(); -// FilePath filePath = new FilePath(new File(((WorkflowRun) build).getParent().getRootDir(). -// getAbsolutePath()+File.separator +"workspace")); -// return filePath; - } - - return null; + return run.getParent().getFullName(); } - public static String getBuildId(Run build){ -// if(build instanceof AbstractBuild){ -// return ((AbstractProject)build.getParent()).getBuilds().getLastBuild().getId(); -// }else{ -// return build.getParent().getLastBuild().getId(); -// } - return build.getParent().getLastBuild().getId(); + public static FilePath getWorkspace(Run run) { + if (run.getExecutor() != null && run.getExecutor().getCurrentWorkspace() != null) { + return run.getExecutor().getCurrentWorkspace(); + } + if (run instanceof AbstractBuild) { + return ((AbstractBuild) run).getWorkspace(); + } + if (run instanceof WorkflowBuildAdapter) { + return ((WorkflowBuildAdapter) run).getWorkspace(); + } + return null; } - public static List getBuildPerWorkspaces(Run build) { - - if(build instanceof WorkflowRun){ - return WorkflowGraphListener.FlowNodeContainer.getFlowNode(build); - - }else { + public static List getBuildPerWorkspaces(Run run) { + if (run instanceof WorkflowRun) { + return WorkflowGraphListener.FlowNodeContainer.getFlowNode(run); + } else { List runsList = new ArrayList<>(); - runsList.add(build); + runsList.add(run); return runsList; } } - public static String getJobCiId(Run r) { - if (r.getParent() instanceof MatrixConfiguration) { - return JobProcessorFactory.getFlowProcessor(((MatrixRun) r).getParentBuild().getParent()).getTranslateJobName(); + public static String getBuildCiId(Run run) { + return run.getNumber() + "_" + run.getStartTimeInMillis(); + } + + public static String getJobCiId(Run run) { + if (run.getParent() instanceof MatrixConfiguration) { + return JobProcessorFactory.getFlowProcessor(((MatrixRun) run).getParentBuild().getParent()).getTranslateJobName(); } - if (r.getParent().getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { - return JobProcessorFactory.getFlowProcessor(r.getParent()).getTranslateJobName(); + if (run.getParent().getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob")) { + return JobProcessorFactory.getFlowProcessor(run.getParent()).getTranslateJobName(); } - return JobProcessorFactory.getFlowProcessor(((AbstractBuild) r).getProject()).getTranslateJobName(); + return JobProcessorFactory.getFlowProcessor(((AbstractBuild) run).getProject()).getTranslateJobName(); } /** diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java index 5d424ab0bf..4045329c37 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java @@ -26,29 +26,33 @@ import java.util.List; +/** + * Run/Build metadata factory for Matrix projects + */ + @Extension public class MatrixBuildExtension extends BuildHandlerExtension { @Override - public boolean supports(Run build) { - return "hudson.matrix.MatrixRun".equals(build.getClass().getName()); + public boolean supports(Run run) { + return "hudson.matrix.MatrixRun".equals(run.getClass().getName()); } @Override - public BuildDescriptor getBuildType(Run build) { - AbstractBuild matrixRun = (AbstractBuild) build; - List parameters = ParameterProcessors.getInstances(build); + public BuildDescriptor getBuildType(Run run) { + AbstractBuild matrixRun = (AbstractBuild) run; + List parameters = ParameterProcessors.getInstances(run); String subBuildName = ModelFactory.generateSubBuildName(parameters); return new BuildDescriptor( - BuildHandlerUtils.getJobCiId(build), + BuildHandlerUtils.getJobCiId(run), matrixRun.getRootBuild().getProject().getName(), - String.valueOf(build.getNumber()), - String.valueOf(build.getNumber()), + BuildHandlerUtils.getBuildCiId(run), + String.valueOf(run.getNumber()), subBuildName); } @Override - public String getProjectFullName(Run build) { - return ((MatrixRun)build).getProject().getFullName(); + public String getProjectFullName(Run run) { + return ((MatrixRun) run).getProject().getFullName(); } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java index 187a2f6d4c..909f228c63 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java @@ -20,32 +20,36 @@ import hudson.model.AbstractBuild; import hudson.model.Run; +/** + * Run/Build metadata factory for Maven projects + */ + @Extension public class MavenBuildExtension extends BuildHandlerExtension { @Override - public boolean supports(Run build) { - return "hudson.maven.MavenBuild".equals(build.getClass().getName()) || - "hudson.maven.MavenModuleSetBuild".equals(build.getClass().getName()); + public boolean supports(Run run) { + return "hudson.maven.MavenBuild".equals(run.getClass().getName()) || + "hudson.maven.MavenModuleSetBuild".equals(run.getClass().getName()); } @Override - public BuildDescriptor getBuildType(Run build) { + public BuildDescriptor getBuildType(Run run) { return new BuildDescriptor( - BuildHandlerUtils.getJobCiId(build), - ((AbstractBuild)build).getProject().getName(), - String.valueOf(build.getNumber()), - String.valueOf(build.getNumber()), + BuildHandlerUtils.getJobCiId(run), + ((AbstractBuild) run).getProject().getName(), + BuildHandlerUtils.getBuildCiId(run), + String.valueOf(run.getNumber()), ""); } @Override - public String getProjectFullName(Run build) { - if ("hudson.maven.MavenBuild".equals(build.getClass().getName())) { + public String getProjectFullName(Run run) { + if ("hudson.maven.MavenBuild".equals(run.getClass().getName())) { // we don't push individual maven module results (although we create the file) return null; } else { - return ((AbstractBuild)build).getProject().getFullName(); + return ((AbstractBuild) run).getProject().getFullName(); } } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java index 4dfa1faa5a..18567101c6 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java @@ -55,17 +55,18 @@ public class JUnitExtension extends MqmTestsExtension { private static Logger logger = LogManager.getLogger(JUnitExtension.class); - public static final String STORM_RUNNER = "StormRunner"; - public static final String LOAD_RUNNER = "LoadRunner"; - public static final String PERFORMANCE_CENTER_RUNNER = "Performance Center"; - public static final String PERFORMANCE_TEST_TYPE = "Performance"; + private static final String STORM_RUNNER = "StormRunner"; + private static final String LOAD_RUNNER = "LoadRunner"; + private static final String PERFORMANCE_CENTER_RUNNER = "Performance Center"; + private static final String PERFORMANCE_TEST_TYPE = "Performance"; private static final String JUNIT_RESULT_XML = "junitResult.xml"; // NON-NLS - private static final String PREFORMANCE_REPORT = "PerformanceReport"; + private static final String PERFORMANCE_REPORT = "PerformanceReport"; private static final String TRANSACTION_SUMMARY = "TransactionSummary"; + @Inject - ResultFieldsDetectionService resultFieldsDetectionService; + private ResultFieldsDetectionService resultFieldsDetectionService; public boolean supports(Run build) throws IOException, InterruptedException { if (build.getAction(CucumberTestResultsAction.class) != null) { @@ -81,23 +82,23 @@ public boolean supports(Run build) throws IOException, InterruptedExceptio } @Override - public TestResultContainer getTestResults(Run build, HPRunnerType hpRunnerType, String jenkinsRootUrl) throws IOException, InterruptedException { + public TestResultContainer getTestResults(Run run, HPRunnerType hpRunnerType, String jenkinsRootUrl) throws IOException, InterruptedException { logger.debug("Collecting JUnit results"); - boolean isLoadRunnerProject = isLoadRunnerProject(build); - FilePath resultFile = new FilePath(build.getRootDir()).child(JUNIT_RESULT_XML); + boolean isLoadRunnerProject = isLoadRunnerProject(run); + FilePath resultFile = new FilePath(run.getRootDir()).child(JUNIT_RESULT_XML); if (resultFile.exists()) { logger.debug("JUnit result report found"); - ResultFields detectedFields = getResultFields(build, hpRunnerType, isLoadRunnerProject); - FilePath filePath= BuildHandlerUtils.getWorkspace(build).act(new GetJUnitTestResults(build, Arrays.asList(resultFile), shallStripPackageAndClass(detectedFields), hpRunnerType, jenkinsRootUrl)); + ResultFields detectedFields = getResultFields(run, hpRunnerType, isLoadRunnerProject); + FilePath filePath = BuildHandlerUtils.getWorkspace(run).act(new GetJUnitTestResults(run, Arrays.asList(resultFile), false, hpRunnerType, jenkinsRootUrl)); return new TestResultContainer(new ObjectStreamIterator(filePath, true), detectedFields); } else { //avoid java.lang.NoClassDefFoundError when maven plugin is not present - if ("hudson.maven.MavenModuleSetBuild".equals(build.getClass().getName())) { + if ("hudson.maven.MavenModuleSetBuild".equals(run.getClass().getName())) { logger.debug("MavenModuleSetBuild detected, looking for results in maven modules"); - List resultFiles = new LinkedList(); - Map moduleLastBuilds = ((MavenModuleSetBuild) build).getModuleLastBuilds(); + List resultFiles = new LinkedList<>(); + Map moduleLastBuilds = ((MavenModuleSetBuild) run).getModuleLastBuilds(); for (MavenBuild mavenBuild : moduleLastBuilds.values()) { AbstractTestResultAction action = mavenBuild.getAction(AbstractTestResultAction.class); if (action != null) { @@ -109,8 +110,8 @@ public TestResultContainer getTestResults(Run build, HPRunnerType hpRunner } } if (!resultFiles.isEmpty()) { - ResultFields detectedFields = getResultFields(build, hpRunnerType, isLoadRunnerProject); - FilePath filePath = BuildHandlerUtils.getWorkspace(build).act(new GetJUnitTestResults(build, resultFiles, shallStripPackageAndClass(detectedFields), hpRunnerType, jenkinsRootUrl)); + ResultFields detectedFields = getResultFields(run, hpRunnerType, isLoadRunnerProject); + FilePath filePath = BuildHandlerUtils.getWorkspace(run).act(new GetJUnitTestResults(run, resultFiles, false, hpRunnerType, jenkinsRootUrl)); return new TestResultContainer(new ObjectStreamIterator(filePath, true), detectedFields); } } @@ -134,20 +135,13 @@ private ResultFields getResultFields(Run build, HPRunnerType hpRunnerType, return detectedFields; } - private boolean shallStripPackageAndClass(ResultFields resultFields) { - /*if (resultFields == null) { - return false; - }*/ - return false; //resultFields.equals(new ResultFields("UFT", "UFT", null)); - } - - private boolean isLoadRunnerProject(Run build) throws IOException, InterruptedException { - FilePath preformanceReportFolder = new FilePath(build.getRootDir()).child(PREFORMANCE_REPORT); - FilePath transactionSummaryFolder = new FilePath(build.getRootDir()).child(TRANSACTION_SUMMARY); - if ((preformanceReportFolder.exists() && preformanceReportFolder.isDirectory()) && (transactionSummaryFolder.exists() && transactionSummaryFolder.isDirectory())) { - return true; - } - return false; + private boolean isLoadRunnerProject(Run run) throws IOException, InterruptedException { + FilePath performanceReportFolder = new FilePath(run.getRootDir()).child(PERFORMANCE_REPORT); + FilePath transactionSummaryFolder = new FilePath(run.getRootDir()).child(TRANSACTION_SUMMARY); + return performanceReportFolder.exists() && + performanceReportFolder.isDirectory() && + transactionSummaryFolder.exists() && + transactionSummaryFolder.isDirectory(); } private static class GetJUnitTestResults implements FilePath.FileCallable { @@ -169,27 +163,26 @@ private static class GetJUnitTestResults implements FilePath.FileCallable build, List reports, boolean stripPackageAndClass, HPRunnerType hpRunnerType, String jenkinsRootUrl) throws IOException, InterruptedException { + public GetJUnitTestResults(Run build, List reports, boolean stripPackageAndClass, HPRunnerType hpRunnerType, String jenkinsRootUrl) throws IOException, InterruptedException { this.reports = reports; this.filePath = new FilePath(build.getRootDir()).createTempFile(getClass().getSimpleName(), null); this.buildStarted = build.getStartTimeInMillis(); - this.workspace = BuildHandlerUtils.getWorkspace(build);//build.getExecutor().getCurrentWorkspace();//build.getWorkspace(); + this.workspace = BuildHandlerUtils.getWorkspace(build); this.stripPackageAndClass = stripPackageAndClass; this.hpRunnerType = hpRunnerType; this.jenkinsRootUrl = jenkinsRootUrl; this.buildRootDir = build.getRootDir().getCanonicalPath(); this.sharedCheckOutDirectory = CheckOutSubDirEnvContributor.getSharedCheckOutDirectory(build.getParent()); - //AbstractProject project = (AbstractProject)build.getParent();/*build.getProject()*/; - this.jobName =build.getParent().getName();// project.getName(); - this.buildId = BuildHandlerUtils.getBuildId(build);///*build.getProject()*/((AbstractProject)build.getParent()).getBuilds().getLastBuild().getId(); - moduleDetection =Arrays.asList( + this.jobName = build.getParent().getName(); + this.buildId = build.getId(); + moduleDetection = Arrays.asList( new MavenBuilderModuleDetection(build), new MavenSetModuleDetection(build), new ModuleDetection.Default()); - if(HPRunnerType.UFT.equals(hpRunnerType)){ + if (HPRunnerType.UFT.equals(hpRunnerType)) { //extract folder names for created tests String reportFolder = buildRootDir + "/archive/UFTReport"; @@ -209,8 +202,7 @@ public GetJUnitTestResults( Run build, List reports, boolean str try { File file = new File(build.getRootDir(), "log"); Path path = Paths.get(file.getPath()); - List lines = Files.readAllLines(path, StandardCharsets.UTF_8); - additionalContext = lines; + additionalContext = Files.readAllLines(path, StandardCharsets.UTF_8); } catch (Exception e) { logger.error("Failed to add log file for StormRunner :" + e.getMessage()); } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java index 56382d993b..cea0648c55 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java @@ -41,7 +41,6 @@ public class TestResultXmlWriter { private FilePath targetPath; - //private Run build; private BuildDescriptor buildDescriptor; private XMLStreamWriter writer; @@ -54,7 +53,6 @@ public TestResultXmlWriter(FilePath targetPath, BuildDescriptor buildDescriptor) public TestResultXmlWriter(FilePath targetPath, Run build) { this.targetPath = targetPath; - //this.build = build; this.buildDescriptor = BuildHandlerUtils.getBuildType(build); } @@ -84,19 +82,18 @@ public void close() throws XMLStreamException { private void initialize(ResultFields resultFields) throws IOException, InterruptedException, XMLStreamException { if (outputStream == null) { outputStream = targetPath.write(); - writer = possiblyCreateIndentingWriter(XMLOutputFactory.newInstance().createXMLStreamWriter(outputStream)); + writer = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStream); writer.writeStartDocument(); writer.writeStartElement("test_result"); writer.writeStartElement("build"); writer.writeAttribute("server_id", ConfigurationService.getModel().getIdentity()); - BuildDescriptor descriptor = this.buildDescriptor; - writer.writeAttribute("job_id", descriptor.getJobId()); - writer.writeAttribute("job_name", descriptor.getJobName()); - writer.writeAttribute("build_id", descriptor.getBuildId()); - writer.writeAttribute("build_name", descriptor.getBuildName()); - if (!StringUtils.isEmpty(descriptor.getSubType())) { - writer.writeAttribute("sub_type", descriptor.getSubType()); + writer.writeAttribute("job_id", buildDescriptor.getJobId()); + writer.writeAttribute("job_name", buildDescriptor.getJobName()); + writer.writeAttribute("build_id", buildDescriptor.getBuildId()); + writer.writeAttribute("build_name", buildDescriptor.getBuildName()); + if (!StringUtils.isEmpty(buildDescriptor.getSubType())) { + writer.writeAttribute("sub_type", buildDescriptor.getSubType()); } writer.writeEndElement(); // build writeFields(resultFields); @@ -123,17 +120,4 @@ private void writeField(String type, String value) throws XMLStreamException { writer.writeEndElement(); } } - - // TODO: check if there is public mechanism yet - private XMLStreamWriter possiblyCreateIndentingWriter(XMLStreamWriter writer) { - try { - Class clazz = Class.forName("com.sun.xml.txw2.output.IndentingXMLStreamWriter"); - XMLStreamWriter xmlStreamWriter = (XMLStreamWriter) clazz.getConstructor(XMLStreamWriter.class).newInstance(writer); - clazz.getMethod("setIndentStep", String.class).invoke(xmlStreamWriter, " "); - return xmlStreamWriter; - } catch (Exception e) { - // do without indentation - return writer; - } - } } From fd0c3285f6b6c440dcd305c8cc3b123ff580be84 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 12 Nov 2017 13:35:51 +0200 Subject: [PATCH 0181/2502] Fix command line when launching the tunnel client (Path to config must be without "" --- .../automation/tools/run/CreateTunnelBuilder.java | 10 +++++++--- .../settings/SrfServerSettingsBuilder/global.jelly | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index ec7583233f..e25e5d64ff 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -52,17 +52,21 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, logger = listener.getLogger(); JSONObject connectionData = RunFromSrfBuilder.GetSrfConnectionData(build, logger); JSONObject configData; - String client = "\"" +"-client=" + connectionData.getString("app") +"\""; + String client = "-client=" + connectionData.getString("app") ; String path =connectionData.getString("tunnel"); - String config = String.format("-\"config=%s\"", srfTunnelName); + String config = String.format("-config=%s", srfTunnelName); ProcessBuilder pb = new ProcessBuilder(path, config, "-reconnect-attempts=3", "-log-level=info", "-log=stdout"); pb.redirectOutput(); logger.println("Launching "+path + " " + config ); + String[] cmdArray = { path, config, "-reconnect-attempts=3", "-log-level=info", "-log=stdout"}; + //Process p = pb.start(); + Process p = Runtime.getRuntime().exec(cmdArray); + + - Process p = pb.start(); TunnelTracker tracker = new TunnelTracker(logger, p); java.lang.Thread th = new Thread(tracker, "trackeer"); Tunnels.add(p); diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly index 81e33c801b..3ba9c71f6c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly @@ -142,7 +142,7 @@ - +
    From 9401b05029ca11823d2ebbb54dd660dbc43fb4d5 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 26 Nov 2017 16:07:18 +0200 Subject: [PATCH 0182/2502] repeat fix --- .../automation/tools/run/CreateTunnelBuilder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index 05f3382b0d..50cac11e7f 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -52,7 +52,7 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, logger = listener.getLogger(); JSONObject connectionData = RunFromSrfBuilder.GetSrfConnectionData(build, logger); JSONObject configData; - String client = "\"" +"-client=" + connectionData.getString("app") +"\""; + String client = "-client=" + connectionData.getString("app") ; String path =connectionData.getString("tunnel"); @@ -61,8 +61,9 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, ProcessBuilder pb = new ProcessBuilder(path, config, "-reconnect-attempts=3", "-log-level=info", "-log=stdout"); pb.redirectOutput(); logger.println("Launching "+path + " " + config ); - - Process p = pb.start(); + String[] cmdArray = { path, config, "-reconnect-attempts=3", "-log-level=info", "-log=stdout"}; + // Process p = pb.start(); + Process p = Runtime.getRuntime().exec(cmdArray); TunnelTracker tracker = new TunnelTracker(logger, p); java.lang.Thread th = new Thread(tracker, "trackeer"); Tunnels.add(p); From 129f40c3d116034e2eb7d66f00001767593082b2 Mon Sep 17 00:00:00 2001 From: ido gadiel Date: Mon, 27 Nov 2017 01:38:35 +0200 Subject: [PATCH 0183/2502] Defect #505031: suspend octane events doesnt work from the CI (#61) --- .../tools/settings/OctaneServerSettingsBuilder/global.jelly | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly index cc0d47a13a..8eab651242 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.jelly @@ -44,10 +44,10 @@ - - +
    + - +
    From 96f8888c9c0f4e8e84ab65f6afd64c62466fceed Mon Sep 17 00:00:00 2001 From: YafimK Date: Sun, 3 Dec 2017 08:58:04 +0200 Subject: [PATCH 0184/2502] Updated copyright to all HPE files --- HpToolsLauncher/JunitXml/junit.xsd | 33 ++++++++++++ HpToolsLauncher/MtbxSchema.xsd | 35 +++++++++++- pom.xml | 33 ++++++++++++ sonar-project.properties | 33 ++++++++++++ .../automation/tools/AlmToolsUtils.java | 36 +++++++++++-- .../automation/tools/EncryptionUtils.java | 36 +++++++++++-- .../tools/common/ALMRESTVersionUtils.java | 33 ++++++++++++ .../automation/tools/common/Func.java | 33 ++++++++++++ .../automation/tools/common/HttpStatus.java | 37 +++++++++---- .../automation/tools/common/Pair.java | 33 ++++++++++++ .../automation/tools/common/PcException.java | 33 ++++++++++++ .../tools/common/RuntimeIOException.java | 37 +++++++++---- .../automation/tools/common/RuntimeUtils.java | 33 ++++++++++++ .../automation/tools/common/SSEException.java | 33 ++++++++++++ .../automation/tools/mc/Constants.java | 33 ++++++++++++ .../automation/tools/mc/HttpResponse.java | 33 ++++++++++++ .../automation/tools/mc/HttpUtils.java | 33 ++++++++++++ .../tools/mc/JobConfigurationProxy.java | 33 ++++++++++++ .../automation/tools/model/ALMVersion.java | 33 ++++++++++++ .../model/AUTEnvironmentModelResolver.java | 33 ++++++++++++ .../model/AUTEnvironmentResolvedModel.java | 33 ++++++++++++ .../tools/model/AbstractSvRunModel.java | 36 +++++++++++-- .../tools/model/AlmServerSettingsModel.java | 36 +++++++++++-- .../tools/model/AutEnvironmentModel.java | 33 ++++++++++++ .../model/AutEnvironmentParameterModel.java | 33 ++++++++++++ .../automation/tools/model/CdaDetails.java | 33 ++++++++++++ .../tools/model/CreateTunnelModel.java | 33 ++++++++++++ .../tools/model/EnumDescription.java | 36 +++++++++++-- .../tools/model/MCServerSettingsModel.java | 33 ++++++++++++ .../model/OctaneServerSettingsModel.java | 36 +++++++++++-- .../automation/tools/model/Pair.java | 33 ++++++++++++ .../automation/tools/model/PcModel.java | 33 ++++++++++++ .../automation/tools/model/PostRunAction.java | 33 ++++++++++++ .../automation/tools/model/ProxySettings.java | 33 ++++++++++++ .../tools/model/ResultsPublisherModel.java | 36 +++++++++++-- .../tools/model/RunFromAlmModel.java | 36 +++++++++++-- .../tools/model/RunFromFileSystemModel.java | 36 +++++++++++-- .../automation/tools/model/RunMode.java | 36 +++++++++++-- .../tools/model/SecretContainer.java | 33 ++++++++++++ .../tools/model/SecretContainerImpl.java | 33 ++++++++++++ .../tools/model/SrfServerSettingsModel.java | 33 ++++++++++++ .../tools/model/SrfTestParamsModel.java | 33 ++++++++++++ .../tools/model/SrfTestResultModel.java | 33 ++++++++++++ .../automation/tools/model/SseModel.java | 33 ++++++++++++ .../tools/model/SseProxySettings.java | 33 ++++++++++++ .../tools/model/SvChangeModeModel.java | 36 +++++++++++-- .../tools/model/SvDataModelSelection.java | 36 +++++++++++-- .../automation/tools/model/SvDeployModel.java | 36 +++++++++++-- .../automation/tools/model/SvExportModel.java | 36 +++++++++++-- .../model/SvPerformanceModelSelection.java | 36 +++++++++++-- .../tools/model/SvServerSettingsModel.java | 36 +++++++++++-- .../tools/model/SvServiceSelectionModel.java | 36 +++++++++++-- .../tools/model/SvUndeployModel.java | 36 +++++++++++-- .../tools/model/TimeslotDuration.java | 33 ++++++++++++ .../tools/model/UploadAppModel.java | 33 ++++++++++++ .../tools/model/UploadAppPathModel.java | 33 ++++++++++++ .../model/UploadTestResultToAlmModel.java | 36 +++++++++++-- .../tools/octane/AbstractResultQueueImpl.java | 37 +++++++++---- .../tools/octane/CIJenkinsServicesImpl.java | 37 +++++++++---- .../automation/tools/octane/ResultQueue.java | 37 +++++++++---- .../tools/octane/actions/BuildActions.java | 37 +++++++++---- .../tools/octane/actions/PluginActions.java | 37 +++++++++---- .../tools/octane/actions/UFTParameter.java | 37 +++++++++---- .../octane/actions/UFTParameterFactory.java | 37 +++++++++---- .../actions/UFTTestDetectionBuildAction.java | 37 +++++++++---- .../actions/UFTTestDetectionPublisher.java | 37 +++++++++---- .../tools/octane/actions/UFTTestUtil.java | 37 +++++++++---- .../tools/octane/actions/UftTestType.java | 37 +++++++++---- .../cucumber/CucumberResultsService.java | 37 +++++++++---- .../cucumber/CucumberTestResultsAction.java | 37 +++++++++---- .../CucumberTestResultsActionPublisher.java | 37 +++++++++---- .../octane/actions/dto/AutomatedTest.java | 37 +++++++++---- .../octane/actions/dto/AutomatedTests.java | 33 ++++++++++++ .../octane/actions/dto/BaseRefEntity.java | 37 +++++++++---- .../octane/actions/dto/ListNodeEntity.java | 37 +++++++++---- .../actions/dto/ListNodeEntityCollection.java | 37 +++++++++---- .../octane/actions/dto/ScmResourceFile.java | 37 +++++++++---- .../octane/actions/dto/ScmResources.java | 37 +++++++++---- .../tools/octane/bridge/BridgeClient.java | 37 +++++++++---- .../tools/octane/bridge/BridgesService.java | 37 +++++++++---- .../tools/octane/buildLogs/LogDispatcher.java | 37 +++++++++---- .../octane/buildLogs/LogsResultQueue.java | 37 +++++++++---- .../tools/octane/buildLogs/OctaneLog.java | 33 ++++++++++++ .../octane/buildLogs/RunListenerForLogs.java | 37 +++++++++---- .../tools/octane/client/EventPublisher.java | 37 +++++++++---- .../client/JenkinsInsightEventPublisher.java | 37 +++++++++---- .../client/JenkinsMqmRestClientFactory.java | 37 +++++++++---- .../JenkinsMqmRestClientFactoryImpl.java | 37 +++++++++---- .../tools/octane/client/RetryModel.java | 37 +++++++++---- .../tools/octane/configuration/ConfigApi.java | 37 +++++++++---- .../configuration/ConfigurationAction.java | 37 +++++++++---- .../ConfigurationActionFactory.java | 37 +++++++++---- .../configuration/ConfigurationListener.java | 37 +++++++++---- .../configuration/ConfigurationParser.java | 37 +++++++++---- .../configuration/ConfigurationService.java | 37 +++++++++---- .../configuration/JobConfigurationProxy.java | 37 +++++++++---- .../octane/configuration/MqmProject.java | 37 +++++++++---- .../PredefinedConfiguration.java | 37 +++++++++---- .../PredefinedConfigurationUnmarshaller.java | 37 +++++++++---- .../configuration/ServerConfiguration.java | 37 +++++++++---- .../tools/octane/events/EventsClient.java | 37 +++++++++---- .../tools/octane/events/EventsService.java | 37 +++++++++---- .../tools/octane/events/ItemListenerImpl.java | 37 +++++++++---- .../octane/events/QueueListenerImpl.java | 37 +++++++++---- .../tools/octane/events/RunListenerImpl.java | 37 +++++++++---- .../tools/octane/events/SCMListenerImpl.java | 37 +++++++++---- .../tools/octane/events/TestListenerImpl.java | 37 +++++++++---- .../CheckOutSubDirEnvContributor.java | 37 +++++++++---- .../executor/CheckOutSubDirEnvService.java | 37 +++++++++---- .../executor/ExecutorConnectivityService.java | 37 +++++++++---- .../octane/executor/OctaneConstants.java | 37 +++++++++---- .../TestExecutionJobCreatorService.java | 37 +++++++++---- .../executor/TriggeredBySuiteRunCause.java | 37 +++++++++---- .../executor/UFTTestDetectionResult.java | 37 +++++++++---- .../executor/UFTTestDetectionService.java | 37 +++++++++---- .../tools/octane/executor/UftConstants.java | 37 +++++++++---- .../tools/octane/executor/UftJobCleaner.java | 37 +++++++++---- .../octane/executor/UftJobRecognizer.java | 37 +++++++++---- .../executor/UftTestDiscoveryDispatcher.java | 37 +++++++++---- .../executor/UftTestDiscoveryQueue.java | 37 +++++++++---- .../octane/model/CIEventCausesFactory.java | 37 +++++++++---- .../tools/octane/model/ModelFactory.java | 37 +++++++++---- .../builders/AbstractBuilderProcessor.java | 37 +++++++++---- .../builders/BuildTriggerProcessor.java | 37 +++++++++---- .../builders/MultiJobBuilderProcessor.java | 37 +++++++++---- .../ParameterizedTriggerProcessor.java | 37 +++++++++---- .../builders/WorkFlowRunProcessor.java | 37 +++++++++---- .../AbstractParametersProcessor.java | 37 +++++++++---- .../parameters/DynamicParameterProcessor.java | 37 +++++++++---- .../ExtendedChoiceParameterProcessor.java | 37 +++++++++---- .../InherentParameterProcessor.java | 37 +++++++++---- .../NodeLabelParameterProcessor.java | 37 +++++++++---- .../parameters/ParameterProcessors.java | 37 +++++++++---- .../RandomStringParameterProcessor.java | 37 +++++++++---- .../UnsupportedParameterProcessor.java | 37 +++++++++---- .../projects/AbstractProjectProcessor.java | 37 +++++++++---- .../projects/FreeStyleProjectProcessor.java | 37 +++++++++---- .../projects/JobProcessorFactory.java | 37 +++++++++---- .../projects/MatrixProjectProcessor.java | 37 +++++++++---- .../projects/MavenProjectProcessor.java | 37 +++++++++---- .../projects/MultiJobProjectProcessor.java | 37 +++++++++---- .../projects/UnsupportedProjectProcessor.java | 37 +++++++++---- .../projects/WorkFlowJobProcessor.java | 37 +++++++++---- .../processors/scm/GenericSCMProcessor.java | 37 +++++++++---- .../model/processors/scm/GitSCMProcessor.java | 37 +++++++++---- .../model/processors/scm/SCMProcessor.java | 33 ++++++++++++ .../model/processors/scm/SCMProcessors.java | 37 +++++++++---- .../model/processors/scm/SvnSCMProcessor.java | 37 +++++++++---- .../AbstractSafeLoggingAsyncPeriodWork.java | 37 +++++++++---- .../tools/octane/tests/HPRunnerType.java | 37 +++++++++---- .../tools/octane/tests/MqmTestsExtension.java | 33 +++++++++++- .../tools/octane/tests/TestApi.java | 37 +++++++++---- .../tools/octane/tests/TestDispatcher.java | 37 +++++++++---- .../tools/octane/tests/TestListener.java | 37 +++++++++---- .../octane/tests/TestProcessingException.java | 37 +++++++++---- .../octane/tests/TestResultContainer.java | 37 +++++++++---- .../tools/octane/tests/TestsResultQueue.java | 37 +++++++++---- .../octane/tests/build/BuildDescriptor.java | 33 +++++++++++- .../tests/build/BuildHandlerExtension.java | 33 +++++++++++- .../octane/tests/build/BuildHandlerUtils.java | 33 +++++++++++- .../tests/build/MatrixBuildExtension.java | 37 +++++++++---- .../tests/build/MavenBuildExtension.java | 37 +++++++++---- .../octane/tests/detection/ResultFields.java | 37 +++++++++---- .../ResultFieldsDetectionExtension.java | 37 +++++++++---- .../ResultFieldsDetectionService.java | 37 +++++++++---- .../tests/detection/TestNGExtension.java | 37 +++++++++---- .../octane/tests/detection/UFTExtension.java | 37 +++++++++---- .../tests/gherkin/GherkinTestExtention.java | 37 +++++++++---- .../tests/gherkin/GherkinTestResult.java | 37 +++++++++---- .../gherkin/GherkinTestResultsCollector.java | 37 +++++++++---- .../tests/impl/ObjectStreamIterator.java | 37 +++++++++---- .../junit/AbstractMavenModuleDetection.java | 37 +++++++++---- .../octane/tests/junit/JUnitExtension.java | 37 +++++++++---- .../octane/tests/junit/JUnitTestResult.java | 37 +++++++++---- .../octane/tests/junit/JUnitXmlIterator.java | 37 +++++++++---- .../junit/MavenBuilderModuleDetection.java | 37 +++++++++---- .../tests/junit/MavenSetModuleDetection.java | 37 +++++++++---- .../octane/tests/junit/ModuleDetection.java | 33 +++++++++++- .../tools/octane/tests/junit/TestError.java | 37 +++++++++---- .../octane/tests/junit/TestResultStatus.java | 33 +++++++++++- .../octane/tests/testResult/TestResult.java | 37 +++++++++---- .../octane/tests/xml/AbstractXmlIterator.java | 37 +++++++++---- .../octane/tests/xml/TestResultXmlWriter.java | 37 +++++++++---- .../tools/octane/workflow/BuildRelations.java | 37 +++++++++---- .../octane/workflow/WorkflowBuildAdapter.java | 37 +++++++++---- .../workflow/WorkflowGraphListener.java | 37 +++++++++---- .../automation/tools/pc/PcClient.java | 13 ++++- .../automation/tools/pc/PcErrorResponse.java | 13 ++++- .../automation/tools/pc/PcRestProxy.java | 13 ++++- .../automation/tools/pc/PcRunEventLog.java | 13 ++++- .../tools/pc/PcRunEventLogRecord.java | 13 ++++- .../automation/tools/pc/PcRunRequest.java | 13 ++++- .../automation/tools/pc/PcRunResponse.java | 13 ++++- .../automation/tools/pc/PcRunResult.java | 13 ++++- .../automation/tools/pc/PcRunResults.java | 13 ++++- .../automation/tools/pc/PcTest.java | 33 ++++++++++++ .../automation/tools/pc/PcTestData.java | 33 ++++++++++++ .../automation/tools/pc/PcTestInstance.java | 33 ++++++++++++ .../automation/tools/pc/PcTestInstances.java | 33 ++++++++++++ .../automation/tools/pc/PcTestSet.java | 33 ++++++++++++ .../automation/tools/pc/PcTestSets.java | 33 ++++++++++++ .../tools/pc/PcTrendReportMetaData.java | 13 ++++- .../automation/tools/pc/PcTrendedRun.java | 13 ++++- .../automation/tools/pc/ReleaseTimeslot.java | 13 ++++- .../automation/tools/pc/RunState.java | 13 ++++- .../tools/pc/TestInstanceCreateRequest.java | 33 ++++++++++++ .../automation/tools/pc/TimeInterval.java | 13 ++++- .../tools/pc/TrendReportMonitorsDataRow.java | 13 ++++- .../tools/pc/TrendReportMonitorsDataRows.java | 13 ++++- .../tools/pc/TrendReportRegularDataRow.java | 13 ++++- .../tools/pc/TrendReportRegularDataRows.java | 13 ++++- .../tools/pc/TrendReportRequest.java | 13 ++++- .../pc/TrendReportTransactionDataRoot.java | 13 ++++- .../pc/TrendReportTransactionDataRow.java | 13 ++++- .../pc/TrendReportTransactionDataRows.java | 13 ++++- .../automation/tools/pc/TrendReportTypes.java | 13 ++++- .../automation/tools/pc/TrendedRange.java | 13 ++++- .../tools/pipelineSteps/AbstractSvStep.java | 33 ++++++++++++ .../AbstractSvStepDescriptor.java | 33 ++++++++++++ .../pipelineSteps/LoadRunnerScriptStep.java | 33 ++++++++++++ .../pipelineSteps/LoadRunnerTestStep.java | 12 ++++- .../LrScenarioLoadStepExecution.java | 13 ++++- .../pipelineSteps/SseBuildAndPublishStep.java | 20 ++++--- .../SseBuilderPublishResultStepExecution.java | 51 ++++++++++-------- .../tools/pipelineSteps/SvChangeModeStep.java | 33 ++++++++++++ .../tools/pipelineSteps/SvDeployStep.java | 33 ++++++++++++ .../tools/pipelineSteps/SvExecution.java | 33 ++++++++++++ .../tools/pipelineSteps/SvExportStep.java | 33 ++++++++++++ .../tools/pipelineSteps/SvUndeployStep.java | 33 ++++++++++++ .../pipelineSteps/UftScenarioLoadStep.java | 12 ++++- .../UftScenarioLoadStepExecution.java | 13 ++++- .../automation/tools/rest/RESTConstants.java | 33 ++++++++++++ .../automation/tools/rest/RestClient.java | 33 ++++++++++++ .../tools/results/DetailReport.java | 33 ++++++++++++ .../tools/results/HtmlBuildReportAction.java | 15 +++++- .../tools/results/LrGraphUtils.java | 11 +++- .../results/PerformanceJobReportAction.java | 11 +++- .../results/PerformanceProjectAction.java | 11 +++- .../results/PerformanceReportAction.java | 15 +++++- .../tools/results/ReportMetaData.java | 37 +++++++++++-- .../tools/results/RunResultRecorder.java | 44 ++++++++++----- .../tools/results/SlaRuleTypes.java | 33 ++++++++++++ .../tools/results/SrfDetailReport.java | 33 ++++++++++++ .../tools/results/SrfResultsReport.java | 33 ++++++++++++ .../tools/results/SrfSummaryReport.java | 33 ++++++++++++ .../tools/results/SummaryReport.java | 33 ++++++++++++ .../results/TestResultToALMUploader.java | 36 +++++++++++-- .../results/TransactionSummaryAction.java | 15 +++++- .../LrScriptHtmlReport.java | 33 ++++++++++++ .../LrScriptHtmlReportAction.java | 33 ++++++++++++ .../LrScriptResultsSanitizer.java | 33 ++++++++++++ .../results/parser/ReportParseException.java | 33 ++++++++++++ .../tools/results/parser/ReportParser.java | 33 ++++++++++++ .../results/parser/ReportParserManager.java | 33 ++++++++++++ .../antjunit/AntJUnitReportParserImpl.java | 33 ++++++++++++ .../tools/results/parser/antjunit/Error.java | 33 ++++++++++++ .../results/parser/antjunit/Failure.java | 33 ++++++++++++ .../parser/antjunit/ObjectFactory.java | 33 ++++++++++++ .../results/parser/antjunit/Properties.java | 33 ++++++++++++ .../results/parser/antjunit/Property.java | 33 ++++++++++++ .../results/parser/antjunit/Testcase.java | 33 ++++++++++++ .../results/parser/antjunit/Testsuite.java | 33 ++++++++++++ .../results/parser/antjunit/Testsuites.java | 33 ++++++++++++ .../JenkinsJUnitReportParserImpl.java | 33 ++++++++++++ .../parser/jenkinsjunit/NewDataSet.java | 33 ++++++++++++ .../parser/jenkinsjunit/ObjectFactory.java | 33 ++++++++++++ .../results/parser/jenkinsjunit/Result.java | 33 ++++++++++++ .../results/parser/mavensurefire/Error.java | 33 ++++++++++++ .../results/parser/mavensurefire/Failure.java | 33 ++++++++++++ .../MavenSureFireReportParserImpl.java | 33 ++++++++++++ .../parser/mavensurefire/ObjectFactory.java | 33 ++++++++++++ .../parser/mavensurefire/Properties.java | 33 ++++++++++++ .../parser/mavensurefire/Property.java | 33 ++++++++++++ .../parser/mavensurefire/Testcase.java | 33 ++++++++++++ .../parser/mavensurefire/Testsuite.java | 33 ++++++++++++ .../results/parser/nunit/CategoriesType.java | 33 ++++++++++++ .../results/parser/nunit/CategoryType.java | 33 ++++++++++++ .../results/parser/nunit/FailureType.java | 33 ++++++++++++ .../parser/nunit/NUnitReportParserImpl.java | 33 ++++++++++++ .../results/parser/nunit/ObjectFactory.java | 33 ++++++++++++ .../results/parser/nunit/ReasonType.java | 33 ++++++++++++ .../results/parser/nunit/ResultType.java | 33 ++++++++++++ .../results/parser/nunit/ResultsType.java | 33 ++++++++++++ .../results/parser/nunit/TestCaseType.java | 33 ++++++++++++ .../results/parser/nunit/TestSuiteType.java | 33 ++++++++++++ .../results/parser/testngxml/NewDataSet.java | 33 ++++++++++++ .../parser/testngxml/ObjectFactory.java | 33 ++++++++++++ .../testngxml/TestNGXmlReportParserImpl.java | 33 ++++++++++++ .../parser/testngxml/TestngResults.java | 33 ++++++++++++ .../tools/results/parser/util/ParserUtil.java | 33 ++++++++++++ .../tools/results/parser/util/TimeUtil.java | 33 ++++++++++++ .../results/projectparser/package-info.java | 33 ++++++++++++ .../AvgTransactionResponseTime.java | 33 ++++++++++++ .../projectparser/performance/GoalResult.java | 33 ++++++++++++ .../performance/JobLrScenarioResult.java | 11 +++- .../performance/LrJobResults.java | 11 +++- .../performance/LrProjectScenarioResults.java | 11 +++- .../performance/LrRunResults.java | 11 +++- .../projectparser/performance/LrScenario.java | 11 +++- .../projectparser/performance/LrTest.java | 33 ++++++++++++ .../PercentileTransactionWholeRun.java | 33 ++++++++++++ .../performance/ProjectLrResults.java | 11 +++- .../projectparser/performance/TimeRange.java | 33 ++++++++++++ .../performance/TimeRangeResult.java | 33 ++++++++++++ .../performance/WholeRunResult.java | 33 ++++++++++++ .../performance/XmlParserUtil.java | 33 ++++++++++++ .../results/service/AlmRestException.java | 33 ++++++++++++ .../tools/results/service/AlmRestInfo.java | 33 ++++++++++++ .../tools/results/service/AlmRestTool.java | 33 ++++++++++++ ...efaultExternalEntityUploadServiceImpl.java | 33 ++++++++++++ .../ExternalEntityUploadException.java | 33 ++++++++++++ .../service/ExternalEntityUploadLogger.java | 33 ++++++++++++ .../service/IExternalEntityUploadService.java | 33 ++++++++++++ .../results/service/SystemOutLogger.java | 33 ++++++++++++ .../almentities/AlmCommonProperties.java | 33 ++++++++++++ .../service/almentities/AlmEntity.java | 33 ++++++++++++ .../service/almentities/AlmEntityImpl.java | 33 ++++++++++++ .../results/service/almentities/AlmRun.java | 33 ++++++++++++ .../service/almentities/AlmRunImpl.java | 33 ++++++++++++ .../results/service/almentities/AlmTest.java | 33 ++++++++++++ .../service/almentities/AlmTestConfig.java | 33 ++++++++++++ .../almentities/AlmTestConfigImpl.java | 33 ++++++++++++ .../service/almentities/AlmTestFolder.java | 33 ++++++++++++ .../almentities/AlmTestFolderImpl.java | 33 ++++++++++++ .../service/almentities/AlmTestImpl.java | 33 ++++++++++++ .../service/almentities/AlmTestInstance.java | 33 ++++++++++++ .../almentities/AlmTestInstanceImpl.java | 33 ++++++++++++ .../service/almentities/AlmTestSet.java | 33 ++++++++++++ .../service/almentities/AlmTestSetFolder.java | 33 ++++++++++++ .../almentities/AlmTestSetFolderImpl.java | 33 ++++++++++++ .../service/almentities/AlmTestSetImpl.java | 33 ++++++++++++ .../service/almentities/EntityRelation.java | 33 ++++++++++++ .../service/almentities/IAlmConsts.java | 33 ++++++++++++ .../service/rest/CreateAlmEntityRequest.java | 33 ++++++++++++ .../service/rest/GetAlmEntityRequest.java | 33 ++++++++++++ .../service/rest/UpdateAlmEntityRequest.java | 33 ++++++++++++ .../tools/run/AbstractSvRunBuilder.java | 33 ++++++++++++ .../tools/run/AbstractSvRunDescriptor.java | 36 +++++++++++-- .../tools/run/AdditionalParametersAction.java | 33 ++++++++++++ .../automation/tools/run/AlmRunTypes.java | 36 +++++++++++-- .../tools/run/AutEnvironmentBuilder.java | 33 ++++++++++++ .../tools/run/CreateTunnelBuilder.java | 33 ++++++++++++ .../tools/run/JobConfigRebrander.java | 33 ++++++++++++ .../tools/run/LrScriptResultsParser.java | 33 ++++++++++++ .../automation/tools/run/PcBuilder.java | 13 ++++- .../tools/run/RunFromAlmBuilder.java | 36 +++++++++++-- .../tools/run/RunFromFileBuilder.java | 36 +++++++++++-- .../tools/run/RunFromSrfBuilder.java | 33 ++++++++++++ .../tools/run/RunLoadRunnerScript.java | 33 ++++++++++++ .../automation/tools/run/SseBuilder.java | 33 ++++++++++++ .../tools/run/SvChangeModeBuilder.java | 36 +++++++++++-- .../automation/tools/run/SvDeployBuilder.java | 36 +++++++++++-- .../automation/tools/run/SvExportBuilder.java | 36 +++++++++++-- .../tools/run/SvUndeployBuilder.java | 36 +++++++++++-- .../tools/run/UploadAppBuilder.java | 33 ++++++++++++ .../settings/AlmServerSettingsBuilder.java | 36 +++++++++++-- .../settings/MCServerSettingsBuilder.java | 33 ++++++++++++ .../settings/OctaneServerSettingsBuilder.java | 36 +++++++++++-- .../settings/SrfServerSettingsBuilder.java | 33 ++++++++++++ .../settings/SvServerSettingsBuilder.java | 36 +++++++++++-- .../automation/tools/sse/ArgsFactory.java | 33 ++++++++++++ .../tools/sse/SSEBuilderPerformer.java | 33 ++++++++++++ .../AUTEnvironmentBuilderPerformer.java | 33 ++++++++++++ .../autenvironment/AUTEnvironmentFolder.java | 33 ++++++++++++ .../autenvironment/AUTEnvironmentManager.java | 33 ++++++++++++ .../AUTEnvironmentParametersManager.java | 33 ++++++++++++ .../AUTEnvironmnentParameter.java | 33 ++++++++++++ .../request/AUTEnvironmentResources.java | 33 ++++++++++++ .../get/GetAutEnvFoldersByIdRequest.java | 33 ++++++++++++ .../GetAutEnvironmentByIdOldApiRequest.java | 33 ++++++++++++ .../get/GetAutEnvironmentByIdRequest.java | 33 ++++++++++++ ...utEnvironmentConfigurationByIdRequest.java | 33 ++++++++++++ .../GetParametersByAutEnvConfIdRequest.java | 33 ++++++++++++ .../request/post/CreateAutEnvConfRequest.java | 33 ++++++++++++ ...utAutEnvironmentParametersBulkRequest.java | 33 ++++++++++++ .../tools/sse/common/JsonHandler.java | 33 ++++++++++++ .../tools/sse/common/RestXmlUtils.java | 33 ++++++++++++ .../tools/sse/common/StringUtils.java | 33 ++++++++++++ .../tools/sse/common/XPathUtils.java | 33 ++++++++++++ .../tools/sse/result/JUnitParser.java | 33 ++++++++++++ .../tools/sse/result/LabPublisher.java | 33 ++++++++++++ .../tools/sse/result/PCPublisher.java | 33 ++++++++++++ .../tools/sse/result/Publisher.java | 33 ++++++++++++ .../tools/sse/result/PublisherFactory.java | 33 ++++++++++++ .../tools/sse/result/model/junit/Error.java | 33 ++++++++++++ .../tools/sse/result/model/junit/Failure.java | 33 ++++++++++++ .../model/junit/JUnitTestCaseStatus.java | 33 ++++++++++++ .../sse/result/model/junit/Properties.java | 33 ++++++++++++ .../sse/result/model/junit/Property.java | 33 ++++++++++++ .../sse/result/model/junit/Testcase.java | 33 ++++++++++++ .../sse/result/model/junit/Testsuite.java | 33 ++++++++++++ .../sse/result/model/junit/Testsuites.java | 33 ++++++++++++ .../tools/sse/sdk/ALMRunReportUrlBuilder.java | 33 ++++++++++++ .../automation/tools/sse/sdk/Args.java | 33 ++++++++++++ .../tools/sse/sdk/Base64Encoder.java | 33 ++++++++++++ .../automation/tools/sse/sdk/Client.java | 33 ++++++++++++ .../tools/sse/sdk/ConsoleLogger.java | 33 ++++++++++++ .../tools/sse/sdk/HttpRequestDecorator.java | 33 ++++++++++++ .../automation/tools/sse/sdk/Logger.java | 33 ++++++++++++ .../tools/sse/sdk/PCRunResponse.java | 33 ++++++++++++ .../tools/sse/sdk/ResourceAccessLevel.java | 33 ++++++++++++ .../automation/tools/sse/sdk/Response.java | 33 ++++++++++++ .../automation/tools/sse/sdk/RunManager.java | 33 ++++++++++++ .../automation/tools/sse/sdk/RunResponse.java | 33 ++++++++++++ .../sdk/authenticator/AuthenticationTool.java | 13 ++++- .../sse/sdk/authenticator/Authenticator.java | 13 ++++- .../sdk/authenticator/RestAuthenticator.java | 13 ++++- .../authenticator/RestAuthenticatorSaas.java | 13 ++++- .../tools/sse/sdk/handler/BvsRunHandler.java | 33 ++++++++++++ .../sse/sdk/handler/EventLogHandler.java | 33 ++++++++++++ .../tools/sse/sdk/handler/Handler.java | 33 ++++++++++++ .../tools/sse/sdk/handler/LabPollHandler.java | 33 ++++++++++++ .../tools/sse/sdk/handler/PCPollHandler.java | 33 ++++++++++++ .../tools/sse/sdk/handler/PCRunHandler.java | 33 ++++++++++++ .../tools/sse/sdk/handler/PollHandler.java | 33 ++++++++++++ .../sse/sdk/handler/PollHandlerFactory.java | 33 ++++++++++++ .../tools/sse/sdk/handler/RunHandler.java | 33 ++++++++++++ .../sse/sdk/handler/RunHandlerFactory.java | 33 ++++++++++++ .../sse/sdk/handler/TestSetRunHandler.java | 33 ++++++++++++ .../sdk/request/CreateSiteSessionRequest.java | 33 ++++++++++++ .../sse/sdk/request/EventLogRequest.java | 33 ++++++++++++ .../sse/sdk/request/GeneralGetRequest.java | 33 ++++++++++++ .../sse/sdk/request/GeneralPostRequest.java | 33 ++++++++++++ .../sdk/request/GeneralPutBulkRequest.java | 33 ++++++++++++ .../tools/sse/sdk/request/GeneralRequest.java | 33 ++++++++++++ .../sse/sdk/request/GetALMVersionRequest.java | 33 ++++++++++++ .../request/GetLabRunEntityDataRequest.java | 33 ++++++++++++ .../GetLabRunEntityTestSetRunsRequest.java | 33 ++++++++++++ .../request/GetPCRunEntityDataRequest.java | 33 ++++++++++++ .../GetPCRunEntityTestSetRunsRequest.java | 33 ++++++++++++ .../tools/sse/sdk/request/GetRequest.java | 33 ++++++++++++ .../sdk/request/GetRunEntityNameRequest.java | 33 ++++++++++++ .../sse/sdk/request/PollSSERunRequest.java | 33 ++++++++++++ .../tools/sse/sdk/request/PostRequest.java | 33 ++++++++++++ .../sdk/request/StartRunEntityRequest.java | 33 ++++++++++++ .../sse/sdk/request/StopEntityRequest.java | 33 ++++++++++++ src/main/resources/LR_SCRIPT_REPORT.css | 33 ++++++++++++ src/main/resources/PDetails.xsl | 35 +++++++++++- .../model/AutEnvironmentModel/config.jelly | 38 ++++++++++--- .../AutEnvironmentModel/config.properties | 33 ++++++++++++ .../help-autEnvironmentId.html | 33 ++++++++++++ .../help-outputParameter.html | 33 ++++++++++++ .../help-pathToJsonFile.html | 33 ++++++++++++ .../AutEnvironmentParameterModel/config.jelly | 38 ++++++++++--- .../help-name.html | 33 ++++++++++++ .../help-paramType.html | 33 ++++++++++++ .../help-value.html | 33 ++++++++++++ .../model/SrfTestParamsModel/config.jelly | 38 ++++++++++--- .../model/SvDataModelSelection/config.jelly | 38 ++++++++++--- .../SvPerformanceModelSelection/config.jelly | 38 ++++++++++--- .../SvServiceSelectionModel/config.jelly | 38 ++++++++++--- .../tools/octane/Messages.properties | 37 +++++++++---- .../tools/octane/OctanePlugin/global.jelly | 46 ++++++++++------ .../octane/OctanePlugin/global.properties | 37 +++++++++---- .../UFTTestDetectionBuildAction/index.jelly | 33 ++++++++++++ .../UFTTestDetectionPublisher/config.jelly | 33 ++++++++++++ .../config.jelly | 46 ++++++++++------ .../config.properties | 37 +++++++++---- .../help.html | 37 +++++++++---- .../ConfigurationAction/index.jelly | 46 ++++++++++------ .../ConfigurationAction/index.properties | 37 +++++++++---- .../LoadRunnerScriptStep/config.jelly | 33 ++++++++++++ .../LoadRunnerTestStep/config.jelly | 13 ++++- .../LoadRunnerTestStep/config.properties | 33 ++++++++++++ .../help-archiveTestResultsMode.html | 33 ++++++++++++ .../help-controllerPollingInterval.html | 33 ++++++++++++ .../LoadRunnerTestStep/help-fsTests.html | 33 ++++++++++++ .../LoadRunnerTestStep/help-fsTimeout.html | 33 ++++++++++++ .../help-ignoreErrorStrings.html | 33 ++++++++++++ .../help-perScenarioTimeOut.html | 33 ++++++++++++ .../SseBuildAndPublishStep/config.jelly | 38 ++++++++++--- .../SseBuildAndPublishStep/config.properties | 33 ++++++++++++ .../help-archiveTestResultsMode.html | 33 ++++++++++++ .../help-environmentConfigurationId.html | 33 ++++++++++++ .../UftScenarioLoadStep/config.jelly | 13 ++++- .../UftScenarioLoadStep/config.properties | 33 ++++++++++++ .../help-archiveTestResultsMode.html | 33 ++++++++++++ .../UftScenarioLoadStep/help-fsTests.html | 33 ++++++++++++ .../tools/results/DetailReport/index.jelly | 38 ++++++++++--- .../results/HtmlBuildReportAction/index.jelly | 33 ++++++++++++ .../PerformanceJobReportAction/index.jelly | 38 ++++++++++--- .../PerformanceProjectAction/index.jelly | 11 +++- .../PerformanceReportAction/index.jelly | 38 ++++++++++--- .../results/RunResultRecorder/config.jelly | 38 ++++++++++--- .../help-archiveTestResultsMode.html | 33 ++++++++++++ .../tools/results/SrfDetailReport/index.jelly | 38 ++++++++++--- .../SrfHtmlBuildReportAction/index.jelly | 38 ++++++++++--- .../results/SrfRunResultRecorder/config.jelly | 38 ++++++++++--- .../help-archiveTestResultsMode.html | 33 ++++++++++++ .../results/SrfSummaryReport/index.jelly | 38 ++++++++++--- .../tools/results/SummaryReport/index.jelly | 38 ++++++++++--- .../TestResultToALMUploader/config.jelly | 38 ++++++++++--- .../TestResultToALMUploader/config.properties | 33 ++++++++++++ .../help-almDomain.html | 33 ++++++++++++ .../help-almPassword.html | 33 ++++++++++++ .../help-almProject.html | 33 ++++++++++++ .../help-almServerName.html | 33 ++++++++++++ .../help-almTestFolder.html | 33 ++++++++++++ .../help-almTestSetFolder.html | 33 ++++++++++++ .../help-almTimeout.html | 33 ++++++++++++ .../help-almUserName.html | 33 ++++++++++++ .../help-jenkinsServerUrl.html | 33 ++++++++++++ .../help-testingFramework.html | 33 ++++++++++++ .../help-testingResultFile.html | 33 ++++++++++++ .../help-testingTool.html | 33 ++++++++++++ .../TransactionSummaryAction/index.jelly | 38 ++++++++++--- .../LrScriptHtmlReportAction/index.jelly | 33 ++++++++++++ .../run/AutEnvironmentBuilder/config.jelly | 38 ++++++++++--- .../AutEnvironmentBuilder/config.properties | 33 ++++++++++++ .../help-environmentConfigurationId.html | 33 ++++++++++++ .../run/CreateTunnelBuilder/config.jelly | 38 ++++++++++--- .../run/CreateTunnelBuilder/config.properties | 33 ++++++++++++ .../JobConfigRebrander/config.jelly | 33 ++++++++++++ .../tools/run/PcBuilder/config.jelly | 47 ++++++++++------ .../tools/run/PcBuilder/config.properties | 33 ++++++++++++ .../run/PcBuilder/help-pcServerName.html | 33 ++++++++++++ .../tools/run/PcBuilder/help-proxyOutURL.html | 33 ++++++++++++ .../tools/run/PcBuilder/help-statusBySLA.html | 33 ++++++++++++ .../run/PcBuilder/help-testInstanceId.html | 33 ++++++++++++ .../tools/run/PcBuilder/help-vudsMode.html | 33 ++++++++++++ .../tools/run/RunFromAlmBuilder/config.jelly | 38 ++++++++++--- .../run/RunFromAlmBuilder/config.properties | 33 ++++++++++++ .../RunFromAlmBuilder/help-AlmRunHost.html | 33 ++++++++++++ .../RunFromAlmBuilder/help-AlmRunMode.html | 33 ++++++++++++ .../RunFromAlmBuilder/help-AlmTestSets.html | 33 ++++++++++++ .../RunFromAlmBuilder/help-AlmTimeout.html | 33 ++++++++++++ .../tools/run/RunFromFileBuilder/config.jelly | 38 ++++++++++--- .../run/RunFromFileBuilder/config.properties | 33 ++++++++++++ .../help-controllerPollingInterval.html | 33 ++++++++++++ .../help-fsAppParamName.html | 33 ++++++++++++ .../RunFromFileBuilder/help-fsAppPath.html | 33 ++++++++++++ .../RunFromFileBuilder/help-fsPassword.html | 33 ++++++++++++ .../help-fsProxyAddress.html | 33 ++++++++++++ .../run/RunFromFileBuilder/help-fsTests.html | 33 ++++++++++++ .../RunFromFileBuilder/help-fsTimeout.html | 33 ++++++++++++ .../RunFromFileBuilder/help-fsUserName.html | 33 ++++++++++++ .../help-ignoreErrorStrings.html | 33 ++++++++++++ .../RunFromFileBuilder/help-mcServerName.html | 33 ++++++++++++ .../help-perScenarioTimeOut.html | 33 ++++++++++++ .../tools/run/RunFromSrfBuilder/config.jelly | 38 ++++++++++--- .../run/RunFromSrfBuilder/config.properties | 33 ++++++++++++ .../run/RunLoadRunnerScript/config.jelly | 33 ++++++++++++ .../tools/run/SseBuilder/config.jelly | 38 ++++++++++--- .../tools/run/SseBuilder/config.properties | 33 ++++++++++++ .../help-environmentConfigurationId.html | 33 ++++++++++++ .../run/SvChangeModeBuilder/config.jelly | 38 ++++++++++--- .../run/SvChangeModeBuilder/config.properties | 33 ++++++++++++ .../run/SvChangeModeBuilder/help-force.html | 33 ++++++++++++ .../tools/run/SvDeployBuilder/config.jelly | 38 ++++++++++--- .../run/SvDeployBuilder/config.properties | 33 ++++++++++++ .../help-firstAgentFallback.html | 33 ++++++++++++ .../tools/run/SvDeployBuilder/help-force.html | 33 ++++++++++++ .../run/SvDeployBuilder/help-service.html | 33 ++++++++++++ .../tools/run/SvExportBuilder/config.jelly | 38 ++++++++++--- .../run/SvExportBuilder/config.properties | 33 ++++++++++++ .../help-cleanTargetDirectory.html | 33 ++++++++++++ .../tools/run/SvExportBuilder/help-force.html | 33 ++++++++++++ .../help-switchToStandByFirst.html | 33 ++++++++++++ .../SvExportBuilder/help-targetDirectory.html | 33 ++++++++++++ .../tools/run/SvUndeployBuilder/config.jelly | 38 ++++++++++--- .../run/SvUndeployBuilder/config.properties | 33 ++++++++++++ .../help-continueIfNotDeployed.html | 33 ++++++++++++ .../run/SvUndeployBuilder/help-force.html | 33 ++++++++++++ .../tools/run/UploadAppBuilder/config.jelly | 38 ++++++++++--- .../run/UploadAppBuilder/config.properties | 33 ++++++++++++ .../AlmServerSettingsBuilder/global.jelly | 33 ++++++++++++ .../help-almServerName.html | 33 ++++++++++++ .../help-almServerUrl.html | 33 ++++++++++++ .../help-almServerVersion.html | 33 ++++++++++++ .../MCServerSettingsBuilder/global.jelly | 33 ++++++++++++ .../help-mcServerName.html | 33 ++++++++++++ .../help-mcServerUrl.html | 33 ++++++++++++ .../OctaneServerSettingsBuilder/global.jelly | 33 ++++++++++++ .../global.properties | 33 ++++++++++++ .../help-identity.html | 33 ++++++++++++ .../help-impersonatedUser.html | 33 ++++++++++++ .../help-uiLocation.html | 33 ++++++++++++ .../help-username.html | 33 ++++++++++++ .../SrfServerSettingsBuilder/global.jelly | 38 ++++++++++--- .../SvServerSettingsBuilder/global.jelly | 33 ++++++++++++ .../hudson/tasks/junit/CaseResult/body.jelly | 54 +++++++++++-------- .../hudson/tasks/junit/CaseResult/index.jelly | 53 ++++++++++-------- .../hudson/tasks/junit/ClassResult/body.jelly | 53 ++++++++++-------- .../tasks/junit/PackageResult/body.jelly | 54 +++++++++++-------- .../hudson/tasks/junit/TestResult/_body.jelly | 53 ++++++++++-------- .../hudson/tasks/junit/TestResult/body.jelly | 54 +++++++++++-------- .../resources/hudson/tasks/junit/body.jelly | 54 +++++++++++-------- .../resources/hudson/tasks/junit/index.jelly | 53 ++++++++++-------- .../tasks/test/MetaTabulatedResult/body.jelly | 54 +++++++++++-------- src/main/resources/index.jelly | 33 ++++++++++++ src/main/resources/lib/octane/configure.js | 33 ++++++++++++ src/main/resources/lib/octane/ui.css | 33 ++++++++++++ src/main/resources/lib/select2/select2-min.js | 33 ++++++++++++ src/main/webapp/autEnvironment.js | 33 ++++++++++++ src/main/webapp/configure.js | 33 ++++++++++++ src/main/webapp/css/ColorPlate.css | 33 ++++++++++++ .../webapp/css/chartist-plugin-tooltip.css | 33 ++++++++++++ src/main/webapp/css/chartist.css | 33 ++++++++++++ src/main/webapp/css/chartistLegend.css | 33 ++++++++++++ src/main/webapp/css/projectReport.css | 33 ++++++++++++ src/main/webapp/help/accessKey.html | 35 +++++++++++- src/main/webapp/help/impersonatedUser.html | 35 +++++++++++- src/main/webapp/help/uiLocation.html | 35 +++++++++++- src/main/webapp/js/dropdown.jsx | 33 ++++++++++++ src/main/webapp/js/jslib.js | 33 ++++++++++++ .../chartist/chartist-plugin-legend.js | 33 ++++++++++++ .../chartist/chartist-plugin-pointlabels.js | 33 ++++++++++++ .../webapp/js/libaries/chartist/chartist.js | 33 ++++++++++++ .../webapp/js/libaries/react/react-dom.js | 35 +++++++++--- .../tools/common/TestALMRESTVersionUtils.java | 37 +++++++++---- .../tools/model/SecretContainerTest.java | 37 +++++++++---- .../automation/tools/octane/EnumsTest.java | 37 +++++++++---- .../tools/octane/actions/Configuration.java | 33 ++++++++++++ .../tools/octane/actions/Utils.java | 37 +++++++++---- .../build/BuildActionsFreeStyleTest.java | 37 +++++++++---- .../actions/build/BuildActionsMatrixTest.java | 33 ++++++++++++ .../actions/build/BuildActionsMavenTest.java | 33 ++++++++++++ .../build/BuildActionsMultiJobTest.java | 33 ++++++++++++ .../actions/plugin/PluginActionsTest.java | 37 +++++++++---- .../octane/actions/project/CustomProject.java | 37 +++++++++---- .../project/ProjectActionsFreeStyleTest.java | 37 +++++++++---- .../project/ProjectActionsMatrixTest.java | 37 +++++++++---- .../project/ProjectActionsMavenTest.java | 37 +++++++++---- .../project/ProjectActionsMultiJobTest.java | 37 +++++++++---- .../tools/octane/client/RetryModelTest.java | 37 +++++++++---- .../octane/client/TestEventPublisher.java | 33 +++++++++++- .../octane/configuration/ConfigApiTest.java | 37 +++++++++---- .../ConfigurationActionFactoryTest.java | 37 +++++++++---- .../ConfigurationListenerTest.java | 37 +++++++++---- .../ConfigurationServiceTest.java | 37 +++++++++---- .../octane/detection/ResultFieldsTest.java | 33 ++++++++++++ .../tools/octane/events/EventsTest.java | 37 +++++++++---- .../octane/identity/ServerIdentityTest.java | 33 ++++++++++++ .../tools/octane/tests/CopyResourceSCM.java | 37 +++++++++---- .../tools/octane/tests/ExtensionUtil.java | 33 +++++++++++- .../tools/octane/tests/JUnitResultsTest.java | 37 +++++++++---- .../tools/octane/tests/TestApiTest.java | 37 +++++++++---- .../octane/tests/TestCustomJUnitArchiver.java | 37 +++++++++---- .../octane/tests/TestDispatcherTest.java | 37 +++++++++---- .../octane/tests/TestJenkinsDurationTest.java | 37 +++++++++---- .../tools/octane/tests/TestQueue.java | 37 +++++++++---- .../octane/tests/TestResultIterable.java | 33 +++++++++++- .../octane/tests/TestResultIterator.java | 37 +++++++++---- .../octane/tests/TestResultQueueTest.java | 37 +++++++++---- .../tools/octane/tests/TestUtils.java | 37 +++++++++---- .../tests/build/BuildHandlerUtilsTest.java | 37 +++++++++---- .../detection/ResultFieldsDetectionTest.java | 37 +++++++++---- .../tests/detection/ResultFieldsTest.java | 37 +++++++++---- .../detection/ResultFieldsXmlReader.java | 37 +++++++++---- .../tests/detection/TestNGExtensionTest.java | 37 +++++++++---- .../tests/detection/UFTExtensionTest.java | 37 +++++++++---- .../tests/gherkin/GherkinResultsTest.java | 37 +++++++++---- .../GherkinTestResultsCollectorTest.java | 37 +++++++++---- .../tests/xml/TestResultXmlWriterTest.java | 37 +++++++++---- .../automation/tools/pc/MockPcModel.java | 33 ++++++++++++ .../automation/tools/pc/MockPcRestProxy.java | 33 ++++++++++++ .../tools/pc/MockPcRestProxyBadResponses.java | 33 ++++++++++++ .../automation/tools/pc/PcTestBase.java | 37 +++++++++---- .../automation/tools/pc/TestPcClient.java | 37 +++++++++---- .../pc/TestPcClientNegativeScenrios.java | 37 +++++++++---- .../pipelineSteps/LrScenarioLoadStepTest.java | 37 +++++++++---- .../tools/results/RunResultRecorderTest.java | 37 +++++++++---- .../results/parser/AntTESTS-TestSuites.xml | 33 ++++++++++++ .../MAVENTEST-com.demoapp.demo.AppTest.xml | 33 ++++++++++++ .../tools/results/parser/NUnitReport.xml | 33 ++++++++++++ .../parser/TestAntJUnitReportParserImpl.java | 37 +++++++++---- .../TestJenkinsJunitReportParserImpl.java | 37 +++++++++---- .../TestMavenSureFireReportParserImpl.java | 37 +++++++++---- .../parser/TestNUnitReportParserImpl.java | 37 +++++++++---- .../parser/TestTestNGXmlReportParserImpl.java | 37 +++++++++---- .../tools/results/parser/junitResult.xml | 33 ++++++++++++ .../tools/results/parser/testng-results.xml | 33 ++++++++++++ .../tools/results/service/NUnitReport.xml | 33 ++++++++++++ ...efaultExternalEntityUploadServiceImpl.java | 37 +++++++++---- .../tools/results/service/junitResult.xml | 33 ++++++++++++ .../tools/results/service/testng-results.xml | 33 ++++++++++++ .../tools/run/LrScriptResultsParserTest.java | 33 ++++++++++++ .../tools/sse/common/ConsoleLogger.java | 37 +++++++++---- .../tools/sse/common/RestClient4Test.java | 37 +++++++++---- .../automation/tools/sse/common/TestCase.java | 37 +++++++++---- .../tools/sse/result/TestPublisher.java | 37 +++++++++---- .../sse/sdk/MockRestClientBadDomain.java | 37 +++++++++---- .../sse/sdk/MockRestClientBadRunEntity.java | 37 +++++++++---- .../sse/sdk/MockRestClientBadRunResponse.java | 37 +++++++++---- .../sse/sdk/MockRestClientFailedLogin.java | 37 +++++++++---- .../sse/sdk/MockRestClientFunctional.java | 37 +++++++++---- .../tools/sse/sdk/MockRestClientPC.java | 37 +++++++++---- .../tools/sse/sdk/MockSseModel.java | 37 +++++++++---- .../tools/sse/sdk/TestBvsRunHandler.java | 37 +++++++++---- .../tools/sse/sdk/TestEventLogHandler.java | 38 +++++++++---- .../tools/sse/sdk/TestPCRunHandler.java | 37 +++++++++---- .../tools/sse/sdk/TestPollHandler.java | 37 +++++++++---- .../tools/sse/sdk/TestPostRequest.java | 37 +++++++++---- .../tools/sse/sdk/TestRestAuthenticator.java | 37 +++++++++---- .../sse/sdk/TestRestAuthenticatorSaas.java | 13 ++++- .../tools/sse/sdk/TestRestClient.java | 37 +++++++++---- .../tools/sse/sdk/TestRunHandlerFactory.java | 37 +++++++++---- .../tools/sse/sdk/TestRunManager.java | 37 +++++++++---- .../sse/sdk/TestRunManagerSystemTests.java | 37 +++++++++---- .../tools/sse/sdk/TestTestSetRunHandler.java | 37 +++++++++---- .../TestTestSetRunHandlerGetReportUrl.java | 37 +++++++++---- src/test/resources/UFT/UFT_results.xml | 33 ++++++++++++ .../gherkin/f1/OctaneGherkinResults0.xml | 37 +++++++++---- .../gherkin/f1/OctaneGherkinResults1.xml | 37 +++++++++---- .../gherkin/f2/OctaneGherkinResults0.xml | 37 +++++++++---- .../gherkin/f2/OctaneGherkinResults1.xml | 37 +++++++++---- .../gherkin/f3/OctaneGherkinResults0.xml | 37 +++++++++---- .../gherkin/f3/OctaneGherkinResults1.xml | 37 +++++++++---- .../automation/tools/results/RunReport.xml | 11 +++- .../tools/results/RunReport_sc5.xml | 33 ++++++++++++ src/test/resources/helloCucumberWorld/pom.xml | 33 ++++++++++++ .../resources/helloCucumberWorld/settings.xml | 48 +++++++++++------ src/test/resources/helloWorldFailsafe/pom.xml | 33 ++++++++++++ .../resources/helloWorldFailsafe/settings.xml | 48 +++++++++++------ .../helloWorldRoot/helloWorld/pom.xml | 33 ++++++++++++ .../helloWorldRoot/helloWorld/settings.xml | 48 +++++++++++------ .../helloWorldRoot/helloWorld2/pom.xml | 33 ++++++++++++ .../helloWorldRoot/helloWorld2/settings.xml | 48 +++++++++++------ src/test/resources/helloWorldRoot/pom.xml | 33 ++++++++++++ .../resources/helloWorldRoot/settings.xml | 48 +++++++++++------ .../helloWorldTestNGRoot/helloWorld/pom.xml | 33 ++++++++++++ .../helloWorld/settings.xml | 48 +++++++++++------ .../helloWorldTestNGRoot/helloWorld2/pom.xml | 33 ++++++++++++ .../helloWorld2/settings.xml | 48 +++++++++++------ .../resources/helloWorldTestNGRoot/pom.xml | 33 ++++++++++++ .../helloWorldTestNGRoot/settings.xml | 48 +++++++++++------ 726 files changed, 21508 insertions(+), 2878 deletions(-) diff --git a/HpToolsLauncher/JunitXml/junit.xsd b/HpToolsLauncher/JunitXml/junit.xsd index 1346313f4b..e27a653707 100644 --- a/HpToolsLauncher/JunitXml/junit.xsd +++ b/HpToolsLauncher/JunitXml/junit.xsd @@ -1,4 +1,37 @@ + + diff --git a/HpToolsLauncher/MtbxSchema.xsd b/HpToolsLauncher/MtbxSchema.xsd index 37abb5e14c..39a9ed6ae6 100644 --- a/HpToolsLauncher/MtbxSchema.xsd +++ b/HpToolsLauncher/MtbxSchema.xsd @@ -1,4 +1,37 @@ - + + + diff --git a/pom.xml b/pom.xml index 0c1e8a7285..8036feba5f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,3 +1,36 @@ + + 4.0.0 diff --git a/sonar-project.properties b/sonar-project.properties index 9410aaf787..46a3cf1032 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,36 @@ +# +# © Copyright 2013 EntIT Software LLC +# Certain versions of software and/or documents (“Material”) accessible here may contain branding from +# Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, +# the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP +# and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE +# marks are the property of their respective owners. +# __________________________________________________________________ +# MIT License +# +# Copyright (c) 2018 Micro Focus Company, L.P. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# ___________________________________________________________________ +# +# + sonar.projectKey=org.jenkins-ci.plugins:hpe-application-automation-tools-plugin sonar.projectVersion=5.2.0.1-beta-SNAPSHOT sonar.projectName=hpe application automation tools plugin diff --git a/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java b/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java index 09474b74d4..6e6005aabf 100644 --- a/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools; diff --git a/src/main/java/com/hpe/application/automation/tools/EncryptionUtils.java b/src/main/java/com/hpe/application/automation/tools/EncryptionUtils.java index 2bc77fc604..6337711601 100644 --- a/src/main/java/com/hpe/application/automation/tools/EncryptionUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/EncryptionUtils.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools; diff --git a/src/main/java/com/hpe/application/automation/tools/common/ALMRESTVersionUtils.java b/src/main/java/com/hpe/application/automation/tools/common/ALMRESTVersionUtils.java index 789f840c25..3d35da2c5b 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/ALMRESTVersionUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/common/ALMRESTVersionUtils.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.common; import com.hpe.application.automation.tools.model.ALMVersion; diff --git a/src/main/java/com/hpe/application/automation/tools/common/Func.java b/src/main/java/com/hpe/application/automation/tools/common/Func.java index e6adc1800c..798e6d1efe 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/Func.java +++ b/src/main/java/com/hpe/application/automation/tools/common/Func.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.common; public interface Func { diff --git a/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java b/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java index 6da7d1d370..ba7c3b9d30 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java +++ b/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/common/Pair.java b/src/main/java/com/hpe/application/automation/tools/common/Pair.java index df52df68f6..200828588b 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/Pair.java +++ b/src/main/java/com/hpe/application/automation/tools/common/Pair.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.common; public class Pair { diff --git a/src/main/java/com/hpe/application/automation/tools/common/PcException.java b/src/main/java/com/hpe/application/automation/tools/common/PcException.java index 4eca8200a1..86ee88712a 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/PcException.java +++ b/src/main/java/com/hpe/application/automation/tools/common/PcException.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.common; public class PcException extends Exception { diff --git a/src/main/java/com/hpe/application/automation/tools/common/RuntimeIOException.java b/src/main/java/com/hpe/application/automation/tools/common/RuntimeIOException.java index 223e117689..d69b559dff 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/RuntimeIOException.java +++ b/src/main/java/com/hpe/application/automation/tools/common/RuntimeIOException.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/common/RuntimeUtils.java b/src/main/java/com/hpe/application/automation/tools/common/RuntimeUtils.java index e477473b39..18a2fd55e4 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/RuntimeUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/common/RuntimeUtils.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.common; public class RuntimeUtils { diff --git a/src/main/java/com/hpe/application/automation/tools/common/SSEException.java b/src/main/java/com/hpe/application/automation/tools/common/SSEException.java index 48858af267..d5c2cac836 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/SSEException.java +++ b/src/main/java/com/hpe/application/automation/tools/common/SSEException.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.common; public class SSEException extends RuntimeException { diff --git a/src/main/java/com/hpe/application/automation/tools/mc/Constants.java b/src/main/java/com/hpe/application/automation/tools/mc/Constants.java index fd27bd26b6..fa4a44319f 100644 --- a/src/main/java/com/hpe/application/automation/tools/mc/Constants.java +++ b/src/main/java/com/hpe/application/automation/tools/mc/Constants.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.mc; /** diff --git a/src/main/java/com/hpe/application/automation/tools/mc/HttpResponse.java b/src/main/java/com/hpe/application/automation/tools/mc/HttpResponse.java index 82433926ae..46cd5bd260 100644 --- a/src/main/java/com/hpe/application/automation/tools/mc/HttpResponse.java +++ b/src/main/java/com/hpe/application/automation/tools/mc/HttpResponse.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.mc; import net.minidev.json.JSONObject; diff --git a/src/main/java/com/hpe/application/automation/tools/mc/HttpUtils.java b/src/main/java/com/hpe/application/automation/tools/mc/HttpUtils.java index e71ea29601..b195325feb 100644 --- a/src/main/java/com/hpe/application/automation/tools/mc/HttpUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/mc/HttpUtils.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.mc; import net.minidev.json.JSONObject; diff --git a/src/main/java/com/hpe/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/hpe/application/automation/tools/mc/JobConfigurationProxy.java index 05bc0b940c..4c1ec6cb59 100644 --- a/src/main/java/com/hpe/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/hpe/application/automation/tools/mc/JobConfigurationProxy.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.mc; import net.minidev.json.JSONArray; diff --git a/src/main/java/com/hpe/application/automation/tools/model/ALMVersion.java b/src/main/java/com/hpe/application/automation/tools/model/ALMVersion.java index c07f5b229a..0bcb485ec0 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/ALMVersion.java +++ b/src/main/java/com/hpe/application/automation/tools/model/ALMVersion.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import javax.xml.bind.annotation.XmlElement; diff --git a/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentModelResolver.java b/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentModelResolver.java index 85f120b228..1a5e51ab39 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentModelResolver.java +++ b/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentModelResolver.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import hudson.Util; diff --git a/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentResolvedModel.java b/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentResolvedModel.java index 1e0f9c5efd..5834555853 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentResolvedModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/AUTEnvironmentResolvedModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import java.util.List; diff --git a/src/main/java/com/hpe/application/automation/tools/model/AbstractSvRunModel.java b/src/main/java/com/hpe/application/automation/tools/model/AbstractSvRunModel.java index 1d840750d8..d2ca139db8 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/AbstractSvRunModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/AbstractSvRunModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/AlmServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/AlmServerSettingsModel.java index 745841474c..bf64295e63 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/AlmServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/AlmServerSettingsModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentModel.java b/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentModel.java index f155a8e9f0..88f7f1e8c8 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import java.util.List; diff --git a/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel.java b/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel.java index 76f3118e87..a861322653 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import java.util.Arrays; diff --git a/src/main/java/com/hpe/application/automation/tools/model/CdaDetails.java b/src/main/java/com/hpe/application/automation/tools/model/CdaDetails.java index c4abd79835..2d25a84856 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/CdaDetails.java +++ b/src/main/java/com/hpe/application/automation/tools/model/CdaDetails.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import java.util.Arrays; diff --git a/src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java b/src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java index 9649129385..a9fccd04d9 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/CreateTunnelModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import com.hpe.application.automation.tools.model.EnumDescription; diff --git a/src/main/java/com/hpe/application/automation/tools/model/EnumDescription.java b/src/main/java/com/hpe/application/automation/tools/model/EnumDescription.java index 3a288bee08..2fda2b8d7d 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/EnumDescription.java +++ b/src/main/java/com/hpe/application/automation/tools/model/EnumDescription.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/MCServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/MCServerSettingsModel.java index 0185ae56a4..207c5a2f84 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/MCServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/MCServerSettingsModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import org.apache.commons.lang.StringUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java index e9560c947a..7c7e77641c 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/OctaneServerSettingsModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/Pair.java b/src/main/java/com/hpe/application/automation/tools/model/Pair.java index a510ff2e91..ce284fdf89 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/Pair.java +++ b/src/main/java/com/hpe/application/automation/tools/model/Pair.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import hudson.Extension; diff --git a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java index 512a9f627a..04204002f6 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/PcModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/PcModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + /* * Takes all the parameter from the job in order to create a loadtest object * */ diff --git a/src/main/java/com/hpe/application/automation/tools/model/PostRunAction.java b/src/main/java/com/hpe/application/automation/tools/model/PostRunAction.java index da74a931a9..3d12a945ac 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/PostRunAction.java +++ b/src/main/java/com/hpe/application/automation/tools/model/PostRunAction.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; public enum PostRunAction { diff --git a/src/main/java/com/hpe/application/automation/tools/model/ProxySettings.java b/src/main/java/com/hpe/application/automation/tools/model/ProxySettings.java index da57bdfceb..ec7d36e9ff 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/ProxySettings.java +++ b/src/main/java/com/hpe/application/automation/tools/model/ProxySettings.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import hudson.util.Secret; diff --git a/src/main/java/com/hpe/application/automation/tools/model/ResultsPublisherModel.java b/src/main/java/com/hpe/application/automation/tools/model/ResultsPublisherModel.java index 17ebbabc1a..5480317b03 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/ResultsPublisherModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/ResultsPublisherModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/RunFromAlmModel.java b/src/main/java/com/hpe/application/automation/tools/model/RunFromAlmModel.java index 49d0a78524..f823c1ce5e 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/RunFromAlmModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/RunFromAlmModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java index b2d6c82840..e4c5a74ca6 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/RunMode.java b/src/main/java/com/hpe/application/automation/tools/model/RunMode.java index 8ba992f22c..08ffa0d470 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/RunMode.java +++ b/src/main/java/com/hpe/application/automation/tools/model/RunMode.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SecretContainer.java b/src/main/java/com/hpe/application/automation/tools/model/SecretContainer.java index 3e281f080e..8d66e903db 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SecretContainer.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SecretContainer.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; public interface SecretContainer { diff --git a/src/main/java/com/hpe/application/automation/tools/model/SecretContainerImpl.java b/src/main/java/com/hpe/application/automation/tools/model/SecretContainerImpl.java index a98ce3a31b..d6b23f9154 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SecretContainerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SecretContainerImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import hudson.util.Secret; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java index 49dd11452f..38e2ad63ef 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfServerSettingsModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import org.apache.commons.lang.StringUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java index 158e7519a8..85f9338c91 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfTestParamsModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import hudson.Extension; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java b/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java index 5025ae1530..9149289b12 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SrfTestResultModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; /** diff --git a/src/main/java/com/hpe/application/automation/tools/model/SseModel.java b/src/main/java/com/hpe/application/automation/tools/model/SseModel.java index c5b8ebc153..a62858617d 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SseModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SseModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import java.util.Arrays; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SseProxySettings.java b/src/main/java/com/hpe/application/automation/tools/model/SseProxySettings.java index 3ac29cfc22..b8e7aafbdf 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SseProxySettings.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SseProxySettings.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import org.kohsuke.stapler.DataBoundConstructor; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvChangeModeModel.java b/src/main/java/com/hpe/application/automation/tools/model/SvChangeModeModel.java index c7b41e125d..c9b444a1a2 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvChangeModeModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvChangeModeModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvDataModelSelection.java b/src/main/java/com/hpe/application/automation/tools/model/SvDataModelSelection.java index b0f46d97ee..eb71007143 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvDataModelSelection.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvDataModelSelection.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvDeployModel.java b/src/main/java/com/hpe/application/automation/tools/model/SvDeployModel.java index f980e73e72..fd28028645 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvDeployModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvDeployModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvExportModel.java b/src/main/java/com/hpe/application/automation/tools/model/SvExportModel.java index 2ae39ccbb5..722eab26f3 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvExportModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvExportModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvPerformanceModelSelection.java b/src/main/java/com/hpe/application/automation/tools/model/SvPerformanceModelSelection.java index c5ad585aa2..d4c9e647bf 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvPerformanceModelSelection.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvPerformanceModelSelection.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvServerSettingsModel.java b/src/main/java/com/hpe/application/automation/tools/model/SvServerSettingsModel.java index da48adc140..87ba8bc964 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvServerSettingsModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvServerSettingsModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvServiceSelectionModel.java b/src/main/java/com/hpe/application/automation/tools/model/SvServiceSelectionModel.java index 053b837886..d1bb7d013b 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvServiceSelectionModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvServiceSelectionModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/SvUndeployModel.java b/src/main/java/com/hpe/application/automation/tools/model/SvUndeployModel.java index 5c5daf6914..a98355d894 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/SvUndeployModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/SvUndeployModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/model/TimeslotDuration.java b/src/main/java/com/hpe/application/automation/tools/model/TimeslotDuration.java index 6c36dea70b..7b70af5bcd 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/TimeslotDuration.java +++ b/src/main/java/com/hpe/application/automation/tools/model/TimeslotDuration.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; public class TimeslotDuration { diff --git a/src/main/java/com/hpe/application/automation/tools/model/UploadAppModel.java b/src/main/java/com/hpe/application/automation/tools/model/UploadAppModel.java index 1d3f9cd241..1d4a5dea07 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/UploadAppModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/UploadAppModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import hudson.util.Secret; diff --git a/src/main/java/com/hpe/application/automation/tools/model/UploadAppPathModel.java b/src/main/java/com/hpe/application/automation/tools/model/UploadAppPathModel.java index 707c03907f..d97570385f 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/UploadAppPathModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/UploadAppPathModel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.model; import hudson.Extension; diff --git a/src/main/java/com/hpe/application/automation/tools/model/UploadTestResultToAlmModel.java b/src/main/java/com/hpe/application/automation/tools/model/UploadTestResultToAlmModel.java index 8e78b6559b..41a37a7ecf 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/UploadTestResultToAlmModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/UploadTestResultToAlmModel.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.model; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java index 6bc4cc3b48..327302a0fa 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/AbstractResultQueueImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java index 0478654201..2ba9b1fbfa 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java b/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java index 2e71aa50d8..86ee7702f7 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/ResultQueue.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/BuildActions.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/BuildActions.java index de61d1ccde..3cf648c011 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/BuildActions.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/BuildActions.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/PluginActions.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/PluginActions.java index ec24a42d77..f8796a7f4e 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/PluginActions.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/PluginActions.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java index 96ad22d838..ce37f97a81 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java index 48f9e220ec..b6fd623856 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java index f7679710dc..496dbb8b76 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java index 6e5e28c718..d210d3fd7b 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java index d1c091ecf6..1df3d8cefc 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java index 62cd62b06b..a4ac917e57 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java index bc03025c87..2b64e74861 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberResultsService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java index 6bfa1440eb..f9b614d736 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java index dccc7654bd..6fdbfc171d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java index 59bf5e26f5..a7b44dba33 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java index 086dbd8f6a..61223b7c42 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.octane.actions.dto; import java.util.ArrayList; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java index 369c6e2803..8debd4dd2c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java index 8fe43b4a1a..26a2f60e62 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java index d12e2fd6c2..d84975e3fa 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java index a515597377..75a19d04db 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java index 19b1b14d3e..1c76b9d799 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java index a2dcff9000..0f6166c422 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgeClient.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgesService.java b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgesService.java index bcbed22b9b..0cf82abbec 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgesService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/bridge/BridgesService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java index 1f3525ba74..a379ce0ad6 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogDispatcher.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogsResultQueue.java b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogsResultQueue.java index eded6b9962..f2a3705301 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogsResultQueue.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/LogsResultQueue.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/OctaneLog.java b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/OctaneLog.java index 84cbf9d4c9..572d418ac0 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/OctaneLog.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/OctaneLog.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.octane.buildLogs; import java.io.File; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java index d1351590c3..438d043617 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/client/EventPublisher.java b/src/main/java/com/hpe/application/automation/tools/octane/client/EventPublisher.java index da6a15a3f8..ec698632d4 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/client/EventPublisher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/client/EventPublisher.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsInsightEventPublisher.java b/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsInsightEventPublisher.java index 5d8cb48601..a9b943cc25 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsInsightEventPublisher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsInsightEventPublisher.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactory.java index be2906dcb4..f373431f44 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactory.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java index 134ab89b3d..22da65ba96 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/client/JenkinsMqmRestClientFactoryImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/client/RetryModel.java b/src/main/java/com/hpe/application/automation/tools/octane/client/RetryModel.java index c51a230e8b..46c7459522 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/client/RetryModel.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/client/RetryModel.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigApi.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigApi.java index c5324d2bec..7cd30369bb 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigApi.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigApi.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction.java index b9697fc39f..3230b41069 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationActionFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationActionFactory.java index 76436de83d..f30961095f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationActionFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationActionFactory.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationListener.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationListener.java index efff5447ef..99709066a9 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationListener.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationListener.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationParser.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationParser.java index 17bd08412f..4f72930e2d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationParser.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationParser.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java index 627b4b16ae..2f2d8b43e4 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/JobConfigurationProxy.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/JobConfigurationProxy.java index 74536ffc07..2b6ddeaa3a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/JobConfigurationProxy.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/JobConfigurationProxy.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/MqmProject.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/MqmProject.java index 1bf372bb19..22160a27d5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/MqmProject.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/MqmProject.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfiguration.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfiguration.java index e6a3b4c469..e1f9e5b326 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfiguration.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfiguration.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfigurationUnmarshaller.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfigurationUnmarshaller.java index bddd475643..1b5999d2b1 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfigurationUnmarshaller.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/PredefinedConfigurationUnmarshaller.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java index e9142f2a66..bca27895a1 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ServerConfiguration.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java b/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java index 1c09d55c70..2415bb598f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/EventsClient.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/EventsService.java b/src/main/java/com/hpe/application/automation/tools/octane/events/EventsService.java index 27c375069d..231154ebb1 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/EventsService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/EventsService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java index 2639bfe311..79a9c89b6e 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/ItemListenerImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java index 6416093d64..7987278ae2 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/QueueListenerImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index f733d2ce7c..09bbe2967f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 294fea8ef2..8a439915ea 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java index e468c646c3..b6a65df63b 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/TestListenerImpl.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java index cc6fc02e29..fb92c4fd9a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvContributor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java index 4eb2991cac..4366505046 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/CheckOutSubDirEnvService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java index 1186342d4f..065c941f84 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java index 6def9af20e..37fb152c12 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 6ea2ce75e1..575fe61d80 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java index bd32cc1b63..b72fb361fd 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java index 9075870b56..ac937c7f55 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java index a4024cf20c..2699e561aa 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java index 09df5e8084..eb896a71c5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftConstants.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ package com.hpe.application.automation.tools.octane.executor; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java index e53daa7f89..578680d5d5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java index fe2e0dec52..61699dc8f5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobRecognizer.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java index c83eacc65f..123fcd1f43 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java index 4046ab92c1..684e2644bb 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryQueue.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/CIEventCausesFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/model/CIEventCausesFactory.java index ea58ca8502..c80ee48f3f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/CIEventCausesFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/CIEventCausesFactory.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java index 45ece95548..bf8dcf1cbc 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java index ad8db7cfe2..6732eb0c8b 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java index 3fd9c536aa..e283890af4 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/BuildTriggerProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java index 3bc0a2daae..039a6e0b33 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/MultiJobBuilderProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java index d147266e9d..7b64bbd5c3 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/ParameterizedTriggerProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java index 4a2b682b20..a57a8a3692 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/builders/WorkFlowRunProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/AbstractParametersProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/AbstractParametersProcessor.java index 6c007dd88e..d7ac05518f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/AbstractParametersProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/AbstractParametersProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/DynamicParameterProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/DynamicParameterProcessor.java index 7763959da2..d2892beada 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/DynamicParameterProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/DynamicParameterProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ExtendedChoiceParameterProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ExtendedChoiceParameterProcessor.java index c43f459a71..46a30dab01 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ExtendedChoiceParameterProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ExtendedChoiceParameterProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/InherentParameterProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/InherentParameterProcessor.java index 27c672c837..6c9e6c529b 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/InherentParameterProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/InherentParameterProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/NodeLabelParameterProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/NodeLabelParameterProcessor.java index e111b6f7f8..4f2fe47704 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/NodeLabelParameterProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/NodeLabelParameterProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java index b4f9eb153d..478a058dda 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/RandomStringParameterProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/RandomStringParameterProcessor.java index 29ae6454d4..16eaf63a86 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/RandomStringParameterProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/RandomStringParameterProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/UnsupportedParameterProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/UnsupportedParameterProcessor.java index b60b0b1ce2..26f9dc0183 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/UnsupportedParameterProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/parameters/UnsupportedParameterProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index e990c30009..239b015e10 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java index 5d487e5831..73dc193c9a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/FreeStyleProjectProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java index 292868c5cf..81e9f785cd 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/JobProcessorFactory.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java index a115b9fb3e..fd2354f440 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MatrixProjectProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java index ddc8aa4be6..1cc4d94d38 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MavenProjectProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java index b6ca3bf02c..dbed16422f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/MultiJobProjectProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/UnsupportedProjectProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/UnsupportedProjectProcessor.java index f343023cfd..3450791372 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/UnsupportedProjectProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/UnsupportedProjectProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/WorkFlowJobProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/WorkFlowJobProcessor.java index c7aee6f923..5a4bc2559d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/WorkFlowJobProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/projects/WorkFlowJobProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java index f417e0b42f..3dcfcdc292 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index e30690af4d..a3c09dc6dc 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java index 740e5ee36d..215182ff86 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.octane.model.processors.scm; import com.hp.octane.integrations.dto.scm.SCMData; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessors.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessors.java index f2d3cb4205..7e3cefc18d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessors.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessors.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java index ae66ad8c31..edcfd7d893 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java index 2d4b80d783..3d940d0434 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/AbstractSafeLoggingAsyncPeriodWork.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/HPRunnerType.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/HPRunnerType.java index 025896c1b4..1afcde32c6 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/HPRunnerType.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/HPRunnerType.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/MqmTestsExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/MqmTestsExtension.java index 4e9fc83003..a62322a68f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/MqmTestsExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/MqmTestsExtension.java @@ -1,4 +1,35 @@ -// (C) Copyright 2003-2015 Hewlett-Packard Development Company, L.P. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.octane.tests; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestApi.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestApi.java index 3905011a1e..ed5c9fb47c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestApi.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestApi.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestDispatcher.java index 8662727693..f33b86eaa2 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestDispatcher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestDispatcher.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java index b4041d3f70..4508aebaa4 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestListener.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestProcessingException.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestProcessingException.java index b968858ba5..5d019fb0e7 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestProcessingException.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestProcessingException.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestResultContainer.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestResultContainer.java index 3db44024b2..9057f60bab 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestResultContainer.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestResultContainer.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestsResultQueue.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestsResultQueue.java index 94b9965ecf..58210d5d03 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/TestsResultQueue.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/TestsResultQueue.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildDescriptor.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildDescriptor.java index a673aff1e4..ddbc6bab0c 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildDescriptor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildDescriptor.java @@ -1,4 +1,35 @@ -// (C) Copyright 2003-2015 Hewlett-Packard Development Company, L.P. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.octane.tests.build; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerExtension.java index 91d15b3f60..3547122843 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerExtension.java @@ -1,4 +1,35 @@ -// (C) Copyright 2003-2015 Hewlett-Packard Development Company, L.P. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.octane.tests.build; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java index 88509f2ad5..c91c20ca55 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/BuildHandlerUtils.java @@ -1,4 +1,35 @@ -// (C) Copyright 2003-2015 Hewlett-Packard Development Company, L.P. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.octane.tests.build; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java index 5d424ab0bf..f2dbc256e2 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MatrixBuildExtension.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java index 187a2f6d4c..452dbfe4e8 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/build/MavenBuildExtension.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFields.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFields.java index 9a7f28921b..fe266f6f62 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFields.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFields.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionExtension.java index 8c4434228a..76935447b4 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionExtension.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionService.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionService.java index 97c8c4d612..2779bf2693 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/ResultFieldsDetectionService.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/TestNGExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/TestNGExtension.java index 40da8a1e5f..267e6ef92f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/TestNGExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/TestNGExtension.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/UFTExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/UFTExtension.java index bd15437d78..2ea1f274f8 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/UFTExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/detection/UFTExtension.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestExtention.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestExtention.java index d2e7fb5eb0..af713b6989 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestExtention.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestExtention.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java index 030655e8ce..437fc1c337 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java index 0980fbf9c8..555d285e95 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/impl/ObjectStreamIterator.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/impl/ObjectStreamIterator.java index d8647a5d13..d1eddd141f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/impl/ObjectStreamIterator.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/impl/ObjectStreamIterator.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/AbstractMavenModuleDetection.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/AbstractMavenModuleDetection.java index 7064be23e0..d26d6b5cb7 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/AbstractMavenModuleDetection.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/AbstractMavenModuleDetection.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java index c0d3640a15..46921fad86 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitExtension.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitTestResult.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitTestResult.java index 046b38ff6e..675eaf6108 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitTestResult.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitTestResult.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index e5bfe19030..40c6fbf11f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenBuilderModuleDetection.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenBuilderModuleDetection.java index c445321df5..e40d24f3ea 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenBuilderModuleDetection.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenBuilderModuleDetection.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenSetModuleDetection.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenSetModuleDetection.java index a1ad35b8f4..d7f9c8404d 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenSetModuleDetection.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/MavenSetModuleDetection.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/ModuleDetection.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/ModuleDetection.java index fa08d95fe1..5af3d45620 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/ModuleDetection.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/ModuleDetection.java @@ -1,4 +1,35 @@ -// (C) Copyright 2003-2015 Hewlett-Packard Development Company, L.P. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.octane.tests.junit; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestError.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestError.java index ba1d922d6a..5bb93150f0 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestError.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestError.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestResultStatus.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestResultStatus.java index e46e78f198..8b428bb87e 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestResultStatus.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/TestResultStatus.java @@ -1,4 +1,35 @@ -// (C) Copyright 2003-2015 Hewlett-Packard Development Company, L.P. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.octane.tests.junit; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/testResult/TestResult.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/testResult/TestResult.java index 0a4994ba25..db0e261096 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/testResult/TestResult.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/testResult/TestResult.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java index f9ee707df1..04517e8211 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java index 56382d993b..db29b24d27 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/workflow/BuildRelations.java b/src/main/java/com/hpe/application/automation/tools/octane/workflow/BuildRelations.java index 36bfd83e3e..07aaee0096 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/workflow/BuildRelations.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/workflow/BuildRelations.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java b/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java index 23c12466c9..d7de204dba 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowBuildAdapter.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowGraphListener.java b/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowGraphListener.java index 4374588fa4..22fad8c771 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowGraphListener.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/workflow/WorkflowGraphListener.java @@ -1,16 +1,33 @@ /* - * Copyright 2017 Hewlett-Packard Development Company, L.P. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2018 Micro Focus Company, L.P. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ * */ diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java index 9eda3ecefc..db82a13f0c 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcErrorResponse.java b/src/main/java/com/hpe/application/automation/tools/pc/PcErrorResponse.java index df606d388f..2ebe94db65 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcErrorResponse.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcErrorResponse.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java index 85843fd261..230800247d 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRestProxy.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ /* diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLog.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLog.java index 41d4a9bcc5..b08cc7999a 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLog.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLog.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLogRecord.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLogRecord.java index 05179e1222..94107d284e 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLogRecord.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRunEventLogRecord.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRunRequest.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRunRequest.java index d08bf48c72..7ca7648516 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRunRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRunRequest.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRunResponse.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRunResponse.java index b3c3defc94..77c2865345 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRunResponse.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRunResponse.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRunResult.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRunResult.java index daa98951ee..991a888025 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRunResult.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRunResult.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcRunResults.java b/src/main/java/com/hpe/application/automation/tools/pc/PcRunResults.java index 8985a0ff50..f651aa71a4 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcRunResults.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcRunResults.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTest.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTest.java index 2f6e77109f..77238c0f1f 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTest.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pc; /** diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTestData.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTestData.java index 72a6b5b918..5d8934abda 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTestData.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTestData.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pc; import com.thoughtworks.xstream.XStream; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstance.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstance.java index cd617945a0..c53b29d50e 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstance.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstance.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pc; import com.thoughtworks.xstream.XStream; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstances.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstances.java index 0f2f8bbf03..8774bf7314 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstances.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTestInstances.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pc; import com.thoughtworks.xstream.XStream; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTestSet.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTestSet.java index 53ae4c1ad5..e99e0aa7d6 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTestSet.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTestSet.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pc; import com.thoughtworks.xstream.XStream; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTestSets.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTestSets.java index 822a36e928..387432f3f0 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTestSets.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTestSets.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pc; import com.thoughtworks.xstream.XStream; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTrendReportMetaData.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTrendReportMetaData.java index f8cef8297e..9180a31114 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTrendReportMetaData.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTrendReportMetaData.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcTrendedRun.java b/src/main/java/com/hpe/application/automation/tools/pc/PcTrendedRun.java index e1ef8cd6f1..1d30c383e2 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcTrendedRun.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcTrendedRun.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/ReleaseTimeslot.java b/src/main/java/com/hpe/application/automation/tools/pc/ReleaseTimeslot.java index e096d7895b..761f1c1547 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/ReleaseTimeslot.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/ReleaseTimeslot.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/RunState.java b/src/main/java/com/hpe/application/automation/tools/pc/RunState.java index d41ce89e3a..3f9bd9dc7e 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/RunState.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/RunState.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TestInstanceCreateRequest.java b/src/main/java/com/hpe/application/automation/tools/pc/TestInstanceCreateRequest.java index 319010f2db..0eac351101 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TestInstanceCreateRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TestInstanceCreateRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pc; import com.thoughtworks.xstream.XStream; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TimeInterval.java b/src/main/java/com/hpe/application/automation/tools/pc/TimeInterval.java index 22bfc2c3e9..4c53ca2efd 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TimeInterval.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TimeInterval.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRow.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRow.java index ffdb68f799..3085dafd13 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRow.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRow.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRows.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRows.java index 4a79fa72bf..5782fa944f 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRows.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportMonitorsDataRows.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRow.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRow.java index c80ade74d4..94b31e6f46 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRow.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRow.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRows.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRows.java index f13388cf47..2be4884a96 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRows.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRegularDataRows.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRequest.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRequest.java index 62c9dab3ce..dbbe09bb92 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportRequest.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRoot.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRoot.java index 80c48b7d56..cf2a00abdf 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRoot.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRoot.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRow.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRow.java index 068ef7e289..bb15d648a9 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRow.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRow.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRows.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRows.java index b0434c703d..5f0a2c322c 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRows.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTransactionDataRows.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTypes.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTypes.java index 55c0e6e8dc..cd07109f2b 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTypes.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendReportTypes.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pc/TrendedRange.java b/src/main/java/com/hpe/application/automation/tools/pc/TrendedRange.java index 288b98c0af..c884bf1ceb 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/TrendedRange.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/TrendedRange.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pc; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStep.java index 949de266fe..bd473493d5 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStep.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import jenkins.tasks.SimpleBuildStep; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStepDescriptor.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStepDescriptor.java index a5b3da87a3..cf7957a58e 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStepDescriptor.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/AbstractSvStepDescriptor.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import javax.annotation.Nonnull; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerScriptStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerScriptStep.java index f711ab0084..bdd8fc6828 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerScriptStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerScriptStep.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import com.hpe.application.automation.tools.run.RunLoadRunnerScript; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java index 30f3341b8b..1e6170d292 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -9,6 +16,7 @@ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -19,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pipelineSteps; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LrScenarioLoadStepExecution.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LrScenarioLoadStepExecution.java index 6ca7032499..d42518d91a 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LrScenarioLoadStepExecution.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LrScenarioLoadStepExecution.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pipelineSteps; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuildAndPublishStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuildAndPublishStep.java index 9bf1584063..4259824bd6 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuildAndPublishStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuildAndPublishStep.java @@ -1,7 +1,15 @@ -/** +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License * - * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -9,10 +17,10 @@ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -20,10 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ * - * - * A pipeline step that combined with ssebuilder and runresultrecorder. - * Created by llu4 on 10/20/2016. */ package com.hpe.application.automation.tools.pipelineSteps; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuilderPublishResultStepExecution.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuilderPublishResultStepExecution.java index 074c32f1d5..a9022c3cd8 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuilderPublishResultStepExecution.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SseBuilderPublishResultStepExecution.java @@ -1,20 +1,14 @@ -package com.hpe.application.automation.tools.pipelineSteps; - -import com.hpe.application.automation.tools.results.RunResultRecorder; -import com.hpe.application.automation.tools.run.RunFromFileBuilder; -import com.hpe.application.automation.tools.run.SseBuilder; -import hudson.FilePath; -import hudson.Launcher; -import hudson.model.Run; -import hudson.model.TaskListener; -import org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution; -import org.jenkinsci.plugins.workflow.steps.StepContextParameter; -import org.apache.commons.lang.StringUtils; -import javax.inject.Inject; -import java.util.HashMap; - -/** - * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,10 +16,10 @@ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -33,10 +27,25 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ * - * Execution for SseBuildAndPublish - * Created by Roy Lu on 10/20/2016. */ + +package com.hpe.application.automation.tools.pipelineSteps; + +import com.hpe.application.automation.tools.results.RunResultRecorder; +import com.hpe.application.automation.tools.run.RunFromFileBuilder; +import com.hpe.application.automation.tools.run.SseBuilder; +import hudson.FilePath; +import hudson.Launcher; +import hudson.model.Run; +import hudson.model.TaskListener; +import org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution; +import org.jenkinsci.plugins.workflow.steps.StepContextParameter; +import org.apache.commons.lang.StringUtils; +import javax.inject.Inject; +import java.util.HashMap; + public class SseBuilderPublishResultStepExecution extends AbstractSynchronousNonBlockingStepExecution { private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvChangeModeStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvChangeModeStep.java index e17f664185..b1be8d2eb3 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvChangeModeStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvChangeModeStep.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import com.hpe.application.automation.tools.model.SvDataModelSelection; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvDeployStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvDeployStep.java index 547579d269..63101735da 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvDeployStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvDeployStep.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import com.hpe.application.automation.tools.run.SvDeployBuilder; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExecution.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExecution.java index 341279a873..fbbefe2c0a 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExecution.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExecution.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import javax.inject.Inject; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExportStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExportStep.java index 5aad81a2ce..b39b6e3f95 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExportStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvExportStep.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import com.hpe.application.automation.tools.model.SvServiceSelectionModel; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvUndeployStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvUndeployStep.java index 2f347c6927..a4425f4fcd 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvUndeployStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/SvUndeployStep.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.pipelineSteps; import com.hpe.application.automation.tools.model.SvServiceSelectionModel; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java index 81d41ffb93..16c4c5a63a 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStep.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -9,6 +16,7 @@ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -19,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pipelineSteps; diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java index f65421004d..2ace350eb2 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.pipelineSteps; diff --git a/src/main/java/com/hpe/application/automation/tools/rest/RESTConstants.java b/src/main/java/com/hpe/application/automation/tools/rest/RESTConstants.java index 5cf72699d7..b8b68aa8cd 100644 --- a/src/main/java/com/hpe/application/automation/tools/rest/RESTConstants.java +++ b/src/main/java/com/hpe/application/automation/tools/rest/RESTConstants.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.rest; /** diff --git a/src/main/java/com/hpe/application/automation/tools/rest/RestClient.java b/src/main/java/com/hpe/application/automation/tools/rest/RestClient.java index ebb62ca245..493f235c1c 100644 --- a/src/main/java/com/hpe/application/automation/tools/rest/RestClient.java +++ b/src/main/java/com/hpe/application/automation/tools/rest/RestClient.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.rest; import java.io.ByteArrayOutputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java b/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java index 05d5b30ced..82d0b15802 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results; import hudson.model.DirectoryBrowserSupport; diff --git a/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java index 1103ffdd76..4d596b477f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java @@ -1,15 +1,26 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -17,6 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/LrGraphUtils.java b/src/main/java/com/hpe/application/automation/tools/results/LrGraphUtils.java index 72770fa66d..02327a40ca 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/LrGraphUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/results/LrGraphUtils.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/PerformanceJobReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/PerformanceJobReportAction.java index 0a8ff87a60..14cef1005a 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/PerformanceJobReportAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/PerformanceJobReportAction.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/PerformanceProjectAction.java b/src/main/java/com/hpe/application/automation/tools/results/PerformanceProjectAction.java index f6786f7122..1821590883 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/PerformanceProjectAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/PerformanceProjectAction.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/PerformanceReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/PerformanceReportAction.java index 32c95b324c..d35f321323 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/PerformanceReportAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/PerformanceReportAction.java @@ -1,15 +1,26 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -17,6 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java b/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java index c98353113b..1f85ce0eec 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java +++ b/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java @@ -1,8 +1,39 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results; -/** - * Created by xueli on 7/23/2015. - */ + public class ReportMetaData { diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index 960d29f3a5..36af415a67 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -1,15 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -// to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of -// the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/SlaRuleTypes.java b/src/main/java/com/hpe/application/automation/tools/results/SlaRuleTypes.java index dfab860628..c3c767b434 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SlaRuleTypes.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SlaRuleTypes.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java index f1f8c0796f..f95b0e556f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfDetailReport.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results; import hudson.model.AbstractBuild; diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index de39115ada..6851cc97f4 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results; import com.hpe.application.automation.tools.common.RuntimeUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java index 0b7376baba..10070e9beb 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfSummaryReport.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results; import java.io.IOException; diff --git a/src/main/java/com/hpe/application/automation/tools/results/SummaryReport.java b/src/main/java/com/hpe/application/automation/tools/results/SummaryReport.java index 5732128ce4..aa12c3352e 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SummaryReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SummaryReport.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results; import hudson.model.DirectoryBrowserSupport; diff --git a/src/main/java/com/hpe/application/automation/tools/results/TestResultToALMUploader.java b/src/main/java/com/hpe/application/automation/tools/results/TestResultToALMUploader.java index fb26aba9de..e440898ed7 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/TestResultToALMUploader.java +++ b/src/main/java/com/hpe/application/automation/tools/results/TestResultToALMUploader.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/TransactionSummaryAction.java b/src/main/java/com/hpe/application/automation/tools/results/TransactionSummaryAction.java index e3f26673cc..d16a71b1fe 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/TransactionSummaryAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/TransactionSummaryAction.java @@ -1,15 +1,26 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -17,6 +28,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results; diff --git a/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java b/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java index 5821c48611..491de915a2 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReport.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.lrscriptresultparser; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java index b6374828a7..256776f568 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptHtmlReportAction.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.lrscriptresultparser; import hudson.model.Action; diff --git a/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java b/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java index 2d35183224..1555ab3ddf 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java +++ b/src/main/java/com/hpe/application/automation/tools/results/lrscriptresultparser/LrScriptResultsSanitizer.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.lrscriptresultparser; import java.io.FilterReader; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParseException.java b/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParseException.java index f0113d6331..d0e24d91b2 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParseException.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParseException.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser; public class ReportParseException extends Exception { diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParser.java b/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParser.java index 6fd19ae117..4da9691bfe 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParser.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParser.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser; import java.io.InputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParserManager.java b/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParserManager.java index 5791e17138..42e82a00cf 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParserManager.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/ReportParserManager.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser; import java.io.FileInputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/AntJUnitReportParserImpl.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/AntJUnitReportParserImpl.java index 3c8c21051a..12f578db37 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/AntJUnitReportParserImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/AntJUnitReportParserImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.antjunit; import java.io.InputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Error.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Error.java index c07fceab92..58ab8f99ad 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Error.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Error.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Failure.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Failure.java index d9a00dd980..022c9be0f7 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Failure.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Failure.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/ObjectFactory.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/ObjectFactory.java index f769560d5e..6361617360 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/ObjectFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/ObjectFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Properties.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Properties.java index c8fc91c67b..9331ec38c0 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Properties.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Properties.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Property.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Property.java index d90fd55dff..10c67e4e14 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Property.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Property.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testcase.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testcase.java index b7e1f019b9..556cfd3394 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testcase.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testcase.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuite.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuite.java index f4661a8620..f70e94dd0f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuite.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuite.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuites.java b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuites.java index 846cc4ac88..bf6b3a7429 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuites.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/antjunit/Testsuites.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/JenkinsJUnitReportParserImpl.java b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/JenkinsJUnitReportParserImpl.java index 0a6a59d9df..a9aa8a6e22 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/JenkinsJUnitReportParserImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/JenkinsJUnitReportParserImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.jenkinsjunit; import java.io.InputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/NewDataSet.java b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/NewDataSet.java index 9286953418..e251671848 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/NewDataSet.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/NewDataSet.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/ObjectFactory.java b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/ObjectFactory.java index 2e93205638..7809aa02f9 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/ObjectFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/ObjectFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.jenkinsjunit; // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/Result.java b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/Result.java index dd29ff682b..a37696e7db 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/Result.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/jenkinsjunit/Result.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Error.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Error.java index a7d8860a95..65645e2ce1 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Error.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Error.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Failure.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Failure.java index a2925d824d..fbf2dd7dc1 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Failure.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Failure.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/MavenSureFireReportParserImpl.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/MavenSureFireReportParserImpl.java index 2cccc3753e..1de201b676 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/MavenSureFireReportParserImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/MavenSureFireReportParserImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.mavensurefire; import java.io.InputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/ObjectFactory.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/ObjectFactory.java index 5bd3ccaf17..11b49a2caf 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/ObjectFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/ObjectFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Properties.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Properties.java index e89ccc51e2..073325c3a5 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Properties.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Properties.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Property.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Property.java index 7efaebb0e2..2748318eb4 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Property.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Property.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testcase.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testcase.java index ca98a0a586..c08178a877 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testcase.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testcase.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testsuite.java b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testsuite.java index e9e18c7e3b..a778d83fe1 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testsuite.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/mavensurefire/Testsuite.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoriesType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoriesType.java index 96b391b8bf..5034263be1 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoriesType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoriesType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoryType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoryType.java index 1a3bd5d158..eea31f0e80 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoryType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/CategoryType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/FailureType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/FailureType.java index 263b2aac2a..bd06a05da4 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/FailureType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/FailureType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/NUnitReportParserImpl.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/NUnitReportParserImpl.java index 608f3b120e..6d2b8061bf 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/NUnitReportParserImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/NUnitReportParserImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.nunit; import java.io.InputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ObjectFactory.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ObjectFactory.java index 17eef9329c..48df2f357f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ObjectFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ObjectFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ReasonType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ReasonType.java index ff8bfd446b..44a841f343 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ReasonType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ReasonType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultType.java index 572d7b5ceb..601e8090ae 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultsType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultsType.java index a4c562fa17..8804b07efa 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultsType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/ResultsType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestCaseType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestCaseType.java index ba56e87707..34ac2fd597 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestCaseType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestCaseType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestSuiteType.java b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestSuiteType.java index 1daa7e4575..69547ce66a 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestSuiteType.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/nunit/TestSuiteType.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/NewDataSet.java b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/NewDataSet.java index 7fa676d1ca..dcb7c88eb4 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/NewDataSet.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/NewDataSet.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/ObjectFactory.java b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/ObjectFactory.java index 05b584473a..03f886828f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/ObjectFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/ObjectFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestNGXmlReportParserImpl.java b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestNGXmlReportParserImpl.java index 0716a38830..fb364ad316 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestNGXmlReportParserImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestNGXmlReportParserImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.testngxml; import java.io.InputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestngResults.java b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestngResults.java index 10c0f179c0..822e8bf844 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestngResults.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/testngxml/TestngResults.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/util/ParserUtil.java b/src/main/java/com/hpe/application/automation/tools/results/parser/util/ParserUtil.java index 0a3c47d36c..b27b8c5077 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/util/ParserUtil.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/util/ParserUtil.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.util; import java.io.StringWriter; diff --git a/src/main/java/com/hpe/application/automation/tools/results/parser/util/TimeUtil.java b/src/main/java/com/hpe/application/automation/tools/results/parser/util/TimeUtil.java index 21fa3d2a59..ef77232549 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/parser/util/TimeUtil.java +++ b/src/main/java/com/hpe/application/automation/tools/results/parser/util/TimeUtil.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.parser.util; import java.text.DateFormat; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/package-info.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/package-info.java index 14ced1e891..e5534c320e 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/package-info.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/package-info.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + /** * Created by kazaky on 07/07/2016. */ diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/AvgTransactionResponseTime.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/AvgTransactionResponseTime.java index 27a5eafdb6..3f004cc6ac 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/AvgTransactionResponseTime.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/AvgTransactionResponseTime.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/GoalResult.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/GoalResult.java index c58fa4b2ac..b17c1742bc 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/GoalResult.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/GoalResult.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/JobLrScenarioResult.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/JobLrScenarioResult.java index dd88c32875..de660c3374 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/JobLrScenarioResult.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/JobLrScenarioResult.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results.projectparser.performance; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrJobResults.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrJobResults.java index 145cd9dcfd..6930ed186e 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrJobResults.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrJobResults.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results.projectparser.performance; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java index d250eb9532..9fd0b279c4 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results.projectparser.performance; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrRunResults.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrRunResults.java index 9f92b3f42a..d51d7cfa94 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrRunResults.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrRunResults.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results.projectparser.performance; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrScenario.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrScenario.java index a102c6cff1..fa97833e69 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrScenario.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrScenario.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results.projectparser.performance; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrTest.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrTest.java index c7b450210e..0f62de8ed2 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrTest.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/LrTest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/PercentileTransactionWholeRun.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/PercentileTransactionWholeRun.java index a2118351a3..1079e810cc 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/PercentileTransactionWholeRun.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/PercentileTransactionWholeRun.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/ProjectLrResults.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/ProjectLrResults.java index 4fe4ce3722..4200fad680 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/ProjectLrResults.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/ProjectLrResults.java @@ -1,7 +1,14 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.results.projectparser.performance; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRange.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRange.java index 713857ed42..6316de5c13 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRange.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRange.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRangeResult.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRangeResult.java index 853ba4dd6f..ec85126306 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRangeResult.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/TimeRangeResult.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; import java.util.ArrayList; diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/WholeRunResult.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/WholeRunResult.java index 3420e1194a..fd62afbf03 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/WholeRunResult.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/WholeRunResult.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; /** diff --git a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/XmlParserUtil.java b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/XmlParserUtil.java index d5e5a4b386..3ce6a90f74 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/XmlParserUtil.java +++ b/src/main/java/com/hpe/application/automation/tools/results/projectparser/performance/XmlParserUtil.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.projectparser.performance; import org.w3c.dom.NamedNodeMap; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestException.java b/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestException.java index 2ad87027f3..0b873c6a43 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestException.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestException.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; public class AlmRestException extends Exception{ diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestInfo.java b/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestInfo.java index 42084d4c91..375b8dc534 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestInfo.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestInfo.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; public class AlmRestInfo { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestTool.java b/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestTool.java index fdc1a58f35..fec32ad1bb 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestTool.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/AlmRestTool.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; import java.net.URLEncoder; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/DefaultExternalEntityUploadServiceImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/DefaultExternalEntityUploadServiceImpl.java index 220c5dd7f3..6f20847a0b 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/DefaultExternalEntityUploadServiceImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/DefaultExternalEntityUploadServiceImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; import java.util.ArrayList; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadException.java b/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadException.java index 6f77e0c4bc..fb74e11fd4 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadException.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadException.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; public class ExternalEntityUploadException extends Exception{ diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadLogger.java b/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadLogger.java index 4969b3b7ed..a35c70d492 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadLogger.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/ExternalEntityUploadLogger.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; import java.io.PrintStream; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/IExternalEntityUploadService.java b/src/main/java/com/hpe/application/automation/tools/results/service/IExternalEntityUploadService.java index 709a44dd40..ddb1b5ac29 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/IExternalEntityUploadService.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/IExternalEntityUploadService.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; public interface IExternalEntityUploadService { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/SystemOutLogger.java b/src/main/java/com/hpe/application/automation/tools/results/service/SystemOutLogger.java index a9d2eb8218..8e811d5c85 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/SystemOutLogger.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/SystemOutLogger.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service; import com.hpe.application.automation.tools.sse.sdk.Logger; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmCommonProperties.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmCommonProperties.java index 491e50fb19..4357485590 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmCommonProperties.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmCommonProperties.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmCommonProperties { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntity.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntity.java index cbb22deaa6..abf2e9cc5c 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntity.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntity.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; import java.util.List; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntityImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntityImpl.java index 71afb7a6b7..4ff11d719e 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntityImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmEntityImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; import java.util.ArrayList; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRun.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRun.java index 280493024c..b4801a77ca 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRun.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRun.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmRun extends AlmEntity{ diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRunImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRunImpl.java index b14346520f..8315acff32 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRunImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmRunImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public class AlmRunImpl extends AlmEntityImpl implements AlmRun { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTest.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTest.java index be2c6de2ec..f5e16d1ada 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTest.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmTest extends AlmEntity{ diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfig.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfig.java index ce5c39091f..4e9ed89f67 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfig.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfig.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmTestConfig extends AlmEntity { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfigImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfigImpl.java index c05400ba16..d6bbe3353b 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfigImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestConfigImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public class AlmTestConfigImpl extends AlmEntityImpl implements AlmTestConfig { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolder.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolder.java index 1553d70d6b..850cf7b2b6 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmTestFolder extends AlmEntity { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolderImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolderImpl.java index 0a0f567651..3c6b614cae 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolderImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestFolderImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public class AlmTestFolderImpl extends AlmEntityImpl implements AlmTestFolder { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestImpl.java index 85853906bd..bd1e1d839d 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public class AlmTestImpl extends AlmEntityImpl implements AlmTest { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstance.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstance.java index 3fbbe2f258..499d0b0b50 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstance.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstance.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmTestInstance extends AlmEntity{ diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstanceImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstanceImpl.java index 64ac74f8a5..c8a85935f9 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstanceImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestInstanceImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public class AlmTestInstanceImpl extends AlmEntityImpl implements diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSet.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSet.java index 9ea9b410e1..2376caf7af 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSet.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSet.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmTestSet extends AlmEntity{ diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolder.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolder.java index 7ce8b20ff4..e1d87dd309 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface AlmTestSetFolder extends AlmEntity { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolderImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolderImpl.java index 66c86b8dca..a0e938e99b 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolderImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetFolderImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public class AlmTestSetFolderImpl extends AlmEntityImpl implements diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetImpl.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetImpl.java index 4d321b0bdd..a5593d445c 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/AlmTestSetImpl.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public class AlmTestSetImpl extends AlmEntityImpl implements AlmTestSet { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/EntityRelation.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/EntityRelation.java index a08834c3a1..5580beb094 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/EntityRelation.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/EntityRelation.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface EntityRelation { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/IAlmConsts.java b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/IAlmConsts.java index 197cad8cbb..c6d5d8d53b 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/almentities/IAlmConsts.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/almentities/IAlmConsts.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.almentities; public interface IAlmConsts { diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/rest/CreateAlmEntityRequest.java b/src/main/java/com/hpe/application/automation/tools/results/service/rest/CreateAlmEntityRequest.java index c58c0cbe91..03ad6bc01f 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/rest/CreateAlmEntityRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/rest/CreateAlmEntityRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.rest; import com.hpe.application.automation.tools.common.Pair; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/rest/GetAlmEntityRequest.java b/src/main/java/com/hpe/application/automation/tools/results/service/rest/GetAlmEntityRequest.java index 8802f411be..c97b7e4be1 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/rest/GetAlmEntityRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/rest/GetAlmEntityRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.rest; import com.hpe.application.automation.tools.results.service.almentities.AlmEntity; diff --git a/src/main/java/com/hpe/application/automation/tools/results/service/rest/UpdateAlmEntityRequest.java b/src/main/java/com/hpe/application/automation/tools/results/service/rest/UpdateAlmEntityRequest.java index 68da6cbbba..002271c929 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/service/rest/UpdateAlmEntityRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/results/service/rest/UpdateAlmEntityRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.results.service.rest; import java.util.List; diff --git a/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunBuilder.java index 93cd9479d0..4e38dc95a6 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import javax.annotation.Nonnull; diff --git a/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunDescriptor.java b/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunDescriptor.java index 2eb2c834f2..4aa7b5cce6 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunDescriptor.java +++ b/src/main/java/com/hpe/application/automation/tools/run/AbstractSvRunDescriptor.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; diff --git a/src/main/java/com/hpe/application/automation/tools/run/AdditionalParametersAction.java b/src/main/java/com/hpe/application/automation/tools/run/AdditionalParametersAction.java index 51640790d3..f2d5ef48fc 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/AdditionalParametersAction.java +++ b/src/main/java/com/hpe/application/automation/tools/run/AdditionalParametersAction.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import hudson.EnvVars; diff --git a/src/main/java/com/hpe/application/automation/tools/run/AlmRunTypes.java b/src/main/java/com/hpe/application/automation/tools/run/AlmRunTypes.java index 8fa8a1c164..8137fe5016 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/AlmRunTypes.java +++ b/src/main/java/com/hpe/application/automation/tools/run/AlmRunTypes.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; public class AlmRunTypes { diff --git a/src/main/java/com/hpe/application/automation/tools/run/AutEnvironmentBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/AutEnvironmentBuilder.java index 086d7eb00f..981ff0f3d0 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/AutEnvironmentBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/AutEnvironmentBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import java.io.IOException; diff --git a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java index 95a55fe51b..e6c2fdfee0 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/CreateTunnelBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import groovy.transform.Synchronized; import hudson.Extension; diff --git a/src/main/java/com/hpe/application/automation/tools/run/JobConfigRebrander.java b/src/main/java/com/hpe/application/automation/tools/run/JobConfigRebrander.java index 29a85c328e..a6eb78ca38 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/JobConfigRebrander.java +++ b/src/main/java/com/hpe/application/automation/tools/run/JobConfigRebrander.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import hudson.Extension; diff --git a/src/main/java/com/hpe/application/automation/tools/run/LrScriptResultsParser.java b/src/main/java/com/hpe/application/automation/tools/run/LrScriptResultsParser.java index 05bab91e21..e7c9f0a62d 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/LrScriptResultsParser.java +++ b/src/main/java/com/hpe/application/automation/tools/run/LrScriptResultsParser.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import hudson.FilePath; diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index 7d0bc981aa..1b9ce852cf 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -1,13 +1,22 @@ /* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ * MIT License * - * Copyright (c) 2016 Hewlett-Packard Development Company, L.P. + * Copyright (c) 2018 Micro Focus Company, L.P. + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java index 83f209fa2f..acc357e235 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 4fc67e0572..d04a4d395f 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java index 9c12e0c987..8883238ebd 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromSrfBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import com.hpe.application.automation.tools.model.SrfServerSettingsModel; import com.hpe.application.automation.tools.model.SrfTestParamsModel; diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunLoadRunnerScript.java b/src/main/java/com/hpe/application/automation/tools/run/RunLoadRunnerScript.java index d898a401c5..06c75659a3 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunLoadRunnerScript.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunLoadRunnerScript.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import com.hpe.application.automation.tools.results.lrscriptresultparser.LrScriptHtmlReportAction; diff --git a/src/main/java/com/hpe/application/automation/tools/run/SseBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/SseBuilder.java index bfcb35742c..d92fddbbee 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/SseBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/SseBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import java.io.IOException; diff --git a/src/main/java/com/hpe/application/automation/tools/run/SvChangeModeBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/SvChangeModeBuilder.java index 4107c1e497..e89af90c4b 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/SvChangeModeBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/SvChangeModeBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; diff --git a/src/main/java/com/hpe/application/automation/tools/run/SvDeployBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/SvDeployBuilder.java index 1a4eb0b818..cbfca527a2 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/SvDeployBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/SvDeployBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; diff --git a/src/main/java/com/hpe/application/automation/tools/run/SvExportBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/SvExportBuilder.java index f0e788ca72..01df4de106 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/SvExportBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/SvExportBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; diff --git a/src/main/java/com/hpe/application/automation/tools/run/SvUndeployBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/SvUndeployBuilder.java index f68cc46f39..c2b4da0b18 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/SvUndeployBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/SvUndeployBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.run; diff --git a/src/main/java/com/hpe/application/automation/tools/run/UploadAppBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/UploadAppBuilder.java index 309ac5e0f8..0d9c47112b 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/UploadAppBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/UploadAppBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.run; import com.hpe.application.automation.tools.mc.JobConfigurationProxy; diff --git a/src/main/java/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder.java index 562ce4f390..8e97a5f526 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2012 Hewlett-Packard Development Company, L.P. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.settings; diff --git a/src/main/java/com/hpe/application/automation/tools/settings/MCServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/MCServerSettingsBuilder.java index f7a5134774..211b0b88af 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/MCServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/MCServerSettingsBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.settings; import com.hpe.application.automation.tools.model.MCServerSettingsModel; diff --git a/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java index ce27c79943..bd4689be41 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.settings; diff --git a/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java index 8e94f8582d..420a7ec2c1 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.settings; import com.hpe.application.automation.tools.model.SrfServerSettingsModel; diff --git a/src/main/java/com/hpe/application/automation/tools/settings/SvServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/SvServerSettingsBuilder.java index f31778f2c0..5ba8b35fc9 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/SvServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/SvServerSettingsBuilder.java @@ -1,7 +1,35 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ package com.hpe.application.automation.tools.settings; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/ArgsFactory.java b/src/main/java/com/hpe/application/automation/tools/sse/ArgsFactory.java index c77d7b6ec1..bc6e273aaf 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/ArgsFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/ArgsFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse; import com.hpe.application.automation.tools.model.SseModel; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/SSEBuilderPerformer.java b/src/main/java/com/hpe/application/automation/tools/sse/SSEBuilderPerformer.java index 9ab9b0b8cc..d52a83dffd 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/SSEBuilderPerformer.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/SSEBuilderPerformer.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse; import com.hpe.application.automation.tools.model.SseModel; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java index 068de1415a..6f2e256f34 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentBuilderPerformer.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment; import java.util.Collection; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentFolder.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentFolder.java index 171378fbe4..a212ae078f 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentFolder.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentFolder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment; /** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentManager.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentManager.java index 900bb70e7b..557fa4346a 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentManager.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentManager.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment; import com.hpe.application.automation.tools.common.SSEException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentParametersManager.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentParametersManager.java index 3356a10b1f..38bcb501df 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentParametersManager.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmentParametersManager.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment; import com.hpe.application.automation.tools.common.SSEException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmnentParameter.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmnentParameter.java index 6cf74ea8ba..415b904376 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmnentParameter.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/AUTEnvironmnentParameter.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment; /** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/AUTEnvironmentResources.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/AUTEnvironmentResources.java index f2decf901a..00a1ed1f59 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/AUTEnvironmentResources.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/AUTEnvironmentResources.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request; /** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvFoldersByIdRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvFoldersByIdRequest.java index 636f2ead6f..ebe30d7f23 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvFoldersByIdRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvFoldersByIdRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request.get; import com.hpe.application.automation.tools.sse.autenvironment.request.AUTEnvironmentResources; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdOldApiRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdOldApiRequest.java index 5eb0c9b690..5d9e36dd1a 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdOldApiRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdOldApiRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request.get; import com.hpe.application.automation.tools.sse.autenvironment.request.AUTEnvironmentResources; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdRequest.java index 662a27ef23..d18eb2ee60 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentByIdRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request.get; import com.hpe.application.automation.tools.sse.autenvironment.request.AUTEnvironmentResources; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentConfigurationByIdRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentConfigurationByIdRequest.java index 89eb991954..1ca587e77e 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentConfigurationByIdRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetAutEnvironmentConfigurationByIdRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request.get; import com.hpe.application.automation.tools.sse.autenvironment.request.AUTEnvironmentResources; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetParametersByAutEnvConfIdRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetParametersByAutEnvConfIdRequest.java index 46c0b28075..acf4847063 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetParametersByAutEnvConfIdRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/get/GetParametersByAutEnvConfIdRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request.get; import com.hpe.application.automation.tools.sse.autenvironment.request.AUTEnvironmentResources; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/post/CreateAutEnvConfRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/post/CreateAutEnvConfRequest.java index a587e0e161..0cff0d30be 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/post/CreateAutEnvConfRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/post/CreateAutEnvConfRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request.post; import java.util.ArrayList; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/put/PutAutEnvironmentParametersBulkRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/put/PutAutEnvironmentParametersBulkRequest.java index 4570154b46..e6fc4b4c7f 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/put/PutAutEnvironmentParametersBulkRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/autenvironment/request/put/PutAutEnvironmentParametersBulkRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.autenvironment.request.put; import com.hpe.application.automation.tools.sse.autenvironment.AUTEnvironmnentParameter; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/common/JsonHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/common/JsonHandler.java index 94bb8ba088..e933a74d55 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/common/JsonHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/common/JsonHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.common; import java.io.FileInputStream; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/common/RestXmlUtils.java b/src/main/java/com/hpe/application/automation/tools/sse/common/RestXmlUtils.java index 83c56407d8..884b9b34a4 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/common/RestXmlUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/common/RestXmlUtils.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.common; import com.hpe.application.automation.tools.rest.RESTConstants; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/common/StringUtils.java b/src/main/java/com/hpe/application/automation/tools/sse/common/StringUtils.java index 1b18ab6fd3..3f620da4ba 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/common/StringUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/common/StringUtils.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.common; /*** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/common/XPathUtils.java b/src/main/java/com/hpe/application/automation/tools/sse/common/XPathUtils.java index 6677235703..2bb3d2fa0b 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/common/XPathUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/common/XPathUtils.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.common; import java.io.StringReader; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/JUnitParser.java b/src/main/java/com/hpe/application/automation/tools/sse/result/JUnitParser.java index af936e4623..786dfc9895 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/JUnitParser.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/JUnitParser.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.result; import java.net.MalformedURLException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/LabPublisher.java b/src/main/java/com/hpe/application/automation/tools/sse/result/LabPublisher.java index 22eb86b70e..0196dbcf68 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/LabPublisher.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/LabPublisher.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.result; import com.hpe.application.automation.tools.sse.common.XPathUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/PCPublisher.java b/src/main/java/com/hpe/application/automation/tools/sse/result/PCPublisher.java index 4772594028..25c50e36e4 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/PCPublisher.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/PCPublisher.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.result; import com.hpe.application.automation.tools.sse.common.XPathUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/Publisher.java b/src/main/java/com/hpe/application/automation/tools/sse/result/Publisher.java index 21909dc5c7..ab36ca4d5c 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/Publisher.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/Publisher.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.result; import java.util.List; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/PublisherFactory.java b/src/main/java/com/hpe/application/automation/tools/sse/result/PublisherFactory.java index ba2091ce95..0e8bc5a62f 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/PublisherFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/PublisherFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.result; import com.hpe.application.automation.tools.common.SSEException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Error.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Error.java index 1a2b36a8bc..0b4ffc2ae5 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Error.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Error.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Failure.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Failure.java index 740831ae76..fee8dac3b8 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Failure.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Failure.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/JUnitTestCaseStatus.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/JUnitTestCaseStatus.java index 432bfb6c87..8759faf2b6 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/JUnitTestCaseStatus.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/JUnitTestCaseStatus.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.result.model.junit; /** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Properties.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Properties.java index a5b01ec3fe..10e3e808c1 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Properties.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Properties.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Property.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Property.java index c52c8d2a67..f8d1eb15e7 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Property.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Property.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testcase.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testcase.java index 8b54772069..702bf6f7ac 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testcase.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testcase.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuite.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuite.java index e011783868..e64152d79b 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuite.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuite.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuites.java b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuites.java index b490e67181..d2a805fae5 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuites.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/result/model/junit/Testsuites.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java index 0248b46f24..04d5d22aaf 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import com.hpe.application.automation.tools.common.ALMRESTVersionUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Args.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Args.java index 15f187195c..ca681efa59 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Args.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Args.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import com.hpe.application.automation.tools.model.CdaDetails; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Base64Encoder.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Base64Encoder.java index c8ad708343..6384bd3a51 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Base64Encoder.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Base64Encoder.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; /*** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Client.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Client.java index bbf45eabed..013b36d70e 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Client.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Client.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import java.util.Map; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/ConsoleLogger.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/ConsoleLogger.java index 1727c57b79..4d0651896d 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/ConsoleLogger.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/ConsoleLogger.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; /** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/HttpRequestDecorator.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/HttpRequestDecorator.java index 3ae2465b6b..f7505c0147 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/HttpRequestDecorator.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/HttpRequestDecorator.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import java.security.MessageDigest; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Logger.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Logger.java index 23b8021a7c..03fd952450 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Logger.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Logger.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; /*** diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/PCRunResponse.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/PCRunResponse.java index cc1fda0194..2f976fa435 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/PCRunResponse.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/PCRunResponse.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import com.hpe.application.automation.tools.sse.common.StringUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/ResourceAccessLevel.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/ResourceAccessLevel.java index b32b21d23e..71981ed156 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/ResourceAccessLevel.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/ResourceAccessLevel.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import com.hpe.application.automation.tools.rest.RESTConstants; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Response.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Response.java index a0512f5a9d..5caa8cab36 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/Response.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/Response.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import java.net.HttpURLConnection; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunManager.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunManager.java index 331c687dc1..5b71ee7642 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunManager.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunManager.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import com.hpe.application.automation.tools.common.SSEException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunResponse.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunResponse.java index 26bffffd5f..a2f5a48506 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunResponse.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/RunResponse.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk; import com.hpe.application.automation.tools.sse.common.StringUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java index 5c040cd09b..8335ed8dc5 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java @@ -1,5 +1,14 @@ /* - * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.sse.sdk.authenticator; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/Authenticator.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/Authenticator.java index 51481ef773..c373beaee2 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/Authenticator.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/Authenticator.java @@ -1,5 +1,14 @@ /* - * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.sse.sdk.authenticator; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticator.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticator.java index 69df6271f0..c70ae2fcc1 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticator.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticator.java @@ -1,5 +1,14 @@ /* - * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.sse.sdk.authenticator; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java index 1ade4479ad..d0cbbfe733 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/RestAuthenticatorSaas.java @@ -1,5 +1,14 @@ /* - * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -18,6 +27,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. + * ___________________________________________________________________ + * */ package com.hpe.application.automation.tools.sse.sdk.authenticator; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/BvsRunHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/BvsRunHandler.java index b58598ed65..ab65b5c7f3 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/BvsRunHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/BvsRunHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/EventLogHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/EventLogHandler.java index b8ac8e53ee..c91e806f60 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/EventLogHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/EventLogHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import java.util.List; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/Handler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/Handler.java index d82afd4716..ac494c307a 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/Handler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/Handler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.sse.common.StringUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/LabPollHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/LabPollHandler.java index aee4f427a8..9c62cfd584 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/LabPollHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/LabPollHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.sse.common.StringUtils; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCPollHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCPollHandler.java index 77e9523a0e..fffcbb8f2d 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCPollHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCPollHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import java.util.Arrays; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCRunHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCRunHandler.java index 0b3d382df6..f024566873 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCRunHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PCRunHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import java.net.MalformedURLException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandler.java index 897819a058..1f456eb043 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandlerFactory.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandlerFactory.java index f27aa8e526..44a6225c5f 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandlerFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/PollHandlerFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.common.SSEException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandler.java index 38e0c1e616..706271ac3e 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.model.CdaDetails; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandlerFactory.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandlerFactory.java index 2559e8cd37..b5b35b5d03 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandlerFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/RunHandlerFactory.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.common.SSEException; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/TestSetRunHandler.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/TestSetRunHandler.java index 4fbda01919..24f8e5bb99 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/TestSetRunHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/handler/TestSetRunHandler.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.handler; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/CreateSiteSessionRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/CreateSiteSessionRequest.java index 4a7b09d899..ef363b1a9e 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/CreateSiteSessionRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/CreateSiteSessionRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.rest.RESTConstants; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/EventLogRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/EventLogRequest.java index 660022b2d2..53f2507cb6 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/EventLogRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/EventLogRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralGetRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralGetRequest.java index f21e147903..22f053c7b4 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralGetRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralGetRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPostRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPostRequest.java index 1f93cced13..57357f83c9 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPostRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPostRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.common.Pair; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPutBulkRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPutBulkRequest.java index 272af6c659..8ab594a63b 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPutBulkRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralPutBulkRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.rest.RESTConstants; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralRequest.java index 0f18965f8e..1069e8065c 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GeneralRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetALMVersionRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetALMVersionRequest.java index 20b96454db..4db9e34206 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetALMVersionRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetALMVersionRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.rest.RESTConstants; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityDataRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityDataRequest.java index 94e43b6618..492f9e37e1 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityDataRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityDataRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityTestSetRunsRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityTestSetRunsRequest.java index 0c1db1926e..5481ba1f53 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityTestSetRunsRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetLabRunEntityTestSetRunsRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityDataRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityDataRequest.java index 3c53d4899c..273a6069c2 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityDataRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityDataRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityTestSetRunsRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityTestSetRunsRequest.java index 5287576822..5c66f6b95e 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityTestSetRunsRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetPCRunEntityTestSetRunsRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRequest.java index 187e9d9a39..5e3e65eec5 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRunEntityNameRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRunEntityNameRequest.java index 92c0645831..1a1ccd03e2 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRunEntityNameRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/GetRunEntityNameRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PollSSERunRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PollSSERunRequest.java index 642278c75d..2b83f8e81d 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PollSSERunRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PollSSERunRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PostRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PostRequest.java index 16539b98f7..0d827153f8 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PostRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/PostRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StartRunEntityRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StartRunEntityRequest.java index 4ac0f6eaf3..88b6d0a38e 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StartRunEntityRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StartRunEntityRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import java.util.ArrayList; diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StopEntityRequest.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StopEntityRequest.java index 8e76b7b8d0..43d0a0d234 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StopEntityRequest.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/request/StopEntityRequest.java @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + package com.hpe.application.automation.tools.sse.sdk.request; import com.hpe.application.automation.tools.sse.sdk.Client; diff --git a/src/main/resources/LR_SCRIPT_REPORT.css b/src/main/resources/LR_SCRIPT_REPORT.css index 8ba0949328..ed5091b65e 100644 --- a/src/main/resources/LR_SCRIPT_REPORT.css +++ b/src/main/resources/LR_SCRIPT_REPORT.css @@ -1,3 +1,36 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + .hl_qt { color: white; font-size: 24pt; font-family: Metric; background-color: #666; text-align: center; padding: 0px 3px 3px } .hl0 diff --git a/src/main/resources/PDetails.xsl b/src/main/resources/PDetails.xsl index 3f1377f183..e092cce3aa 100644 --- a/src/main/resources/PDetails.xsl +++ b/src/main/resources/PDetails.xsl @@ -1,4 +1,37 @@ - + + diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.jelly index f2ab0474a8..c6ec345ef8 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.jelly @@ -1,11 +1,35 @@ + ~ © Copyright 2013 EntIT Software LLC + ~ Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + ~ Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + ~ the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + ~ and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + ~ marks are the property of their respective owners. + ~ __________________________________________________________________ + ~ MIT License + ~ + ~ Copyright (c) 2018 Micro Focus Company, L.P. + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + ~ THE SOFTWARE. + ~ ___________________________________________________________________ + ~ + --> diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties index 213c935d6d..39e13aa8a6 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties @@ -1,3 +1,36 @@ +# +# © Copyright 2013 EntIT Software LLC +# Certain versions of software and/or documents (“Material”) accessible here may contain branding from +# Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, +# the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP +# and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE +# marks are the property of their respective owners. +# __________________________________________________________________ +# MIT License +# +# Copyright (c) 2018 Micro Focus Company, L.P. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# ___________________________________________________________________ +# +# + AlmServersAreNotDefined=HPE ALM servers are not defined. To use this build step, goto Manage Jenkins->Configure System->Application Lifecycle Management->Add ALM server AutEnvironmentConfigurationDescription=Use this build step to assign values to AUT Environment Configuration in ALM. \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-autEnvironmentId.html b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-autEnvironmentId.html index f192425845..242c6aed7f 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-autEnvironmentId.html +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-autEnvironmentId.html @@ -1,3 +1,36 @@ + +
    Assign ID of an AUT Environment that exists in the ALM project you selected.
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-outputParameter.html b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-outputParameter.html index e5e9e26729..c886ea7c6f 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-outputParameter.html +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-outputParameter.html @@ -1,3 +1,36 @@ + +
    The name of the build environment parameter that will get the ID of the updated/created AUT Environment Configuration. diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-pathToJsonFile.html b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-pathToJsonFile.html index 7391dfedce..a4c9dcf3ab 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-pathToJsonFile.html +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/help-pathToJsonFile.html @@ -1,3 +1,36 @@ + +
    A path to the JSON file that will be loaded in order to assign values to all the AUT Environment Parameters of 'From JSON' type. diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/config.jelly index c1ca4fe848..9c3f2667f1 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/config.jelly @@ -1,11 +1,35 @@ + ~ © Copyright 2013 EntIT Software LLC + ~ Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + ~ Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + ~ the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + ~ and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + ~ marks are the property of their respective owners. + ~ __________________________________________________________________ + ~ MIT License + ~ + ~ Copyright (c) 2018 Micro Focus Company, L.P. + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + ~ THE SOFTWARE. + ~ ___________________________________________________________________ + ~ + --> diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-name.html b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-name.html index 20123aff10..841e3c6fcc 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-name.html +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-name.html @@ -1,3 +1,36 @@ + +
    The name must be set in the same hierarchical structure as it defined in ALM ( 'Parameters' tab of the AUT Environment) diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-paramType.html b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-paramType.html index 51b4f0120f..752edf6562 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-paramType.html +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-paramType.html @@ -1,3 +1,36 @@ + +
    Manual - the value you'll assign for 'Parameter value' field will be used as is.

    diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-value.html b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-value.html index 21a64fcc1f..5a6a436ed7 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-value.html +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentParameterModel/help-value.html @@ -1,3 +1,36 @@ + +
    If you are using a 'From JSON' type, specify here the path for the element you would like to get.

    diff --git a/src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly index e741d62899..5c408e793a 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/model/SrfTestParamsModel/config.jelly @@ -1,11 +1,35 @@ + ~ © Copyright 2013 EntIT Software LLC + ~ Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + ~ Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + ~ the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + ~ and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + ~ marks are the property of their respective owners. + ~ __________________________________________________________________ + ~ MIT License + ~ + ~ Copyright (c) 2018 Micro Focus Company, L.P. + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + ~ THE SOFTWARE. + ~ ___________________________________________________________________ + ~ + --> diff --git a/src/main/resources/com/hpe/application/automation/tools/model/SvDataModelSelection/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/SvDataModelSelection/config.jelly index 555d572d1c..5b31f46b6d 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/SvDataModelSelection/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/model/SvDataModelSelection/config.jelly @@ -1,11 +1,35 @@ + ~ © Copyright 2013 EntIT Software LLC + ~ Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + ~ Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + ~ the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + ~ and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + ~ marks are the property of their respective owners. + ~ __________________________________________________________________ + ~ MIT License + ~ + ~ Copyright (c) 2018 Micro Focus Company, L.P. + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + ~ THE SOFTWARE. + ~ ___________________________________________________________________ + ~ + --> diff --git a/src/main/resources/com/hpe/application/automation/tools/model/SvPerformanceModelSelection/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/SvPerformanceModelSelection/config.jelly index a6c905cc7c..1d0c36ad4b 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/SvPerformanceModelSelection/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/model/SvPerformanceModelSelection/config.jelly @@ -1,11 +1,35 @@ + ~ © Copyright 2013 EntIT Software LLC + ~ Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + ~ Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + ~ the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + ~ and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + ~ marks are the property of their respective owners. + ~ __________________________________________________________________ + ~ MIT License + ~ + ~ Copyright (c) 2018 Micro Focus Company, L.P. + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + ~ THE SOFTWARE. + ~ ___________________________________________________________________ + ~ + --> diff --git a/src/main/resources/com/hpe/application/automation/tools/model/SvServiceSelectionModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/SvServiceSelectionModel/config.jelly index 6defb0e15c..fbc8795d11 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/SvServiceSelectionModel/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/model/SvServiceSelectionModel/config.jelly @@ -1,11 +1,35 @@ + ~ © Copyright 2013 EntIT Software LLC + ~ Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + ~ Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + ~ the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + ~ and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + ~ marks are the property of their respective owners. + ~ __________________________________________________________________ + ~ MIT License + ~ + ~ Copyright (c) 2018 Micro Focus Company, L.P. + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + ~ THE SOFTWARE. + ~ ___________________________________________________________________ + ~ + --> diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties b/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties index 1261388fe9..65e005932e 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties +++ b/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties @@ -1,16 +1,33 @@ # -# Copyright 2017 Hewlett-Packard Development Company, L.P. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# © Copyright 2013 EntIT Software LLC +# Certain versions of software and/or documents (“Material”) accessible here may contain branding from +# Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, +# the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP +# and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE +# marks are the property of their respective owners. +# __________________________________________________________________ +# MIT License # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright (c) 2018 Micro Focus Company, L.P. # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# ___________________________________________________________________ # # diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.jelly b/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.jelly index 7ce5f674fc..c49adb4afe 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.jelly @@ -1,19 +1,35 @@ + ~ © Copyright 2013 EntIT Software LLC + ~ Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + ~ Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + ~ the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + ~ and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + ~ marks are the property of their respective owners. + ~ __________________________________________________________________ + ~ MIT License + ~ + ~ Copyright (c) 2018 Micro Focus Company, L.P. + ~ + ~ Permission is hereby granted, free of charge, to any person obtaining a copy + ~ of this software and associated documentation files (the "Software"), to deal + ~ in the Software without restriction, including without limitation the rights + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + ~ copies of the Software, and to permit persons to whom the Software is + ~ furnished to do so, subject to the following conditions: + ~ + ~ The above copyright notice and this permission notice shall be included in all + ~ copies or substantial portions of the Software. + ~ + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + ~ THE SOFTWARE. + ~ ___________________________________________________________________ + ~ + --> + + @@ -106,9 +110,17 @@

    + + Moved data tables : ${it.results.updatedScmResourceFiles.size()} +
    +
    +
    + Deleted folders : ${it.results.deletedFolders.size()}

    +
    +

    @@ -116,32 +128,20 @@ - + + - - - - - - - - - - - - - - - + - + + @@ -155,26 +155,20 @@ - + + - - - - - - - + - + + - -
    Test packageTest package Test name StatusDescription
    ${s.package}${s.name}new
    ${s.package}${s.name}deleted
    ${s.package} ${s.name}updated${s.octaneStatus}moved from ${s.oldPackage}\${s.oldName}
    Data tables
    PathPath StatusDescription
    ${s.relativePath}new
    ${s.relativePath}deleted${s.octaneStatus}moved from ${s.oldRelativePath}

    @@ -187,7 +181,7 @@ Deleted Folders - Path + Path @@ -210,6 +204,12 @@
    To make sure Git can properly list such file names, configure Git as follows : git config --global core.quotepath false
    To discover the updated tests that were missed in this run and send them to ALM Octane, run this job manually with the "Full sync" parameter selected. + +


    + + This report contains items that were discovered in SCM repository. Final list of dispatched items can be found here after dispatching. + +
    From d542311e88f49d8dba13ab861a983cf468bae28e Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 24 May 2018 08:50:19 +0300 Subject: [PATCH 0334/2502] tech : fix errata --- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index d0bc23a0aa..cf55812016 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -692,8 +692,8 @@ private void QTPTestCleanup() /// private void ChangeDCOMSettingToInteractiveUser() { - string errorMsg = "Unable to change DCOM settings. To chage it manually: " + - "run dcomcnfg.exe -> My Computer -> DCOM Config -> QuickTest Professional Automation -> Identity -> and select The Interactive User"; + string errorMsg = "Unable to change DCOM settings. To change it manually: " + + "run dcomcnfg.exe -> My Computer -> DCOM Config -> QuickTest Professional Automation -> Identity -> and select The Interactive User. "; string interactiveUser = "Interactive User"; string runAs = "RunAs"; From 9f5df58bf88e333ed6706166a48dca6f2b7a3ae0 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 24 May 2018 09:46:31 +0300 Subject: [PATCH 0335/2502] user story #622117 : UFT integration - add to discovery job configuration - add timestamps to the console output --- .../TestExecutionJobCreatorService.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index d3ba7b0acb..142c2ee5d2 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -41,11 +41,12 @@ import com.hp.octane.integrations.dto.scm.SCMRepository; import com.hpe.application.automation.tools.model.ResultsPublisherModel; import com.hpe.application.automation.tools.octane.actions.UFTTestDetectionPublisher; -import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginHandler; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginFactory; +import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginHandler; import com.hpe.application.automation.tools.results.RunResultRecorder; import com.hpe.application.automation.tools.run.RunFromFileBuilder; import hudson.model.*; +import hudson.tasks.BuildWrapper; import hudson.tasks.LogRotator; import hudson.triggers.SCMTrigger; import jenkins.model.BuildDiscarder; @@ -137,6 +138,7 @@ private static FreeStyleProject getExecutionJob(TestSuiteExecutionInfo suiteExec addConstantParameter(proj, UftConstants.SUITE_ID_PARAMETER_NAME, suiteExecutionInfo.getSuiteId(), "ALM Octane test suite ID"); addStringParameter(proj, UftConstants.SUITE_RUN_ID_PARAMETER_NAME, "", "The ID of the ALM Octane test suite run to associate with the test run results. Provided by ALM Octane when running a planned suite run.\nOtherwise, leave this parameter empty. ALM Octane creates a new test suite run for the new results."); addAssignedNode(proj); + addTimestamper(proj); //add build action String fsTestsData = prepareMtbxData(suiteExecutionInfo.getTests()); @@ -286,7 +288,7 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { SCMTrigger scmTrigger = new SCMTrigger("H/2 * * * *");//H/2 * * * * : once in two minutes proj.addTrigger(scmTrigger); delayPollingStart(proj, scmTrigger); - + addTimestamper(proj); //add post-build action - publisher UFTTestDetectionPublisher uftTestDetectionPublisher = null; @@ -310,6 +312,22 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { } } + private static void addTimestamper(FreeStyleProject proj) { + try { + Descriptor wrapperDescriptor = Jenkins.getInstance().getBuildWrapper("TimestamperBuildWrapper"); + if (wrapperDescriptor != null) { + BuildWrapper wrapper = proj.getBuildWrappersList().get(wrapperDescriptor); + if (wrapper == null) { + wrapper = wrapperDescriptor.newInstance(null, null); + proj.getBuildWrappersList().add(wrapper); + } + + } + } catch (Descriptor.FormException e) { + logger.error("Failed to addTimestamper : " + e.getMessage()); + } + } + private static String buildDiscoveryJobName(TestingToolType testingToolType, String executorId, String executorLogicalName) { String name = String.format("%s %s %s (%s)", testingToolType.toString(), UftConstants.DISCOVERY_JOB_MIDDLE_NAME, executorId, executorLogicalName); return name; From 45499567ccef846a84a1af89207a29133e2cb547 Mon Sep 17 00:00:00 2001 From: shitritn Date: Tue, 12 Jun 2018 13:45:28 +0300 Subject: [PATCH 0336/2502] user story #622057: fix reassigning parameters 'getItemByRefId' method --- .../automation/tools/octane/CIJenkinsServicesImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java index 84af2f109f..9f031cd0c8 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -563,14 +563,14 @@ private Item getItemByRefId(String itemRefId) { Item result = null; if (itemRefId != null) { try { - itemRefId = URLDecoder.decode(itemRefId, "UTF-8"); - if (itemRefId.contains("/")) { - String newItemRefId = itemRefId.substring(0, itemRefId.indexOf("/")); + String itemRefIdUncoded = URLDecoder.decode(itemRefId, "UTF-8"); + if (itemRefIdUncoded.contains("/")) { + String newItemRefId = itemRefIdUncoded.substring(0, itemRefIdUncoded.indexOf("/")); Item item = getTopLevelItem(newItemRefId); if (item != null && item.getClass().getName().equals(JobProcessorFactory.GITHUB_ORGANIZATION_FOLDER)) { Collection allItems = ((OrganizationFolder)item).getItems(); for (Item multibranchItem : allItems) { - if (itemRefId.endsWith(multibranchItem.getName())) { + if (itemRefIdUncoded.endsWith(multibranchItem.getName())) { result = multibranchItem; break; } From f4a044ee43018baba7343ce090c64b7f351d92cb Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 18 Jun 2018 08:25:23 +0300 Subject: [PATCH 0337/2502] user story #651006 : [UFT integration]Move common logic related to UFT integration to sdk --- pom.xml | 14 +- .../automation/tools/common/HttpStatus.java | 2 +- .../tools/octane/actions/UFTParameter.java | 87 --- .../octane/actions/UFTParameterFactory.java | 222 ------- .../actions/UFTTestDetectionBuildAction.java | 40 +- .../actions/UFTTestDetectionPublisher.java | 209 +++--- .../tools/octane/actions/UFTTestUtil.java | 104 --- .../tools/octane/actions/UftTestType.java | 50 -- .../octane/actions/dto/AutomatedTest.java | 236 ------- .../octane/actions/dto/AutomatedTests.java | 60 -- .../octane/actions/dto/BaseRefEntity.java | 68 -- .../octane/actions/dto/ListNodeEntity.java | 52 -- .../actions/dto/ListNodeEntityCollection.java | 60 -- .../octane/actions/dto/OctaneStatus.java | 41 -- .../octane/actions/dto/ScmResourceFile.java | 163 ----- .../octane/actions/dto/ScmResources.java | 60 -- .../actions/dto/SupportsMoveDetection.java | 49 -- .../actions/dto/SupportsOctaneStatus.java | 43 -- .../configuration/ConfigurationService.java | 52 +- .../octane/executor/OctaneConstants.java | 73 --- .../TestExecutionJobCreatorService.java | 6 +- .../executor/UFTTestDetectionResult.java | 184 ------ .../executor/UFTTestDetectionService.java | 255 ++------ .../tools/octane/executor/UftJobCleaner.java | 23 +- .../executor/UftTestDiscoveryDispatcher.java | 617 ++---------------- .../octane/tests/junit/JUnitXmlIterator.java | 10 +- 26 files changed, 250 insertions(+), 2530 deletions(-) delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/OctaneStatus.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsMoveDetection.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsOctaneStatus.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java delete mode 100644 src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java diff --git a/pom.xml b/pom.xml index 34eb3a8abe..481737f7a3 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5.13 + 1.5.15 @@ -582,12 +582,6 @@ 1.2.3 - - org.apache.poi - poi - 3.7 - - com.seitenbau.jenkins.plugins dynamicparameter @@ -601,12 +595,6 @@ 20090211 - - org.jdom - jdom2 - 2.0.4 - - diff --git a/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java b/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java index ba7c3b9d30..a7ea1b864d 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java +++ b/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java @@ -35,7 +35,7 @@ /** * Created by shitritn on 10/05/2017. - * enum class that define all http protocol statuses with thire cuase for intenral use in plugin + * enum class that define all http protocol statuses with their cause for internal use in sdk */ public enum HttpStatus { OK(200, "OK"), diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java deleted file mode 100644 index ce37f97a81..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameter.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions; - -/** - * Created by kashbi on 22/09/2016. - */ -public class UFTParameter { - private String argName; - private int argDirection; - private String argDefaultValue; - private String argType; - private int argIsExternal; - - public UFTParameter(){} - - public String getArgName() { - return argName; - } - - public void setArgName(String argName) { - this.argName = argName; - } - - public int getArgDirection() { - return argDirection; - } - - public void setArgDirection(int argDirection) { - this.argDirection = argDirection; - } - - public String getArgDefaultValue() { - return argDefaultValue; - } - - public void setArgDefaultValue(String argDefaultValue) { - this.argDefaultValue = argDefaultValue; - } - - public String getArgType() { - return argType; - } - - public void setArgType(String argType) { - this.argType = argType; - } - - public int getArgIsExternal() { - return argIsExternal; - } - - public void setArgIsExternal(int argIsExternal) { - this.argIsExternal = argIsExternal; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java deleted file mode 100644 index b6fd623856..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTParameterFactory.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.jdom2.Document; -import org.jdom2.Element; -import org.jdom2.input.SAXBuilder; -import org.jdom2.input.sax.XMLReaders; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.util.*; - -/** - * This class Converts UFT's Parameters info stored in Resource.mtr file into JSON string - */ -public class UFTParameterFactory { - - - private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(UFTParameterFactory.class.getName()); - - - public static String convertResourceMtrAsJSON(InputStream resourceMtrInputStream) throws IOException { - - //String QTPFileParameterFileName = "resource.mtr"; - //InputStream is = paths.get(0).getParent().child("Action0").child(QTPFileParameterFileName).read(); - - String xmlData = UFTTestUtil.decodeXmlContent(resourceMtrInputStream); - - try { - SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, null, null); - Document document = saxBuilder.build(new StringReader(xmlData)); - Element rootElement = document.getRootElement(); - List rootChildrenElements = rootElement.getChildren(); - ArrayList uftParameters = new ArrayList<>(); - for (int temp = 0; temp < rootChildrenElements.size(); temp++) { - Element tag = rootChildrenElements.get(temp); - if ("ArgumentsCollection".equalsIgnoreCase(tag.getName())) { - List children = tag.getChildren(); - for (int i = 0; i < children.size(); i++) { - UFTParameter uftParameter = new UFTParameter(); - Element element = children.get(i); - List elements = element.getChildren(); - - for (int j = 0; j < elements.size(); j++) { - - Element element1 = elements.get(j); - switch (element1.getName()) { - case "ArgName": - uftParameter.setArgName(element1.getValue()); - break; - case "ArgDirection": - uftParameter.setArgDirection(Integer.parseInt(element1.getValue())); - break; - case "ArgDefaultValue": - uftParameter.setArgDefaultValue(element1.getValue()); - break; - case "ArgType": - uftParameter.setArgType(element1.getValue()); - break; - case "ArgIsExternal": - uftParameter.setArgIsExternal(Integer.parseInt(element1.getValue())); - break; - default: - logger.warning(String.format("Element name %s didn't match any case", element1.getName())); - break; - } - } - uftParameters.add(uftParameter); - } - ObjectMapper mapper = new ObjectMapper(); - String result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(uftParameters); - return result; - } - } - } catch (Exception e) { - logger.severe(e.getMessage()); - } - return null; - } - - public static String convertApiTestXmlsAsJSON(File inputParameters, File outputParameters) throws IOException { - //String testInputParametersFileName = "TestInputParameters.xml"; - //String testOutputParametersFileName = "TestOutputParameters.xml"; - //URI inputParamsUri = paths.get(0).getParent().child(testInputParametersFileName).toURI(); - //URI outputParamsUri = paths.get(0).getParent().child(testOutputParametersFileName).toURI(); - - //File inputParamsFile = new File(inputParamsUri); - //File outputParamsFile = new File(outputParamsUri); - - - List params = new ArrayList<>(); - params.addAll(convertApiTestXmlToArguments(inputParameters, true)); - params.addAll(convertApiTestXmlToArguments(outputParameters, false)); - ObjectMapper mapper = new ObjectMapper(); - String result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(params); - return result; - } - - public static Collection convertApiTestXmlToArguments(File parametersFile, boolean isInputParameters) throws IOException { - - /* - - - - - - - - - - - - - - - - - - - - - - - - 1 - f - - - */ - - try { - SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, null, null); - Document document = saxBuilder.build(parametersFile); - Element rootElement = document.getRootElement(); - - Map uftParametersMap = new HashMap<>(); - List argElements = getHierarchyChildElement(rootElement, "Schema", "schema", "element", "complexType", "sequence").getChildren(); - for (Element argElement : argElements) { - String name = argElement.getAttributeValue("name"); - String type = argElement.getAttributeValue("type").replace("xs:", ""); - int direction = isInputParameters ? 0 : 1; - - UFTParameter parameter = new UFTParameter(); - parameter.setArgName(name); - parameter.setArgType(type); - parameter.setArgDirection(direction); - uftParametersMap.put(parameter.getArgName(), parameter); - } - - //getArg default values - List argDefValuesElements = getHierarchyChildElement(rootElement, "Values", "Arguments").getChildren(); - for (Element argElement : argDefValuesElements) { - UFTParameter parameter = uftParametersMap.get(argElement.getName()); - if (parameter != null) { - parameter.setArgDefaultValue(argElement.getValue()); - } - } - - return uftParametersMap.values(); - } catch (Exception e) { - logger.severe(e.getMessage()); - } - return Collections.emptySet(); - } - - private static Element getHierarchyChildElement(Element root, String... childPath) { - Element parent; - Element found = root; - for (int i = 0; i < childPath.length; i++) { - parent = found; - found = null; - String elementName = childPath[i]; - - for (Element child : parent.getChildren()) { - if (child.getName().equals(elementName)) { - found = child; - break; - } - } - } - - return found; - } -} - - - diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java index cc3b5bc8e4..26ee362eca 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction.java @@ -33,13 +33,16 @@ package com.hpe.application.automation.tools.octane.actions; -import com.hpe.application.automation.tools.octane.actions.dto.OctaneStatus; -import com.hpe.application.automation.tools.octane.executor.UFTTestDetectionResult; +import com.hp.octane.integrations.uft.items.OctaneStatus; +import com.hp.octane.integrations.uft.items.SupportsOctaneStatus; +import com.hp.octane.integrations.uft.items.UftTestDiscoveryResult; import com.hpe.application.automation.tools.octane.executor.UFTTestDetectionService; import hudson.model.AbstractBuild; import hudson.model.Action; import hudson.model.Run; +import java.util.List; + /** * Class responsible to show report of {@link UFTTestDetectionService} */ @@ -47,7 +50,7 @@ public class UFTTestDetectionBuildAction implements Action { private AbstractBuild build; - private UFTTestDetectionResult results; + private UftTestDiscoveryResult results; @Override public String getIconFileName() { @@ -69,12 +72,12 @@ public String getUrlName() { return build; } - public UFTTestDetectionBuildAction(final AbstractBuild build, UFTTestDetectionResult results) { + public UFTTestDetectionBuildAction(final AbstractBuild build, UftTestDiscoveryResult results) { this.build = build; - this.results = results == null ? new UFTTestDetectionResult() : results; + this.results = results == null ? new UftTestDiscoveryResult() : results; } - public UFTTestDetectionResult getResults() { + public UftTestDiscoveryResult getResults() { return results; } @@ -84,7 +87,7 @@ public UFTTestDetectionResult getResults() { * @return */ public boolean getHasNewTests() { - return UFTTestDetectionResult.countItemsWithStatus(OctaneStatus.NEW, results.getAllTests()) > 0; + return countItemsWithStatus(OctaneStatus.NEW, results.getAllTests()) > 0; } /** @@ -93,7 +96,7 @@ public boolean getHasNewTests() { * @return */ public boolean getHasDeletedTests() { - return UFTTestDetectionResult.countItemsWithStatus(OctaneStatus.DELETED, results.getAllTests()) > 0; + return countItemsWithStatus(OctaneStatus.DELETED, results.getAllTests()) > 0; } /** @@ -102,7 +105,7 @@ public boolean getHasDeletedTests() { * @return */ public boolean getHasUpdatedTests() { - return UFTTestDetectionResult.countItemsWithStatus(OctaneStatus.MODIFIED, results.getAllTests()) > 0; + return countItemsWithStatus(OctaneStatus.MODIFIED, results.getAllTests()) > 0; } public boolean getHasQuotedPaths() { @@ -115,7 +118,7 @@ public boolean getHasQuotedPaths() { * @return */ public boolean getHasNewScmResources() { - return UFTTestDetectionResult.countItemsWithStatus(OctaneStatus.NEW, results.getAllScmResourceFiles()) > 0; + return countItemsWithStatus(OctaneStatus.NEW, results.getAllScmResourceFiles()) > 0; } /** @@ -124,7 +127,7 @@ public boolean getHasNewScmResources() { * @return */ public boolean getHasDeletedScmResources() { - return UFTTestDetectionResult.countItemsWithStatus(OctaneStatus.DELETED, results.getAllScmResourceFiles()) > 0; + return countItemsWithStatus(OctaneStatus.DELETED, results.getAllScmResourceFiles()) > 0; } /** @@ -133,7 +136,7 @@ public boolean getHasDeletedScmResources() { * @return */ public boolean getHasUpdatedScmResources() { - return UFTTestDetectionResult.countItemsWithStatus(OctaneStatus.MODIFIED, results.getAllScmResourceFiles()) > 0; + return countItemsWithStatus(OctaneStatus.MODIFIED, results.getAllScmResourceFiles()) > 0; } /** @@ -146,7 +149,18 @@ public boolean getHasDeletedFolders() { } - public void setResults(UFTTestDetectionResult results) { + public void setResults(UftTestDiscoveryResult results) { this.results = results; } + + private static int countItemsWithStatus(OctaneStatus status, List items) { + + int count = 0; + for (SupportsOctaneStatus item : items) { + if (item.getOctaneStatus().equals(status)) { + count++; + } + } + return count; + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java index a2822e7f41..fbd26c5fc2 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java @@ -33,16 +33,12 @@ package com.hpe.application.automation.tools.octane.actions; -import com.hpe.application.automation.tools.octane.executor.UFTTestDetectionResult; +import com.hp.octane.integrations.OctaneSDK; +import com.hp.octane.integrations.api.EntitiesService; +import com.hp.octane.integrations.dto.entities.Entity; +import com.hp.octane.integrations.uft.items.UftTestDiscoveryResult; import com.hpe.application.automation.tools.octane.executor.UFTTestDetectionService; -import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.model.PagedList; -import com.hp.mqm.client.model.Workspace; -import com.hpe.application.automation.tools.octane.client.JenkinsMqmRestClientFactory; -import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; -import com.hpe.application.automation.tools.octane.configuration.ServerConfiguration; import hudson.Extension; -import hudson.ExtensionList; import hudson.Launcher; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; @@ -54,7 +50,6 @@ import hudson.tasks.Recorder; import hudson.util.FormValidation; import hudson.util.ListBoxModel; -import jenkins.model.Jenkins; import net.sf.json.JSONObject; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; @@ -69,109 +64,95 @@ */ public class UFTTestDetectionPublisher extends Recorder { - private final String workspaceName; - private final String scmRepositoryId; - - public String getWorkspaceName() { - return workspaceName; - } - - public String getScmRepositoryId() { - return scmRepositoryId; - } - - // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" - @DataBoundConstructor - public UFTTestDetectionPublisher(String workspaceName, String scmRepositoryId) { - - this.workspaceName = workspaceName; - this.scmRepositoryId = scmRepositoryId; - } - - @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { - UFTTestDetectionResult results = UFTTestDetectionService.startScanning(build, getWorkspaceName(), getScmRepositoryId(), listener); - UFTTestDetectionBuildAction buildAction = new UFTTestDetectionBuildAction(build, results); - build.addAction(buildAction); - - return true; - } - - @Override - public DescriptorImpl getDescriptor() { - return (DescriptorImpl) super.getDescriptor(); - } - - @Override - public BuildStepMonitor getRequiredMonitorService() { - return BuildStepMonitor.NONE; - } - - private static T getExtension(Class clazz) { - ExtensionList items = Jenkins.getInstance().getExtensionList(clazz); - return items.get(0); - } - - @Extension // This indicates to Jenkins that this is an implementation of an extension point. - public static final class DescriptorImpl extends BuildStepDescriptor { - private MqmRestClient createClient() { - ServerConfiguration configuration = ConfigurationService.getServerConfiguration(); - JenkinsMqmRestClientFactory clientFactory = getExtension(JenkinsMqmRestClientFactory.class); - return clientFactory.obtain( - configuration.location, - configuration.sharedSpace, - configuration.username, - configuration.password); - } - - private String workspace; - - public DescriptorImpl() { - load(); - } - - public ListBoxModel doFillWorkspaceNameItems() { - ListBoxModel m = new ListBoxModel(); - PagedList workspacePagedList = createClient().queryWorkspaces("", 0, 200); - List items = workspacePagedList.getItems(); - for (Workspace workspace : items) { - m.add(workspace.getName(), String.valueOf(workspace.getId())); - } - return m; - } - - public FormValidation doCheckWorkspaceName(@QueryParameter String value) throws IOException, ServletException { - if (value == null || value.length() == 0) { - return FormValidation.error("Please select workspace"); - } else { - return FormValidation.ok(); - } - } - - public boolean isApplicable(Class aClass) { - // Indicates that this builder can be used with all kinds of project types - - return aClass.equals(FreeStyleProject.class); - } - - public String getDisplayName() { - return "ALM Octane UFT Tests Scanner"; - } - - @Override - public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { - // To persist global configuration information, - // set that to properties and call save(). - workspace = formData.getString("useFrench"); - // ^Can also use req.bindJSON(this, formData); - // (easier when there are many fields; need set* methods for this, like setUseFrench) - save(); - return super.configure(req, formData); - } - - public String getWorkspace() { - return workspace; - } - - } + private final String workspaceName; + private final String scmRepositoryId; + + public String getWorkspaceName() { + return workspaceName; + } + + public String getScmRepositoryId() { + return scmRepositoryId; + } + + // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" + @DataBoundConstructor + public UFTTestDetectionPublisher(String workspaceName, String scmRepositoryId) { + + this.workspaceName = workspaceName; + this.scmRepositoryId = scmRepositoryId; + } + + @Override + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { + UftTestDiscoveryResult results = UFTTestDetectionService.startScanning(build, getWorkspaceName(), getScmRepositoryId(), listener); + UFTTestDetectionBuildAction buildAction = new UFTTestDetectionBuildAction(build, results); + build.addAction(buildAction); + + return true; + } + + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl) super.getDescriptor(); + } + + @Override + public BuildStepMonitor getRequiredMonitorService() { + return BuildStepMonitor.NONE; + } + + @Extension // This indicates to Jenkins that this is an implementation of an extension point. + public static final class DescriptorImpl extends BuildStepDescriptor { + + private String workspace; + + public DescriptorImpl() { + load(); + } + + public ListBoxModel doFillWorkspaceNameItems() { + ListBoxModel m = new ListBoxModel(); + EntitiesService entitiesService = OctaneSDK.getInstance().getEntitiesService(); + List workspaces = entitiesService.getEntities(null, "workspaces", null, null); + for (Entity workspace : workspaces) { + m.add(workspace.getName(), String.valueOf(workspace.getId())); + } + return m; + } + + public FormValidation doCheckWorkspaceName(@QueryParameter String value) throws IOException, ServletException { + if (value == null || value.length() == 0) { + return FormValidation.error("Please select workspace"); + } else { + return FormValidation.ok(); + } + } + + public boolean isApplicable(Class aClass) { + // Indicates that this builder can be used with all kinds of project types + + return aClass.equals(FreeStyleProject.class); + } + + public String getDisplayName() { + return "ALM Octane UFT Tests Scanner"; + } + + @Override + public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { + // To persist global configuration information, + // set that to properties and call save(). + workspace = formData.getString("useFrench"); + // ^Can also use req.bindJSON(this, formData); + // (easier when there are many fields; need set* methods for this, like setUseFrench) + save(); + return super.configure(req, formData); + } + + public String getWorkspace() { + return workspace; + } + + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java deleted file mode 100644 index 1df3d8cefc..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UFTTestUtil.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions; - -import hudson.FilePath; -import org.apache.poi.poifs.filesystem.*; -import org.apache.poi.util.StringUtil; -import org.jdom2.Document; -import org.jdom2.Element; -import org.jdom2.input.SAXBuilder; -import org.jdom2.input.sax.XMLReaders; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; - -/** - * Utility for extracting information from UFT test located on FS - */ -public class UFTTestUtil { - - /** - * Extract test description from UFT GUI test. - * Note : UFT API test doesn't contain description - * @param dirPath path of UFT test - * @return test description - */ - public static String getTestDescription(FilePath dirPath) { - String desc; - - try { - if(!dirPath.exists()){ - return null; - } - - FilePath tspTestFile = new FilePath(dirPath, "Test.tsp"); - InputStream is = new FileInputStream(tspTestFile.getRemote()); - String xmlContent = decodeXmlContent(is); - - SAXBuilder saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING, null, null); - Document document = saxBuilder.build(new StringReader(xmlContent)); - Element rootElement = document.getRootElement(); - Element descElement = rootElement.getChild("Description"); - desc = descElement.getValue(); - } catch (Exception e) { - return null; - } - - return desc; - } - - public static String decodeXmlContent(InputStream stream) throws IOException { - POIFSFileSystem poiFS = new POIFSFileSystem(stream); - DirectoryNode root = poiFS.getRoot(); - String xmlData = ""; - - for (Entry entry : root) { - String name = entry.getName(); - if ("ComponentInfo".equals(name)) { - if (entry instanceof DirectoryEntry) { - System.out.println(entry); - } else if (entry instanceof DocumentEntry) { - byte[] content = new byte[((DocumentEntry) entry).getSize()]; - poiFS.createDocumentInputStream("ComponentInfo").read(content); - String fromUnicodeLE = StringUtil.getFromUnicodeLE(content); - xmlData = fromUnicodeLE.substring(fromUnicodeLE.indexOf('<')).replaceAll("\u0000", ""); - } - } - } - return xmlData; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java deleted file mode 100644 index a4ac917e57..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/UftTestType.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions; - -/** - * Created by berkovir on 20/04/2017. - */ -public enum UftTestType { - GUI("gui"), API("api"), None("none"); - private String testType; - - UftTestType(String testType) { - this.testType = testType; - } - - public boolean isNone() { - return this.testType.equals(None.testType); - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java deleted file mode 100644 index 06f7f32777..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTest.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -import com.hpe.application.automation.tools.octane.actions.UftTestType; - -import javax.xml.bind.annotation.*; - -/** - * This file represents automated test for sending to Octane - */ -@XmlRootElement(name = "test") -@XmlAccessorType(XmlAccessType.FIELD) -public class AutomatedTest implements SupportsMoveDetection, SupportsOctaneStatus { - - @XmlAttribute - private Long id; - @XmlTransient - private String type = "test_automated"; - @XmlTransient - private ListNodeEntity testingToolType; - @XmlTransient - private ListNodeEntity framework; - @XmlTransient - private ListNodeEntityCollection testTypes; - - //PROPERTIES FOR MOVED ENTITY, don't serialized to server, used to set testType property - @XmlAttribute - private String changeSetSrc; - @XmlAttribute - private String changeSetDst; - @XmlAttribute - private String oldName; - @XmlAttribute - private String oldPackageName; - @XmlAttribute - private Boolean isMoved; - - //don't serialized to server, used to set testType property - @XmlAttribute - private UftTestType uftTestType; - - //don't serialized to server - @XmlAttribute - private OctaneStatus octaneStatus; - - - @XmlAttribute - private String name; - @XmlAttribute - private String packageName; - @XmlAttribute - private Boolean executable; - - private String description; - - @XmlTransient - private BaseRefEntity scmRepository; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ListNodeEntity getFramework() { - return framework; - } - - public void setFramework(ListNodeEntity framework) { - this.framework = framework; - } - - public String getPackage() { - return packageName; - } - - public void setPackage(String packageName) { - this.packageName = packageName; - } - - public ListNodeEntity getTestingToolType() { - return testingToolType; - } - - public void setTestingToolType(ListNodeEntity testingToolType) { - this.testingToolType = testingToolType; - } - - public BaseRefEntity getScmRepository() { - return scmRepository; - } - - public void setScmRepository(BaseRefEntity scmRepository) { - this.scmRepository = scmRepository; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setUftTestType(UftTestType uftTestType) { - this.uftTestType = uftTestType; - } - - public UftTestType getUftTestType() { - return uftTestType; - } - - public ListNodeEntityCollection getTestTypes() { - return testTypes; - } - - public void setTestTypes(ListNodeEntityCollection testTypes) { - this.testTypes = testTypes; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Boolean getExecutable() { - return executable; - } - - public void setExecutable(Boolean executable) { - this.executable = executable; - } - - @Override - public String toString() { - return "#" + getId() == null ? "0" : getId() + " - " + getPackage() + "@" + getName(); - } - - @Override - public String getChangeSetSrc() { - return changeSetSrc; - } - - @Override - public void setChangeSetSrc(String changeSetSrc) { - this.changeSetSrc = changeSetSrc; - } - - @Override - public String getChangeSetDst() { - return changeSetDst; - } - - @Override - public void setChangeSetDst(String changeSetDst) { - this.changeSetDst = changeSetDst; - } - - public String getOldName() { - return oldName; - } - - public void setOldName(String oldName) { - this.oldName = oldName; - } - - public String getOldPackage() { - return oldPackageName; - } - - public void setOldPackage(String oldPackageName) { - this.oldPackageName = oldPackageName; - } - - public Boolean getIsMoved() { - return isMoved == null ? false : isMoved; - } - - public void setIsMoved(Boolean moved) { - isMoved = moved; - } - - @Override - public OctaneStatus getOctaneStatus() { - return octaneStatus; - } - - public void setOctaneStatus(OctaneStatus octaneStatus) { - this.octaneStatus = octaneStatus; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java deleted file mode 100644 index 61223b7c42..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/AutomatedTests.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * Created by kashbi on 25/09/2016. - */ -public class AutomatedTests { - - private List data = new ArrayList<>(); - - public static AutomatedTests createWithTests(Collection tests) { - AutomatedTests result = new AutomatedTests(); - result.setData(new ArrayList<>(tests)); - return result; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java deleted file mode 100644 index 8debd4dd2c..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/BaseRefEntity.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -/** - * Base class for (de)serialization of reference entities in Octane - */ -@SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"}) -public class BaseRefEntity { - - private String type; - private String id; - - public static BaseRefEntity create(String type, String id) { - BaseRefEntity baseRefEntity = new BaseRefEntity(); - baseRefEntity.setType(type); - baseRefEntity.setId(id); - return baseRefEntity; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java deleted file mode 100644 index 26a2f60e62..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntity.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -/** - * Class for (de)serialization of list_node entities in Octane - */ -@SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"}) -public class ListNodeEntity extends BaseRefEntity { - - public ListNodeEntity(){ - setType("list_node"); - } - - public static ListNodeEntity create(String id) { - ListNodeEntity entity = new ListNodeEntity(); - entity.setId(id); - return entity; - } - -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java deleted file mode 100644 index d84975e3fa..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ListNodeEntityCollection.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -import java.util.Arrays; -import java.util.List; - -/** - * Class for (de)serialization of collection of list_node entities in Octane - */ -@SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"}) -public class ListNodeEntityCollection { - - private List data; - - public static ListNodeEntityCollection create(ListNodeEntity item) { - ListNodeEntityCollection coll = new ListNodeEntityCollection(); - coll.setData(Arrays.asList(item)); - return coll; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/OctaneStatus.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/OctaneStatus.java deleted file mode 100644 index 6c1a35ff25..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/OctaneStatus.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -/** - * Octane status of items that should be dispatched to Octane - */ -public enum OctaneStatus { - NEW, MODIFIED, DELETED , NONE -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java deleted file mode 100644 index d376dbbf18..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResourceFile.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -import javax.xml.bind.annotation.*; - -/** - * This file represents scm resource for sending to Octane - */ -@XmlRootElement(name = "dataTable") -@XmlAccessorType(XmlAccessType.FIELD) -public class ScmResourceFile implements SupportsMoveDetection, SupportsOctaneStatus { - - @XmlTransient - private Long id; - @XmlTransient - private String type = "scm_resource_file"; - @XmlTransient - private BaseRefEntity scmRepository; - - //PROPERTIES FOR MOVED ENTITY - @XmlAttribute - private String changeSetSrc; - @XmlAttribute - private String changeSetDst; - @XmlAttribute - private String oldRelativePath; - @XmlAttribute - private String oldName; - @XmlAttribute - private Boolean isMoved; - - //don't serialized to server - @XmlAttribute - private OctaneStatus octaneStatus; - - private String name; - - private String relativePath; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getRelativePath() { - return relativePath; - } - - public void setRelativePath(String relativePath) { - this.relativePath = relativePath; - } - - public BaseRefEntity getScmRepository() { - return scmRepository; - } - - public void setScmRepository(BaseRefEntity scmRepository) { - this.scmRepository = scmRepository; - } - - @Override - public String getChangeSetSrc() { - return changeSetSrc; - } - @Override - public void setChangeSetSrc(String changeSetSrc) { - this.changeSetSrc = changeSetSrc; - } - - @Override - public String getChangeSetDst() { - return changeSetDst; - } - - @Override - public void setChangeSetDst(String changeSetDst) { - this.changeSetDst = changeSetDst; - } - - public String getOldRelativePath() { - return oldRelativePath; - } - - public void setOldRelativePath(String oldRelativePath) { - this.oldRelativePath = oldRelativePath; - } - - public String getOldName() { - return oldName; - } - - public void setOldName(String oldName) { - this.oldName = oldName; - } - - public Boolean getIsMoved() { - return isMoved == null ? false : isMoved; - } - - public void setIsMoved(Boolean moved) { - isMoved = moved; - } - - @Override - public OctaneStatus getOctaneStatus() { - return octaneStatus; - } - - public void setOctaneStatus(OctaneStatus octaneStatus) { - this.octaneStatus = octaneStatus; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java deleted file mode 100644 index 1c76b9d799..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/ScmResources.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * This file represents collection of scm resources for sending to Octane - */ -public class ScmResources { - - private List data = new ArrayList<>(); - - public static ScmResources createWithItems(Collection resources) { - ScmResources result = new ScmResources(); - result.setData(new ArrayList<>(resources)); - return result; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsMoveDetection.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsMoveDetection.java deleted file mode 100644 index 1179a69e16..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsMoveDetection.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -/** - * Interface for entities that support changeSet source and destination properties - */ -public interface SupportsMoveDetection { - - String getChangeSetSrc(); - - void setChangeSetSrc(String changeSetSrc); - - String getChangeSetDst(); - - void setChangeSetDst(String changeSetDst); - -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsOctaneStatus.java b/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsOctaneStatus.java deleted file mode 100644 index cfe8177d03..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/actions/dto/SupportsOctaneStatus.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.actions.dto; - -/** - * Interface for entities that support octane status - */ -public interface SupportsOctaneStatus { - - OctaneStatus getOctaneStatus(); - -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java index ed6a9bedc3..72794a8df1 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java @@ -34,12 +34,7 @@ package com.hpe.application.automation.tools.octane.configuration; import com.hpe.application.automation.tools.model.OctaneServerSettingsModel; -import com.hpe.application.automation.tools.octane.client.JenkinsMqmRestClientFactoryImpl; import com.hpe.application.automation.tools.settings.OctaneServerSettingsBuilder; -import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.exception.LoginException; -import com.hp.mqm.client.exception.RequestException; -import com.hp.mqm.client.exception.SharedSpaceNotExistException; import hudson.Plugin; import jenkins.model.Jenkins; import org.apache.logging.log4j.LogManager; @@ -53,8 +48,6 @@ */ public class ConfigurationService { - private static JenkinsMqmRestClientFactoryImpl clientFactory; - private static Logger logger = LogManager.getLogger(ConfigurationService.class); /** @@ -72,7 +65,7 @@ public static OctaneServerSettingsModel getModel() { * @return */ public static ServerConfiguration getServerConfiguration() { - if(getOctaneDescriptor() != null) { + if (getOctaneDescriptor() != null) { return getOctaneDescriptor().getServerConfiguration(); } return null; @@ -84,7 +77,7 @@ public static ServerConfiguration getServerConfiguration() { * @param newModel */ public static void configurePlugin(OctaneServerSettingsModel newModel) { - if(getOctaneDescriptor() != null) { + if (getOctaneDescriptor() != null) { getOctaneDescriptor().setModel(newModel); } } @@ -102,45 +95,4 @@ public static String getPluginVersion() { Plugin plugin = Jenkins.getInstance().getPlugin("hp-application-automation-tools-plugin"); return plugin.getWrapper().getVersion(); } - - /** - * Create restClient based on some server configuration - * - * @param serverConfiguration - * @return - */ - public static MqmRestClient createClient(ServerConfiguration serverConfiguration) { - - if (!serverConfiguration.isValid()) { - logger.warn("MQM server configuration is not valid"); - return null; - } - - MqmRestClient client = getMqmRestClientFactory().obtain( - serverConfiguration.location, - serverConfiguration.sharedSpace, - serverConfiguration.username, - serverConfiguration.password); - - try { - client.validateConfigurationWithoutLogin(); - return client; - } catch (SharedSpaceNotExistException e) { - logger.warn("Invalid shared space"); - } catch (LoginException e) { - logger.warn("Login failed : " + e.getMessage()); - } catch (RequestException e) { - logger.warn("Problem with communication with MQM server : " + e.getMessage()); - } - - return null; - } - - private static JenkinsMqmRestClientFactoryImpl getMqmRestClientFactory() { - if (clientFactory == null) { - clientFactory = Jenkins.getInstance().getExtensionList(JenkinsMqmRestClientFactoryImpl.class).get(0); - } - return clientFactory; - } - } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java deleted file mode 100644 index 37fb152c12..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/OctaneConstants.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.executor; - -/** - * Constants of Octane Entities - */ -public class OctaneConstants { - - public static class General{ - - public static final String WINDOWS_PATH_SPLITTER = "\\"; - public static final String LINUX_PATH_SPLITTER = "/"; - } - - public static class Base { - public static final String ID_FIELD = "id"; - public static final String NAME_FIELD = "name"; - public static final String LOGICAL_NAME_FIELD = "logical_name"; - public static final String DESCRIPTION_FIELD = "description"; - } - - public static class Tests extends Base { - public static final String COLLECTION_NAME = "automated_tests"; - public static final String SCM_REPOSITORY_FIELD = "scm_repository"; - public static final String TESTING_TOOL_TYPE_FIELD = "testing_tool_type"; - public static final String TEST_TYPE_FIELD = "test_type"; - public static final String PACKAGE_FIELD = "package"; - public static final String EXECUTABLE_FIELD = "executable"; - } - - public static class DataTables extends Base { - public static final String COLLECTION_NAME = "scm_resource_files"; - public static final String RELATIVE_PATH_FIELD = "relative_path"; - public static final String SCM_REPOSITORY_FIELD = "scm_repository"; - } - - public static class Executors extends Base { - public static final String COLLECTION_NAME = "executors"; - } - -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 142c2ee5d2..21b6c251e5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -39,6 +39,7 @@ import com.hp.octane.integrations.dto.executor.TestSuiteExecutionInfo; import com.hp.octane.integrations.dto.executor.impl.TestingToolType; import com.hp.octane.integrations.dto.scm.SCMRepository; +import com.hp.octane.integrations.util.SdkConstants; import com.hpe.application.automation.tools.model.ResultsPublisherModel; import com.hpe.application.automation.tools.octane.actions.UFTTestDetectionPublisher; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginFactory; @@ -203,12 +204,13 @@ private static String prepareMtbxData(List tests) throws IOEx Element testElement = doc.createElement("Test"); String packageAndTestName = (StringUtils.isNotEmpty(test.getPackageName()) ? test.getPackageName() + "\\" : "") + test.getTestName(); testElement.setAttribute("name", packageAndTestName); - String path = "${WORKSPACE}\\${CHECKOUT_SUBDIR}" + (StringUtils.isEmpty(test.getPackageName()) ? "" : OctaneConstants.General.WINDOWS_PATH_SPLITTER + test.getPackageName()) + OctaneConstants.General.WINDOWS_PATH_SPLITTER + test.getTestName(); + String path = "${WORKSPACE}\\${CHECKOUT_SUBDIR}" + (StringUtils.isEmpty(test.getPackageName()) ? "" : SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER + test.getPackageName()) + + SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER + test.getTestName(); testElement.setAttribute("path", path); if (StringUtils.isNotEmpty(test.getDataTable())) { Element dataTableElement = doc.createElement("DataTable"); - dataTableElement.setAttribute("path", "${WORKSPACE}\\${CHECKOUT_SUBDIR}" + OctaneConstants.General.WINDOWS_PATH_SPLITTER + test.getDataTable()); + dataTableElement.setAttribute("path", "${WORKSPACE}\\${CHECKOUT_SUBDIR}" + SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER + test.getDataTable()); testElement.appendChild(dataTableElement); } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java deleted file mode 100644 index 76425ab780..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionResult.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.octane.executor; - -import com.hpe.application.automation.tools.octane.actions.dto.AutomatedTest; -import com.hpe.application.automation.tools.octane.actions.dto.OctaneStatus; -import com.hpe.application.automation.tools.octane.actions.dto.ScmResourceFile; -import com.hpe.application.automation.tools.octane.actions.dto.SupportsOctaneStatus; - -import javax.xml.bind.annotation.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * This file represents result of UFT detection files (tests and data tables) - */ -@XmlRootElement(name = "detectionResult") -@XmlAccessorType(XmlAccessType.FIELD) -public class UFTTestDetectionResult { - - - @XmlElementWrapper(name = "tests") - @XmlElement(name = "test") - private List tests = new ArrayList<>(); - - @XmlElementWrapper(name = "dataTables") - @XmlElement(name = "dataTable") - private List scmResourceFiles = new ArrayList<>(); - - @XmlElementWrapper(name = "deletedFolders") - @XmlElement(name = "folder") - private List deletedFolders = new ArrayList<>(); - - @XmlAttribute - private String scmRepositoryId; - - @XmlAttribute - private String workspaceId; - - @XmlAttribute - private boolean fullScan; - - @XmlAttribute - private boolean hasQuotedPaths; - - private List getTestByOctaneStatus(OctaneStatus status) { - List filtered = new ArrayList<>(); - for (AutomatedTest test : tests) { - if (test.getOctaneStatus().equals(status)) { - filtered.add(test); - } - } - return Collections.unmodifiableList(filtered); - } - - private List getResourceFilesByOctaneStatus(OctaneStatus status) { - List filtered = new ArrayList<>(); - for (ScmResourceFile file : scmResourceFiles) { - if (file.getOctaneStatus().equals(status)) { - filtered.add(file); - } - } - return Collections.unmodifiableList(filtered); - } - - public List getNewTests() { - return getTestByOctaneStatus(OctaneStatus.NEW); - } - - public List getDeletedTests() { - return getTestByOctaneStatus(OctaneStatus.DELETED); - } - - public List getUpdatedTests() { - return getTestByOctaneStatus(OctaneStatus.MODIFIED); - } - - public String getScmRepositoryId() { - return scmRepositoryId; - } - - public void setScmRepositoryId(String scmRepositoryId) { - this.scmRepositoryId = scmRepositoryId; - } - - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - } - - public boolean isFullScan() { - return fullScan; - } - - public void setFullScan(boolean fullScan) { - this.fullScan = fullScan; - } - - public boolean hasChanges() { - return !getAllScmResourceFiles().isEmpty() || !getAllTests().isEmpty() || !getDeletedFolders().isEmpty(); - } - - public List getNewScmResourceFiles() { - return getResourceFilesByOctaneStatus(OctaneStatus.NEW); - } - - public List getDeletedScmResourceFiles() { - return getResourceFilesByOctaneStatus(OctaneStatus.DELETED); - } - - public List getUpdatedScmResourceFiles() { - return getResourceFilesByOctaneStatus(OctaneStatus.MODIFIED); - } - - public boolean isHasQuotedPaths() { - return hasQuotedPaths; - } - - public void setHasQuotedPaths(boolean hasQuotedPaths) { - this.hasQuotedPaths = hasQuotedPaths; - } - - public List getDeletedFolders() { - return deletedFolders; - } - - public void setDeletedFolders(List deletedFolders) { - this.deletedFolders = deletedFolders; - } - - public List getAllTests() { - return tests; - } - - public List getAllScmResourceFiles() { - return scmResourceFiles; - } - - public static int countItemsWithStatus(OctaneStatus status, List items) { - - int count = 0; - for (SupportsOctaneStatus item : items) { - if (item.getOctaneStatus().equals(status)) { - count++; - } - } - return count; - } -} \ No newline at end of file diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java index e929b9003f..e2b99197d2 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -33,9 +33,10 @@ package com.hpe.application.automation.tools.octane.executor; -import com.hpe.application.automation.tools.octane.actions.UFTTestUtil; -import com.hpe.application.automation.tools.octane.actions.UftTestType; -import com.hpe.application.automation.tools.octane.actions.dto.*; +import com.hp.octane.integrations.uft.UftTestDiscoveryUtils; +import com.hp.octane.integrations.uft.items.*; +import com.hp.octane.integrations.util.SdkConstants; +import com.hp.octane.integrations.util.SdkStringUtils; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginFactory; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginHandler; import hudson.ExtensionList; @@ -44,7 +45,6 @@ import hudson.scm.ChangeLogSet; import hudson.scm.EditType; import jenkins.model.Jenkins; -import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.reflect.FieldUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -66,27 +66,21 @@ public class UFTTestDetectionService { private static final Logger logger = LogManager.getLogger(UFTTestDetectionService.class); private static final String INITIAL_DETECTION_FILE = "INITIAL_DETECTION_FILE.txt"; private static final String DETECTION_RESULT_FILE = "detection_result.xml"; - private static final String STFileExtention = ".st";//api test - private static final String QTPFileExtention = ".tsp";//gui test - private static final String XLSXExtention = ".xlsx";//excel file - private static final String XLSExtention = ".xls";//excel file - private static final String windowsPathSplitter = "\\"; - private static final String linuxPathSplitter = "/"; - - public static UFTTestDetectionResult startScanning(AbstractBuild build, String workspaceId, String scmRepositoryId, BuildListener buildListener) { + + public static UftTestDiscoveryResult startScanning(AbstractBuild build, String workspaceId, String scmRepositoryId, BuildListener buildListener) { ChangeLogSet changeSet = build.getChangeSet(); Object[] changeSetItems = changeSet.getItems(); - UFTTestDetectionResult result = null; + UftTestDiscoveryResult result = null; try { boolean fullScan = build.getId().equals("1") || !initialDetectionFileExist(build.getWorkspace()) || isFullScan((build)); if (fullScan) { printToConsole(buildListener, "Executing full sync"); - result = doInitialDetection(build.getWorkspace()); + result = UftTestDiscoveryUtils.doFullDiscovery(new File(build.getWorkspace().getRemote())); } else { printToConsole(buildListener, "Executing changeSet sync"); - result = doChangeSetDetection(changeSetItems, build.getWorkspace()); + result = doChangeSetDetection(changeSetItems, new File(build.getWorkspace().getRemote())); removeTestDuplicatedForUpdateTests(result); removeFalsePositiveDataTables(result, result.getDeletedTests(), result.getDeletedScmResourceFiles()); removeFalsePositiveDataTables(result, result.getNewTests(), result.getNewScmResourceFiles()); @@ -112,7 +106,7 @@ public static UFTTestDetectionResult startScanning(AbstractBuild build, St //Full sync wil be triggered with delay of 60 secs to give the dispatcher possibility to sync other found changes //triggering full sync - printToConsole(buildListener, "To sync deleted items - full sync required. Triggerring job with full sync parameter."); + printToConsole(buildListener, "To sync deleted items - full sync required. Triggering job with full sync parameter."); FreeStyleProject proj = (FreeStyleProject) build.getParent(); List newParameters = new ArrayList<>(); @@ -141,8 +135,7 @@ public static UFTTestDetectionResult startScanning(AbstractBuild build, St result.setScmRepositoryId(scmRepositoryId); result.setWorkspaceId(workspaceId); result.setFullScan(fullScan); - sortTests(result.getAllTests()); - sortDataTables(result.getAllScmResourceFiles()); + result.sortItems(); publishDetectionResults(getReportXmlFile(build), buildListener, result); if (result.hasChanges()) { @@ -151,8 +144,8 @@ public static UFTTestDetectionResult startScanning(AbstractBuild build, St } createInitialDetectionFile(build.getWorkspace()); - } catch (InterruptedException | IOException e) { - e.printStackTrace(); + } catch (Exception e) { + logger.error("Fail in startScanning : " + e.getMessage()); } return result; @@ -176,16 +169,16 @@ private static Map computeStatusMap(List tests, List scmResourceFiles) { + private static void removeFalsePositiveDataTables(UftTestDiscoveryResult result, List tests, List scmResourceFiles) { if (!scmResourceFiles.isEmpty() && !tests.isEmpty()) { List falsePositive = new ArrayList<>(); for (ScmResourceFile item : scmResourceFiles) { - int parentSplitterIndex = item.getRelativePath().lastIndexOf(windowsPathSplitter); + int parentSplitterIndex = item.getRelativePath().lastIndexOf(SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); if (parentSplitterIndex != -1) { String parentName = item.getRelativePath().substring(0, parentSplitterIndex); for (AutomatedTest test : tests) { - String testPath = StringUtils.isEmpty(test.getPackage()) ? test.getName() : test.getPackage() + windowsPathSplitter + test.getName(); + String testPath = SdkStringUtils.isEmpty(test.getPackage()) ? test.getName() : test.getPackage() + SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER + test.getName(); if (parentName.contains(testPath)) { falsePositive.add(item); break; @@ -209,35 +202,13 @@ private static boolean isFullScan(AbstractBuild build) { return false; } - private static void sortTests(List newTests) { - Collections.sort(newTests, new Comparator() { - @Override - public int compare(AutomatedTest o1, AutomatedTest o2) { - int comparePackage = o1.getPackage().compareTo(o2.getPackage()); - if (comparePackage == 0) { - return o1.getName().compareTo(o2.getName()); - } else { - return comparePackage; - } - } - }); - } - - private static void sortDataTables(List dataTables) { - Collections.sort(dataTables, new Comparator() { - @Override - public int compare(ScmResourceFile o1, ScmResourceFile o2) { - return o1.getRelativePath().compareTo(o2.getRelativePath()); - } - }); - } private static T getExtension(Class clazz) { ExtensionList items = Jenkins.getInstance().getExtensionList(clazz); return items.get(0); } - private static void removeTestDuplicatedForUpdateTests(UFTTestDetectionResult result) { + private static void removeTestDuplicatedForUpdateTests(UftTestDiscoveryResult result) { Set keys = new HashSet<>(); List testsToRemove = new ArrayList<>(); for (AutomatedTest test : result.getUpdatedTests()) { @@ -257,67 +228,70 @@ private static void printToConsole(BuildListener buildListener, String msg) { } } - private static UFTTestDetectionResult doChangeSetDetection(Object[] changeSetItems, FilePath workspace) throws IOException, InterruptedException { - UFTTestDetectionResult result = new UFTTestDetectionResult(); + private static UftTestDiscoveryResult doChangeSetDetection(Object[] changeSetItems, File workspace) { + UftTestDiscoveryResult result = new UftTestDiscoveryResult(); if (changeSetItems.length == 0) { return result; } for (int i = 0; i < changeSetItems.length; i++) { ChangeLogSet.Entry changeSet = (ChangeLogSet.Entry) changeSetItems[i]; - for (ChangeLogSet.AffectedFile affectedFile : changeSet.getAffectedFiles()) { - if (affectedFile.getPath().startsWith("\"")) { + for (ChangeLogSet.AffectedFile affectedFileChange : changeSet.getAffectedFiles()) { + if (affectedFileChange.getPath().startsWith("\"")) { result.setHasQuotedPaths(true); } - boolean isDir = isDir(affectedFile); - String fileFullPath = workspace + File.separator + affectedFile.getPath(); + boolean isDir = isDir(affectedFileChange); + String affectedFileFullPath = workspace + File.separator + affectedFileChange.getPath(); if (!isDir) { - if (isTestMainFilePath(affectedFile.getPath())) { - FilePath filePath = new FilePath(new File(fileFullPath)); - boolean fileExist = filePath.exists(); + if (UftTestDiscoveryUtils.isTestMainFilePath(affectedFileChange.getPath())) { + File testFolder = UftTestDiscoveryUtils.getTestFolderForTestMainFile(affectedFileFullPath); + File affectedFile = new File(affectedFileFullPath); + boolean fileExist = affectedFile.exists(); + UftTestType uftTestType = UftTestDiscoveryUtils.getUftTestType(affectedFileChange.getPath()); + + AutomatedTest test = UftTestDiscoveryUtils.createAutomatedTest(workspace, testFolder, uftTestType); + addChangeSetSrcAndDst(test, affectedFileChange); - if (EditType.ADD.equals(affectedFile.getEditType())) { + if (EditType.ADD.equals(affectedFileChange.getEditType())) { if (fileExist) { - FilePath testFolder = getTestFolderForTestMainFile(fileFullPath); - scanFileSystemRecursively(workspace, testFolder, affectedFile, result, OctaneStatus.NEW); - } else { - logger.error("doChangeSetDetection : file not exist " + fileFullPath); + result.getAllTests().add(test); } - } else if (EditType.DELETE.equals(affectedFile.getEditType())) { + } else if (EditType.DELETE.equals(affectedFileChange.getEditType())) { if (!fileExist) { - FilePath testFolder = getTestFolderForTestMainFile(fileFullPath); - AutomatedTest test = createAutomatedTest(workspace, testFolder, affectedFile, null, false, OctaneStatus.DELETED); + test.setOctaneStatus(OctaneStatus.DELETED); + test.setExecutable(false); result.getAllTests().add(test); } - } else if (EditType.EDIT.equals(affectedFile.getEditType())) { + } else if (EditType.EDIT.equals(affectedFileChange.getEditType())) { if (fileExist) { - FilePath testFolder = getTestFolderForTestMainFile(fileFullPath); - scanFileSystemRecursively(workspace, testFolder, affectedFile, result, OctaneStatus.MODIFIED); + test.setOctaneStatus(OctaneStatus.MODIFIED); + result.getAllTests().add(test); } } - } else if (isUftDataTableFile(affectedFile.getPath())) { - FilePath filePath = new FilePath(new File(fileFullPath)); - if (EditType.ADD.equals(affectedFile.getEditType())) { - UftTestType testType = isUftTestFolder(filePath.getParent().list()); + } else if (UftTestDiscoveryUtils.isUftDataTableFile(affectedFileChange.getPath())) { + File affectedFile = new File(affectedFileFullPath); + ScmResourceFile resourceFile = UftTestDiscoveryUtils.createDataTable(workspace, affectedFile); + addChangeSetSrcAndDst(resourceFile, affectedFileChange); + if (EditType.ADD.equals(affectedFileChange.getEditType())) { + UftTestType testType = UftTestDiscoveryUtils.isUftTestFolder(affectedFile.getParentFile().listFiles()); if (testType.isNone()) { - if (filePath.exists()) { - ScmResourceFile resourceFile = createDataTable(workspace, filePath, affectedFile, OctaneStatus.NEW); + if (affectedFile.exists()) { result.getAllScmResourceFiles().add(resourceFile); } } - } else if (EditType.DELETE.equals(affectedFile.getEditType())) { - if (!filePath.exists()) { - ScmResourceFile resourceFile = createDataTable(workspace, filePath, affectedFile, OctaneStatus.DELETED); + } else if (EditType.DELETE.equals(affectedFileChange.getEditType())) { + if (!affectedFile.exists()) { + resourceFile.setOctaneStatus(OctaneStatus.DELETED); result.getAllScmResourceFiles().add(resourceFile); } } } } else //isDir { - if (EditType.DELETE.equals(affectedFile.getEditType())) { + if (EditType.DELETE.equals(affectedFileChange.getEditType())) { - FilePath filePath = new FilePath(new File(affectedFile.getPath())); - String deletedFolder = filePath.getRemote().replace(linuxPathSplitter, windowsPathSplitter); + FilePath filePath = new FilePath(new File(affectedFileChange.getPath())); + String deletedFolder = filePath.getRemote().replace(SdkConstants.FileSystem.LINUX_PATH_SPLITTER, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); result.getDeletedFolders().add(deletedFolder); } } @@ -328,7 +302,7 @@ private static UFTTestDetectionResult doChangeSetDetection(Object[] changeSetIte } private static boolean isDir(ChangeLogSet.AffectedFile path) { - + //ONLY for SVN plugin : Check if path is directory if (path.getClass().getName().equals("hudson.scm.SubversionChangeLogSet$Path")) { try { String value = (String) FieldUtils.readDeclaredField(path, "kind", true); @@ -340,27 +314,6 @@ private static boolean isDir(ChangeLogSet.AffectedFile path) { return false; } - private static AutomatedTest createAutomatedTest(FilePath root, FilePath dirPath, ChangeLogSet.AffectedFile affectedFile, UftTestType testType, boolean executable, OctaneStatus status) { - AutomatedTest test = new AutomatedTest(); - test.setName(dirPath.getName()); - - String relativePath = getRelativePath(root, dirPath); - String packageName = relativePath.length() != dirPath.getName().length() ? relativePath.substring(0, relativePath.length() - dirPath.getName().length() - 1) : ""; - test.setPackage(packageName); - test.setExecutable(executable); - - if (testType != null && !testType.isNone()) { - test.setUftTestType(testType); - } - - String description = UFTTestUtil.getTestDescription(dirPath); - test.setDescription(description); - test.setOctaneStatus(status); - addChangeSetSrcAndDst(test, affectedFile); - - return test; - } - private static void addChangeSetSrcAndDst(SupportsMoveDetection entity, ChangeLogSet.AffectedFile affectedFile) { if (affectedFile != null) { ScmPluginHandler handler = ScmPluginFactory.getScmHandlerByChangePathClass(affectedFile.getClass().getName()); @@ -371,17 +324,6 @@ private static void addChangeSetSrcAndDst(SupportsMoveDetection entity, ChangeLo } } - private static String getRelativePath(FilePath root, FilePath path) { - String testPath = path.getRemote(); - String rootPath = root.getRemote(); - String relativePath = testPath.replace(rootPath, ""); - relativePath = StringUtils.strip(relativePath, windowsPathSplitter + linuxPathSplitter); - //we want all paths will be in windows style, because tests are run in windows, therefore we replace all linux splitters (/) by windows one (\) - //http://stackoverflow.com/questions/23869613/how-to-replace-one-or-more-in-string-with-just - relativePath = relativePath.replaceAll(linuxPathSplitter, windowsPathSplitter + windowsPathSplitter);//str.replaceAll("/", "\\\\"); - return relativePath; - } - private static boolean initialDetectionFileExist(FilePath workspace) { try { File rootFile = new File(workspace.toURI()); @@ -403,81 +345,6 @@ private static void createInitialDetectionFile(FilePath workspace) { } } - private static UFTTestDetectionResult doInitialDetection(FilePath workspace) throws IOException, InterruptedException { - UFTTestDetectionResult result = new UFTTestDetectionResult(); - scanFileSystemRecursively(workspace, workspace, null, result, OctaneStatus.NEW); - return result; - } - - private static void scanFileSystemRecursively(FilePath root, FilePath dirPath, ChangeLogSet.AffectedFile affectedFile, UFTTestDetectionResult detectionResult, OctaneStatus status) throws IOException, InterruptedException { - List paths = dirPath.isDirectory() ? dirPath.list() : Arrays.asList(dirPath); - - //if it test folder - create new test, else drill down to subFolders - UftTestType testType = isUftTestFolder(paths); - if (!testType.isNone()) { - AutomatedTest test = createAutomatedTest(root, dirPath, affectedFile, testType, true, status); - detectionResult.getAllTests().add(test); - - } else { - for (FilePath path : paths) { - if (path.isDirectory()) { - scanFileSystemRecursively(root, path, null, detectionResult, status); - } else if (isUftDataTableFile(path.getName())) { - ScmResourceFile dataTable = createDataTable(root, path, null, status); - detectionResult.getAllScmResourceFiles().add(dataTable); - } - } - } - } - - private static ScmResourceFile createDataTable(FilePath root, FilePath path, ChangeLogSet.AffectedFile affectedFile, OctaneStatus status) { - ScmResourceFile resourceFile = new ScmResourceFile(); - resourceFile.setName(path.getName()); - resourceFile.setRelativePath(getRelativePath(root, path)); - resourceFile.setOctaneStatus(status); - addChangeSetSrcAndDst(resourceFile, affectedFile); - return resourceFile; - - } - - private static boolean isUftDataTableFile(String path) { - String loweredPath = path.toLowerCase(); - return loweredPath.endsWith(XLSXExtention) || loweredPath.endsWith(XLSExtention); - } - - private static UftTestType isUftTestFolder(List paths) { - for (FilePath path : paths) { - if (path.getName().endsWith(STFileExtention)) { - return UftTestType.API; - } - if (path.getName().endsWith(QTPFileExtention)) { - return UftTestType.GUI; - } - } - - return UftTestType.None; - } - - private static boolean isTestMainFilePath(String path) { - String lowerPath = path.toLowerCase(); - if (lowerPath.endsWith(STFileExtention)) { - return true; - } else if (lowerPath.endsWith(QTPFileExtention)) { - return true; - } - - return false; - } - - private static FilePath getTestFolderForTestMainFile(String path) { - if (isTestMainFilePath(path)) { - File file = new File(path); - File parent = file.getParentFile(); - return new FilePath(parent); - } - return null; - } - /** * Serialize detectionResult to file in XML format * @@ -485,15 +352,10 @@ private static FilePath getTestFolderForTestMainFile(String path) { * @param taskListenerLog * @param detectionResult */ - public static void publishDetectionResults(File fileToWriteTo, TaskListener taskListenerLog, UFTTestDetectionResult detectionResult) { + public static void publishDetectionResults(File fileToWriteTo, TaskListener taskListenerLog, UftTestDiscoveryResult detectionResult) { try { - JAXBContext jaxbContext = JAXBContext.newInstance(UFTTestDetectionResult.class); - Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); - - jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - jaxbMarshaller.marshal(detectionResult, fileToWriteTo); - + detectionResult.writeToFile(fileToWriteTo); } catch (JAXBException e) { if (taskListenerLog != null) { taskListenerLog.error("Failed to persist detection results: " + e.getMessage()); @@ -502,13 +364,12 @@ public static void publishDetectionResults(File fileToWriteTo, TaskListener task } } - public static UFTTestDetectionResult readDetectionResults(Run run) { + public static UftTestDiscoveryResult readDetectionResults(Run run) { File file = getReportXmlFile(run); + try { - JAXBContext context = JAXBContext.newInstance(UFTTestDetectionResult.class); - Unmarshaller m = context.createUnmarshaller(); - return (UFTTestDetectionResult) m.unmarshal(new FileReader(file)); + return UftTestDiscoveryResult.readFromFile(file); } catch (JAXBException | FileNotFoundException e) { return null; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java index 578680d5d5..f47ea67367 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftJobCleaner.java @@ -33,12 +33,12 @@ package com.hpe.application.automation.tools.octane.executor; +import com.hp.octane.integrations.OctaneSDK; +import com.hp.octane.integrations.api.EntitiesService; +import com.hp.octane.integrations.dto.entities.Entity; +import com.hp.octane.integrations.dto.entities.EntityConstants; import com.hpe.application.automation.tools.octane.actions.UFTTestDetectionPublisher; -import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; -import com.hpe.application.automation.tools.octane.configuration.ServerConfiguration; import com.hpe.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; -import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.model.Entity; import hudson.Extension; import hudson.model.*; import jenkins.model.Jenkins; @@ -142,14 +142,13 @@ private void clearDiscoveryJobs(List jobs) { } if (!workspace2executorLogical2DiscoveryJobMap.isEmpty()) { - ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - MqmRestClient client = ConfigurationService.createClient(serverConfiguration); - if (client != null) { + if (OctaneSDK.getInstance().getConfigurationService().isConfigurationValid()) { + EntitiesService entitiesService = OctaneSDK.getInstance().getEntitiesService(); int deleteCounter = 0; for (Long workspaceId : workspace2executorLogical2DiscoveryJobMap.keySet()) { try { Map discoveryJobs = workspace2executorLogical2DiscoveryJobMap.get(workspaceId); - Set octaneExecutorsLogicalNames = getOctaneExecutorsLogicalNames(client, workspaceId); + Set octaneExecutorsLogicalNames = getOctaneExecutorsLogicalNames(entitiesService, workspaceId); for (String jobExecutorLogical : discoveryJobs.keySet()) { boolean isExistInOctane = octaneExecutorsLogicalNames.contains(jobExecutorLogical); if (!isExistInOctane) { @@ -176,12 +175,12 @@ private void clearDiscoveryJobs(List jobs) { } } - private Set getOctaneExecutorsLogicalNames(MqmRestClient client, Long workspaceId) { - List entities = client.getEntities(workspaceId, OctaneConstants.Executors.COLLECTION_NAME, null, - Arrays.asList(OctaneConstants.Base.ID_FIELD, OctaneConstants.Base.LOGICAL_NAME_FIELD)); + private Set getOctaneExecutorsLogicalNames( EntitiesService entitiesService, Long workspaceId) { + List entities = entitiesService.getEntities(workspaceId, EntityConstants.Executors.COLLECTION_NAME, null, + Arrays.asList(EntityConstants.Executors.ID_FIELD, EntityConstants.Executors.LOGICAL_NAME_FIELD)); Set octaneExecutorIds = new HashSet<>(); for (Entity executor : entities) { - octaneExecutorIds.add(executor.getStringValue(OctaneConstants.Base.LOGICAL_NAME_FIELD)); + octaneExecutorIds.add(executor.getStringValue(EntityConstants.Executors.LOGICAL_NAME_FIELD)); } return octaneExecutorIds; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java index 7d6ce01a74..d4832b4020 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java @@ -34,18 +34,14 @@ package com.hpe.application.automation.tools.octane.executor; import com.google.inject.Inject; -import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.QueryHelper; -import com.hp.mqm.client.exception.RequestErrorException; -import com.hp.mqm.client.model.Entity; -import com.hp.mqm.client.model.ListItem; -import com.hp.mqm.client.model.PagedList; -import com.hpe.application.automation.tools.common.HttpStatus; +import com.hp.octane.integrations.OctaneSDK; +import com.hp.octane.integrations.api.EntitiesService; +import com.hp.octane.integrations.dto.entities.Entity; +import com.hp.octane.integrations.uft.UftTestDispatchUtils; +import com.hp.octane.integrations.uft.items.*; +import com.hp.octane.integrations.util.SdkStringUtils; import com.hpe.application.automation.tools.octane.ResultQueue; -import com.hpe.application.automation.tools.octane.actions.UftTestType; -import com.hpe.application.automation.tools.octane.actions.dto.*; import com.hpe.application.automation.tools.octane.configuration.ConfigurationListener; -import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; import com.hpe.application.automation.tools.octane.configuration.ServerConfiguration; import com.hpe.application.automation.tools.octane.tests.AbstractSafeLoggingAsyncPeriodWork; import hudson.Extension; @@ -56,16 +52,10 @@ import hudson.model.TaskListener; import hudson.util.TimeUnit2; import jenkins.model.Jenkins; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; -import net.sf.json.processors.PropertyNameProcessor; -import net.sf.json.util.PropertyFilter; -import org.apache.commons.collections.map.HashedMap; -import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import javax.xml.bind.JAXBException; import java.io.File; import java.io.IOException; import java.util.*; @@ -82,10 +72,8 @@ public class UftTestDiscoveryDispatcher extends AbstractSafeLoggingAsyncPeriodWork implements ConfigurationListener { private final static Logger logger = LogManager.getLogger(UftTestDiscoveryDispatcher.class); - private final static String DUPLICATE_ERROR_CODE = "platform.duplicate_entity_error"; - private final static int POST_BULK_SIZE = 100; + private final static int MAX_DISPATCH_TRIALS = 5; - private final static int QUERY_CONDITION_SIZE_THRESHOLD = 3000; private static final String OCTANE_VERSION_SUPPORTING_TEST_RENAME = "12.60.3"; private static String OCTANE_VERSION = null; @@ -103,14 +91,13 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE } logger.warn("Queue size " + queue.size()); - ServerConfiguration serverConfiguration = ConfigurationService.getServerConfiguration(); - MqmRestClient client = ConfigurationService.createClient(serverConfiguration); - if (client == null) { + if (!OctaneSDK.getInstance().getConfigurationService().isConfigurationValid()) { logger.warn("There are pending discovered UFT tests, but MQM server configuration is not valid, results can't be submitted"); return; } + EntitiesService entitiesService = OctaneSDK.getInstance().getEntitiesService(); ResultQueue.QueueItem item = null; try { while ((item = queue.peekFirst()) != null) { @@ -129,7 +116,7 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE continue; } - UFTTestDetectionResult result = UFTTestDetectionService.readDetectionResults(build); + UftTestDiscoveryResult result = UFTTestDetectionService.readDetectionResults(build); if (result == null) { logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer contains valid detection result file"); queue.remove(); @@ -137,7 +124,7 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE } logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "]"); - dispatchDetectionResults(item, client, result); + dispatchDetectionResults(item, entitiesService, result); queue.remove(); } } catch (Exception e) { @@ -151,24 +138,25 @@ protected void doExecute(TaskListener listener) throws IOException, InterruptedE } } - private static void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRestClient client, UFTTestDetectionResult result) { + private static void dispatchDetectionResults(ResultQueue.QueueItem item, EntitiesService entitiesService, UftTestDiscoveryResult result) { //Check if there is diff in discovery and server status //for example : discovery found new test , but it already exist in server , instead of create new tests we will do update test if (result.isFullScan()) { - validateTestDiscoveryForFullDetection(client, result); - validateDataTablesDiscoveryForFullDetection(client, result); + UftTestDispatchUtils.prepareDispatchingForFullSync(entitiesService, result); + } else { - if (isOctaneSupportTestRename(client)) { + if (isOctaneSupportTestRename(entitiesService)) { handleMovedTests(result); handleMovedDataTables(result); } - validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(client, result); - validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(client, result); - //no need to add validation for dataTables, because there is no DTs update and there is no special delete strategy + validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(entitiesService, result); + validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(entitiesService, result); + + + UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllTests()); + UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllScmResourceFiles()); } - removeItemsWithStatusNone(result.getAllTests()); - removeItemsWithStatusNone(result.getAllScmResourceFiles()); //publish final results FreeStyleProject project = (FreeStyleProject) Jenkins.getInstance().getItemByFullName(item.getProjectName()); @@ -178,63 +166,18 @@ private static void dispatchDetectionResults(ResultQueue.QueueItem item, MqmRest subWorkspace.mkdirs(); } File reportXmlFile = new File(subWorkspace.getRemote(), "final_detection_result_build_" + item.getBuildNumber() + ".xml"); - UFTTestDetectionService.publishDetectionResults(reportXmlFile, null, result); - } catch (IOException | InterruptedException e) { + result.writeToFile(reportXmlFile); + } catch (IOException | InterruptedException | JAXBException e) { logger.error("Failed to write final_detection_result file :" + e.getMessage()); } - //post new tests - List tests = result.getNewTests(); - if (!tests.isEmpty()) { - boolean posted = postTests(client, tests, result.getWorkspaceId(), result.getScmRepositoryId()); - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + tests + " new tests posted successfully = " + posted); - } - - //post test updated - tests = result.getUpdatedTests(); - if (!tests.isEmpty()) { - boolean updated = updateTests(client, tests, result.getWorkspaceId()); - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + tests.size() + " updated tests posted successfully = " + updated); - } - - //post test deleted - tests = result.getDeletedTests(); - if (!tests.isEmpty()) { - boolean updated = updateTests(client, tests, result.getWorkspaceId()); - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + tests.size() + " deleted tests set as not executable successfully = " + updated); - } - - //post scm resources - List resources = result.getNewScmResourceFiles(); - if (!resources.isEmpty()) { - boolean posted = postScmResources(client, resources, result.getWorkspaceId(), result.getScmRepositoryId()); - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + resources.size() + " new scmResources posted successfully = " + posted); - } - - //update scm resources - resources = result.getUpdatedScmResourceFiles(); - if (!resources.isEmpty()) { - boolean posted = updateScmResources(client, resources, result.getWorkspaceId()); - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + resources.size() + " updated scmResources posted successfully = " + posted); - } - - //delete scm resources - resources = result.getDeletedScmResourceFiles(); - if (!resources.isEmpty()) { - boolean posted = deleteScmResources(client, resources, result.getWorkspaceId(), result.getScmRepositoryId()); - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "] : " + resources.size() + " scmResources deleted successfully = " + posted); - } + //dispatch + JobRunContext jobRunContext = JobRunContext.create(item.getProjectName(), item.getBuildNumber()); + UftTestDispatchUtils.dispatchDiscoveryResult(entitiesService, result, jobRunContext); } - private static void removeItemsWithStatusNone(List list) { - for (int i = list.size(); i > 0; i--) { - if (list.get(i - 1).getOctaneStatus().equals(OctaneStatus.NONE)) { - list.remove(i - 1); - } - } - } - private static boolean validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(MqmRestClient client, UFTTestDetectionResult result) { + private static boolean validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { boolean hasDiff = false; Set allNames = new HashSet<>(); for (ScmResourceFile file : result.getAllScmResourceFiles()) { @@ -246,7 +189,7 @@ private static boolean validateTestDiscoveryAndCompleteDataTableIdsForScmChangeD } //GET DataTables FROM OCTANE - Map octaneEntityMapByRelativePath = getDataTablesFromServer(client, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allNames); + Map octaneEntityMapByRelativePath = UftTestDispatchUtils.getDataTablesFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allNames); //MATCHING @@ -297,7 +240,7 @@ private static boolean validateTestDiscoveryAndCompleteDataTableIdsForScmChangeD * * @return true if there were changes comparing to discoverede results */ - private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(MqmRestClient client, UFTTestDetectionResult result) { + private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { boolean hasDiff = false; Set allTestNames = new HashSet<>(); @@ -310,12 +253,14 @@ private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetect } //GET TESTS FROM OCTANE - Map octaneTestsMapByKey = getTestsFromServer(client, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allTestNames); + Map octaneTestsMapByKey = UftTestDispatchUtils.getTestsFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allTestNames); //MATCHING for (AutomatedTest discoveredTest : result.getAllTests()) { - String key = discoveredTest.getIsMoved() ? createKey(discoveredTest.getOldPackage(), discoveredTest.getOldName()) : createKey(discoveredTest.getPackage(), discoveredTest.getName()); + String key = discoveredTest.getIsMoved() + ? UftTestDispatchUtils.createKey(discoveredTest.getOldPackage(), discoveredTest.getOldName()) + : UftTestDispatchUtils.createKey(discoveredTest.getPackage(), discoveredTest.getName()); Entity octaneTest = octaneTestsMapByKey.get(key); boolean octaneTestFound = (octaneTest != null); if (octaneTestFound) { @@ -335,7 +280,7 @@ private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetect hasDiff = true; discoveredTest.setOctaneStatus(OctaneStatus.NEW); } else { - boolean testsEqual = checkTestEquals(discoveredTest, octaneTest); + boolean testsEqual = UftTestDispatchUtils.checkTestEquals(discoveredTest, octaneTest); if (testsEqual) { //if equal - skip discoveredTest.setOctaneStatus(OctaneStatus.NONE); } @@ -356,468 +301,10 @@ private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetect return hasDiff; } - /** - * This method check whether discovered test are already exist on server, and instead of creation - those tests will be updated - * Go over discovered and octane tests - * 1.if test doesn't exist on octane - this is new test - * 2.if test exist - * 2.1 if test different from discovered - this is test for update - * 2.2 if tests are equal - skip test - * 3. all tests that are found in Octane but not discovered - those deleted tests and they will be turned to not executable - * - * @return true if there were changes comparing to discovered results - */ - private static boolean validateTestDiscoveryForFullDetection(MqmRestClient client, UFTTestDetectionResult detectionResult) { - boolean hasDiff = false; - Map octaneTestsMap = getTestsFromServer(client, Long.parseLong(detectionResult.getWorkspaceId()), Long.parseLong(detectionResult.getScmRepositoryId()), null); - - for (AutomatedTest discoveredTest : detectionResult.getAllTests()) { - String key = createKey(discoveredTest.getPackage(), discoveredTest.getName()); - Entity octaneTest = octaneTestsMap.remove(key); - - if (octaneTest == null) { - //do nothing, status of test should remain NEW - } else { - hasDiff = true;//if we get here - there is diff with discovered tests - //the only fields that might be different is description and executable - boolean testsEqual = checkTestEquals(discoveredTest, octaneTest); - if (!testsEqual) { //if equal - skip - discoveredTest.setId(octaneTest.getId()); - discoveredTest.setOctaneStatus(OctaneStatus.MODIFIED); - } else { - discoveredTest.setOctaneStatus(OctaneStatus.NONE); - } - } - } - - //go over executable tests that exist in Octane but not discovered and disable them - for (Entity octaneTest : octaneTestsMap.values()) { - hasDiff = true;//if some test exist - there is diff with discovered tests - boolean octaneExecutable = octaneTest.getBooleanValue(OctaneConstants.Tests.EXECUTABLE_FIELD); - if (octaneExecutable) { - AutomatedTest test = new AutomatedTest(); - test.setId(octaneTest.getId()); - test.setExecutable(false); - test.setName(octaneTest.getName()); - test.setPackage(octaneTest.getStringValue(OctaneConstants.Tests.PACKAGE_FIELD)); - test.setOctaneStatus(OctaneStatus.DELETED); - } - } - - return hasDiff; - } - - private static boolean checkTestEquals(AutomatedTest discoveredTest, Entity octaneTest) { - boolean octaneExecutable = octaneTest.getBooleanValue(OctaneConstants.Tests.EXECUTABLE_FIELD); - String octaneDescription = octaneTest.getStringValue(OctaneConstants.Tests.DESCRIPTION_FIELD); - boolean descriptionEquals = ((StringUtils.isEmpty(octaneDescription) || "null".equals(octaneDescription)) && discoveredTest.getDescription() == null) || - octaneDescription.contains(discoveredTest.getDescription()); - boolean testsEqual = (octaneExecutable && descriptionEquals && !discoveredTest.getIsMoved()); - return testsEqual; - } - - /** - * Go over discovered and octane data tables - * 1.if DT doesn't exist on octane - this is new DT - * 2. all DTs that are found in Octane but not discovered - delete those DTs from server - */ - private static boolean validateDataTablesDiscoveryForFullDetection(MqmRestClient client, UFTTestDetectionResult detectionResult) { - boolean hasDiff = false; - - - Map octaneDataTablesMap = getDataTablesFromServer(client, Long.parseLong(detectionResult.getWorkspaceId()), Long.parseLong(detectionResult.getScmRepositoryId()), null); - for (ScmResourceFile dataTable : detectionResult.getAllScmResourceFiles()) { - Entity octaneDataTable = octaneDataTablesMap.remove(dataTable.getRelativePath()); - if (octaneDataTable != null) {//found in Octnat - skip - dataTable.setOctaneStatus(OctaneStatus.NONE); - hasDiff = true; - } - } - - //go over DT that exist in Octane but not discovered - for (Entity octaneDataTable : octaneDataTablesMap.values()) { - hasDiff = true; - ScmResourceFile dt = new ScmResourceFile(); - dt.setId(octaneDataTable.getId()); - dt.setName(octaneDataTable.getName()); - dt.setRelativePath(octaneDataTable.getStringValue(OctaneConstants.DataTables.RELATIVE_PATH_FIELD)); - dt.setOctaneStatus(OctaneStatus.DELETED); - detectionResult.getAllScmResourceFiles().add(dt); - } - - return hasDiff; - } - - private static Map getTestsFromServer(MqmRestClient client, long workspaceId, long scmRepositoryId, Set allTestNames) { - List conditions = new ArrayList<>(); - if (allTestNames != null && !allTestNames.isEmpty()) { - String byNameCondition = QueryHelper.conditionIn(OctaneConstants.Tests.NAME_FIELD, allTestNames, false); - //Query string is part of UR, some servers limit request size by 4K, - //Here we limit nameCondition by 3K, if it exceed, we will fetch all tests - if (byNameCondition.length() < QUERY_CONDITION_SIZE_THRESHOLD) { - conditions.add(byNameCondition); - } - } - - conditions.add(QueryHelper.conditionRef(OctaneConstants.Tests.SCM_REPOSITORY_FIELD, scmRepositoryId)); - Collection fields = Arrays.asList(OctaneConstants.Tests.ID_FIELD, OctaneConstants.Tests.NAME_FIELD, OctaneConstants.Tests.PACKAGE_FIELD, OctaneConstants.Tests.EXECUTABLE_FIELD, OctaneConstants.Tests.DESCRIPTION_FIELD); - List octaneTests = client.getEntities(workspaceId, OctaneConstants.Tests.COLLECTION_NAME, conditions, fields); - Map octaneTestsMapByKey = new HashedMap(); - for (Entity octaneTest : octaneTests) { - String key = createKey(octaneTest.getStringValue(OctaneConstants.Tests.PACKAGE_FIELD), octaneTest.getName()); - octaneTestsMapByKey.put(key, octaneTest); - } - return octaneTestsMapByKey; - } - - private static Map getDataTablesFromServer(MqmRestClient client, long workspaceId, long scmRepositoryId, Set allNames) { - List conditions = new ArrayList<>(); - if (allNames != null && !allNames.isEmpty()) { - String byPathCondition = QueryHelper.conditionIn(OctaneConstants.DataTables.NAME_FIELD, allNames, false); - - //Query string is part of UR, some servers limit request size by 4K, - //Here we limit nameCondition by 3K, if it exceed, we will fetch all - if (byPathCondition.length() < QUERY_CONDITION_SIZE_THRESHOLD) { - conditions.add(byPathCondition); - } - } - - String conditionByScmRepository = QueryHelper.conditionRef(OctaneConstants.DataTables.SCM_REPOSITORY_FIELD, scmRepositoryId); - conditions.add(conditionByScmRepository); - - List dataTablesFields = Arrays.asList(OctaneConstants.DataTables.ID_FIELD, OctaneConstants.DataTables.NAME_FIELD, OctaneConstants.DataTables.RELATIVE_PATH_FIELD); - List octaneDataTables = client.getEntities(workspaceId, OctaneConstants.DataTables.COLLECTION_NAME, conditions, dataTablesFields); - - Map octaneDataTablesMap = new HashedMap(); - for (Entity dataTable : octaneDataTables) { - octaneDataTablesMap.put(dataTable.getStringValue(OctaneConstants.DataTables.RELATIVE_PATH_FIELD), dataTable); - } - - return octaneDataTablesMap; - } - - private static String createKey(String... values) { - for (int i = 0; i < values.length; i++) { - if (values[i] == null || "null".equals(values[i])) { - values[i] = ""; - } - } - return StringUtils.join(values, "#"); - } - - private static boolean postTests(MqmRestClient client, List tests, String workspaceId, String scmRepositoryId) { - - if (!tests.isEmpty()) { - try { - completeTestProperties(client, Long.parseLong(workspaceId), tests, scmRepositoryId); - } catch (RequestErrorException e) { - logger.error("Failed to completeTestProperties : " + e.getMessage()); - return false; - } - - for (int i = 0; i < tests.size(); i += POST_BULK_SIZE) { - try { - AutomatedTests data = AutomatedTests.createWithTests(tests.subList(i, Math.min(i + POST_BULK_SIZE, tests.size()))); - String uftTestJson = convertToJsonString(data); - client.postEntities(Long.parseLong(workspaceId), OctaneConstants.Tests.COLLECTION_NAME, uftTestJson); - } catch (RequestErrorException e) { - return checkIfExceptionCanBeIgnoredInPOST(e, "Failed to post tests"); - } - } - } - return true; - } - - private static boolean postScmResources(MqmRestClient client, List resources, String workspaceId, String scmResourceId) { - - if (!resources.isEmpty()) { - try { - completeScmResourceProperties(resources, scmResourceId); - } catch (RequestErrorException e) { - logger.error("Failed to completeScmResourceProperties : " + e.getMessage()); - return false; - } - - for (int i = 0; i < resources.size(); i += POST_BULK_SIZE) - try { - ScmResources data = ScmResources.createWithItems(resources.subList(i, Math.min(i + POST_BULK_SIZE, resources.size()))); - String json = convertToJsonString(data); - client.postEntities(Long.parseLong(workspaceId), OctaneConstants.DataTables.COLLECTION_NAME, json); - } catch (RequestErrorException e) { - return checkIfExceptionCanBeIgnoredInPOST(e, "Failed to post scm resource files"); - } - } - return true; - } - - /** - * Entities might be posted while they already exist in Octane, such POST request will fail with general error code will be 409. - * The same error code might be received on other validation error. - * In this method we check whether exist other exception than duplicate - * - * @param e - * @param errorPrefix - * @return - */ - private static boolean checkIfExceptionCanBeIgnoredInPOST(RequestErrorException e, String errorPrefix) { - if (e.getStatusCode() == HttpStatus.CONFLICT.getCode() && e.getJsonObject() != null && e.getJsonObject().containsKey("errors")) { - JSONObject error = findFirstErrorDifferThan(e.getJsonObject().getJSONArray("errors"), DUPLICATE_ERROR_CODE); - String errorMessage = null; - if (error != null) { - errorMessage = error.getString("description"); - logger.error(errorPrefix + " : " + errorMessage); - } - return errorMessage == null; - } - - logger.error(errorPrefix + " : " + e.getMessage()); - return false; - } - - /** - * Search for error code that differ from supplied errorCode. - */ - private static JSONObject findFirstErrorDifferThan(JSONArray errors, String excludeErrorCode) { - for (int errorIndex = 0; errorIndex < errors.size(); errorIndex++) { - JSONObject error = errors.getJSONObject(errorIndex); - String errorCode = error.getString("error_code"); - if (errorCode.equals(excludeErrorCode)) { - continue; - } else { - return error; - } - } - return null; - } - - private static String convertToJsonString(Object data) { - JsonConfig config = getJsonConfig(); - return JSONObject.fromObject(data, config).toString(); - } - - private static JsonConfig getJsonConfig() { - JsonConfig config = new JsonConfig(); - //override field names - config.registerJsonPropertyNameProcessor(AutomatedTest.class, new PropertyNameProcessor() { - - @Override - public String processPropertyName(Class className, String fieldName) { - String result = fieldName; - switch (fieldName) { - case "scmRepository": - result = OctaneConstants.Tests.SCM_REPOSITORY_FIELD; - break; - case "testingToolType": - result = OctaneConstants.Tests.TESTING_TOOL_TYPE_FIELD; - break; - case "testTypes": - result = OctaneConstants.Tests.TEST_TYPE_FIELD; - break; - default: - break; - } - return result; - } - }); - - config.registerJsonPropertyNameProcessor(ScmResourceFile.class, new PropertyNameProcessor() { - - @Override - public String processPropertyName(Class className, String fieldName) { - String result = fieldName; - switch (fieldName) { - case "relativePath": - result = OctaneConstants.DataTables.RELATIVE_PATH_FIELD; - break; - case "scmRepository": - result = OctaneConstants.DataTables.SCM_REPOSITORY_FIELD; - break; - default: - break; - } - return result; - } - }); - - //filter empty fields - PropertyFilter pf = new PropertyFilter() { - public boolean apply(Object source, String name, Object value) { - if (value != null) { - return false; - } - return true; - } - }; - config.setJsonPropertyFilter(pf); - - //skip fields - config.registerPropertyExclusions(AutomatedTest.class, new String[]{"uftTestType", "changeSetSrc", "changeSetDst", "oldName", "oldPackage", "isMoved", "octaneStatus"}); - config.registerPropertyExclusions(ScmResourceFile.class, new String[]{"changeSetSrc", "changeSetDst", "oldName", "oldRelativePath", "isMoved", "octaneStatus"}); - return config; - } - - private static boolean updateTests(MqmRestClient client, Collection tests, String workspaceId) { - - try { - //build testsForUpdate - List testsForUpdate = new ArrayList<>(); - for (AutomatedTest test : tests) { - AutomatedTest testForUpdate = new AutomatedTest(); - if (test.getDescription() != null) { - testForUpdate.setDescription(test.getDescription()); - } - testForUpdate.setExecutable(test.getExecutable()); - testForUpdate.setId(test.getId()); - - if (test.getIsMoved()) { - testForUpdate.setName(test.getName()); - testForUpdate.setPackage(test.getPackage()); - } - testsForUpdate.add(testForUpdate); - } - - if (!testsForUpdate.isEmpty()) { - for (int i = 0; i < tests.size(); i += POST_BULK_SIZE) { - AutomatedTests data = AutomatedTests.createWithTests(testsForUpdate.subList(i, Math.min(i + POST_BULK_SIZE, tests.size()))); - String uftTestJson = convertToJsonString(data); - client.updateEntities(Long.parseLong(workspaceId), OctaneConstants.Tests.COLLECTION_NAME, uftTestJson); - } - } - - return true; - } catch (Exception e) { - logger.error("Failed to update tests : " + e.getMessage()); - return false; - } - } - - private static Entity fetchDataTableFromOctane(MqmRestClient client, long workspaceIdAsLong, long scmRepositoryId, String relativePath) { - List conditions = new ArrayList<>(); - conditions.add(QueryHelper.condition(OctaneConstants.DataTables.RELATIVE_PATH_FIELD, relativePath)); - conditions.add(QueryHelper.conditionRef(OctaneConstants.DataTables.SCM_REPOSITORY_FIELD, scmRepositoryId)); - List entities = client.getEntities(workspaceIdAsLong, OctaneConstants.DataTables.COLLECTION_NAME, conditions, Arrays.asList("id, name")); - - return entities.size() == 1 ? entities.get(0) : null; - } - - private static boolean updateScmResources(MqmRestClient client, List updatedResourceFiles, String workspaceId) { - try { - - if (!updatedResourceFiles.isEmpty()) { - for (int i = 0; i < updatedResourceFiles.size(); i += POST_BULK_SIZE) { - ScmResources data = ScmResources.createWithItems(updatedResourceFiles.subList(i, Math.min(i + POST_BULK_SIZE, updatedResourceFiles.size()))); - String json = convertToJsonString(data); - client.updateEntities(Long.parseLong(workspaceId), OctaneConstants.DataTables.COLLECTION_NAME, json); - } - } - - return true; - } catch (Exception e) { - logger.error("Failed to update data tables : " + e.getMessage()); - return false; - } - } - - private static boolean deleteScmResources(MqmRestClient client, List deletedResourceFiles, String workspaceId, String scmRepositoryId) { - - long workspaceIdAsLong = Long.parseLong(workspaceId); - long scmRepositoryIdAsLong = Long.parseLong(scmRepositoryId); - Set deletedIds = new HashSet<>(); - try { - for (ScmResourceFile scmResource : deletedResourceFiles) { - Entity found = fetchDataTableFromOctane(client, workspaceIdAsLong, scmRepositoryIdAsLong, scmResource.getRelativePath()); - if (found != null) { - deletedIds.add(found.getId()); - } - } - - client.deleteEntities(Long.parseLong(workspaceId), OctaneConstants.DataTables.COLLECTION_NAME, deletedIds); - return true; - - } catch (Exception e) { - return false; - } - } - - private static void completeTestProperties(MqmRestClient client, long workspaceId, Collection tests, String scmRepositoryId) { - ListNodeEntity uftTestingTool = getUftTestingTool(client, workspaceId); - ListNodeEntity uftFramework = getUftFramework(client, workspaceId); - ListNodeEntity guiTestType = hasTestsByType(tests, UftTestType.GUI) ? getGuiTestType(client, workspaceId) : null; - ListNodeEntity apiTestType = hasTestsByType(tests, UftTestType.API) ? getApiTestType(client, workspaceId) : null; - - BaseRefEntity scmRepository = StringUtils.isEmpty(scmRepositoryId) ? null : BaseRefEntity.create(OctaneConstants.Tests.SCM_REPOSITORY_FIELD, scmRepositoryId); - for (AutomatedTest test : tests) { - test.setTestingToolType(uftTestingTool); - test.setFramework(uftFramework); - test.setScmRepository(scmRepository); - - ListNodeEntity testType = guiTestType; - if (UftTestType.API.equals(test.getUftTestType())) { - testType = apiTestType; - } - test.setTestTypes(ListNodeEntityCollection.create(testType)); - } - } - - private static void completeScmResourceProperties(List resources, String scmResourceId) { - BaseRefEntity scmRepository = StringUtils.isEmpty(scmResourceId) ? null : BaseRefEntity.create(OctaneConstants.DataTables.SCM_REPOSITORY_FIELD, scmResourceId); - for (ScmResourceFile resource : resources) { - resource.setScmRepository(scmRepository); - } - } - - private static ListNodeEntity getUftTestingTool(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.testing_tool_type", null, workspaceId, 0, POST_BULK_SIZE); - String uftTestingToolLogicalName = "list_node.testing_tool_type.uft"; - - for (ListItem item : testingTools.getItems()) { - if (uftTestingToolLogicalName.equals(item.getLogicalName())) { - return ListNodeEntity.create(item.getId()); - } - } - return null; - } - - private static ListNodeEntity getUftFramework(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.je.framework", null, workspaceId, 0, POST_BULK_SIZE); - String uftTestingToolLogicalName = "list_node.je.framework.uft"; - - for (ListItem item : testingTools.getItems()) { - if (uftTestingToolLogicalName.equals(item.getLogicalName())) { - return ListNodeEntity.create(item.getId()); - } - } - return null; - } - - private static ListNodeEntity getGuiTestType(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, POST_BULK_SIZE); - String guiLogicalName = "list_node.test_type.gui"; - - for (ListItem item : testingTools.getItems()) { - if (guiLogicalName.equals(item.getLogicalName())) { - return ListNodeEntity.create(item.getId()); - } - } - return null; - } - - private static ListNodeEntity getApiTestType(MqmRestClient client, long workspaceId) { - PagedList testingTools = client.queryListItems("list_node.test_type", null, workspaceId, 0, POST_BULK_SIZE); - String guiLogicalName = "list_node.test_type.api"; - - for (ListItem item : testingTools.getItems()) { - if (guiLogicalName.equals(item.getLogicalName())) { - return ListNodeEntity.create(item.getId()); - } - } - return null; - } - @Override public long getRecurrencePeriod() { String value = System.getProperty("UftTestDiscoveryDispatcher.Period"); // let's us config the recurrence period. default is 60 seconds. - if (!StringUtils.isEmpty(value)) { + if (!SdkStringUtils.isEmpty(value)) { return Long.valueOf(value); } return TimeUnit2.SECONDS.toMillis(30); @@ -828,15 +315,6 @@ public void setTestResultQueue(UftTestDiscoveryQueue queue) { this.queue = queue; } - private static boolean hasTestsByType(Collection tests, UftTestType uftTestType) { - for (AutomatedTest test : tests) { - if (uftTestType.equals(test.getUftTestType())) { - return true; - } - } - return false; - } - /** * Queue that current run contains discovered tests * @@ -847,20 +325,19 @@ public void enqueueResult(String projectName, int buildNumber) { queue.add(projectName, buildNumber); } - - private static void handleMovedTests(UFTTestDetectionResult result) { + private static void handleMovedTests(UftTestDiscoveryResult result) { List newTests = result.getNewTests(); List deletedTests = result.getDeletedTests(); if (!newTests.isEmpty() && !deletedTests.isEmpty()) { Map dst2Test = new HashMap<>(); Map deleted2newMovedTests = new HashMap<>(); for (AutomatedTest newTest : newTests) { - if (StringUtils.isNotEmpty(newTest.getChangeSetDst())) { + if (SdkStringUtils.isNotEmpty(newTest.getChangeSetDst())) { dst2Test.put(newTest.getChangeSetDst(), newTest); } } for (AutomatedTest deletedTest : deletedTests) { - if (StringUtils.isNotEmpty(deletedTest.getChangeSetDst()) && dst2Test.containsKey(deletedTest.getChangeSetDst())) { + if (SdkStringUtils.isNotEmpty(deletedTest.getChangeSetDst()) && dst2Test.containsKey(deletedTest.getChangeSetDst())) { AutomatedTest newTest = dst2Test.get(deletedTest.getChangeSetDst()); deleted2newMovedTests.put(deletedTest, newTest); } @@ -880,19 +357,19 @@ private static void handleMovedTests(UFTTestDetectionResult result) { } } - private static void handleMovedDataTables(UFTTestDetectionResult result) { + private static void handleMovedDataTables(UftTestDiscoveryResult result) { List newItems = result.getNewScmResourceFiles(); List deletedItems = result.getDeletedScmResourceFiles(); if (!newItems.isEmpty() && !deletedItems.isEmpty()) { Map dst2File = new HashMap<>(); Map deleted2newMovedFiles = new HashMap<>(); for (ScmResourceFile newFile : newItems) { - if (StringUtils.isNotEmpty(newFile.getChangeSetDst())) { + if (SdkStringUtils.isNotEmpty(newFile.getChangeSetDst())) { dst2File.put(newFile.getChangeSetDst(), newFile); } } for (ScmResourceFile deletedFile : deletedItems) { - if (StringUtils.isNotEmpty(deletedFile.getChangeSetDst()) && dst2File.containsKey(deletedFile.getChangeSetDst())) { + if (SdkStringUtils.isNotEmpty(deletedFile.getChangeSetDst()) && dst2File.containsKey(deletedFile.getChangeSetDst())) { ScmResourceFile newFile = dst2File.get(deletedFile.getChangeSetDst()); deleted2newMovedFiles.put(deletedFile, newFile); } @@ -912,18 +389,17 @@ private static void handleMovedDataTables(UFTTestDetectionResult result) { } } - - private static boolean isOctaneSupportTestRename(MqmRestClient client) { - String octane_version = getOctaneVersion(client); + private static boolean isOctaneSupportTestRename(EntitiesService entitiesService) { + String octane_version = getOctaneVersion(entitiesService); boolean supportTestRename = (octane_version != null && versionCompare(OCTANE_VERSION_SUPPORTING_TEST_RENAME, octane_version) <= 0); logger.warn("Support test rename = " + supportTestRename); return supportTestRename; } - private static String getOctaneVersion(MqmRestClient client) { + private static String getOctaneVersion(EntitiesService entitiesService) { if (OCTANE_VERSION == null) { - List entities = client.getEntities(null, "server_version", null, null); + List entities = entitiesService.getEntities(null, "server_version", null, null); if (entities.size() == 1) { Entity entity = entities.get(0); OCTANE_VERSION = entity.getStringValue("version"); @@ -975,5 +451,4 @@ private static Integer versionCompare(String str1, String str2) { } } - } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index bad4a73991..b45e0964fc 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -36,7 +36,7 @@ import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.tests.Property; import com.hp.octane.integrations.dto.tests.TestSuite; -import com.hpe.application.automation.tools.octane.executor.OctaneConstants; +import com.hp.octane.integrations.util.SdkConstants; import com.hpe.application.automation.tools.octane.tests.HPRunnerType; import com.hpe.application.automation.tools.octane.tests.xml.AbstractXmlIterator; import hudson.FilePath; @@ -186,12 +186,12 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I // currently this handling is needed for UFT tests int testStartIndex = workspace.getRemote().length() + (sharedCheckOutDirectory == null ? 0 : (sharedCheckOutDirectory.length() + 1)); String path = testName.substring(testStartIndex); - path = path.replace(OctaneConstants.General.LINUX_PATH_SPLITTER, OctaneConstants.General.WINDOWS_PATH_SPLITTER); - path = StringUtils.strip(path, OctaneConstants.General.WINDOWS_PATH_SPLITTER); + path = path.replace(SdkConstants.FileSystem.LINUX_PATH_SPLITTER, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); + path = StringUtils.strip(path, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); //split path to package and and name fields - if (path.contains(OctaneConstants.General.WINDOWS_PATH_SPLITTER)) { - int testNameStartIndex = path.lastIndexOf(OctaneConstants.General.WINDOWS_PATH_SPLITTER); + if (path.contains(SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER)) { + int testNameStartIndex = path.lastIndexOf(SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); testName = path.substring(testNameStartIndex + 1); packageName = path.substring(0, testNameStartIndex); From dc6d098e8b16a2c333b1ca87d4c7882b04ef899e Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 18 Jun 2018 08:32:03 +0300 Subject: [PATCH 0338/2502] user story #651006 : [UFT integration]Move common logic related to UFT integration to sdk - codacy fixes --- .../tools/octane/configuration/ConfigurationService.java | 4 ---- .../tools/octane/executor/UFTTestDetectionService.java | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java index 72794a8df1..664a928ccf 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java @@ -37,8 +37,6 @@ import com.hpe.application.automation.tools.settings.OctaneServerSettingsBuilder; import hudson.Plugin; import jenkins.model.Jenkins; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; /*** * Octane plugin configuration service - @@ -48,8 +46,6 @@ */ public class ConfigurationService { - private static Logger logger = LogManager.getLogger(ConfigurationService.class); - /** * Get current {@see OctaneServerSettingsModel} model * diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java index e2b99197d2..14c3a158e9 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -49,13 +49,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; import java.io.File; import java.io.FileNotFoundException; -import java.io.FileReader; import java.io.IOException; import java.util.*; From 3a9d1e8888a0df534518bfc827dffe56dd3f02b4 Mon Sep 17 00:00:00 2001 From: Yafim Kazak Date: Tue, 19 Jun 2018 09:56:33 +0300 Subject: [PATCH 0339/2502] Update pom.xml --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 98ab7813d8..275ebd6fcc 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ hp-application-automation-tools-plugin - 5.4.1-SNAPSHOT + 5.4 hpi HPE Application Automation Tools The plugin integrates Jenkins with the following MicroFocus products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -82,7 +82,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - HEAD + hpe-application-automation-tools-plugin-5.4 From 17d3be0bae8babab8fc5299cf3ddf04c7610536d Mon Sep 17 00:00:00 2001 From: vladrolando-mihai <38353189+vladrolando-mihai@users.noreply.github.com> Date: Tue, 19 Jun 2018 10:33:52 +0300 Subject: [PATCH 0340/2502] Renamed val1 to a more meaningful name --- .../automation/tools/run/RunFromFileBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index d041d7d7e3..0c0430a295 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -731,12 +731,12 @@ public FormValidation doCheckFsTimeout(@QueryParameter String value) { return FormValidation.ok(); } - String val1 = value.trim(); - if (val1.length() > 0 && val1.charAt(0) == '-') { - val1 = val1.substring(1); + String sanitizedValue = value.trim(); + if (sanitizedValue.length() > 0 && sanitizedValue.charAt(0) == '-') { + sanitizedValue = sanitizedValue.substring(1); } - if (!val1.matches("^\\$\\{[\\w-. ]*}$|^\\$[\\w-.]*$") && !val1.matches("[0-9]*$")) { + if (!sanitizedValue.matches("^\\$\\{[\\w-. ]*}$|^\\$[\\w-.]*$") && !sanitizedValue.matches("[0-9]*$")) { return FormValidation.error("Timeout must be a parameter or a number, e.g.: 23, $Timeout or ${Timeout}."); } From 14a8e9d4c55cafd38cbae5eaf202b0efcde930c2 Mon Sep 17 00:00:00 2001 From: vladrolando-mihai <38353189+vladrolando-mihai@users.noreply.github.com> Date: Tue, 19 Jun 2018 11:39:55 +0300 Subject: [PATCH 0341/2502] Refactoring --- .../automation/tools/run/RunFromFileBuilder.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 0c0430a295..e6b7cdef62 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -736,7 +736,7 @@ public FormValidation doCheckFsTimeout(@QueryParameter String value) { sanitizedValue = sanitizedValue.substring(1); } - if (!sanitizedValue.matches("^\\$\\{[\\w-. ]*}$|^\\$[\\w-.]*$") && !sanitizedValue.matches("[0-9]*$")) { + if (!isParameterizedValue(sanitizedValue) && !StringUtils.isNumeric(sanitizedValue)) { return FormValidation.error("Timeout must be a parameter or a number, e.g.: 23, $Timeout or ${Timeout}."); } @@ -795,11 +795,21 @@ public FormValidation doCheckPerScenarioTimeOut(@QueryParameter String value) { return FormValidation.ok(); } - if (!value.matches("^\\$\\{[\\w-. ]*}$|^\\$[\\w-.]*$") && !value.matches("[0-9]*$")) { + if (!isParameterizedValue(value) && !StringUtils.isNumeric(value)) { return FormValidation.error("Per Scenario Timeout must be a parameter or a number, e.g.: 23, $ScenarioDuration or ${ScenarioDuration}."); } - return FormValidation.ok(); + return FormValidation.ok(); + } + /** + * Check if the value is parameterized. + * + * @param value the value + * @return boolean + */ + public boolean isParameterizedValue(String value) { + //Parameter (with or without brackets) + return value.matches("^\\$\\{[\\w-. ]*}$|^\\$[\\w-.]*$"); } } } From 38f6b94634fd5022f3851e7505e5918f97b819b4 Mon Sep 17 00:00:00 2001 From: Michael S Date: Tue, 19 Jun 2018 14:37:52 +0300 Subject: [PATCH 0342/2502] fix typo --- .../tools/octane/executor/TestExecutionJobCreatorService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 142c2ee5d2..2c71ffe521 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -129,7 +129,7 @@ private static FreeStyleProject getExecutionJob(TestSuiteExecutionInfo suiteExec FreeStyleProject proj = (FreeStyleProject) Jenkins.getInstance().getItem(projectName); if (proj == null) { proj = Jenkins.getInstance().createProject(FreeStyleProject.class, projectName); - proj.setDescription(String.format("This job was created by the Microfocus Application Automation Tools plugin for running %s tests. It is associated with ALM Octane test suite #%s.", + proj.setDescription(String.format("This job was created by the Micro Focus Application Automation Tools plugin for running %s tests. It is associated with ALM Octane test suite #%s.", suiteExecutionInfo.getTestingToolType().toString(), suiteExecutionInfo.getSuiteId())); } From 2fead82d2d3c9d4c9889dad87a72a68c547e7af2 Mon Sep 17 00:00:00 2001 From: Michael S Date: Tue, 19 Jun 2018 14:38:24 +0300 Subject: [PATCH 0343/2502] typo fix --- .../tools/octane/executor/TestExecutionJobCreatorService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 2c71ffe521..f31dbe4b52 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -274,7 +274,7 @@ private static FreeStyleProject getDiscoveryJob(DiscoveryInfo discoveryInfo) { if (proj == null) { proj = Jenkins.getInstance().createProject(FreeStyleProject.class, discoveryJobName); - proj.setDescription(String.format("This job was created by the Microfocus Application Automation Tools plugin for discovery of %s tests. It is associated with ALM Octane testing tool connection #%s.", + proj.setDescription(String.format("This job was created by the Micro Focus Application Automation Tools plugin for discovery of %s tests. It is associated with ALM Octane testing tool connection #%s.", discoveryInfo.getTestingToolType().toString(), discoveryInfo.getExecutorId())); } From 7e174986caad791b3be15bc2deadc04df8b76331 Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Tue, 19 Jun 2018 14:53:00 +0300 Subject: [PATCH 0344/2502] typo fixes --- .../tools/octane/executor/ExecutorConnectivityService.java | 2 +- .../tools/octane/executor/scmmanager/ScmPluginFactory.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java index 3e70851211..cc43f32615 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -152,7 +152,7 @@ public static OctaneResponse upsertRepositoryCredentials(final CredentialsInfo c } if (StringUtils.isNotEmpty(credentialsInfo.getUsername()) && credentialsInfo.getPassword() != null) { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - String desc = "Created by the Microfocus Application Automation Tools plugin on " + formatter.format(new Date()); + String desc = "Created by the Micro Focus Application Automation Tools plugin on " + formatter.format(new Date()); BaseStandardCredentials c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialsId(), desc, credentialsInfo.getUsername(), credentialsInfo.getPassword()); CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); try { diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/ScmPluginFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/ScmPluginFactory.java index b03bf655bb..83fa068064 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/ScmPluginFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/ScmPluginFactory.java @@ -81,11 +81,10 @@ public static ScmPluginHandler getScmHandlerByChangePathClass(String changePath if ("hudson.plugins.git.GitChangeSet$Path".equals(changePathClass)) { scmType = scmType.GIT; - } /*else if ("hudson.scm.SubversionSCM".equals(pluginName)) { - scmType = scmType.SVN; - } */else { + } else { return null; } + return getScmHandler(scmType); } From 19360a0c4ac5941354c7a418d11f863c94f79202 Mon Sep 17 00:00:00 2001 From: YafimK Date: Tue, 19 Jun 2018 16:28:50 +0300 Subject: [PATCH 0345/2502] set beta tagging --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2b391409d..3f72d96568 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ hp-application-automation-tools-plugin - 5.4.1-SNAPSHOT + 5.4.1-beta-SNAPSHOT hpi HPE Application Automation Tools The plugin integrates Jenkins with the following MicroFocus products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. From f8bc8d17b09c7e4f831d2188bc856cd25d563aab Mon Sep 17 00:00:00 2001 From: YafimK Date: Tue, 19 Jun 2018 17:14:38 +0300 Subject: [PATCH 0346/2502] [maven-release-plugin] prepare release hpe-application-automation-tools-plugin-5.4.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3f72d96568..512dc205a5 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ hp-application-automation-tools-plugin - 5.4.1-beta-SNAPSHOT + 5.4.1-beta hpi HPE Application Automation Tools The plugin integrates Jenkins with the following MicroFocus products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -82,7 +82,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - HEAD + hpe-application-automation-tools-plugin-5.4.1-beta From 40e8197e064bd1c18cab460f78821d8335ddc8fe Mon Sep 17 00:00:00 2001 From: YafimK Date: Tue, 19 Jun 2018 17:14:52 +0300 Subject: [PATCH 0347/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 512dc205a5..b892e69273 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ hp-application-automation-tools-plugin - 5.4.1-beta + 5.4.2-beta-SNAPSHOT hpi HPE Application Automation Tools The plugin integrates Jenkins with the following MicroFocus products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -82,7 +82,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - hpe-application-automation-tools-plugin-5.4.1-beta + HEAD From 1bb76e22b8a189c5016f328f5ec1d22e915704a4 Mon Sep 17 00:00:00 2001 From: Roy Lu Date: Wed, 20 Jun 2018 10:47:34 +0800 Subject: [PATCH 0348/2502] Change the display name. --- .../application/automation/tools/results/RunResultRecorder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index d65f09f6f1..2d11747b98 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -1323,7 +1323,7 @@ public DescriptorImpl() { @Override public String getDisplayName() { - return "Publish ALM tests result"; + return "Publish Micro Focus tests result"; } @Override From 461f0001ee27bbcccdbba023579a1d2a555a0fe1 Mon Sep 17 00:00:00 2001 From: Ionut Florin Tamas Date: Mon, 25 Jun 2018 17:00:32 +0300 Subject: [PATCH 0349/2502] Added the ability to customize the result path for mtbx files --- HpToolsLauncher/MtbxManager.cs | 9 ++++- HpToolsLauncher/MtbxSchema.xsd | 1 + .../Properties/Resources.Designer.cs | 13 +++++-- HpToolsLauncher/Properties/Resources.resx | 3 ++ HpToolsLauncher/TestInfo.cs | 11 ++++++ HpToolsLauncher/TestRunners/ApiTestRunner.cs | 31 +++++++++++++++- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 36 ++++++++++++++++++- 7 files changed, 99 insertions(+), 5 deletions(-) diff --git a/HpToolsLauncher/MtbxManager.cs b/HpToolsLauncher/MtbxManager.cs index 489780161d..698527c09a 100644 --- a/HpToolsLauncher/MtbxManager.cs +++ b/HpToolsLauncher/MtbxManager.cs @@ -150,7 +150,14 @@ public static List LoadMtbx(string xmlContent, Dictionary paramNames = new HashSet(); foreach (var param in GetElements(test, "Parameter")) diff --git a/HpToolsLauncher/MtbxSchema.xsd b/HpToolsLauncher/MtbxSchema.xsd index 39a9ed6ae6..a07a65e0f6 100644 --- a/HpToolsLauncher/MtbxSchema.xsd +++ b/HpToolsLauncher/MtbxSchema.xsd @@ -91,6 +91,7 @@ + diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index d3adccc6da..cca61e3c5e 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34003 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace HpToolsLauncher.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -474,6 +474,15 @@ internal static string HPToolsAssemblyResolverWrongVersion { } } + /// + /// Looks up a localized string similar to Invalid report path provided: '{0]'. + /// + internal static string InvalidReportPath { + get { + return ResourceManager.GetString("InvalidReportPath", resourceCulture); + } + } + /// /// Looks up a localized string similar to Run mode is set to: {0}. /// diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 631b4f7e1f..48da0f3714 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -439,4 +439,7 @@ Save the test in QuickTest and then run it again. UFT cannot start while HPE Sprinter is running. + + Invalid report path provided: '{0]' + \ No newline at end of file diff --git a/HpToolsLauncher/TestInfo.cs b/HpToolsLauncher/TestInfo.cs index 917ec699b9..3b3f32546b 100644 --- a/HpToolsLauncher/TestInfo.cs +++ b/HpToolsLauncher/TestInfo.cs @@ -120,6 +120,13 @@ public TestInfo(string testPath, string testName, string testGroup) _testName = testName; } + public TestInfo(string testPath, string testName, string testGroup, string reportPath) + { + _testPath = testPath; + TestGroup = testGroup; + _testName = testName; + ReportPath = reportPath; + } List _paramList = new List(); string _testName; @@ -144,6 +151,10 @@ public string TestPath get { return _testPath; } set { _testPath = value; } } + + // the path where the report will be saved + public string ReportPath{ get;set; } + public List ParameterList { get { return _paramList; } diff --git a/HpToolsLauncher/TestRunners/ApiTestRunner.cs b/HpToolsLauncher/TestRunners/ApiTestRunner.cs index 5a73fe0460..23b861ef86 100644 --- a/HpToolsLauncher/TestRunners/ApiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ApiTestRunner.cs @@ -72,7 +72,36 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance ConsoleWriter.ActiveTestRun = runDesc; ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testinf.TestPath); - runDesc.ReportLocation = testinf.TestPath; + // check if the report path has been defined + if (!String.IsNullOrEmpty(testinf.ReportPath)) + { + runDesc.ReportLocation = testinf.ReportPath; + + if (!Directory.Exists(runDesc.ReportLocation)) + { + try + { + Directory.CreateDirectory(runDesc.ReportLocation); + } + catch (Exception) + { + errorReason = string.Format(Resources.InvalidReportPath, runDesc.ReportLocation); + runDesc.TestState = TestState.Error; + runDesc.ErrorDesc = errorReason; + runDesc.TestPath = testinf.TestPath; + ConsoleWriter.WriteErrLine(runDesc.ErrorDesc); + ConsoleWriter.ErrorSummaryLines.Add(runDesc.ErrorDesc); + Environment.ExitCode = (int)Launcher.ExitCodeEnum.Failed; + return runDesc; + } + } + } + else + { + // no report path was defined + runDesc.ReportLocation = testinf.TestPath; + } + runDesc.ErrorDesc = errorReason; runDesc.TestPath = testinf.TestPath; runDesc.TestState = TestState.Unknown; diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index cf55812016..8cd50df642 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -79,6 +79,31 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testPath); runDesc.ReportLocation = testPath; + // use the report path instead of the test path + // (if defined) + if (!String.IsNullOrEmpty(testinf.ReportPath)) + { + runDesc.ReportLocation = testinf.ReportPath; + + if (!Directory.Exists(runDesc.ReportLocation)) + { + try + { + Directory.CreateDirectory(runDesc.ReportLocation); + } + catch (Exception) + { + errorReason = string.Format(Resources.InvalidReportPath, runDesc.ReportLocation); + runDesc.TestState = TestState.Error; + runDesc.ErrorDesc = errorReason; + runDesc.TestPath = testinf.TestPath; + ConsoleWriter.WriteErrLine(runDesc.ErrorDesc); + ConsoleWriter.ErrorSummaryLines.Add(runDesc.ErrorDesc); + Environment.ExitCode = (int)Launcher.ExitCodeEnum.Failed; + return runDesc; + } + } + } runDesc.TestPath = testPath; runDesc.TestState = TestState.Unknown; @@ -116,7 +141,16 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance Version qtpVersion = Version.Parse(_qtpApplication.Version); if (qtpVersion.Equals(new Version(11, 0))) { - runDesc.ReportLocation = Path.Combine(testPath, "Report"); + // use the defined report path if provided + if (!String.IsNullOrEmpty(testinf.ReportPath)) + { + runDesc.ReportLocation = Path.Combine(testinf.ReportPath, "Report"); + } + else + { + runDesc.ReportLocation = Path.Combine(testPath, "Report"); + } + if (Directory.Exists(runDesc.ReportLocation)) { Directory.Delete(runDesc.ReportLocation, true); From 95c0bcea1b7d1edd32d554a21eb5285c34322eca Mon Sep 17 00:00:00 2001 From: Ionut Florin Tamas Date: Mon, 25 Jun 2018 17:05:42 +0300 Subject: [PATCH 0350/2502] fixed typo --- HpToolsLauncher/Properties/Resources.Designer.cs | 2 +- HpToolsLauncher/Properties/Resources.resx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index cca61e3c5e..1fc1bb1b22 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -475,7 +475,7 @@ internal static string HPToolsAssemblyResolverWrongVersion { } /// - /// Looks up a localized string similar to Invalid report path provided: '{0]'. + /// Looks up a localized string similar to Invalid report path provided: '{0}'. /// internal static string InvalidReportPath { get { diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 48da0f3714..efba4bccd1 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -440,6 +440,6 @@ Save the test in QuickTest and then run it again. UFT cannot start while HPE Sprinter is running. - Invalid report path provided: '{0]' + Invalid report path provided: '{0}' \ No newline at end of file From 32dc0b2072b3d7b45d73cc7648d897eb136cf952 Mon Sep 17 00:00:00 2001 From: Ionut Florin Tamas Date: Mon, 25 Jun 2018 19:59:48 +0300 Subject: [PATCH 0351/2502] Implemented requested changes --- HpToolsLauncher/Helper.cs | 62 ++++++++++++++++++++ HpToolsLauncher/MtbxManager.cs | 2 + HpToolsLauncher/TestRunners/ApiTestRunner.cs | 31 +++------- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 28 +++------ 4 files changed, 78 insertions(+), 45 deletions(-) diff --git a/HpToolsLauncher/Helper.cs b/HpToolsLauncher/Helper.cs index ed83c997ca..9e59c3af60 100644 --- a/HpToolsLauncher/Helper.cs +++ b/HpToolsLauncher/Helper.cs @@ -553,6 +553,68 @@ public static bool CanUftProcessStart(out string reason) #region Report Related + /// + /// Set the error for a test when the report path is invalid. + /// + /// The test run results + /// The error reason + /// The test informatio + public static void SetTestReportPathError(TestRunResults runResults, ref string errorReason, TestInfo testInfo) + { + // Invalid path was provided, return useful description + errorReason = string.Format(Resources.InvalidReportPath, runResults.ReportLocation); + + // since the report path is invalid, the test should fail + runResults.TestState = TestState.Error; + runResults.ErrorDesc = errorReason; + + // output the error for the current test run + ConsoleWriter.WriteErrLine(runResults.ErrorDesc); + + // include the error in the summary + ConsoleWriter.ErrorSummaryLines.Add(runResults.ErrorDesc); + + // provide the appropriate exit code for the launcher + Environment.ExitCode = (int)Launcher.ExitCodeEnum.Failed; + } + + /// + /// Try to set the custom report path for a given test. + /// + /// The test run results + /// The test information + /// The error reason + /// True if the report path was set, false otherwise + public static bool TrySetTestReportPath(TestRunResults runResults, TestInfo testInfo, ref string errorReason) + { + // set the report location for the run results + runResults.ReportLocation = testInfo.ReportPath; + + // if the directory already exists then CreateDirectory + // will not create it + try + { + Directory.CreateDirectory(runResults.ReportLocation); + } + catch (Exception) + { + // do nothing here, as we will check if the directory exists + // if it doesn't it means that an exception has ocurred + // or the path was invalid + } + + // directory should be created by now + if (!Directory.Exists(runResults.ReportLocation)) + { + // set the result for this test and return + SetTestReportPathError(runResults, ref errorReason, testInfo); + + return false; + } + + return true; + } + public static string GetUftViewerInstallPath() { string ret = String.Empty; diff --git a/HpToolsLauncher/MtbxManager.cs b/HpToolsLauncher/MtbxManager.cs index 698527c09a..e9b1eb86f0 100644 --- a/HpToolsLauncher/MtbxManager.cs +++ b/HpToolsLauncher/MtbxManager.cs @@ -155,7 +155,9 @@ public static List LoadMtbx(string xmlContent, Dictionary paramNames = new HashSet(); diff --git a/HpToolsLauncher/TestRunners/ApiTestRunner.cs b/HpToolsLauncher/TestRunners/ApiTestRunner.cs index 23b861ef86..f05eeb65ab 100644 --- a/HpToolsLauncher/TestRunners/ApiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ApiTestRunner.cs @@ -72,38 +72,21 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance ConsoleWriter.ActiveTestRun = runDesc; ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testinf.TestPath); + runDesc.TestPath = testinf.TestPath; + + // default report location is the test path + runDesc.ReportLocation = testinf.TestPath; + // check if the report path has been defined if (!String.IsNullOrEmpty(testinf.ReportPath)) { - runDesc.ReportLocation = testinf.ReportPath; - - if (!Directory.Exists(runDesc.ReportLocation)) + if(!Helper.TrySetTestReportPath(runDesc, testinf,ref errorReason)) { - try - { - Directory.CreateDirectory(runDesc.ReportLocation); - } - catch (Exception) - { - errorReason = string.Format(Resources.InvalidReportPath, runDesc.ReportLocation); - runDesc.TestState = TestState.Error; - runDesc.ErrorDesc = errorReason; - runDesc.TestPath = testinf.TestPath; - ConsoleWriter.WriteErrLine(runDesc.ErrorDesc); - ConsoleWriter.ErrorSummaryLines.Add(runDesc.ErrorDesc); - Environment.ExitCode = (int)Launcher.ExitCodeEnum.Failed; - return runDesc; - } + return runDesc; } } - else - { - // no report path was defined - runDesc.ReportLocation = testinf.TestPath; - } runDesc.ErrorDesc = errorReason; - runDesc.TestPath = testinf.TestPath; runDesc.TestState = TestState.Unknown; if (!Helper.IsServiceTestInstalled()) { diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 8cd50df642..6141191145 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -77,35 +77,21 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance TestRunResults runDesc = new TestRunResults(); ConsoleWriter.ActiveTestRun = runDesc; ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testPath); + + runDesc.TestPath = testPath; + + // default report location is the test path runDesc.ReportLocation = testPath; - // use the report path instead of the test path - // (if defined) + // check if the report path has been defined if (!String.IsNullOrEmpty(testinf.ReportPath)) { - runDesc.ReportLocation = testinf.ReportPath; - - if (!Directory.Exists(runDesc.ReportLocation)) + if (!Helper.TrySetTestReportPath(runDesc, testinf, ref errorReason)) { - try - { - Directory.CreateDirectory(runDesc.ReportLocation); - } - catch (Exception) - { - errorReason = string.Format(Resources.InvalidReportPath, runDesc.ReportLocation); - runDesc.TestState = TestState.Error; - runDesc.ErrorDesc = errorReason; - runDesc.TestPath = testinf.TestPath; - ConsoleWriter.WriteErrLine(runDesc.ErrorDesc); - ConsoleWriter.ErrorSummaryLines.Add(runDesc.ErrorDesc); - Environment.ExitCode = (int)Launcher.ExitCodeEnum.Failed; - return runDesc; - } + return runDesc; } } - runDesc.TestPath = testPath; runDesc.TestState = TestState.Unknown; _runCancelled = runCanclled; From 4fb6fc23fc5cbab94e0635916a6bfb2b976bb558 Mon Sep 17 00:00:00 2001 From: Michael S Date: Tue, 26 Jun 2018 01:59:35 +0300 Subject: [PATCH 0352/2502] update ci-java-sdk Problems with docker deployment --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 34eb3a8abe..21397d5391 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5.13 + 1.5.16 From 6ca4a37e7da7235ab6897b644c2482300d62a280 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 26 Jun 2018 10:40:19 +0300 Subject: [PATCH 0353/2502] user story #651006 : [UFT integration]Move common logic related to UFT integration to sdk - moving HttpStatus --- pom.xml | 2 +- .../automation/tools/common/HttpStatus.java | 93 ------------------- .../executor/ExecutorConnectivityService.java | 18 ++-- .../executor/scmmanager/GitPluginHandler.java | 8 +- .../executor/scmmanager/SvnPluginHandler.java | 8 +- 5 files changed, 18 insertions(+), 111 deletions(-) delete mode 100644 src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java diff --git a/pom.xml b/pom.xml index 8e9dc0a40a..1f3c8c7255 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5.15 + 1.5.17 diff --git a/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java b/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java deleted file mode 100644 index a7ea1b864d..0000000000 --- a/src/main/java/com/hpe/application/automation/tools/common/HttpStatus.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * © Copyright 2013 EntIT Software LLC - * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * Copyright (c) 2018 Micro Focus Company, L.P. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * ___________________________________________________________________ - * - */ - -package com.hpe.application.automation.tools.common; - -/** - * Created by shitritn on 10/05/2017. - * enum class that define all http protocol statuses with their cause for internal use in sdk - */ -public enum HttpStatus { - OK(200, "OK"), - CREATED(201, "Created"), - ACCEPTED(202, "Accepted"), - NO_CONTENT(204, "No Content"), - RESET_CONTENT(205, "Reset Content"), - PARTIAL_CONTENT(206, "Partial Content"), - MOVED_PERMANENTLY(301, "Moved Permanently"), - FOUND(302, "Found"), - SEE_OTHER(303, "See Other"), - NOT_MODIFIED(304, "Not Modified"), - USE_PROXY(305, "Use Proxy"), - TEMPORARY_REDIRECT(307, "Temporary Redirect"), - BAD_REQUEST(400, "Bad Request"), - UNAUTHORIZED(401, "Unauthorized"), - PAYMENT_REQUIRED(402, "Payment Required"), - FORBIDDEN(403, "Forbidden"), - NOT_FOUND(404, "Not Found"), - METHOD_NOT_ALLOWED(405, "Method Not Allowed"), - NOT_ACCEPTABLE(406, "Not Acceptable"), - PROXY_AUTHENTICATION_REQUIRED(407, "Proxy Authentication Required"), - REQUEST_TIMEOUT(408, "Request Timeout"), - CONFLICT(409, "Conflict"), - GONE(410, "Gone"), - LENGTH_REQUIRED(411, "Length Required"), - PRECONDITION_FAILED(412, "Precondition Failed"), - REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"), - REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"), - UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"), - REQUESTED_RANGE_NOT_SATISFIABLE(416, "Requested Range Not Satisfiable"), - EXPECTATION_FAILED(417, "Expectation Failed"), - INTERNAL_SERVER_ERROR(500, "Internal Server Error"), - NOT_IMPLEMENTED(501, "Not Implemented"), - BAD_GATEWAY(502, "Bad Gateway"), - SERVICE_UNAVAILABLE(503, "Service Unavailable"), - GATEWAY_TIMEOUT(504, "Gateway Timeout"), - HTTP_VERSION_NOT_SUPPORTED(505, "HTTP Version Not Supported"); - - private final int code; - private final String reason; - - private HttpStatus(int statusCode, String reason) { - this.code = statusCode; - this.reason = reason; - } - - public int getCode() { - return code; - } - - public String getReason() { - return reason; - } -} diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java index 3e70851211..f65a5293a5 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -45,7 +45,7 @@ import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.CredentialsInfo; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; -import com.hpe.application.automation.tools.common.HttpStatus; +import com.hp.octane.integrations.util.SdkHttpStatus; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginFactory; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginHandler; import hudson.model.Item; @@ -100,13 +100,13 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te String user = User.current() != null ? User.current().getId() : jenkins.ANONYMOUS.getPrincipal().toString(); String error = String.format("Failed : User \'%s\' is missing permissions \'%s\' on CI server", user, permissionResult); logger.error(error); - result.setStatus(HttpStatus.FORBIDDEN.getCode()); + result.setStatus(SdkHttpStatus.FORBIDDEN.getCode()); result.setBody(error); return result; } if (!ScmPluginFactory.isPluginInstalled(testConnectivityInfo.getScmRepository().getType())) { - result.setStatus(HttpStatus.BAD_REQUEST.getCode()); + result.setStatus(SdkHttpStatus.BAD_REQUEST.getCode()); result.setBody(String.format("%s plugin is not installed.", testConnectivityInfo.getScmRepository().getType().value().toUpperCase())); } else { ScmPluginHandler handler = ScmPluginFactory.getScmHandler(testConnectivityInfo.getScmRepository().getType()); @@ -114,7 +114,7 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te } } else { - result.setStatus(HttpStatus.BAD_REQUEST.getCode()); + result.setStatus(SdkHttpStatus.BAD_REQUEST.getCode()); result.setBody("Missing input for testing"); } return result; @@ -130,7 +130,7 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te public static OctaneResponse upsertRepositoryCredentials(final CredentialsInfo credentialsInfo) { OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); - result.setStatus(HttpStatus.CREATED.getCode()); + result.setStatus(SdkHttpStatus.CREATED.getCode()); if (StringUtils.isNotEmpty(credentialsInfo.getCredentialsId())) { BaseStandardCredentials cred = getCredentialsById(credentialsInfo.getCredentialsId()); @@ -140,11 +140,11 @@ public static OctaneResponse upsertRepositoryCredentials(final CredentialsInfo c CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); try { store.updateCredentials(Domain.global(), cred, newCred); - result.setStatus(HttpStatus.CREATED.getCode()); + result.setStatus(SdkHttpStatus.CREATED.getCode()); result.setBody(newCred.getId()); } catch (IOException e) { logger.error("Failed to update credentials " + e.getMessage()); - result.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.getCode()); + result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); result.setBody("Failed to update credentials " + e.getMessage()); } return result; @@ -157,11 +157,11 @@ public static OctaneResponse upsertRepositoryCredentials(final CredentialsInfo c CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); try { store.addCredentials(Domain.global(), c); - result.setStatus(HttpStatus.CREATED.getCode()); + result.setStatus(SdkHttpStatus.CREATED.getCode()); result.setBody(c.getId()); } catch (IOException e) { logger.error("Failed to add credentials " + e.getMessage()); - result.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.getCode()); + result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); result.setBody("Failed to add credentials " + e.getMessage()); } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java index 51be482977..93977d7ed0 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java @@ -37,7 +37,7 @@ import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; import com.hp.octane.integrations.dto.scm.SCMRepository; -import com.hpe.application.automation.tools.common.HttpStatus; +import com.hp.octane.integrations.util.SdkHttpStatus; import hudson.EnvVars; import hudson.model.FreeStyleProject; import hudson.model.Job; @@ -110,15 +110,15 @@ public void checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInf git.addDefaultCredentials(credentials); git.getHeadRev(testConnectivityInfo.getScmRepository().getUrl(), "HEAD"); - result.setStatus(HttpStatus.OK.getCode()); + result.setStatus(SdkHttpStatus.OK.getCode()); } catch (IOException | InterruptedException e) { logger.error("Failed to connect to git : " + e.getMessage()); - result.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.getCode()); + result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); result.setBody(e.getMessage()); } catch (GitException e) { logger.error("Failed to execute getHeadRev : " + e.getMessage()); - result.setStatus(HttpStatus.NOT_FOUND.getCode()); + result.setStatus(SdkHttpStatus.NOT_FOUND.getCode()); result.setBody(e.getMessage()); } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java index 1c484a6f72..687a012ccc 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java @@ -37,7 +37,7 @@ import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; import com.hp.octane.integrations.dto.scm.SCMRepository; -import com.hpe.application.automation.tools.common.HttpStatus; +import com.hp.octane.integrations.util.SdkHttpStatus; import hudson.model.FreeStyleProject; import hudson.model.Item; import hudson.model.Job; @@ -90,12 +90,12 @@ public void checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInf SubversionSCM svn = new SubversionSCM(testConnectivityInfo.getScmRepository().getUrl(), credentialsId); try { svn.getDescriptor().checkRepositoryPath((Item) null, svn.getLocations()[0].getSVNURL(), credentials); - result.setStatus(HttpStatus.OK.getCode()); + result.setStatus(SdkHttpStatus.OK.getCode()); } catch (SVNException e) { - result.setStatus(HttpStatus.NOT_FOUND.getCode()); + result.setStatus(SdkHttpStatus.NOT_FOUND.getCode()); result.setBody(e.getMessage()); } catch (Exception e) { - result.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.getCode()); + result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); result.setBody(e.getMessage()); } } From 4cf19e7c8860b08e7b8c8f973109ce858bb2afcc Mon Sep 17 00:00:00 2001 From: Ionut Florin Tamas Date: Tue, 26 Jun 2018 15:12:55 +0300 Subject: [PATCH 0354/2502] Added requested changes for TrySetReportPath --- HpToolsLauncher/Helper.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/HpToolsLauncher/Helper.cs b/HpToolsLauncher/Helper.cs index 9e59c3af60..56492fbf0b 100644 --- a/HpToolsLauncher/Helper.cs +++ b/HpToolsLauncher/Helper.cs @@ -590,25 +590,19 @@ public static bool TrySetTestReportPath(TestRunResults runResults, TestInfo test // set the report location for the run results runResults.ReportLocation = testInfo.ReportPath; - // if the directory already exists then CreateDirectory - // will not create it + // no need to create it + if (Directory.Exists(runResults.ReportLocation)) + { + return true; + } + try { Directory.CreateDirectory(runResults.ReportLocation); } catch (Exception) { - // do nothing here, as we will check if the directory exists - // if it doesn't it means that an exception has ocurred - // or the path was invalid - } - - // directory should be created by now - if (!Directory.Exists(runResults.ReportLocation)) - { - // set the result for this test and return SetTestReportPathError(runResults, ref errorReason, testInfo); - return false; } From 8ca7c4ee207b80ef94fb3f990770f8be8e2691aa Mon Sep 17 00:00:00 2001 From: gullery Date: Tue, 26 Jun 2018 17:05:01 +0300 Subject: [PATCH 0355/2502] tech: correct handling of potential NPE --- .../configuration/ConfigurationService.java | 194 ++++++++++-------- 1 file changed, 104 insertions(+), 90 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java index ed6a9bedc3..3b3c4d3d72 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java @@ -53,94 +53,108 @@ */ public class ConfigurationService { - private static JenkinsMqmRestClientFactoryImpl clientFactory; - - private static Logger logger = LogManager.getLogger(ConfigurationService.class); - - /** - * Get current {@see OctaneServerSettingsModel} model - * - * @return - */ - public static OctaneServerSettingsModel getModel() { - return getOctaneDescriptor().getModel(); - } - - /** - * Get current Octane server configuration (that is based on model) - * - * @return - */ - public static ServerConfiguration getServerConfiguration() { - if(getOctaneDescriptor() != null) { - return getOctaneDescriptor().getServerConfiguration(); - } - return null; - } - - /** - * Change model (used by tests) - * - * @param newModel - */ - public static void configurePlugin(OctaneServerSettingsModel newModel) { - if(getOctaneDescriptor() != null) { - getOctaneDescriptor().setModel(newModel); - } - } - - private static OctaneServerSettingsBuilder.OctaneDescriptorImpl getOctaneDescriptor() { - return Jenkins.getInstance().getDescriptorByType(OctaneServerSettingsBuilder.OctaneDescriptorImpl.class); - } - - /** - * Get plugin version - * - * @return - */ - public static String getPluginVersion() { - Plugin plugin = Jenkins.getInstance().getPlugin("hp-application-automation-tools-plugin"); - return plugin.getWrapper().getVersion(); - } - - /** - * Create restClient based on some server configuration - * - * @param serverConfiguration - * @return - */ - public static MqmRestClient createClient(ServerConfiguration serverConfiguration) { - - if (!serverConfiguration.isValid()) { - logger.warn("MQM server configuration is not valid"); - return null; - } - - MqmRestClient client = getMqmRestClientFactory().obtain( - serverConfiguration.location, - serverConfiguration.sharedSpace, - serverConfiguration.username, - serverConfiguration.password); - - try { - client.validateConfigurationWithoutLogin(); - return client; - } catch (SharedSpaceNotExistException e) { - logger.warn("Invalid shared space"); - } catch (LoginException e) { - logger.warn("Login failed : " + e.getMessage()); - } catch (RequestException e) { - logger.warn("Problem with communication with MQM server : " + e.getMessage()); - } - - return null; - } - - private static JenkinsMqmRestClientFactoryImpl getMqmRestClientFactory() { - if (clientFactory == null) { - clientFactory = Jenkins.getInstance().getExtensionList(JenkinsMqmRestClientFactoryImpl.class).get(0); - } - return clientFactory; - } - + private static JenkinsMqmRestClientFactoryImpl clientFactory; + + private static Logger logger = LogManager.getLogger(ConfigurationService.class); + + /** + * Get current {@see OctaneServerSettingsModel} model + * + * @return current configuration + */ + public static OctaneServerSettingsModel getModel() { + return getOctaneDescriptor().getModel(); + } + + /** + * Get current Octane server configuration (that is based on model) + * + * @return current configuration + */ + public static ServerConfiguration getServerConfiguration() { + if (getOctaneDescriptor() != null) { + return getOctaneDescriptor().getServerConfiguration(); + } + return null; + } + + /** + * Change model (used by tests) + * + * @param newModel new configuration + */ + public static void configurePlugin(OctaneServerSettingsModel newModel) { + if (getOctaneDescriptor() != null) { + getOctaneDescriptor().setModel(newModel); + } + } + + private static OctaneServerSettingsBuilder.OctaneDescriptorImpl getOctaneDescriptor() { + OctaneServerSettingsBuilder.OctaneDescriptorImpl octaneDescriptor = getJenkinsInstance().getDescriptorByType(OctaneServerSettingsBuilder.OctaneDescriptorImpl.class); + if (octaneDescriptor == null) { + throw new IllegalArgumentException("failed to obtain Octane plugin descriptor"); + } + + return octaneDescriptor; + } + + /** + * Get plugin version + * + * @return plugin version + */ + public static String getPluginVersion() { + Plugin plugin = getJenkinsInstance().getPlugin("hp-application-automation-tools-plugin"); + return plugin.getWrapper().getVersion(); + } + + /** + * Create restClient based on some server configuration + * + * @param serverConfiguration server configuration + * @return MQM rest client + */ + @Deprecated + public static MqmRestClient createClient(ServerConfiguration serverConfiguration) { + + if (!serverConfiguration.isValid()) { + logger.warn("MQM server configuration is not valid"); + return null; + } + + MqmRestClient client = getMqmRestClientFactory().obtain( + serverConfiguration.location, + serverConfiguration.sharedSpace, + serverConfiguration.username, + serverConfiguration.password); + + try { + client.validateConfigurationWithoutLogin(); + return client; + } catch (SharedSpaceNotExistException e) { + logger.warn("Invalid shared space"); + } catch (LoginException e) { + logger.warn("Login failed : " + e.getMessage()); + } catch (RequestException e) { + logger.warn("Problem with communication with MQM server : " + e.getMessage()); + } + + return null; + } + + @Deprecated + private static JenkinsMqmRestClientFactoryImpl getMqmRestClientFactory() { + if (clientFactory == null) { + clientFactory = getJenkinsInstance().getExtensionList(JenkinsMqmRestClientFactoryImpl.class).get(0); + } + return clientFactory; + } + + private static Jenkins getJenkinsInstance() { + Jenkins result = Jenkins.getInstance(); + if (result == null) { + throw new IllegalStateException("failed to obtain Jenkins instance"); + } + return result; + } } From f7d8c27ed33c69364afdd69896ab2bb3b67f6428 Mon Sep 17 00:00:00 2001 From: Michael S Date: Wed, 27 Jun 2018 13:50:21 +0300 Subject: [PATCH 0356/2502] update sdk defect #605134 CI servers cannot be added on nightly --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 21397d5391..1616330e50 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5.16 + 1.5.18 From b21d3721c0161055c8907fb69424040e963accd5 Mon Sep 17 00:00:00 2001 From: Daniel Shmaya Date: Wed, 27 Jun 2018 14:49:07 +0300 Subject: [PATCH 0357/2502] us #584005: Branch Compare : expand Jenkins Plugin Capabilities - fix CommonOriginRevision --- .../tools/octane/events/RunListenerImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index cbcdd227fc..3167742e2f 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -47,6 +47,7 @@ import com.hpe.application.automation.tools.octane.model.CIEventCausesFactory; import com.hpe.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; import com.hpe.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; +import com.hpe.application.automation.tools.octane.model.processors.scm.CommonOriginRevision; import com.hpe.application.automation.tools.octane.model.processors.scm.SCMProcessor; import com.hpe.application.automation.tools.octane.model.processors.scm.SCMProcessors; import com.hpe.application.automation.tools.octane.tests.TestListener; @@ -157,7 +158,7 @@ public void onStarted(final Run r, TaskListener listener) { public void onFinalized(Run r) { if (onFinelizedValidations()) return; - SCMProcessor.CommonOriginRevision commonOriginRevision = getCommonOriginRevision(r); + CommonOriginRevision commonOriginRevision= getCommonOriginRevision(r); boolean hasTests = testListener.processBuild(r); @@ -172,9 +173,7 @@ public void onFinalized(Run r) { OctaneSDK.getInstance().getEventsService().publishEvent(event); } - - - private CIEvent getCiEvent(Run r, SCMProcessor.CommonOriginRevision commonOriginRevision, boolean hasTests, CIBuildResult result) { + private CIEvent getCiEvent(Run r, CommonOriginRevision commonOriginRevision, boolean hasTests, CIBuildResult result) { return dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.FINISHED) .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) @@ -211,8 +210,8 @@ private CIBuildResult getCiBuildResult(Run r) { return result; } - private SCMProcessor.CommonOriginRevision getCommonOriginRevision(Run r) { - SCMProcessor.CommonOriginRevision commonOriginRevision=null; + private CommonOriginRevision getCommonOriginRevision(Run r) { + CommonOriginRevision commonOriginRevision=null; if(r instanceof AbstractBuild) { final SCM scm = ((AbstractBuild) r).getProject().getScm(); if (scm != null) { From 5b4d478d1e438d864e9b34245adc2187fe46755a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 27 Jun 2018 21:28:37 +0300 Subject: [PATCH 0358/2502] user story #651006 : [UFT integration]Move common logic related to UFT integration to sdk --- pom.xml | 12 -- .../configuration/ConfigurationService.java | 170 ++++++------------ 2 files changed, 59 insertions(+), 123 deletions(-) diff --git a/pom.xml b/pom.xml index 992de4dd18..c5d06c0c53 100644 --- a/pom.xml +++ b/pom.xml @@ -582,12 +582,6 @@ 1.2.3 - - org.apache.poi - poi - 3.7 - - com.seitenbau.jenkins.plugins dynamicparameter @@ -601,12 +595,6 @@ 20090211 - - org.jdom - jdom2 - 2.0.4 - - diff --git a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java index 3b3c4d3d72..745ee1eb65 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/configuration/ConfigurationService.java @@ -34,16 +34,9 @@ package com.hpe.application.automation.tools.octane.configuration; import com.hpe.application.automation.tools.model.OctaneServerSettingsModel; -import com.hpe.application.automation.tools.octane.client.JenkinsMqmRestClientFactoryImpl; import com.hpe.application.automation.tools.settings.OctaneServerSettingsBuilder; -import com.hp.mqm.client.MqmRestClient; -import com.hp.mqm.client.exception.LoginException; -import com.hp.mqm.client.exception.RequestException; -import com.hp.mqm.client.exception.SharedSpaceNotExistException; import hudson.Plugin; import jenkins.model.Jenkins; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; /*** * Octane plugin configuration service - @@ -53,108 +46,63 @@ */ public class ConfigurationService { - private static JenkinsMqmRestClientFactoryImpl clientFactory; - - private static Logger logger = LogManager.getLogger(ConfigurationService.class); - - /** - * Get current {@see OctaneServerSettingsModel} model - * - * @return current configuration - */ - public static OctaneServerSettingsModel getModel() { - return getOctaneDescriptor().getModel(); - } - - /** - * Get current Octane server configuration (that is based on model) - * - * @return current configuration - */ - public static ServerConfiguration getServerConfiguration() { - if (getOctaneDescriptor() != null) { - return getOctaneDescriptor().getServerConfiguration(); - } - return null; - } - - /** - * Change model (used by tests) - * - * @param newModel new configuration - */ - public static void configurePlugin(OctaneServerSettingsModel newModel) { - if (getOctaneDescriptor() != null) { - getOctaneDescriptor().setModel(newModel); - } - } - - private static OctaneServerSettingsBuilder.OctaneDescriptorImpl getOctaneDescriptor() { - OctaneServerSettingsBuilder.OctaneDescriptorImpl octaneDescriptor = getJenkinsInstance().getDescriptorByType(OctaneServerSettingsBuilder.OctaneDescriptorImpl.class); - if (octaneDescriptor == null) { - throw new IllegalArgumentException("failed to obtain Octane plugin descriptor"); - } - - return octaneDescriptor; - } - - /** - * Get plugin version - * - * @return plugin version - */ - public static String getPluginVersion() { - Plugin plugin = getJenkinsInstance().getPlugin("hp-application-automation-tools-plugin"); - return plugin.getWrapper().getVersion(); - } - - /** - * Create restClient based on some server configuration - * - * @param serverConfiguration server configuration - * @return MQM rest client - */ - @Deprecated - public static MqmRestClient createClient(ServerConfiguration serverConfiguration) { - - if (!serverConfiguration.isValid()) { - logger.warn("MQM server configuration is not valid"); - return null; - } - - MqmRestClient client = getMqmRestClientFactory().obtain( - serverConfiguration.location, - serverConfiguration.sharedSpace, - serverConfiguration.username, - serverConfiguration.password); - - try { - client.validateConfigurationWithoutLogin(); - return client; - } catch (SharedSpaceNotExistException e) { - logger.warn("Invalid shared space"); - } catch (LoginException e) { - logger.warn("Login failed : " + e.getMessage()); - } catch (RequestException e) { - logger.warn("Problem with communication with MQM server : " + e.getMessage()); - } - - return null; - } - - @Deprecated - private static JenkinsMqmRestClientFactoryImpl getMqmRestClientFactory() { - if (clientFactory == null) { - clientFactory = getJenkinsInstance().getExtensionList(JenkinsMqmRestClientFactoryImpl.class).get(0); - } - return clientFactory; - } - - private static Jenkins getJenkinsInstance() { - Jenkins result = Jenkins.getInstance(); - if (result == null) { - throw new IllegalStateException("failed to obtain Jenkins instance"); - } - return result; - } + /** + * Get current {@see OctaneServerSettingsModel} model + * + * @return current configuration + */ + public static OctaneServerSettingsModel getModel() { + return getOctaneDescriptor().getModel(); + } + + /** + * Get current Octane server configuration (that is based on model) + * + * @return current configuration + */ + public static ServerConfiguration getServerConfiguration() { + if (getOctaneDescriptor() != null) { + return getOctaneDescriptor().getServerConfiguration(); + } + return null; + } + + /** + * Change model (used by tests) + * + * @param newModel new configuration + */ + public static void configurePlugin(OctaneServerSettingsModel newModel) { + if (getOctaneDescriptor() != null) { + getOctaneDescriptor().setModel(newModel); + } + } + + private static OctaneServerSettingsBuilder.OctaneDescriptorImpl getOctaneDescriptor() { + OctaneServerSettingsBuilder.OctaneDescriptorImpl octaneDescriptor = getJenkinsInstance().getDescriptorByType(OctaneServerSettingsBuilder.OctaneDescriptorImpl.class); + if (octaneDescriptor == null) { + throw new IllegalArgumentException("failed to obtain Octane plugin descriptor"); + } + + return octaneDescriptor; + } + + /** + * Get plugin version + * + * @return plugin version + */ + public static String getPluginVersion() { + Plugin plugin = getJenkinsInstance().getPlugin("hp-application-automation-tools-plugin"); + return plugin.getWrapper().getVersion(); + } + + + private static Jenkins getJenkinsInstance() { + Jenkins result = Jenkins.getInstance(); + if (result == null) { + throw new IllegalStateException("failed to obtain Jenkins instance"); + } + return result; + } } From 225d5529f9e4f93111ceb177d73ce2655ec46eb0 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Thu, 28 Jun 2018 09:50:31 +0300 Subject: [PATCH 0359/2502] Add rebranding function Every product should use this function in their Descriptor in order to avoid breakage in old builds\jobs. --- .../tools/common/CompatibilityRebrander.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java diff --git a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java new file mode 100644 index 0000000000..36bb61b9e5 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java @@ -0,0 +1,74 @@ +package com.hpe.application.automation.tools.common; + + +import hudson.model.Items; +import hudson.model.Run; + +import javax.annotation.Nonnull; +import java.util.logging.Logger; + +/** + * CompatibilityRebrander is an interface for all related to the company rebranding phase. + *

    + * This process is required because our serialized data includes the old package class name. + * A measure must be taken in order to maintain backward compatibility. + *

    + * Important note to mention is this class will only work after: + *

      + *
    • Package path is renamed from the old brand to the new one + *
    • Only the various Descriptors (e.g. BuildStepDescriptor) use this function + *
    + */ +public class CompatibilityRebrander { + private final static String COM_HPE = "com.hpe"; + private final static String COM_HP = "com.hp"; + private final static String COM_MICROFOCUS = "com.microfocus"; + private final static Logger LOG = Logger.getLogger(CompatibilityRebrander.class.getName()); + + /** + * addAliases is the actual function who does the rebranding part for all the old package names + *

    + * Items.XSTREAM2.addCompatibilityAlias is for serializing project configurations. + * Run.XSTREAM2.addCompatibilityAlias is for serializing builds and its associated Actions. + * + * @param newClass the Descriptor class we want to add alias for + * @see hudson.model.Items#XSTREAM2 + * @see hudson.model.Run#XSTREAM2 + * @since 5.5 + */ + public static void addAliases(@Nonnull Class newClass) { + String newClassName = newClass.toString().replaceFirst("class ", ""); + String oldHpeClassName = newClassName.replaceFirst(COM_MICROFOCUS, COM_HPE); + String oldHpClassName = newClassName.replaceFirst(COM_MICROFOCUS, COM_HP); + + LOG.info("Starting the rebranding aliasing"); + addAliasesForSingleClass(newClass, oldHpClassName, COM_HP); + addAliasesForSingleClass(newClass, oldHpeClassName, COM_HPE); + } + + /** + * addAliasesForSingleClass responsible for handling the rebranding for a single class + */ + private static void addAliasesForSingleClass(@Nonnull Class newClass, String oldClassName, String beforeBrand) { + handleReceivedWrongParameters(newClass, oldClassName, beforeBrand); + invokeXstreamCompatibilityAlias(newClass, oldClassName); + } + + /** + * invokeXstreamCompatibilityAlias invokes the XSTREAM2 functions required for the rebranding + */ + private static void invokeXstreamCompatibilityAlias(@Nonnull Class newClass, String oldClassName) { + LOG.info(String.format("Adding alias from %s to %s", oldClassName, newClass)); + Items.XSTREAM2.addCompatibilityAlias(oldClassName, newClass); + Run.XSTREAM2.addCompatibilityAlias(oldClassName, newClass); + } + + /** + * handleReceivedWrongParameters logs a warning when the passed newClass doesn't contain any of the package names + * we trying to add alias to + */ + private static void handleReceivedWrongParameters(@Nonnull Class newClass, String oldClassName, String beforeBrand) { + if (!oldClassName.contains(beforeBrand)) + LOG.warning(String.format("The %s class name doesn't contain: %s class name", newClass.toString(), beforeBrand)); + } +} \ No newline at end of file From ea25e1d97fd9d0da4b4ecc94fc1aa3b5153e7c83 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Thu, 28 Jun 2018 10:07:09 +0300 Subject: [PATCH 0360/2502] Add compatibility rebranding example --- .../automation/tools/run/RunFromFileBuilder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index e6b7cdef62..7d8bcac23d 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -35,6 +35,7 @@ import com.hpe.application.automation.tools.AlmToolsUtils; import com.hpe.application.automation.tools.EncryptionUtils; +import com.hpe.application.automation.tools.common.CompatibilityRebrander; import com.hpe.application.automation.tools.mc.JobConfigurationProxy; import com.hpe.application.automation.tools.model.MCServerSettingsModel; import com.hpe.application.automation.tools.model.ProxySettings; @@ -45,6 +46,8 @@ import hudson.FilePath; import hudson.Launcher; import hudson.Util; +import hudson.init.InitMilestone; +import hudson.init.Initializer; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; import hudson.model.Result; @@ -628,6 +631,15 @@ public boolean isApplicable( return true; } + /** + * The function needs to be used in every the inner class of the describable which extends any kind of descriptor + * For example: BuildStepDescriptor + */ + @Initializer(before = InitMilestone.PLUGINS_STARTED) + public static void addAliases() { + CompatibilityRebrander.addAliases(RunFromFileBuilder.class); + } + /** * Gets job id. * If there is already a job created by jenkins plugin, and exists then return this job id, From cc100bc78c5bcecca996007f4c54e30c160e9b79 Mon Sep 17 00:00:00 2001 From: gullery Date: Thu, 28 Jun 2018 16:29:40 +0300 Subject: [PATCH 0361/2502] defect #663077: fixing the logic of proxy resolution to work on host only and not on the full URLs --- pom.xml | 8 +- .../tools/octane/CIJenkinsServicesImpl.java | 2 +- .../executor/ExecutorConnectivityService.java | 284 +++++++++--------- .../executor/scmmanager/GitPluginHandler.java | 151 +++++----- .../executor/scmmanager/SvnPluginHandler.java | 98 +++--- .../tools/octane/events/EventsTest.java | 57 ++-- 6 files changed, 293 insertions(+), 307 deletions(-) diff --git a/pom.xml b/pom.xml index c5d06c0c53..381a023597 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5.18 + 1.5.19 @@ -589,12 +589,6 @@ true - - org.json - json - 20090211 - - diff --git a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java index 9f031cd0c8..2358f19f8e 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -164,7 +164,7 @@ public CIProxyConfiguration getProxyConfiguration(String targetHost) { if (proxy != null) { boolean noProxyHost = false; for (Pattern pattern : proxy.getNoProxyHostPatterns()) { - if (pattern.matcher(targetHost).find()) { + if (pattern.matcher(targetHost).matches()) { noProxyHost = true; break; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java index f65a5293a5..96da908eeb 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -45,15 +45,14 @@ import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.CredentialsInfo; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; -import com.hp.octane.integrations.util.SdkHttpStatus; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginFactory; import com.hpe.application.automation.tools.octane.executor.scmmanager.ScmPluginHandler; import hudson.model.Item; import hudson.model.User; import hudson.security.Permission; import jenkins.model.Jenkins; -import org.apache.commons.collections.map.HashedMap; import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpStatus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -61,6 +60,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -70,144 +70,144 @@ */ public class ExecutorConnectivityService { - private static final Logger logger = LogManager.getLogger(ExecutorConnectivityService.class); - private static final Map requirePremissions = initRequirePremissions(); - private static final Map credentialsPremissions = initCredentialsPremissions(); - - /** - * Validate that scm repository is valid - * - * @param testConnectivityInfo contains values to check - * @return OctaneResponse return status code and error to show for client - */ - public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { - OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); - if (testConnectivityInfo.getScmRepository() != null && StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl())) { - - BaseStandardCredentials credentials = null; - if (StringUtils.isNotEmpty(testConnectivityInfo.getUsername()) && testConnectivityInfo.getPassword() != null) { - credentials = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, null, null, testConnectivityInfo.getUsername(), testConnectivityInfo.getPassword()); - } else if (StringUtils.isNotEmpty(testConnectivityInfo.getCredentialsId())) { - credentials = getCredentialsById(testConnectivityInfo.getCredentialsId()); - } - - - Jenkins jenkins = Jenkins.getActiveInstance(); - - List permissionResult = checkCIPermissions(jenkins, credentials != null); - - if (permissionResult != null && !permissionResult.isEmpty()) { - String user = User.current() != null ? User.current().getId() : jenkins.ANONYMOUS.getPrincipal().toString(); - String error = String.format("Failed : User \'%s\' is missing permissions \'%s\' on CI server", user, permissionResult); - logger.error(error); - result.setStatus(SdkHttpStatus.FORBIDDEN.getCode()); - result.setBody(error); - return result; - } - - if (!ScmPluginFactory.isPluginInstalled(testConnectivityInfo.getScmRepository().getType())) { - result.setStatus(SdkHttpStatus.BAD_REQUEST.getCode()); - result.setBody(String.format("%s plugin is not installed.", testConnectivityInfo.getScmRepository().getType().value().toUpperCase())); - } else { - ScmPluginHandler handler = ScmPluginFactory.getScmHandler(testConnectivityInfo.getScmRepository().getType()); - handler.checkRepositoryConnectivity(testConnectivityInfo, credentials, result); - } - - } else { - result.setStatus(SdkHttpStatus.BAD_REQUEST.getCode()); - result.setBody("Missing input for testing"); - } - return result; - } - - /** - * Insert of update(if already exist) of credentials in Jenkins. - * If credentialsInfo contains credentialsId - we update existing credentials with new user/password, otherwise - create new credentials - * - * @param credentialsInfo contains values to insert / update - exist credentials will be updated or recreate if deleted in jenkins - * @return OctaneResponse created/updated credentials with filled credentials id as body - */ - public static OctaneResponse upsertRepositoryCredentials(final CredentialsInfo credentialsInfo) { - - OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); - result.setStatus(SdkHttpStatus.CREATED.getCode()); - - if (StringUtils.isNotEmpty(credentialsInfo.getCredentialsId())) { - BaseStandardCredentials cred = getCredentialsById(credentialsInfo.getCredentialsId()); - if (cred != null) { - BaseStandardCredentials newCred = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialsId(), - null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); - CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); - try { - store.updateCredentials(Domain.global(), cred, newCred); - result.setStatus(SdkHttpStatus.CREATED.getCode()); - result.setBody(newCred.getId()); - } catch (IOException e) { - logger.error("Failed to update credentials " + e.getMessage()); - result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); - result.setBody("Failed to update credentials " + e.getMessage()); - } - return result; - } - } - if (StringUtils.isNotEmpty(credentialsInfo.getUsername()) && credentialsInfo.getPassword() != null) { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - String desc = "Created by the Microfocus Application Automation Tools plugin on " + formatter.format(new Date()); - BaseStandardCredentials c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialsId(), desc, credentialsInfo.getUsername(), credentialsInfo.getPassword()); - CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); - try { - store.addCredentials(Domain.global(), c); - result.setStatus(SdkHttpStatus.CREATED.getCode()); - result.setBody(c.getId()); - } catch (IOException e) { - logger.error("Failed to add credentials " + e.getMessage()); - result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); - result.setBody("Failed to add credentials " + e.getMessage()); - } - } - - return result; - } - - private static BaseStandardCredentials getCredentialsById(String credentialsId) { - List list = CredentialsProvider.lookupCredentials(BaseStandardCredentials.class, (Item) null, null, (DomainRequirement) null); - for (BaseStandardCredentials cred : list) { - if (cred.getId().equals(credentialsId)) - return cred; - } - return null; - } - - private static List checkCIPermissions(final Jenkins jenkins, boolean hasCredentials) { - List result = new ArrayList<>(); - checkPermissions(jenkins, result, requirePremissions); - if (hasCredentials) { - checkPermissions(jenkins, result, credentialsPremissions); - } - return result; - } - - private static void checkPermissions(Jenkins jenkins, List result, Map permissions) { - for (Permission permission : permissions.keySet()) { - if (!jenkins.hasPermission(permission)) { - result.add(permissions.get(permission)); - } - } - } - - private static Map initRequirePremissions() { - Map result = new HashedMap(); - result.put(Item.CREATE, "Job.CREATE"); - result.put(Item.DELETE, "Job.DELETE"); - result.put(Item.READ, "Job.READ"); - return result; - } - - private static Map initCredentialsPremissions() { - Map result = new HashedMap(); - result.put(CredentialsProvider.CREATE, "Credentials.CREATE"); - result.put(CredentialsProvider.UPDATE, "Credentials.UPDATE"); - return result; - - } + private static final Logger logger = LogManager.getLogger(ExecutorConnectivityService.class); + private static final Map requirePremissions = initRequirePremissions(); + private static final Map credentialsPremissions = initCredentialsPremissions(); + + /** + * Validate that scm repository is valid + * + * @param testConnectivityInfo contains values to check + * @return OctaneResponse return status code and error to show for client + */ + public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { + OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); + if (testConnectivityInfo.getScmRepository() != null && StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl())) { + + BaseStandardCredentials credentials = null; + if (StringUtils.isNotEmpty(testConnectivityInfo.getUsername()) && testConnectivityInfo.getPassword() != null) { + credentials = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, null, null, testConnectivityInfo.getUsername(), testConnectivityInfo.getPassword()); + } else if (StringUtils.isNotEmpty(testConnectivityInfo.getCredentialsId())) { + credentials = getCredentialsById(testConnectivityInfo.getCredentialsId()); + } + + + Jenkins jenkins = Jenkins.getActiveInstance(); + + List permissionResult = checkCIPermissions(jenkins, credentials != null); + + if (permissionResult != null && !permissionResult.isEmpty()) { + String user = User.current() != null ? User.current().getId() : jenkins.ANONYMOUS.getPrincipal().toString(); + String error = String.format("Failed : User \'%s\' is missing permissions \'%s\' on CI server", user, permissionResult); + logger.error(error); + result.setStatus(HttpStatus.SC_FORBIDDEN); + result.setBody(error); + return result; + } + + if (!ScmPluginFactory.isPluginInstalled(testConnectivityInfo.getScmRepository().getType())) { + result.setStatus(HttpStatus.SC_BAD_REQUEST); + result.setBody(String.format("%s plugin is not installed.", testConnectivityInfo.getScmRepository().getType().value().toUpperCase())); + } else { + ScmPluginHandler handler = ScmPluginFactory.getScmHandler(testConnectivityInfo.getScmRepository().getType()); + handler.checkRepositoryConnectivity(testConnectivityInfo, credentials, result); + } + + } else { + result.setStatus(HttpStatus.SC_BAD_REQUEST); + result.setBody("Missing input for testing"); + } + return result; + } + + /** + * Insert of update(if already exist) of credentials in Jenkins. + * If credentialsInfo contains credentialsId - we update existing credentials with new user/password, otherwise - create new credentials + * + * @param credentialsInfo contains values to insert / update - exist credentials will be updated or recreate if deleted in jenkins + * @return OctaneResponse created/updated credentials with filled credentials id as body + */ + public static OctaneResponse upsertRepositoryCredentials(final CredentialsInfo credentialsInfo) { + + OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); + result.setStatus(HttpStatus.SC_CREATED); + + if (StringUtils.isNotEmpty(credentialsInfo.getCredentialsId())) { + BaseStandardCredentials cred = getCredentialsById(credentialsInfo.getCredentialsId()); + if (cred != null) { + BaseStandardCredentials newCred = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialsId(), + null, credentialsInfo.getUsername(), credentialsInfo.getPassword()); + CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); + try { + store.updateCredentials(Domain.global(), cred, newCred); + result.setStatus(HttpStatus.SC_CREATED); + result.setBody(newCred.getId()); + } catch (IOException e) { + logger.error("Failed to update credentials " + e.getMessage()); + result.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); + result.setBody("Failed to update credentials " + e.getMessage()); + } + return result; + } + } + if (StringUtils.isNotEmpty(credentialsInfo.getUsername()) && credentialsInfo.getPassword() != null) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + String desc = "Created by the Microfocus Application Automation Tools plugin on " + formatter.format(new Date()); + BaseStandardCredentials c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsInfo.getCredentialsId(), desc, credentialsInfo.getUsername(), credentialsInfo.getPassword()); + CredentialsStore store = new SystemCredentialsProvider.StoreImpl(); + try { + store.addCredentials(Domain.global(), c); + result.setStatus(HttpStatus.SC_CREATED); + result.setBody(c.getId()); + } catch (IOException e) { + logger.error("Failed to add credentials " + e.getMessage()); + result.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); + result.setBody("Failed to add credentials " + e.getMessage()); + } + } + + return result; + } + + private static BaseStandardCredentials getCredentialsById(String credentialsId) { + List list = CredentialsProvider.lookupCredentials(BaseStandardCredentials.class, (Item) null, null, (DomainRequirement) null); + for (BaseStandardCredentials cred : list) { + if (cred.getId().equals(credentialsId)) + return cred; + } + return null; + } + + private static List checkCIPermissions(final Jenkins jenkins, boolean hasCredentials) { + List result = new ArrayList<>(); + checkPermissions(jenkins, result, requirePremissions); + if (hasCredentials) { + checkPermissions(jenkins, result, credentialsPremissions); + } + return result; + } + + private static void checkPermissions(Jenkins jenkins, List result, Map permissions) { + for (Permission permission : permissions.keySet()) { + if (!jenkins.hasPermission(permission)) { + result.add(permissions.get(permission)); + } + } + } + + private static Map initRequirePremissions() { + Map result = new HashMap<>(); + result.put(Item.CREATE, "Job.CREATE"); + result.put(Item.DELETE, "Job.DELETE"); + result.put(Item.READ, "Job.READ"); + return result; + } + + private static Map initCredentialsPremissions() { + Map result = new HashMap<>(); + result.put(CredentialsProvider.CREATE, "Credentials.CREATE"); + result.put(CredentialsProvider.UPDATE, "Credentials.UPDATE"); + return result; + + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java index 93977d7ed0..135a95f474 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/GitPluginHandler.java @@ -37,7 +37,6 @@ import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; import com.hp.octane.integrations.dto.scm.SCMRepository; -import com.hp.octane.integrations.util.SdkHttpStatus; import hudson.EnvVars; import hudson.model.FreeStyleProject; import hudson.model.Job; @@ -47,90 +46,90 @@ import hudson.plugins.git.extensions.impl.RelativeTargetDirectory; import hudson.scm.ChangeLogSet; import hudson.scm.SCM; +import org.apache.http.HttpStatus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jenkinsci.plugins.gitclient.Git; import org.jenkinsci.plugins.gitclient.GitClient; import java.io.IOException; -import java.util.Arrays; import java.util.Collections; import java.util.List; public class GitPluginHandler implements ScmPluginHandler { - private static final Logger logger = LogManager.getLogger(GitPluginHandler.class); - - @Override - public void setScmRepositoryInJob(SCMRepository scmRepository, String scmRepositoryCredentialsId, FreeStyleProject proj, boolean executorJob) throws IOException { - - List repoLists = Arrays.asList(new UserRemoteConfig(scmRepository.getUrl(), null, null, scmRepositoryCredentialsId)); - List extensions = null; - - if (executorJob) { - String relativeCheckOut = "..\\..\\_test_sources\\" + scmRepository.getUrl().replaceAll("[<>:\"/\\|?*]", "_"); - RelativeTargetDirectory targetDirectory = new RelativeTargetDirectory(relativeCheckOut); - extensions = Arrays.asList(targetDirectory); - } - - String branch = "*/master"; - if (proj.getScm() != null && proj.getScm() instanceof GitSCM) { - List branches = ((GitSCM) proj.getScm()).getBranches(); - if (branches.size() > 0) { - String existingBrName = branches.get(0).getName(); - boolean emptyBrName = (existingBrName == null || existingBrName.isEmpty() || existingBrName.equals("**")); - if (!emptyBrName) { - branch = existingBrName; - } - } - } - - GitSCM scm = new GitSCM(repoLists, Collections.singletonList(new BranchSpec(branch)), false, Collections.emptyList(), null, null, extensions); - proj.setScm(scm); - } - - @Override - public String getSharedCheckOutDirectory(Job j) { - SCM scm = ((FreeStyleProject) j).getScm(); - - GitSCM gitScm = (GitSCM) scm; - RelativeTargetDirectory sharedCheckOutDirectory = gitScm.getExtensions().get(RelativeTargetDirectory.class); - if (sharedCheckOutDirectory != null) { - return sharedCheckOutDirectory.getRelativeTargetDir(); - } - return null; - } - - @Override - public void checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo, StandardCredentials credentials, OctaneResponse result) { - - try { - EnvVars environment = new EnvVars(System.getenv()); - GitClient git = Git.with(TaskListener.NULL, environment).using(GitTool.getDefaultInstallation().getGitExe()).getClient(); - git.addDefaultCredentials(credentials); - git.getHeadRev(testConnectivityInfo.getScmRepository().getUrl(), "HEAD"); - - result.setStatus(SdkHttpStatus.OK.getCode()); - - } catch (IOException | InterruptedException e) { - logger.error("Failed to connect to git : " + e.getMessage()); - result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); - result.setBody(e.getMessage()); - } catch (GitException e) { - logger.error("Failed to execute getHeadRev : " + e.getMessage()); - result.setStatus(SdkHttpStatus.NOT_FOUND.getCode()); - result.setBody(e.getMessage()); - } - - } - - @Override - public String getChangeSetSrc(ChangeLogSet.AffectedFile affectedFile) { - return ((GitChangeSet.Path)affectedFile).getSrc(); - } - - @Override - public String getChangeSetDst(ChangeLogSet.AffectedFile affectedFile) { - return ((GitChangeSet.Path)affectedFile).getDst(); - } + private static final Logger logger = LogManager.getLogger(GitPluginHandler.class); + + @Override + public void setScmRepositoryInJob(SCMRepository scmRepository, String scmRepositoryCredentialsId, FreeStyleProject proj, boolean executorJob) throws IOException { + + List repoLists = Collections.singletonList(new UserRemoteConfig(scmRepository.getUrl(), null, null, scmRepositoryCredentialsId)); + List extensions = null; + + if (executorJob) { + String relativeCheckOut = "..\\..\\_test_sources\\" + scmRepository.getUrl().replaceAll("[<>:\"/\\|?*]", "_"); + RelativeTargetDirectory targetDirectory = new RelativeTargetDirectory(relativeCheckOut); + extensions = Collections.singletonList(targetDirectory); + } + + String branch = "*/master"; + if (proj.getScm() != null && proj.getScm() instanceof GitSCM) { + List branches = ((GitSCM) proj.getScm()).getBranches(); + if (branches.size() > 0) { + String existingBrName = branches.get(0).getName(); + boolean emptyBrName = (existingBrName == null || existingBrName.isEmpty() || existingBrName.equals("**")); + if (!emptyBrName) { + branch = existingBrName; + } + } + } + + GitSCM scm = new GitSCM(repoLists, Collections.singletonList(new BranchSpec(branch)), false, Collections.emptyList(), null, null, extensions); + proj.setScm(scm); + } + + @Override + public String getSharedCheckOutDirectory(Job j) { + SCM scm = ((FreeStyleProject) j).getScm(); + + GitSCM gitScm = (GitSCM) scm; + RelativeTargetDirectory sharedCheckOutDirectory = gitScm.getExtensions().get(RelativeTargetDirectory.class); + if (sharedCheckOutDirectory != null) { + return sharedCheckOutDirectory.getRelativeTargetDir(); + } + return null; + } + + @Override + public void checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo, StandardCredentials credentials, OctaneResponse result) { + + try { + EnvVars environment = new EnvVars(System.getenv()); + GitClient git = Git.with(TaskListener.NULL, environment).using(GitTool.getDefaultInstallation().getGitExe()).getClient(); + git.addDefaultCredentials(credentials); + git.getHeadRev(testConnectivityInfo.getScmRepository().getUrl(), "HEAD"); + + result.setStatus(HttpStatus.SC_OK); + + } catch (IOException | InterruptedException e) { + logger.error("Failed to connect to git : " + e.getMessage()); + result.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); + result.setBody(e.getMessage()); + } catch (GitException e) { + logger.error("Failed to execute getHeadRev : " + e.getMessage()); + result.setStatus(HttpStatus.SC_NOT_FOUND); + result.setBody(e.getMessage()); + } + + } + + @Override + public String getChangeSetSrc(ChangeLogSet.AffectedFile affectedFile) { + return ((GitChangeSet.Path) affectedFile).getSrc(); + } + + @Override + public String getChangeSetDst(ChangeLogSet.AffectedFile affectedFile) { + return ((GitChangeSet.Path) affectedFile).getDst(); + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java index 687a012ccc..dee8d20161 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/scmmanager/SvnPluginHandler.java @@ -37,7 +37,6 @@ import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; import com.hp.octane.integrations.dto.scm.SCMRepository; -import com.hp.octane.integrations.util.SdkHttpStatus; import hudson.model.FreeStyleProject; import hudson.model.Item; import hudson.model.Job; @@ -45,6 +44,7 @@ import hudson.scm.SCM; import hudson.scm.SubversionSCM; import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpStatus; import org.tmatesoft.svn.core.SVNException; import java.io.File; @@ -52,61 +52,61 @@ public class SvnPluginHandler implements ScmPluginHandler { - @Override - public void setScmRepositoryInJob(SCMRepository scmRepository, String scmRepositoryCredentialsId, FreeStyleProject proj, boolean executorJob) throws IOException { + @Override + public void setScmRepositoryInJob(SCMRepository scmRepository, String scmRepositoryCredentialsId, FreeStyleProject proj, boolean executorJob) throws IOException { - String relativeCheckOut = null; - if (executorJob) { - String url = StringUtils.stripEnd(scmRepository.getUrl(), "/").replaceAll("[<>:\"/\\|?*]", "_"); - relativeCheckOut = "a\\..\\..\\..\\_test_sources\\" + url; - }else{ - relativeCheckOut = "a" + File.separator + "..";//it doesn't has any affect on checkout folder. Without it, svn do checkout to folder of svn repository name - //for example for URL https://myd-vm00812.hpeswlab.net/svn/uft_tests/ - tests will be cloned to "uft_tests" subfolder - //adding a\.. will clone as is - Why we need it - subfolder is part of "package" reported to Octane - } + String relativeCheckOut; + if (executorJob) { + String url = StringUtils.stripEnd(scmRepository.getUrl(), "/").replaceAll("[<>:\"/\\|?*]", "_"); + relativeCheckOut = "a\\..\\..\\..\\_test_sources\\" + url; + } else { + relativeCheckOut = "a" + File.separator + "..";//it doesn't has any affect on checkout folder. Without it, svn do checkout to folder of svn repository name + //for example for URL https://myd-vm00812.hpeswlab.net/svn/uft_tests/ - tests will be cloned to "uft_tests" subfolder + //adding a\.. will clone as is - Why we need it - subfolder is part of "package" reported to Octane + } - SubversionSCM svn = new SubversionSCM(scmRepository.getUrl(), scmRepositoryCredentialsId, relativeCheckOut); - proj.setScm(svn); - } + SubversionSCM svn = new SubversionSCM(scmRepository.getUrl(), scmRepositoryCredentialsId, relativeCheckOut); + proj.setScm(svn); + } - @Override - public String getSharedCheckOutDirectory(Job j) { - SCM scm = ((FreeStyleProject) j).getScm(); + @Override + public String getSharedCheckOutDirectory(Job j) { + SCM scm = ((FreeStyleProject) j).getScm(); - SubversionSCM svnScm = (SubversionSCM) scm; - for (SubversionSCM.ModuleLocation location : svnScm.getLocations()) { - if (StringUtils.isNotEmpty(location.getLocalDir())) { - return location.getLocalDir(); - } - } + SubversionSCM svnScm = (SubversionSCM) scm; + for (SubversionSCM.ModuleLocation location : svnScm.getLocations()) { + if (StringUtils.isNotEmpty(location.getLocalDir())) { + return location.getLocalDir(); + } + } - return null; - } + return null; + } - @Override - public void checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo, StandardCredentials credentials, OctaneResponse result) { + @Override + public void checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo, StandardCredentials credentials, OctaneResponse result) { - String credentialsId = (credentials != null ? credentials.getId() : null); - SubversionSCM svn = new SubversionSCM(testConnectivityInfo.getScmRepository().getUrl(), credentialsId); - try { - svn.getDescriptor().checkRepositoryPath((Item) null, svn.getLocations()[0].getSVNURL(), credentials); - result.setStatus(SdkHttpStatus.OK.getCode()); - } catch (SVNException e) { - result.setStatus(SdkHttpStatus.NOT_FOUND.getCode()); - result.setBody(e.getMessage()); - } catch (Exception e) { - result.setStatus(SdkHttpStatus.INTERNAL_SERVER_ERROR.getCode()); - result.setBody(e.getMessage()); - } - } + String credentialsId = (credentials != null ? credentials.getId() : null); + SubversionSCM svn = new SubversionSCM(testConnectivityInfo.getScmRepository().getUrl(), credentialsId); + try { + svn.getDescriptor().checkRepositoryPath((Item) null, svn.getLocations()[0].getSVNURL(), credentials); + result.setStatus(HttpStatus.SC_OK); + } catch (SVNException e) { + result.setStatus(HttpStatus.SC_NOT_FOUND); + result.setBody(e.getMessage()); + } catch (Exception e) { + result.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); + result.setBody(e.getMessage()); + } + } - @Override - public String getChangeSetSrc(ChangeLogSet.AffectedFile affectedFile) { - return null; - } + @Override + public String getChangeSetSrc(ChangeLogSet.AffectedFile affectedFile) { + return null; + } - @Override - public String getChangeSetDst(ChangeLogSet.AffectedFile affectedFile) { - return null; - } + @Override + public String getChangeSetDst(ChangeLogSet.AffectedFile affectedFile) { + return null; + } } diff --git a/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java b/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java index 476a0781d8..d582108c67 100644 --- a/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java +++ b/src/test/java/com/hpe/application/automation/tools/octane/events/EventsTest.java @@ -33,6 +33,9 @@ package com.hpe.application.automation.tools.octane.events; +import com.hp.octane.integrations.dto.DTOFactory; +import com.hp.octane.integrations.dto.events.CIEvent; +import com.hp.octane.integrations.dto.events.CIEventsList; import com.hpe.application.automation.tools.model.OctaneServerSettingsModel; import com.hp.octane.integrations.dto.events.CIEventType; import com.hpe.application.automation.tools.octane.OctaneServerMock; @@ -40,9 +43,6 @@ import hudson.model.FreeStyleProject; import hudson.util.Secret; import org.eclipse.jetty.server.Request; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; import org.junit.*; import org.jvnet.hudson.test.JenkinsRule; @@ -67,6 +67,7 @@ @SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109", "squid:S1607", "squid:S2701", "squid:S2698"}) public class EventsTest { private static final Logger logger = Logger.getLogger(EventsTest.class.getName()); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private static final String projectName = "root-job-events-case"; private static final String sharedSpaceId = "1007"; @@ -106,35 +107,30 @@ public void testEventsA() throws Exception { Thread.sleep(5000); List eventsOrder = new ArrayList<>(Arrays.asList(CIEventType.STARTED, CIEventType.FINISHED)); - List eventsLists = eventsTestHandler.eventsLists; - JSONObject tmp; - JSONArray events; + CIEventsList eventsLists = eventsTestHandler.eventsLists; logger.info(eventsLists.toString()); - logger.info("EVENTS TEST: server mock received " + eventsLists.size() + " list/s of events"); - for (JSONObject l : eventsLists) { - assertEquals(2, l.length()); - - assertFalse(l.isNull("server")); - tmp = l.getJSONObject("server"); - assertTrue(rule.getInstance().getRootUrl() != null && rule.getInstance().getRootUrl().startsWith(tmp.getString("url"))); - assertEquals("jenkins", tmp.getString("type")); - assertEquals(ConfigurationService.getModel().getIdentity(), tmp.getString("instanceId")); - - assertFalse(l.isNull("events")); - events = l.getJSONArray("events"); - for (int i = 0; i < events.length(); i++) { - tmp = events.getJSONObject(i); - if (tmp.getString("project").equals(projectName)) { - assertEquals(eventsOrder.get(0), CIEventType.fromValue(tmp.getString("eventType"))); - eventsOrder.remove(0); - } + logger.info("EVENTS TEST: server mock received " + eventsLists.getEvents().size() + " list/s of events"); + + assertNotNull(eventsLists.getServer()); + assertTrue(rule.getInstance().getRootUrl() != null && rule.getInstance().getRootUrl().startsWith(eventsLists.getServer().getUrl())); + assertEquals("jenkins", eventsLists.getServer().getType()); + assertEquals(ConfigurationService.getModel().getIdentity(), eventsLists.getServer().getInstanceId()); + + assertNotNull(eventsLists.getEvents()); + assertFalse(eventsLists.getEvents().isEmpty()); + for (CIEvent event : eventsLists.getEvents()) { + System.out.println(event.getEventType() + "-" + event.getProject() + "-" + event.getBuildCiId()); + if (projectName.equals(event.getProject())) { + assertEquals(eventsOrder.get(0), event.getEventType()); + eventsOrder.remove(0); } } assertEquals(0, eventsOrder.size()); } private static final class EventsTestHandler extends OctaneServerMock.TestSpecificHandler { - private final List eventsLists = new LinkedList<>(); + private final CIEventsList eventsLists = dtoFactory.newDTO(CIEventsList.class) + .setEvents(new LinkedList()); @Override public boolean ownsUrlToProcess(String url) { @@ -144,13 +140,10 @@ public boolean ownsUrlToProcess(String url) { @Override public void handle(String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { String requestBody = getBodyAsString(baseRequest); - - try { - eventsLists.add(new JSONObject(requestBody)); - } catch (JSONException e) { - logger.warning("EVENTS TEST: response wasn't JSON compatible"); - } - logger.info("EVENTS TEST: server mock events list length " + eventsLists.size()); + CIEventsList tmp = dtoFactory.dtoFromJson(requestBody, CIEventsList.class); + eventsLists.setServer(tmp.getServer()); + eventsLists.getEvents().addAll(tmp.getEvents()); + logger.info("EVENTS TEST: server mock events list length " + eventsLists.getEvents().size()); response.setStatus(HttpServletResponse.SC_OK); } } From 77848c9367dc2a8ff9bd7220ed0dd1545395383b Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Sun, 1 Jul 2018 09:21:53 +0300 Subject: [PATCH 0362/2502] Ownership change and typo --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e0f4f4b9f6..cfe4393e8b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,6 +6,6 @@ Please Make sure these boxes are checked before submitting your pull request - T - [ ] Proper Jira ticket - Number, Link in pull request description. - [ ] The PR can is merged on your machine without any conflicts. - [ ] The PR can is built on your machine without any (new) warnings. -- [ ] The PR passed sanity tests by you / QA / DevTest / Good Samaritain. +- [ ] The PR passed sanity tests by you / QA / DevTest / Good Samaritan. - [ ] Add unit tests with new features. -- [ ] If you added any dependency to the POM - Please update YafimK +- [ ] If you added any dependency to the POM - Please update grount From 2e2c87934bea6b2193d221a8def3120466e712f7 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Sun, 1 Jul 2018 15:55:29 +0300 Subject: [PATCH 0363/2502] Pom ownership change --- pom.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b892e69273..3329c6694c 100644 --- a/pom.xml +++ b/pom.xml @@ -98,12 +98,18 @@ + + grount + Daniel Gront + + Global Owner + + YafimK Fima (Yafim) Kazak - kazak@hpe.com - Global owner and LoadRunner Dev + Global owner and LoadRunner Dev (retired) From 6879efac362f16a70d107b9413316a10136c564b Mon Sep 17 00:00:00 2001 From: noamdoron Date: Mon, 2 Jul 2018 08:58:33 +0300 Subject: [PATCH 0364/2502] - Completed US# 160188 [Jenkins Plugin] Test connection in SRF common settings should validate client's id and secret (Reviewed by: Idan V) - Completed US# 151039 [Jenkins Plugin] Update Views Settings Help Description (Reviewed by: Idan V) - Fixed defect #146010 String fixes in Jenkins plugin - including rebranding (Reviewed by: Idan V) --- .../tools/results/SrfResultsReport.java | 39 ++-------- .../settings/SrfServerSettingsBuilder.java | 58 ++++++--------- .../tools/srf/model/SrfScriptRunModel.java | 6 +- .../srf/results/SrfResultFileWriter.java | 6 +- .../tools/srf/run/RunFromSrfBuilder.java | 41 ++-------- .../utilities/HttpCodeErrorClassifier.java | 2 +- .../tools/srf/utilities/SrfClient.java | 36 ++++++--- .../tools/srf/utilities/SrfTrustManager.java | 74 +++++++++++++++++++ .../SrfServerSettingsBuilder/global.jelly | 10 +-- .../help-srfAppName.html | 37 ++++++++++ .../help-srfSecretName.html | 37 ++++++++++ .../help-srfServerName.html | 38 ++++++++++ .../help-srfTunnelPath.html | 39 ++++++++++ .../srf/run/CreateTunnelBuilder/config.jelly | 15 +--- .../srf/run/RunFromSrfBuilder/config.jelly | 14 ++-- .../hudson/tasks/junit/TestResult/body.jelly | 6 +- 16 files changed, 313 insertions(+), 145 deletions(-) create mode 100644 src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index 2ecb410494..3661e2ded7 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -146,6 +146,10 @@ public SrfTestResultAction(AbstractBuild owner, TestResult result, BuildListener _result=result; } + public String getSuiteId(TestResult testResult, int suiteIndex) { + return ((SuiteResult) ((ArrayList) testResult.getSuites()).get(suiteIndex)).getId(); + } + public SrfScriptRunModel[] getScriptRuns(ClassResult classResult) { JSONArray scriptRunsJson = null; ArrayList scriptRuns = new ArrayList<>(); @@ -167,8 +171,8 @@ public SrfScriptRunModel[] getScriptRuns(ClassResult classResult) { return null; String name = jTest.getString("name").toLowerCase(); - - if(name.compareTo(testName) == 0) { + String normalizedName = SrfScriptRunModel.normalizeName(name); + if(normalizedName.compareTo(testName) == 0) { scriptRunsJson = jTest.getJSONArray("scriptRuns"); break; } @@ -365,34 +369,6 @@ public void checkRoles(RoleChecker arg0) throws SecurityException { build.getActions().add(action); - /* try { - archiveTestsReport(build, listener, fileSystemResultNames, result); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - File artifactsDir = build.getArtifactsDir(); - if (artifactsDir.exists()) { - File reportDirectory = new File(artifactsDir.getParent(), PERFORMANCE_REPORT_FOLDER); - if (reportDirectory.exists()) { - File htmlIndexFile = new File(reportDirectory, INDEX_HTML_NAME); - if (htmlIndexFile.exists()) - build.getActions().add(new PerformanceReportAction(build)); - } - - File summaryDirectory = new File(artifactsDir.getParent(), TRANSACTION_SUMMARY_FOLDER); - if (summaryDirectory.exists()) { - File htmlIndexFile = new File(summaryDirectory, INDEX_HTML_NAME); - if (htmlIndexFile.exists()) - build.getActions().add(new TransactionSummaryAction(build)); - } - }*/ - - // get the artifacts directory where we will upload the zipped report // folder @@ -469,8 +445,7 @@ public DescriptorImpl() { @Override public String getDisplayName() { - - return "Publish HPE SRF Test Results"; + return "Publish SRF test results"; } @Override diff --git a/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java index da9438510e..12f613327b 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java @@ -33,8 +33,9 @@ package com.hpe.application.automation.tools.settings; -import com.hpe.application.automation.tools.srf.model.SrfException; import com.hpe.application.automation.tools.srf.model.SrfServerSettingsModel; +import com.hpe.application.automation.tools.srf.utilities.SrfClient; +import com.hpe.application.automation.tools.srf.utilities.SrfTrustManager; import hudson.CopyOnWrite; import hudson.Extension; import hudson.model.AbstractProject; @@ -42,16 +43,20 @@ import hudson.tasks.Builder; import hudson.util.FormValidation; import net.sf.json.JSONObject; +import org.apache.commons.httpclient.auth.AuthenticationException; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.bind.JavaScriptMethod; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLSocketFactory; import javax.servlet.ServletException; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.net.*; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; /** * Created by shepshel on 20/07/2016. @@ -182,44 +187,27 @@ public FormValidation doTestConnection(@QueryParameter("srfServerName") final St @QueryParameter("srfProxyName") final String srfProxyName, @QueryParameter("srfAppName") final String srfAppName, @QueryParameter("srfSecretName") final String srfSecretName) throws IOException, ServletException { - - HttpURLConnection connection; - BufferedReader in = null; - try { - URL url = new URL(srfServer.concat("/health/ready")); - if (srfProxyName != null && !srfProxyName.isEmpty()) { - URL proxyUrl = new URL(srfProxyName); - Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort())); - connection = (HttpURLConnection) url.openConnection(proxy); - } else { - connection = (HttpURLConnection) url.openConnection(); - } - - connection.setRequestMethod("GET"); - int responseCode = connection.getResponseCode(); - - in = new BufferedReader( - new InputStreamReader(connection.getInputStream())); - String inputLine; - StringBuffer response = new StringBuffer(); - - while ((inputLine = in.readLine()) != null) { - response.append(inputLine); - } - - if (responseCode >= 300) - throw new SrfException("Received response code of: " + responseCode); - - return FormValidation.ok("Success"); + SSLContext sslContext = SSLContext.getInstance("TLS"); + SrfTrustManager _trustMgr = new SrfTrustManager(); + sslContext.init(null, new SrfTrustManager[]{_trustMgr}, null); + SSLContext.setDefault(sslContext); + SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); + SrfClient srfClient = new SrfClient(srfServer, sslSocketFactory , new URL(srfProxyName)); + srfClient.login(srfAppName, srfSecretName); + } catch (KeyManagementException | NoSuchAlgorithmException e) { + return FormValidation.error("Connection error : connection initialization error " + e.getMessage()); } catch (UnknownHostException e) { return FormValidation.error("Connection error : Unknown host " + e.getMessage()); + } catch (AuthenticationException e) { + return FormValidation.error("Authentication error: " + e.getMessage()); + } catch (SSLHandshakeException e) { + return FormValidation.error("Connection error : " + e.getMessage() + " (Could be a proxy issue)"); } catch (Exception e) { return FormValidation.error("Connection error : " + e.getMessage()); - } finally { - if (in != null) - in.close(); } + + return FormValidation.ok("Success"); } @JavaScriptMethod diff --git a/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java b/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java index 5c0aefef59..9dcd2f57e0 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java @@ -74,10 +74,14 @@ public String getFullName() { } public String getLinkName() { - String normalizedScriptRunName = this.name.replaceAll("[\\.|\\-|\\s|\\+]","_"); + String normalizedScriptRunName = SrfScriptRunModel.normalizeName(this.name); return String.format("%s_%s", normalizedScriptRunName, this.yac); } + public static String normalizeName(String name) { + return name.replaceAll("[\\.|\\-|\\s|\\+]","_"); + } + public class NameVersion { public String name; public String version; diff --git a/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java b/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java index cccc01b714..c9f4fa9eb6 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java @@ -34,6 +34,7 @@ package com.hpe.application.automation.tools.srf.results; import com.hpe.application.automation.tools.srf.model.SrfException; +import com.hpe.application.automation.tools.srf.model.SrfScriptRunModel; import com.hpe.application.automation.tools.srf.utilities.SrfStepsHtmlUtil; import hudson.model.AbstractBuild; import hudson.model.Result; @@ -201,13 +202,12 @@ private static Element createTestSuite(JSONObject test, Document doc) throws Srf testSuite.setAttribute("time", String.format("%1d.0",duration_i )); String testRunYac = test.getString("yac"); testSuite.setAttribute("yac", testRunYac); - testSuite.setAttribute("id", testRunYac); - String name = test.getString("name"); + testSuite.setAttribute("id", String.format("%s_%s", name, testRunYac)); + testSuite.setAttribute("name", SrfScriptRunModel.normalizeName(name)); JSONArray scriptRuns = (JSONArray) (test.get("scriptRuns")); int scriptCnt = scriptRuns.size(); - testSuite.setAttribute("name", name); testSuite.setAttribute("timestamp", timestamp); testSuite.setAttribute("tests", String.format("%1d", scriptCnt)); //root.appendChild(testSuite); diff --git a/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java index a8f0c8dec6..9d7a2d3bc9 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java @@ -36,6 +36,7 @@ import com.hpe.application.automation.tools.settings.SrfServerSettingsBuilder; import com.hpe.application.automation.tools.srf.results.SrfResultFileWriter; import com.hpe.application.automation.tools.srf.utilities.SrfClient; +import com.hpe.application.automation.tools.srf.utilities.SrfTrustManager; import com.hpe.application.automation.tools.srf.utilities.SseEventListener; import groovy.transform.Synchronized; import hudson.Extension; @@ -619,7 +620,11 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, if (!jobIds.isEmpty()) { for (int i = 0; i < jobIds.size(); i++) { String jobId = jobIds.get(i).toString(); - srfClient.cancelJob(jobId.toString()); + try { + srfClient.cancelJob(jobId); + } catch (SrfException e1) { + e1.printStackTrace(); + } } } @@ -648,38 +653,6 @@ private void cleanUp() { } } - static class SrfTrustManager extends X509ExtendedTrustManager implements X509TrustManager { - - @Override - public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { - // Empty body - } - @Override - public void checkClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { - // Empty body - } - @Override - public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { - // Empty body - } - @Override - public void checkServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { - // Empty body - } - @Override - public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { - // Empty body - } - @Override - public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { - // Empty body - } - - @Override - public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[0]; - } - } @Extension // This indicates to Jenkins that this is an implementation of an extension @@ -696,7 +669,7 @@ public boolean isApplicable(Class aClass) { @Override public String getDisplayName() { - return "Execute tests by SRF"; + return "Execute SRF tests"; } public SrfServerSettingsModel[] getSrfServers() { diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java index 73d80bbedf..04a7592c28 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java @@ -49,7 +49,7 @@ public static void throwError(int statusCode, String responseMessage) throws IOE systemLogger.fine(String.format("Received http status code %d with response message %s", statusCode, responseMessage)); switch (statusCode) { - case 401: throw new AuthenticationException("Login required, possibly wrong credentials supplied"); + case 401: throw new AuthenticationException("Failed to login, possibly wrong credentials supplied"); case 403: throw new AuthorizationException("Operation is forbidden"); default: JSONObject srfError = JSONObject.fromObject(responseMessage); diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java index 45035685ed..dda2838d62 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java @@ -43,11 +43,11 @@ import org.apache.http.impl.client.HttpClients; import org.apache.maven.wagon.authorization.AuthorizationException; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.*; import java.io.*; import java.net.*; import java.text.MessageFormat; +import java.util.Properties; import java.util.logging.Logger; public class SrfClient { @@ -61,12 +61,22 @@ public class SrfClient { private String tenantId; private static final Logger systemLogger = Logger.getLogger(SrfClient.class.getName()); - public SrfClient(String srfServerAddress, String tenantId, SSLSocketFactory sslSocketFactory, URL proxyUrl) { + public SrfClient(String srfServerAddress, SSLSocketFactory sslSocketFactory, URL proxyUrl) { this.srfServerAddress = srfServerAddress; - this.tenantId = tenantId; httpclient = HttpClients.createDefault(); this.sslSocketFactory = sslSocketFactory; this.proxyHost = proxyUrl != null ? new HttpHost(proxyUrl.getHost(), proxyUrl.getPort()) : null; + + Properties systemProperties = System.getProperties(); + systemProperties.setProperty("https.proxyHost", proxyHost.getHostName()); + systemProperties.setProperty("http.proxyHost", proxyHost.getHostName()); + systemProperties.setProperty("https.proxyPort", String.valueOf(proxyHost.getPort())); + systemProperties.setProperty("http.proxyPort", String.valueOf(proxyHost.getPort())); + } + + public SrfClient(String srfServerAddress, String tenantId, SSLSocketFactory sslSocketFactory, URL proxyUrl) { + this(srfServerAddress, sslSocketFactory, proxyUrl); + this.tenantId = tenantId; } public void login(String clientId, String clientSecret) throws AuthorizationException, IOException, SrfException { @@ -81,6 +91,7 @@ public void login(String clientId, String clientSecret) throws AuthorizationExce JSONObject accessKeys = JSONObject.fromObject(response); accessToken = accessKeys.getString("accessToken"); workspaceId = accessKeys.getString("workspaceId"); + // tenantId = accessKeys.getString("tenantId"); wait till 1.61 is out if (accessToken == null || accessToken.isEmpty() || workspaceId == null || workspaceId.isEmpty()) { throw new SrfException(String.format("Received invalid access keys: access token %s ,workspace id %s", accessToken, workspaceId)); @@ -97,7 +108,7 @@ public JSONArray executeTestsSet(JSONObject requestBody) throws AuthorizationExc return JSONObject.fromObject(response).getJSONArray("jobs"); } - public void cancelJob(String jobId) { + public void cancelJob(String jobId) throws SrfException { systemLogger.fine(String.format("Cancelling job id: %s", jobId)); String jobCancelAddress = getAuthenticatedSrfApiAddress("/rest/jobmanager/v1/workspaces/%s/execution/jobs/{0}", new String[]{jobId}); @@ -159,7 +170,7 @@ private String sendRequest(URL url, HttpMethod method) throws IOException, SrfEx return response.toString(); } - private String sendPostRequest(URL url, JSONObject body) throws IOException, SrfException, AuthorizationException { + private String sendPostRequest(URL url, JSONObject body) throws IOException, SrfException, AuthorizationException { OutputStreamWriter writer = null; OutputStream out = null; BufferedReader bufferedReader = null; @@ -201,21 +212,24 @@ private String sendPostRequest(URL url, JSONObject body) throws IOException, Srf } catch (Exception e) { throw e; } finally { - out.close(); - writer.close(); - bufferedReader.close(); + if (out != null) out.close(); + if (writer != null) writer.close(); + if (bufferedReader != null) bufferedReader.close(); } return response.toString(); } - private String getAuthenticatedSrfApiAddress(String path) { + private String getAuthenticatedSrfApiAddress(String path) throws SrfException { + if (tenantId == null || tenantId.isEmpty()) { + throw new SrfException("Tenant id is null or empty"); + } return srfServerAddress .concat(String.format(path, workspaceId)) .concat(String.format("?access-token=%s&TENANTID=%s", accessToken, tenantId)); } - private String getAuthenticatedSrfApiAddress(String path, String[] pathParams) { + private String getAuthenticatedSrfApiAddress(String path, String[] pathParams) throws SrfException { String parametizesUrl = MessageFormat.format(path, pathParams); return getAuthenticatedSrfApiAddress(parametizesUrl); } diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java new file mode 100644 index 0000000000..4abfbd85a9 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java @@ -0,0 +1,74 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ +package com.hpe.application.automation.tools.srf.utilities; + +import javax.net.ssl.SSLEngine; +import javax.net.ssl.X509ExtendedTrustManager; +import javax.net.ssl.X509TrustManager; +import java.net.Socket; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +public class SrfTrustManager extends X509ExtendedTrustManager implements X509TrustManager { + + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { + // Empty body + } + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { + // Empty body + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { + // Empty body + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { + // Empty body + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + // Empty body + } + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + // Empty body + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + +} diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly index 9a5a4fd0c3..4cb6a9dd88 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly @@ -111,23 +111,23 @@ - + - + - + - + - + diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html new file mode 100644 index 0000000000..a5044edbf5 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html @@ -0,0 +1,37 @@ + + +
    + Use an SRF client ID and secret to access SRF remotely. + For more details, see the SRF Help Center. +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html new file mode 100644 index 0000000000..a5044edbf5 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html @@ -0,0 +1,37 @@ + + +
    + Use an SRF client ID and secret to access SRF remotely. + For more details, see the SRF Help Center. +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html new file mode 100644 index 0000000000..04908cc3d1 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html @@ -0,0 +1,38 @@ + + +
    + Use one of the following URLs:
    + AMS: https://ftaas.saas.hpe.com
    + EMEA: https://ftaas-eu1.saas.hpe.com +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html new file mode 100644 index 0000000000..8f0326b194 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html @@ -0,0 +1,39 @@ + + +
    + SRF tunnels enable you to open secure connections between SRF and apps stored locally, or behind a corporate firewall.
    + Enter the path to your tunnel client with the syntax used in the following example:
    + /var/tunnelClient/ftaas
    + For more details, see the SRF Help Center +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly index dafa80cd7a..5d92da461f 100644 --- a/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly @@ -33,19 +33,8 @@ - - + - + diff --git a/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly index 758eba97a4..5dc55b41fc 100644 --- a/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly @@ -45,26 +45,26 @@ - + - + - + - + - + - + - + diff --git a/src/main/resources/hudson/tasks/junit/TestResult/body.jelly b/src/main/resources/hudson/tasks/junit/TestResult/body.jelly index 9fbc7dfa28..c4a597deef 100644 --- a/src/main/resources/hudson/tasks/junit/TestResult/body.jelly +++ b/src/main/resources/hudson/tasks/junit/TestResult/body.jelly @@ -59,7 +59,7 @@ -

    ${%All Tests}

    +

    ${%All SRF Tests}

    @@ -87,13 +87,13 @@ - + + + - - + + + + + + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly index 7833862596..96f93dd05a 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -31,8 +31,10 @@ ~ --> - + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 0a926ae1cf..796d934656 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -19,9 +19,87 @@ ~ ___________________________________________________________________ ~ --> + + + + \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html new file mode 100644 index 0000000000..136b4d7127 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html @@ -0,0 +1,29 @@ + +
    + The delimiter used to separate different tests during conversion to "testsToRun" parameter to the format of the selected testing framework conversion
    + + For example: +
      +
    • Maven format: ,
    • +
    • Protractor format: |
    • +
    + +
    \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html new file mode 100644 index 0000000000..ad424edd8d --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html @@ -0,0 +1,45 @@ + +
    + The format used to convert the data received in "testsToRun" parameter to the format of the Custom testing framework, and inject it to the "testsToRunConverted" parameter
    + The format syntax is: +
      +
    • $package - to use the test package name in format
    • +
    • $class - to use the test class name in format
    • +
    • $testName - to use the test name in format
    • +
    + + For different frameworks: +
      +
    • Gradle format: --tests $package.$class.$testName
    • +
    • Maven format: $package.$class#$testName
    • +
    • Protractor format: $class $testName
    • +
    + + For example:

    + testsToRun parameter has value v1:MF.simple.tests|AppTest|testAlwaysFail;MF.simple.tests|App2Test|testSendGet
    + $package is MF.simple.tests
    + $class is AppTest
    + $testName is testAlwaysFail
    + + The defined format is --tests $package.$class.$testName

    + The testsToRunConverted will get the value --tests MF.simple.tests.AppTest.testAlwaysFail --tests MF.simple.tests.App2Test.testSendGet + +
    \ No newline at end of file From d6a5bc4b45c157553f5d21d93420467be24d3f3d Mon Sep 17 00:00:00 2001 From: gullery Date: Tue, 28 May 2019 15:16:52 +0300 Subject: [PATCH 0906/2502] tech: fixing potential resources leak while working with GIT --- .../model/processors/scm/GitSCMProcessor.java | 837 +++++++++--------- 1 file changed, 421 insertions(+), 416 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index c642bf97e5..84b8bcb77a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -69,420 +69,425 @@ */ class GitSCMProcessor implements SCMProcessor { - private static final Logger logger = LogManager.getLogger(GitSCMProcessor.class); - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - private static final String MASTER = "refs/remotes/origin/master"; - - @Override - public SCMData getSCMData(AbstractBuild build, SCM scm) { - List> changes = new ArrayList<>(); - changes.add(build.getChangeSet()); - SCMData scmData = extractSCMData(build, scm, changes); - scmData = enrichLinesOnSCMData(scmData, build); - return scmData; - } - - /** - * this method go over each of the changed files and enrich line changes - * into existing scm events, so that the new enriched events will have line ranges. - * in addition, for each renamed file, we enrich inside delete event the 'renamed to' file - * - * @param scmData - * @param build - */ - private SCMData enrichLinesOnSCMData(SCMData scmData, AbstractBuild build) { - long startTime = System.currentTimeMillis(); - try { - FilePath workspace = build.getWorkspace(); - if (workspace != null) { - File repoDir = new File(getRemoteString(build) + File.separator + ".git"); - scmData = workspace.act(new LineEnricherCallable(repoDir, scmData)); - logger.info("Line enricher: process took: " + ((System.currentTimeMillis() - startTime) / 1000) + " seconds"); - } - else { - logger.warn("Line enricher: workspace is null"); - } - } catch (Exception e1) { - logger.error("Line enricher: FAILED. could not enrich lines on SCM Data ", e1); - } - return scmData; - } - - - @Override - public SCMData getSCMData(WorkflowRun run, SCM scm) { - return extractSCMData(run, scm, run.getChangeSets()); - } - - @Override - public CommonOriginRevision getCommonOriginRevision(final Run run) { - //for phase 1 this is hard coded since its not possible to calculate it, and configuration from outside will complicate the feature - //so for this phase we keep it hardcoded. - CommonOriginRevision commonOriginRevision = new CommonOriginRevision(); - commonOriginRevision.branch = getBranchName(run); - - try { - final AbstractBuild abstractBuild = (AbstractBuild) run; - FilePath workspace = ((AbstractBuild) run).getWorkspace(); - if (workspace != null) { - File repoDir = new File(getRemoteString(abstractBuild) + File.separator + ".git"); - commonOriginRevision.revision = workspace.act(new FileContentCallable(repoDir)); - - } - logger.info("most recent common revision resolved to " + commonOriginRevision.revision + " (branch: " + commonOriginRevision.branch + ")"); - } catch (Exception e) { - logger.error("failed to resolve most recent common revision", e); - return commonOriginRevision; - } - return commonOriginRevision; - } - - private SCMData extractSCMData(Run run, SCM scm, List> changes) { - if (!(scm instanceof GitSCM)) { - throw new IllegalArgumentException("GitSCM type of SCM was expected here, found '" + scm.getClass().getName() + "'"); - } - - GitSCM gitData = (GitSCM) scm; - SCMRepository repository; - List tmpCommits; - String builtRevId = null; - - repository = getRepository(run, gitData); - - BuildData buildData = gitData.getBuildData(run); - if (buildData != null && buildData.getLastBuiltRevision() != null) { - builtRevId = buildData.getLastBuiltRevision().getSha1String(); - } - - tmpCommits = extractCommits(changes); - return dtoFactory.newDTO(SCMData.class) - .setRepository(repository) - .setBuiltRevId(builtRevId) - .setCommits(tmpCommits); - } - - private String getBranchName(Run r) { - try { - SCM scm = ((AbstractBuild) r).getProject().getScm(); - GitSCM git = (GitSCM) scm; - List branches = git.getBranches(); - String rawBranchName = branches.get(0).toString(); - if (rawBranchName != null && rawBranchName.startsWith("${") && rawBranchName.endsWith("}")) { - String param = rawBranchName.substring(2, rawBranchName.length() - 1); - if (((AbstractBuild) r).getBuildVariables().get(param) != null) { - return ((AbstractBuild) r).getBuildVariables().get(param).toString(); - } else { - return param; - } - } - if (rawBranchName != null && rawBranchName.startsWith("*/")) { - return rawBranchName.substring(2); - } - return rawBranchName; //trunk the '*/' from the '*/' in order to get clean branch name - } catch (Exception e) { - logger.error("failed to extract branch name", e); - } - return null; - } - - private static String getRemoteString(AbstractBuild r) { - final DescribableList extensions = ((GitSCM) (r.getProject()).getScm()).getExtensions(); - String relativeTargetDir = ""; - if (extensions != null) { - final RelativeTargetDirectory relativeTargetDirectory = extensions.get(RelativeTargetDirectory.class); - if (relativeTargetDirectory != null && relativeTargetDirectory.getRelativeTargetDir() != null) { - relativeTargetDir = File.separator + relativeTargetDirectory.getRelativeTargetDir(); - } - } - if (r.getWorkspace().isRemote()) { - VirtualChannel vc = r.getWorkspace().getChannel(); - String fp = r.getWorkspace().getRemote(); - String remote = new FilePath(vc, fp).getRemote(); - return remote + relativeTargetDir; - } else { - String remote = r.getWorkspace().getRemote(); - return remote + relativeTargetDir; - } - } - - private SCMRepository getRepository(Run run, GitSCM gitData) { - SCMRepository result = null; - String url = null; - String branch = null; - if (gitData != null && gitData.getBuildData(run) != null) { - BuildData buildData = gitData.getBuildData(run); - if (buildData != null) { - if (buildData.getRemoteUrls() != null && !buildData.getRemoteUrls().isEmpty()) { - url = (String) buildData.getRemoteUrls().toArray()[0]; - } - if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { - branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); - } - result = dtoFactory.newDTO(SCMRepository.class) - .setType(SCMType.GIT) - .setUrl(url) - .setBranch(branch); - } else { - logger.warn("failed to obtain BuildData; no SCM repository info will be available"); - } - } - return result; - } - - private List extractCommits(List> changes) { - List commits = new LinkedList<>(); - for (ChangeLogSet set : changes) { - for (ChangeLogSet.Entry change : set) { - if (change instanceof GitChangeSet) { - GitChangeSet commit = (GitChangeSet) change; - User user = commit.getAuthor(); - String userEmail = null; - - List tmpChanges = new ArrayList<>(); - for (GitChangeSet.Path item : commit.getAffectedFiles()) { - SCMChange tmpChange = dtoFactory.newDTO(SCMChange.class) - .setType(item.getEditType().getName()) - .setFile(item.getPath()); - tmpChanges.add(tmpChange); - } - - for (UserProperty property : user.getAllProperties()) { - if (property instanceof Mailer.UserProperty) { - userEmail = ((Mailer.UserProperty) property).getAddress(); - } - } - - SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) - .setTime(commit.getTimestamp()) - .setUser(user.getId()) - .setUserEmail(userEmail) - .setRevId(commit.getCommitId()) - .setParentRevId(commit.getParentCommit()) - .setComment(commit.getComment().trim()) - .setChanges(tmpChanges); - - commits.add(tmpCommit); - } - } - } - return commits; - } - - private static final class FileContentCallable extends MasterToSlaveFileCallable { - private final File repoDir; - - private FileContentCallable(File file) { - this.repoDir = file; - } - - @Override - public String invoke(File rootDir, VirtualChannel channel) throws IOException { - - Git git = Git.open(repoDir); - Repository repo = git.getRepository(); - if (repo == null) { - return ""; - } - final RevWalk walk = new RevWalk(repo); - if (walk == null) { - return ""; - } - ObjectId resolveForCurrentBranch = repo.resolve(Constants.HEAD); - if (resolveForCurrentBranch == null) { - return ""; - } - RevCommit currentBranchCommit = walk.parseCommit(resolveForCurrentBranch); - if (currentBranchCommit == null) { - return ""; - } - ObjectId resolveForMaster = repo.resolve(MASTER); - if (resolveForMaster == null) { - return ""; - } - RevCommit masterCommit = walk.parseCommit(resolveForMaster); - - walk.reset(); - walk.setRevFilter(RevFilter.MERGE_BASE); - walk.markStart(currentBranchCommit); - walk.markStart(masterCommit); - RevCommit base = walk.next(); - if (base == null) - return ""; - final RevCommit base2 = walk.next(); - if (base2 != null) { - throw new NoMergeBaseException(NoMergeBaseException.MergeBaseFailureReason.MULTIPLE_MERGE_BASES_NOT_SUPPORTED, - MessageFormat.format(JGitText.get().multipleMergeBasesFor, currentBranchCommit.name(), masterCommit.name(), base.name(), base2.name())); - } - //in order to return actual revision and not merge commit - while (base.getParents().length > 1) { - RevCommit base_1 = base.getParent(0); - RevCommit base_2 = base.getParent(1); - if (base_1.getParents().length == 1) { - base = base_1; - } else { - base = base_2; - } - } - return base.getId().getName(); - } - } - - /*line enricher running on the same jenkins node that the job is running in it*/ - private static final class LineEnricherCallable extends MasterToSlaveFileCallable { - private final File repoDir; - private final SCMData scmData; - - private LineEnricherCallable(File file, SCMData scmData) { - this.repoDir = file; - this.scmData = scmData; - } - - @Override - public SCMData invoke(File rootDir, VirtualChannel channel) throws IOException { - - Git git = Git.open(repoDir); - Repository repo = git.getRepository(); - if (repo == null) { - return null; - } - RevWalk rw = new RevWalk(repo); - DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE); - df.setDiffComparator(RawTextComparator.DEFAULT); - df.setRepository(repo); - df.setDetectRenames(true); - - //add blame data to scm data - Set committedFiles = getAddedOrEditedFiles(scmData); - List fileBlameList = getBlameData(repo, committedFiles); - scmData.setFileBlameList(fileBlameList); - - for (SCMCommit curCommit : scmData.getCommits()) { - Map fileChanges = new HashMap<>(); - curCommit.getChanges().forEach(change -> fileChanges.put(change.getFile(), change)); - RevCommit commit = rw.parseCommit(repo.resolve(curCommit.getRevId())); // Any ref will work here (HEAD, a sha1, tag, branch) - RevCommit parent = rw.parseCommit(commit.getParent(0).getId()); - - List diffs = df.scan(parent.getTree(), commit.getTree()); - // FOR EACH FILE - for (DiffEntry diff : diffs) { // each file change will be in seperate diff - EditList fileEdits = df.toFileHeader(diff).toEditList(); - switch (diff.getChangeType()) { - case ADD: - // old path == null, need to use new path - handleAddLinesDiff(fileEdits, fileChanges.get(diff.getNewPath())); - break; - case COPY: - // need to validate this type - handleModifyDiff(fileEdits, fileChanges.get(diff.getNewPath())); - break; - case DELETE: - // new path == null, need to use old path - handleDeleteLinesDiff(fileEdits, fileChanges.get(diff.getOldPath())); - break; - case MODIFY: - handleModifyDiff(fileEdits, fileChanges.get(diff.getNewPath())); - break; - case RENAME: - // enrich delete event with 'rename to' data - SCMChange deletedChange = fileChanges.get(diff.getOldPath()); - SCMChange newRenamedFile = fileChanges.get(diff.getNewPath()); - deletedChange.setRenamedToFile(newRenamedFile.getFile()); - // handle changes - handleModifyDiff(fileEdits, fileChanges.get(diff.getNewPath())); - break; - default: - break; - } - } - } - return scmData; - } - } - - private static Set getAddedOrEditedFiles(SCMData scmData) { - Set filesCommittedInPPR = new HashSet<>(); - for (SCMCommit curCommit : scmData.getCommits()) { - curCommit.getChanges().stream().filter(change -> !change.getType().equals("delete")).forEach(change -> filesCommittedInPPR.add(change.getFile())); - } - return filesCommittedInPPR; - } - - - private static List getBlameData(Repository repo, Set files) { - BlameCommand blamer = new BlameCommand(repo); - List fileBlameList = new ArrayList<>(); - ObjectId commitID; - try { - commitID = repo.resolve(Constants.HEAD); - for (String filePath : files) { - blamer.setStartCommit(commitID); - blamer.setFilePath(filePath); - BlameResult blameResult = blamer.call(); - RawText rawText = blameResult.getResultContents(); - Integer fileSize = rawText.size(); - - RevisionsMap revisionsMap = new RevisionsMap(); - - if (fileSize > 0) { - String startRangeRevision = blameResult.getSourceCommit(0).getName(); - Integer startRange = 1; - for (int i = 1; i < fileSize; i++) { - String currentRevision = blameResult.getSourceCommit(i).getName(); - if (!currentRevision.equals(startRangeRevision)) { - LineRange range = new LineRange(startRange, i);//line numbers starting from 1 not from 0. - revisionsMap.addRangeToRevision(startRangeRevision, range); - startRange = i + 1; - startRangeRevision = currentRevision; - } - } - } - fileBlameList.add(new SCMFileBlameImpl(filePath, revisionsMap)); - } - } catch (IOException e) { - logger.error("failed to resolve repo head", e); - } catch (GitAPIException e) { - logger.error("failed to get blame result from git", e); - } - return fileBlameList; - } - - private static void handleModifyDiff(EditList fileEdits, SCMChange scmChange) { - if (scmChange != null) { - for (Edit edit : fileEdits) { - switch (edit.getType()) { - case INSERT: - scmChange.insertAddedLines(new LineRange(edit.getBeginB() + 1, edit.getEndB())); - break; - case DELETE: - scmChange.insertDeletedLines(new LineRange(edit.getBeginA() + 1, edit.getEndA())); - break; - case REPLACE: - scmChange.insertDeletedLines(new LineRange(edit.getBeginA() + 1, edit.getEndA())); - scmChange.insertAddedLines(new LineRange(edit.getBeginB() + 1, edit.getEndB())); - break; - default: - break; - } - } - } - } - - // probably it's useless to track deleted lines (inside scm change), consider removing it later. - private static void handleDeleteLinesDiff(EditList fileEdits, SCMChange scmChange) { - if (scmChange != null) { - for (Edit edit : fileEdits) { - scmChange.insertDeletedLines(new LineRange(edit.getBeginA() + 1, edit.getEndA())); - } - } - } - - private static void handleAddLinesDiff(EditList fileEdits, SCMChange scmChange) { - if (scmChange != null) { - for (Edit edit : fileEdits) { - scmChange.insertAddedLines(new LineRange(edit.getBeginB() + 1, edit.getEndB())); - } - } - } - - + private static final Logger logger = LogManager.getLogger(GitSCMProcessor.class); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + private static final String MASTER = "refs/remotes/origin/master"; + + @Override + public SCMData getSCMData(AbstractBuild build, SCM scm) { + List> changes = new ArrayList<>(); + changes.add(build.getChangeSet()); + SCMData scmData = extractSCMData(build, scm, changes); + scmData = enrichLinesOnSCMData(scmData, build); + return scmData; + } + + /** + * this method go over each of the changed files and enrich line changes + * into existing scm events, so that the new enriched events will have line ranges. + * in addition, for each renamed file, we enrich inside delete event the 'renamed to' file + * + * @param scmData SCM data as an input + * @param build build context + */ + private SCMData enrichLinesOnSCMData(SCMData scmData, AbstractBuild build) { + long startTime = System.currentTimeMillis(); + try { + FilePath workspace = build.getWorkspace(); + if (workspace != null) { + File repoDir = new File(getRemoteString(build) + File.separator + ".git"); + scmData = workspace.act(new LineEnricherCallable(repoDir, scmData)); + logger.info("Line enricher: process took: " + ((System.currentTimeMillis() - startTime) / 1000) + " seconds"); + } else { + logger.warn("Line enricher: workspace is null"); + } + } catch (Exception e1) { + logger.error("Line enricher: FAILED. could not enrich lines on SCM Data ", e1); + } + return scmData; + } + + + @Override + public SCMData getSCMData(WorkflowRun run, SCM scm) { + return extractSCMData(run, scm, run.getChangeSets()); + } + + @Override + public CommonOriginRevision getCommonOriginRevision(final Run run) { + //for phase 1 this is hard coded since its not possible to calculate it, and configuration from outside will complicate the feature + //so for this phase we keep it hardcoded. + CommonOriginRevision commonOriginRevision = new CommonOriginRevision(); + commonOriginRevision.branch = getBranchName(run); + + try { + final AbstractBuild abstractBuild = (AbstractBuild) run; + FilePath workspace = ((AbstractBuild) run).getWorkspace(); + if (workspace != null) { + File repoDir = new File(getRemoteString(abstractBuild) + File.separator + ".git"); + commonOriginRevision.revision = workspace.act(new FileContentCallable(repoDir)); + + } + logger.info("most recent common revision resolved to " + commonOriginRevision.revision + " (branch: " + commonOriginRevision.branch + ")"); + } catch (Exception e) { + logger.error("failed to resolve most recent common revision", e); + return commonOriginRevision; + } + return commonOriginRevision; + } + + private SCMData extractSCMData(Run run, SCM scm, List> changes) { + if (!(scm instanceof GitSCM)) { + throw new IllegalArgumentException("GitSCM type of SCM was expected here, found '" + scm.getClass().getName() + "'"); + } + + GitSCM gitData = (GitSCM) scm; + SCMRepository repository; + List tmpCommits; + String builtRevId = null; + + repository = getRepository(run, gitData); + + BuildData buildData = gitData.getBuildData(run); + if (buildData != null && buildData.getLastBuiltRevision() != null) { + builtRevId = buildData.getLastBuiltRevision().getSha1String(); + } + + tmpCommits = extractCommits(changes); + return dtoFactory.newDTO(SCMData.class) + .setRepository(repository) + .setBuiltRevId(builtRevId) + .setCommits(tmpCommits); + } + + private String getBranchName(Run r) { + try { + SCM scm = ((AbstractBuild) r).getProject().getScm(); + GitSCM git = (GitSCM) scm; + List branches = git.getBranches(); + String rawBranchName = branches.get(0).toString(); + if (rawBranchName != null && rawBranchName.startsWith("${") && rawBranchName.endsWith("}")) { + String param = rawBranchName.substring(2, rawBranchName.length() - 1); + if (((AbstractBuild) r).getBuildVariables().get(param) != null) { + return ((AbstractBuild) r).getBuildVariables().get(param).toString(); + } else { + return param; + } + } + if (rawBranchName != null && rawBranchName.startsWith("*/")) { + return rawBranchName.substring(2); + } + return rawBranchName; //trunk the '*/' from the '*/' in order to get clean branch name + } catch (Exception e) { + logger.error("failed to extract branch name", e); + } + return null; + } + + private static String getRemoteString(AbstractBuild r) { + final DescribableList extensions = ((GitSCM) (r.getProject()).getScm()).getExtensions(); + String relativeTargetDir = ""; + if (extensions != null) { + final RelativeTargetDirectory relativeTargetDirectory = extensions.get(RelativeTargetDirectory.class); + if (relativeTargetDirectory != null && relativeTargetDirectory.getRelativeTargetDir() != null) { + relativeTargetDir = File.separator + relativeTargetDirectory.getRelativeTargetDir(); + } + } + if (r.getWorkspace() != null) { + if (r.getWorkspace().isRemote()) { + VirtualChannel vc = r.getWorkspace().getChannel(); + String fp = r.getWorkspace().getRemote(); + String remote = new FilePath(vc, fp).getRemote(); + return remote + relativeTargetDir; + } else { + String remote = r.getWorkspace().getRemote(); + return remote + relativeTargetDir; + } + } else { + return ""; + } + } + + private SCMRepository getRepository(Run run, GitSCM gitData) { + SCMRepository result = null; + String url = null; + String branch = null; + if (gitData != null && gitData.getBuildData(run) != null) { + BuildData buildData = gitData.getBuildData(run); + if (buildData != null) { + if (buildData.getRemoteUrls() != null && !buildData.getRemoteUrls().isEmpty()) { + url = (String) buildData.getRemoteUrls().toArray()[0]; + } + if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { + branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); + } + result = dtoFactory.newDTO(SCMRepository.class) + .setType(SCMType.GIT) + .setUrl(url) + .setBranch(branch); + } else { + logger.warn("failed to obtain BuildData; no SCM repository info will be available"); + } + } + return result; + } + + private List extractCommits(List> changes) { + List commits = new LinkedList<>(); + for (ChangeLogSet set : changes) { + for (ChangeLogSet.Entry change : set) { + if (change instanceof GitChangeSet) { + GitChangeSet commit = (GitChangeSet) change; + User user = commit.getAuthor(); + String userEmail = null; + + List tmpChanges = new ArrayList<>(); + for (GitChangeSet.Path item : commit.getAffectedFiles()) { + SCMChange tmpChange = dtoFactory.newDTO(SCMChange.class) + .setType(item.getEditType().getName()) + .setFile(item.getPath()); + tmpChanges.add(tmpChange); + } + + for (UserProperty property : user.getAllProperties()) { + if (property instanceof Mailer.UserProperty) { + userEmail = ((Mailer.UserProperty) property).getAddress(); + } + } + + SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) + .setTime(commit.getTimestamp()) + .setUser(user.getId()) + .setUserEmail(userEmail) + .setRevId(commit.getCommitId()) + .setParentRevId(commit.getParentCommit()) + .setComment(commit.getComment().trim()) + .setChanges(tmpChanges); + + commits.add(tmpCommit); + } + } + } + return commits; + } + + private static final class FileContentCallable extends MasterToSlaveFileCallable { + private final File repoDir; + + private FileContentCallable(File file) { + this.repoDir = file; + } + + @Override + public String invoke(File rootDir, VirtualChannel channel) throws IOException { + try (Git git = Git.open(repoDir); + Repository repo = git.getRepository()) { + if (repo == null) { + return ""; + } + + try (RevWalk walk = new RevWalk(repo)) { + ObjectId resolveForCurrentBranch = repo.resolve(Constants.HEAD); + if (resolveForCurrentBranch == null) { + return ""; + } + + RevCommit currentBranchCommit = walk.parseCommit(resolveForCurrentBranch); + if (currentBranchCommit == null) { + return ""; + } + + ObjectId resolveForMaster = repo.resolve(MASTER); + if (resolveForMaster == null) { + return ""; + } + + RevCommit masterCommit = walk.parseCommit(resolveForMaster); + walk.reset(); + walk.setRevFilter(RevFilter.MERGE_BASE); + walk.markStart(currentBranchCommit); + walk.markStart(masterCommit); + RevCommit base = walk.next(); + if (base == null) { + return ""; + } + final RevCommit base2 = walk.next(); + if (base2 != null) { + throw new NoMergeBaseException(NoMergeBaseException.MergeBaseFailureReason.MULTIPLE_MERGE_BASES_NOT_SUPPORTED, + MessageFormat.format(JGitText.get().multipleMergeBasesFor, currentBranchCommit.name(), masterCommit.name(), base.name(), base2.name())); + } + + //in order to return actual revision and not merge commit + while (base.getParents().length > 1) { + RevCommit base_1 = base.getParent(0); + RevCommit base_2 = base.getParent(1); + if (base_1.getParents().length == 1) { + base = base_1; + } else { + base = base_2; + } + } + return base.getId().getName(); + } + } + } + } + + /*line enricher running on the same jenkins node that the job is running in it*/ + private static final class LineEnricherCallable extends MasterToSlaveFileCallable { + private final File repoDir; + private final SCMData scmData; + + private LineEnricherCallable(File file, SCMData scmData) { + this.repoDir = file; + this.scmData = scmData; + } + + @Override + public SCMData invoke(File rootDir, VirtualChannel channel) throws IOException { + try (Git git = Git.open(repoDir); + Repository repo = git.getRepository()) { + if (repo == null) { + return null; + } + + try (RevWalk rw = new RevWalk(repo); + DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE)) { + df.setDiffComparator(RawTextComparator.DEFAULT); + df.setRepository(repo); + df.setDetectRenames(true); + + //add blame data to scm data + Set committedFiles = getAddedOrEditedFiles(scmData); + List fileBlameList = getBlameData(repo, committedFiles); + scmData.setFileBlameList(fileBlameList); + + for (SCMCommit curCommit : scmData.getCommits()) { + Map fileChanges = new HashMap<>(); + curCommit.getChanges().forEach(change -> fileChanges.put(change.getFile(), change)); + RevCommit commit = rw.parseCommit(repo.resolve(curCommit.getRevId())); // Any ref will work here (HEAD, a sha1, tag, branch) + RevCommit parent = rw.parseCommit(commit.getParent(0).getId()); + + List diffs = df.scan(parent.getTree(), commit.getTree()); + // FOR EACH FILE + for (DiffEntry diff : diffs) { // each file change will be in seperate diff + EditList fileEdits = df.toFileHeader(diff).toEditList(); + switch (diff.getChangeType()) { + case ADD: + // old path == null, need to use new path + handleAddLinesDiff(fileEdits, fileChanges.get(diff.getNewPath())); + break; + case COPY: + // need to validate this type + handleModifyDiff(fileEdits, fileChanges.get(diff.getNewPath())); + break; + case DELETE: + // new path == null, need to use old path + handleDeleteLinesDiff(fileEdits, fileChanges.get(diff.getOldPath())); + break; + case MODIFY: + handleModifyDiff(fileEdits, fileChanges.get(diff.getNewPath())); + break; + case RENAME: + // enrich delete event with 'rename to' data + SCMChange deletedChange = fileChanges.get(diff.getOldPath()); + SCMChange newRenamedFile = fileChanges.get(diff.getNewPath()); + deletedChange.setRenamedToFile(newRenamedFile.getFile()); + // handle changes + handleModifyDiff(fileEdits, fileChanges.get(diff.getNewPath())); + break; + default: + break; + } + } + } + return scmData; + } + } + } + } + + private static Set getAddedOrEditedFiles(SCMData scmData) { + Set filesCommittedInPPR = new HashSet<>(); + for (SCMCommit curCommit : scmData.getCommits()) { + curCommit.getChanges().stream().filter(change -> !change.getType().equals("delete")).forEach(change -> filesCommittedInPPR.add(change.getFile())); + } + return filesCommittedInPPR; + } + + private static List getBlameData(Repository repo, Set files) { + BlameCommand blamer = new BlameCommand(repo); + List fileBlameList = new ArrayList<>(); + ObjectId commitID; + try { + commitID = repo.resolve(Constants.HEAD); + for (String filePath : files) { + blamer.setStartCommit(commitID); + blamer.setFilePath(filePath); + BlameResult blameResult = blamer.call(); + RawText rawText = blameResult.getResultContents(); + int fileSize = rawText.size(); + + RevisionsMap revisionsMap = new RevisionsMap(); + + if (fileSize > 0) { + String startRangeRevision = blameResult.getSourceCommit(0).getName(); + int startRange = 1; + for (int i = 1; i < fileSize; i++) { + String currentRevision = blameResult.getSourceCommit(i).getName(); + if (!currentRevision.equals(startRangeRevision)) { + LineRange range = new LineRange(startRange, i);//line numbers starting from 1 not from 0. + revisionsMap.addRangeToRevision(startRangeRevision, range); + startRange = i + 1; + startRangeRevision = currentRevision; + } + } + } + fileBlameList.add(new SCMFileBlameImpl(filePath, revisionsMap)); + } + } catch (IOException e) { + logger.error("failed to resolve repo head", e); + } catch (GitAPIException e) { + logger.error("failed to get blame result from git", e); + } + return fileBlameList; + } + + private static void handleModifyDiff(EditList fileEdits, SCMChange scmChange) { + if (scmChange != null) { + for (Edit edit : fileEdits) { + switch (edit.getType()) { + case INSERT: + scmChange.insertAddedLines(new LineRange(edit.getBeginB() + 1, edit.getEndB())); + break; + case DELETE: + scmChange.insertDeletedLines(new LineRange(edit.getBeginA() + 1, edit.getEndA())); + break; + case REPLACE: + scmChange.insertDeletedLines(new LineRange(edit.getBeginA() + 1, edit.getEndA())); + scmChange.insertAddedLines(new LineRange(edit.getBeginB() + 1, edit.getEndB())); + break; + default: + break; + } + } + } + } + + // probably it's useless to track deleted lines (inside scm change), consider removing it later. + private static void handleDeleteLinesDiff(EditList fileEdits, SCMChange scmChange) { + if (scmChange != null) { + for (Edit edit : fileEdits) { + scmChange.insertDeletedLines(new LineRange(edit.getBeginA() + 1, edit.getEndA())); + } + } + } + + private static void handleAddLinesDiff(EditList fileEdits, SCMChange scmChange) { + if (scmChange != null) { + for (Edit edit : fileEdits) { + scmChange.insertAddedLines(new LineRange(edit.getBeginB() + 1, edit.getEndB())); + } + } + } } From 9433f398b49e1c04283a9b7b3ccae9b79ceb70f0 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 28 May 2019 21:59:05 +0300 Subject: [PATCH 0907/2502] tech : CodeClimate fixed --- .../automation/tools/octane/configuration/ConfigApi.java | 1 - .../tools/octane/configuration/SDKBasedLoggerProvider.java | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigApi.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigApi.java index 5be2b20be6..ffd6f515c4 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigApi.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigApi.java @@ -41,7 +41,6 @@ import java.util.List; public class ConfigApi { - private static final Logger logger = SDKBasedLoggerProvider.getLogger(ConfigApi.class); public void doRead(StaplerRequest req, StaplerResponse res) throws ServletException, IOException { checkPermission(); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java index 7105e89f95..abf94c4dca 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java @@ -34,6 +34,9 @@ public final class SDKBasedLoggerProvider { private static volatile boolean sysParamConfigured = false; + private SDKBasedLoggerProvider(){ + //CodeClimate : Add a private constructor to hide the implicit public one. + } public static Logger getLogger(Class type) { if (!sysParamConfigured) { System.setProperty("octaneAllowedStorage", new File(Jenkins.get().getRootDir(), "userContent").getAbsolutePath() + File.separator); From 99d7e9a9e965dacdc36b4670eb5f4c17eaf07f4d Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 29 May 2019 12:41:52 +0300 Subject: [PATCH 0908/2502] tech: fixing premature logs initialization --- .../automation/tools/octane/CIJenkinsServicesImpl.java | 6 +++++- .../tools/octane/configuration/SDKBasedLoggerProvider.java | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index c8de4bf2fd..8b7e7180e1 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -115,7 +115,7 @@ public void suspendCIEvents(boolean suspend) { @Override public File getAllowedOctaneStorage() { - return new File(Jenkins.get().getRootDir(), "userContent"); + return getAllowedStorageFile(); } @Override @@ -775,6 +775,10 @@ private TopLevelItem getTopLevelItem(String jobRefId) { return item; } + public static File getAllowedStorageFile(){ + return new File(Jenkins.get().getRootDir(), "userContent"); + } + public static CIServerInfo getJenkinsServerInfo() { CIServerInfo result = dtoFactory.newDTO(CIServerInfo.class); String serverUrl = Jenkins.get().getRootUrl(); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java index abf94c4dca..cd4a9957e0 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java @@ -20,7 +20,7 @@ package com.microfocus.application.automation.tools.octane.configuration; -import jenkins.model.Jenkins; +import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -39,7 +39,7 @@ private SDKBasedLoggerProvider(){ } public static Logger getLogger(Class type) { if (!sysParamConfigured) { - System.setProperty("octaneAllowedStorage", new File(Jenkins.get().getRootDir(), "userContent").getAbsolutePath() + File.separator); + System.setProperty("octaneAllowedStorage", CIJenkinsServicesImpl.getAllowedStorageFile().getAbsolutePath() + File.separator); sysParamConfigured = true; } return LogManager.getLogger(type); From d84aa77c68fb29e2062f63ed9af032b1d2db9e46 Mon Sep 17 00:00:00 2001 From: mayar Date: Wed, 29 May 2019 17:42:05 +0300 Subject: [PATCH 0909/2502] US 717038 custom converter - support backward compatibility, fix help --- .../TestsToRunConverterBuilder.java | 16 +++++--------- .../testrunner/TestsToRunConverterModel.java | 10 ++++++--- .../help-delimiter.html | 6 +----- .../help-format.html | 21 +++++++------------ 4 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 95980d5ba6..7111c5f533 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -49,7 +49,7 @@ */ public class TestsToRunConverterBuilder extends Builder implements SimpleBuildStep { - private TestsToRunConverterModel frameworkModel; + private TestsToRunConverterModel framework; private final String TESTS_TO_RUN_PARAMETER = "testsToRun"; private final String TESTS_TO_RUN_CONVERTED_PARAMETER = "testsToRunConverted"; @@ -57,19 +57,13 @@ public class TestsToRunConverterBuilder extends Builder implements SimpleBuildSt private final String DEFAULT_EXECUTING_DIRECTORY = "${workspace}"; private final String CHECKOUT_DIRECTORY_PARAMETER = "testsToRunCheckoutDirectory"; - public TestsToRunConverterBuilder(String value) { - TestsFramework testFramework = new TestsFramework(value); - this.frameworkModel = new TestsToRunConverterModel(testFramework); - } - - public TestsToRunConverterBuilder(TestsFramework framework) { - this.frameworkModel = new TestsToRunConverterModel(framework); + public TestsToRunConverterBuilder(String framework) { + this.framework = new TestsToRunConverterModel(framework, "", ""); } @DataBoundConstructor public TestsToRunConverterBuilder(String framework, String format, String delimiter) { - TestsFramework testFramework = new TestsFramework(framework, "", format, delimiter); - this.frameworkModel = new TestsToRunConverterModel(testFramework); + this.framework = new TestsToRunConverterModel(framework, format, delimiter); } @Override @@ -144,7 +138,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu public TestsToRunConverterModel getTestsToRunConverterModel() { - return frameworkModel; + return framework; } private void printToConsole(TaskListener listener, String msg) { diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java index 062e46d03f..8a5410dfd4 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java @@ -39,7 +39,9 @@ public class TestsToRunConverterModel implements Serializable { public final static List Frameworks; - private TestsFramework framework; + private String framework; + private String format; + private String delimiter; static { List temp = new ArrayList<>(); @@ -51,12 +53,14 @@ public class TestsToRunConverterModel implements Serializable { } @DataBoundConstructor - public TestsToRunConverterModel(TestsFramework framework) { + public TestsToRunConverterModel(String framework, String format, String delimiter) { this.framework = framework; + this.format = format; + this.delimiter = delimiter; } public TestsFramework getFramework() { - return framework; + return new TestsFramework(framework, "", format, delimiter); } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html index 136b4d7127..9c5a3ecf3b 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html @@ -20,10 +20,6 @@
    The delimiter used to separate different tests during conversion to "testsToRun" parameter to the format of the selected testing framework conversion
    - For example: -
      -
    • Maven format: ,
    • -
    • Protractor format: |
    • -
    + For usage details look at help for format field
    \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html index ad424edd8d..3de6388e30 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html @@ -26,20 +26,15 @@
  • $testName - to use the test name in format
  • - For different frameworks: +
    For example:

    + testsToRun parameter received 2 tests semicolon separated: v1:MF.simple.tests|AppTest|testAlwaysFail;MF.simple.tests|App2Test|testSendGet
    + The defined format is: $package.$class#$testName
    + The defined delimiter is: ,
      -
    • Gradle format: --tests $package.$class.$testName
    • -
    • Maven format: $package.$class#$testName
    • -
    • Protractor format: $class $testName
    • +
    • $package variable will get a value: MF.simple.tests
    • +
    • $class variable will get a value: AppTest
    • +
    • $testName variable will get a value: testAlwaysFail
    - - For example:

    - testsToRun parameter has value v1:MF.simple.tests|AppTest|testAlwaysFail;MF.simple.tests|App2Test|testSendGet
    - $package is MF.simple.tests
    - $class is AppTest
    - $testName is testAlwaysFail
    - - The defined format is --tests $package.$class.$testName

    - The testsToRunConverted will get the value --tests MF.simple.tests.AppTest.testAlwaysFail --tests MF.simple.tests.App2Test.testSendGet +
    The testsToRunConverted will be equal: MF.simple.tests.AppTest#testAlwaysFail,MF.simple.tests.App2Test#testSendGet \ No newline at end of file From 23432434f4e4f1386f1b221b2588c810b5f84005 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 29 May 2019 20:56:34 +0300 Subject: [PATCH 0910/2502] US 717038 custom converter - handling correctly case of "No frameworkModel is selected" --- .../tools/octane/testrunner/TestsToRunConverterBuilder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 7111c5f533..30f117d16d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -103,12 +103,12 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu return; } - TestsFramework framework = getTestsToRunConverterModel().getFramework(); - String frameworkName = framework.getValue(); - if (StringUtils.isEmpty(frameworkName)) { + if (getTestsToRunConverterModel() == null) { printToConsole(listener, "No frameworkModel is selected. Skipping."); return; } + TestsFramework framework = getTestsToRunConverterModel().getFramework(); + String frameworkName = framework.getValue(); String frameworkFormat = framework.getFormat(); String frameworkDelimiter = framework.getDelimiter(); From 4731f45a76da49da401f7a1a1aaf8d4ec4b2f88d Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 30 May 2019 22:49:50 +0300 Subject: [PATCH 0911/2502] US 717038 custom converter - adjustments --- .../tools/model/TestsFramework.java | 89 +++++++------------ .../TestsToRunConverterBuilder.java | 37 +++++--- .../testrunner/TestsToRunConverterModel.java | 23 ++++- .../TestsToRunConverterBuilder/config.jelly | 14 +-- .../help-format.html | 8 +- 5 files changed, 89 insertions(+), 82 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/TestsFramework.java b/src/main/java/com/microfocus/application/automation/tools/model/TestsFramework.java index 5c6b0e98a4..d9b26a1dcd 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/TestsFramework.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/TestsFramework.java @@ -20,62 +20,41 @@ package com.microfocus.application.automation.tools.model; -import com.hp.octane.integrations.executor.TestsToRunConverter; -import org.apache.commons.collections.map.HashedMap; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - public class TestsFramework { - private String description; - private String value; - private String format; - private String delimiter; - - public TestsFramework(String value) { - this.value = value; - this.description = ""; - this.format = ""; - this.delimiter = ""; - } - - public TestsFramework(String value, String description, String format, String delimiter) { - this.value = value; - this.description = description; - this.format = format; - this.delimiter = delimiter; - } - - public String getDescription() { - return description; - } - - public String getValue() { - return value; - } - - public String getFormat() { return format; } - - public String getDelimiter() { return delimiter; } - - public Map getProperties() { - Map properties = new HashMap(); - - setProperty(properties, TestsToRunConverter.CONVERTER_FORMAT, this.format); - setProperty(properties, TestsToRunConverter.CONVERTER_DELIMITER, this.delimiter); - - return properties; - } + private String description; + private String name; + private String format; + private String delimiter; + + public TestsFramework() { + this.name = ""; + this.description = ""; + this.format = ""; + this.delimiter = ""; + } + + public TestsFramework(String name, String description, String format, String delimiter) { + this.name = name; + this.description = description; + this.format = format; + this.delimiter = delimiter; + } + + public String getDescription() { + return description; + } + + public String getName() { + return name; + } + + public String getFormat() { + return format; + } + + public String getDelimiter() { + return delimiter; + } - private void setProperty(Map map, String key, String value) { - if (map.containsKey(key)) { - map.replace(key, value); - } - else { - map.put(key, value); - } - } } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 30f117d16d..b6451be6ff 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -21,6 +21,7 @@ package com.microfocus.application.automation.tools.octane.testrunner; +import com.hp.octane.integrations.executor.TestsToRunConverter; import com.hp.octane.integrations.executor.TestsToRunConverterResult; import com.hp.octane.integrations.executor.TestsToRunConvertersFactory; import com.hp.octane.integrations.executor.TestsToRunFramework; @@ -42,14 +43,16 @@ import javax.annotation.Nonnull; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Builder for available frameworks for converting */ public class TestsToRunConverterBuilder extends Builder implements SimpleBuildStep { - private TestsToRunConverterModel framework; + private TestsToRunConverterModel model; private final String TESTS_TO_RUN_PARAMETER = "testsToRun"; private final String TESTS_TO_RUN_CONVERTED_PARAMETER = "testsToRunConverted"; @@ -57,13 +60,13 @@ public class TestsToRunConverterBuilder extends Builder implements SimpleBuildSt private final String DEFAULT_EXECUTING_DIRECTORY = "${workspace}"; private final String CHECKOUT_DIRECTORY_PARAMETER = "testsToRunCheckoutDirectory"; - public TestsToRunConverterBuilder(String framework) { - this.framework = new TestsToRunConverterModel(framework, "", ""); + public TestsToRunConverterBuilder(String model) { + this.model = new TestsToRunConverterModel(model, "", ""); } @DataBoundConstructor public TestsToRunConverterBuilder(String framework, String format, String delimiter) { - this.framework = new TestsToRunConverterModel(framework, format, delimiter); + this.model = new TestsToRunConverterModel(framework, format, delimiter); } @Override @@ -103,15 +106,13 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu return; } - if (getTestsToRunConverterModel() == null) { + if (model == null || SdkStringUtils.isEmpty(model.getName())) { printToConsole(listener, "No frameworkModel is selected. Skipping."); return; } - TestsFramework framework = getTestsToRunConverterModel().getFramework(); - String frameworkName = framework.getValue(); - - String frameworkFormat = framework.getFormat(); - String frameworkDelimiter = framework.getDelimiter(); + String frameworkName = model.getName(); + String frameworkFormat = model.getFormat(); + String frameworkDelimiter = model.getDelimiter(); printToConsole(listener, "Selected framework = " + frameworkName); if (SdkStringUtils.isNotEmpty(frameworkFormat)) { printToConsole(listener, "Using format = " + frameworkFormat); @@ -120,7 +121,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(frameworkName); TestsToRunConverterResult convertResult = TestsToRunConvertersFactory.createConverter(testsToRunFramework) - .setProperties(framework.getProperties()) + .setProperties(this.getProperties()) .convert(rawTests, executingDirectory); printToConsole(listener, "Found #tests : " + convertResult.getTestsData().size()); printToConsole(listener, TESTS_TO_RUN_CONVERTED_PARAMETER + " = " + convertResult.getConvertedTestsString()); @@ -136,9 +137,21 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } } + public Map getProperties() { + Map properties = new HashMap(); + + properties.put(TestsToRunConverter.CONVERTER_FORMAT, model.getFormat()); + properties.put(TestsToRunConverter.CONVERTER_DELIMITER, model.getDelimiter()); + + return properties; + } + /*** + * Used in UI + * @return + */ public TestsToRunConverterModel getTestsToRunConverterModel() { - return framework; + return model; } private void printToConsole(TaskListener listener, String msg) { diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java index 8a5410dfd4..28e4bab7c5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterModel.java @@ -21,7 +21,9 @@ package com.microfocus.application.automation.tools.octane.testrunner; import com.hp.octane.integrations.executor.TestsToRunFramework; +import com.hp.octane.integrations.utils.SdkStringUtils; import com.microfocus.application.automation.tools.model.TestsFramework; +import org.apache.http.annotation.Obsolete; import org.kohsuke.stapler.DataBoundConstructor; import java.io.Serializable; @@ -39,7 +41,9 @@ public class TestsToRunConverterModel implements Serializable { public final static List Frameworks; - private String framework; + @Obsolete + private String model;//remainders from version 5.7 + private String name; private String format; private String delimiter; @@ -53,16 +57,27 @@ public class TestsToRunConverterModel implements Serializable { } @DataBoundConstructor - public TestsToRunConverterModel(String framework, String format, String delimiter) { - this.framework = framework; + public TestsToRunConverterModel(String name, String format, String delimiter) { + this.name = name; this.format = format; this.delimiter = delimiter; } public TestsFramework getFramework() { - return new TestsFramework(framework, "", format, delimiter); + return new TestsFramework(getName(), "", format, delimiter); } + public String getName() { + return SdkStringUtils.isEmpty(name) ? model : name; + } + + public String getFormat() { + return format; + } + + public String getDelimiter() { + return delimiter; + } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly index 51aaad3634..f723b6c256 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly @@ -25,7 +25,7 @@
    - + From e60d1d4726499afde1c25bf36afa4b1773c466da Mon Sep 17 00:00:00 2001 From: noamdoron Date: Mon, 2 Jul 2018 08:58:33 +0300 Subject: [PATCH 0365/2502] - Completed US# 160188 [Jenkins Plugin] Test connection in SRF common settings should validate client's id and secret (Reviewed by: Idan V) - Completed US# 151039 [Jenkins Plugin] Update Views Settings Help Description (Reviewed by: Idan V) - Fixed defect #146010 String fixes in Jenkins plugin - including rebranding (Reviewed by: Idan V) - Fixed defect #17871 [Jenkins Plugin] > Failed to present report in Jenkins (Reviewed by: Idan V) - Fixed review rejects --- pom.xml | 105 +++++++++++++++--- .../tools/results/SrfResultsReport.java | 39 ++----- .../settings/SrfServerSettingsBuilder.java | 58 ++++------ .../tools/srf/model/SrfScriptRunModel.java | 6 +- .../srf/results/SrfResultFileWriter.java | 6 +- .../tools/srf/run/RunFromSrfBuilder.java | 41 ++----- .../utilities/HttpCodeErrorClassifier.java | 2 +- .../tools/srf/utilities/SrfClient.java | 68 ++++++++++-- .../tools/srf/utilities/SrfStepsHtmlUtil.java | 4 +- .../tools/srf/utilities/SrfTrustManager.java | 74 ++++++++++++ .../SrfServerSettingsBuilder/global.jelly | 10 +- .../help-srfAppName.html | 37 ++++++ .../help-srfSecretName.html | 37 ++++++ .../help-srfServerName.html | 38 +++++++ .../help-srfTunnelPath.html | 39 +++++++ .../srf/run/CreateTunnelBuilder/config.jelly | 15 +-- .../srf/run/RunFromSrfBuilder/config.jelly | 14 +-- .../hudson/tasks/junit/TestResult/body.jelly | 6 +- 18 files changed, 436 insertions(+), 163 deletions(-) create mode 100644 src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html diff --git a/pom.xml b/pom.xml index 40c2f5e146..40b0b37eef 100644 --- a/pom.xml +++ b/pom.xml @@ -61,9 +61,9 @@ Release 1.642.4 2.2 - false - 1.8 - 1.8 + true + 1.8 + 1.8 @@ -84,7 +84,7 @@ https://github.com/jenkinsci/hpe-application-automation-tools-plugin HEAD - + JIRA @@ -322,18 +322,91 @@ - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.16 - - - org.codehaus.mojo.signature - java18 - 1.0 - - - + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + org.codehaus.mojo + animal-sniffer-maven-plugin + 1.16 + + + + check + + check + + + + + org.codehaus.mojo.signature + java18 + + + diff --git a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java index 2ecb410494..3661e2ded7 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/SrfResultsReport.java @@ -146,6 +146,10 @@ public SrfTestResultAction(AbstractBuild owner, TestResult result, BuildListener _result=result; } + public String getSuiteId(TestResult testResult, int suiteIndex) { + return ((SuiteResult) ((ArrayList) testResult.getSuites()).get(suiteIndex)).getId(); + } + public SrfScriptRunModel[] getScriptRuns(ClassResult classResult) { JSONArray scriptRunsJson = null; ArrayList scriptRuns = new ArrayList<>(); @@ -167,8 +171,8 @@ public SrfScriptRunModel[] getScriptRuns(ClassResult classResult) { return null; String name = jTest.getString("name").toLowerCase(); - - if(name.compareTo(testName) == 0) { + String normalizedName = SrfScriptRunModel.normalizeName(name); + if(normalizedName.compareTo(testName) == 0) { scriptRunsJson = jTest.getJSONArray("scriptRuns"); break; } @@ -365,34 +369,6 @@ public void checkRoles(RoleChecker arg0) throws SecurityException { build.getActions().add(action); - /* try { - archiveTestsReport(build, listener, fileSystemResultNames, result); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - File artifactsDir = build.getArtifactsDir(); - if (artifactsDir.exists()) { - File reportDirectory = new File(artifactsDir.getParent(), PERFORMANCE_REPORT_FOLDER); - if (reportDirectory.exists()) { - File htmlIndexFile = new File(reportDirectory, INDEX_HTML_NAME); - if (htmlIndexFile.exists()) - build.getActions().add(new PerformanceReportAction(build)); - } - - File summaryDirectory = new File(artifactsDir.getParent(), TRANSACTION_SUMMARY_FOLDER); - if (summaryDirectory.exists()) { - File htmlIndexFile = new File(summaryDirectory, INDEX_HTML_NAME); - if (htmlIndexFile.exists()) - build.getActions().add(new TransactionSummaryAction(build)); - } - }*/ - - // get the artifacts directory where we will upload the zipped report // folder @@ -469,8 +445,7 @@ public DescriptorImpl() { @Override public String getDisplayName() { - - return "Publish HPE SRF Test Results"; + return "Publish SRF test results"; } @Override diff --git a/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java index da9438510e..12f613327b 100644 --- a/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder.java @@ -33,8 +33,9 @@ package com.hpe.application.automation.tools.settings; -import com.hpe.application.automation.tools.srf.model.SrfException; import com.hpe.application.automation.tools.srf.model.SrfServerSettingsModel; +import com.hpe.application.automation.tools.srf.utilities.SrfClient; +import com.hpe.application.automation.tools.srf.utilities.SrfTrustManager; import hudson.CopyOnWrite; import hudson.Extension; import hudson.model.AbstractProject; @@ -42,16 +43,20 @@ import hudson.tasks.Builder; import hudson.util.FormValidation; import net.sf.json.JSONObject; +import org.apache.commons.httpclient.auth.AuthenticationException; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.bind.JavaScriptMethod; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLSocketFactory; import javax.servlet.ServletException; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.net.*; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; /** * Created by shepshel on 20/07/2016. @@ -182,44 +187,27 @@ public FormValidation doTestConnection(@QueryParameter("srfServerName") final St @QueryParameter("srfProxyName") final String srfProxyName, @QueryParameter("srfAppName") final String srfAppName, @QueryParameter("srfSecretName") final String srfSecretName) throws IOException, ServletException { - - HttpURLConnection connection; - BufferedReader in = null; - try { - URL url = new URL(srfServer.concat("/health/ready")); - if (srfProxyName != null && !srfProxyName.isEmpty()) { - URL proxyUrl = new URL(srfProxyName); - Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort())); - connection = (HttpURLConnection) url.openConnection(proxy); - } else { - connection = (HttpURLConnection) url.openConnection(); - } - - connection.setRequestMethod("GET"); - int responseCode = connection.getResponseCode(); - - in = new BufferedReader( - new InputStreamReader(connection.getInputStream())); - String inputLine; - StringBuffer response = new StringBuffer(); - - while ((inputLine = in.readLine()) != null) { - response.append(inputLine); - } - - if (responseCode >= 300) - throw new SrfException("Received response code of: " + responseCode); - - return FormValidation.ok("Success"); + SSLContext sslContext = SSLContext.getInstance("TLS"); + SrfTrustManager _trustMgr = new SrfTrustManager(); + sslContext.init(null, new SrfTrustManager[]{_trustMgr}, null); + SSLContext.setDefault(sslContext); + SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); + SrfClient srfClient = new SrfClient(srfServer, sslSocketFactory , new URL(srfProxyName)); + srfClient.login(srfAppName, srfSecretName); + } catch (KeyManagementException | NoSuchAlgorithmException e) { + return FormValidation.error("Connection error : connection initialization error " + e.getMessage()); } catch (UnknownHostException e) { return FormValidation.error("Connection error : Unknown host " + e.getMessage()); + } catch (AuthenticationException e) { + return FormValidation.error("Authentication error: " + e.getMessage()); + } catch (SSLHandshakeException e) { + return FormValidation.error("Connection error : " + e.getMessage() + " (Could be a proxy issue)"); } catch (Exception e) { return FormValidation.error("Connection error : " + e.getMessage()); - } finally { - if (in != null) - in.close(); } + + return FormValidation.ok("Success"); } @JavaScriptMethod diff --git a/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java b/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java index 5c0aefef59..9dcd2f57e0 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/model/SrfScriptRunModel.java @@ -74,10 +74,14 @@ public String getFullName() { } public String getLinkName() { - String normalizedScriptRunName = this.name.replaceAll("[\\.|\\-|\\s|\\+]","_"); + String normalizedScriptRunName = SrfScriptRunModel.normalizeName(this.name); return String.format("%s_%s", normalizedScriptRunName, this.yac); } + public static String normalizeName(String name) { + return name.replaceAll("[\\.|\\-|\\s|\\+]","_"); + } + public class NameVersion { public String name; public String version; diff --git a/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java b/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java index cccc01b714..c9f4fa9eb6 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/results/SrfResultFileWriter.java @@ -34,6 +34,7 @@ package com.hpe.application.automation.tools.srf.results; import com.hpe.application.automation.tools.srf.model.SrfException; +import com.hpe.application.automation.tools.srf.model.SrfScriptRunModel; import com.hpe.application.automation.tools.srf.utilities.SrfStepsHtmlUtil; import hudson.model.AbstractBuild; import hudson.model.Result; @@ -201,13 +202,12 @@ private static Element createTestSuite(JSONObject test, Document doc) throws Srf testSuite.setAttribute("time", String.format("%1d.0",duration_i )); String testRunYac = test.getString("yac"); testSuite.setAttribute("yac", testRunYac); - testSuite.setAttribute("id", testRunYac); - String name = test.getString("name"); + testSuite.setAttribute("id", String.format("%s_%s", name, testRunYac)); + testSuite.setAttribute("name", SrfScriptRunModel.normalizeName(name)); JSONArray scriptRuns = (JSONArray) (test.get("scriptRuns")); int scriptCnt = scriptRuns.size(); - testSuite.setAttribute("name", name); testSuite.setAttribute("timestamp", timestamp); testSuite.setAttribute("tests", String.format("%1d", scriptCnt)); //root.appendChild(testSuite); diff --git a/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java b/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java index a8f0c8dec6..9d7a2d3bc9 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder.java @@ -36,6 +36,7 @@ import com.hpe.application.automation.tools.settings.SrfServerSettingsBuilder; import com.hpe.application.automation.tools.srf.results.SrfResultFileWriter; import com.hpe.application.automation.tools.srf.utilities.SrfClient; +import com.hpe.application.automation.tools.srf.utilities.SrfTrustManager; import com.hpe.application.automation.tools.srf.utilities.SseEventListener; import groovy.transform.Synchronized; import hudson.Extension; @@ -619,7 +620,11 @@ public boolean perform(final AbstractBuild build, final Launcher launcher, if (!jobIds.isEmpty()) { for (int i = 0; i < jobIds.size(); i++) { String jobId = jobIds.get(i).toString(); - srfClient.cancelJob(jobId.toString()); + try { + srfClient.cancelJob(jobId); + } catch (SrfException e1) { + e1.printStackTrace(); + } } } @@ -648,38 +653,6 @@ private void cleanUp() { } } - static class SrfTrustManager extends X509ExtendedTrustManager implements X509TrustManager { - - @Override - public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { - // Empty body - } - @Override - public void checkClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { - // Empty body - } - @Override - public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { - // Empty body - } - @Override - public void checkServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { - // Empty body - } - @Override - public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { - // Empty body - } - @Override - public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { - // Empty body - } - - @Override - public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[0]; - } - } @Extension // This indicates to Jenkins that this is an implementation of an extension @@ -696,7 +669,7 @@ public boolean isApplicable(Class aClass) { @Override public String getDisplayName() { - return "Execute tests by SRF"; + return "Execute SRF tests"; } public SrfServerSettingsModel[] getSrfServers() { diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java index 73d80bbedf..04a7592c28 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/HttpCodeErrorClassifier.java @@ -49,7 +49,7 @@ public static void throwError(int statusCode, String responseMessage) throws IOE systemLogger.fine(String.format("Received http status code %d with response message %s", statusCode, responseMessage)); switch (statusCode) { - case 401: throw new AuthenticationException("Login required, possibly wrong credentials supplied"); + case 401: throw new AuthenticationException("Failed to login, possibly wrong credentials supplied"); case 403: throw new AuthorizationException("Operation is forbidden"); default: JSONObject srfError = JSONObject.fromObject(responseMessage); diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java index 45035685ed..e127762939 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfClient.java @@ -43,11 +43,11 @@ import org.apache.http.impl.client.HttpClients; import org.apache.maven.wagon.authorization.AuthorizationException; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.*; import java.io.*; import java.net.*; import java.text.MessageFormat; +import java.util.Properties; import java.util.logging.Logger; public class SrfClient { @@ -61,14 +61,32 @@ public class SrfClient { private String tenantId; private static final Logger systemLogger = Logger.getLogger(SrfClient.class.getName()); - public SrfClient(String srfServerAddress, String tenantId, SSLSocketFactory sslSocketFactory, URL proxyUrl) { + public SrfClient(String srfServerAddress, SSLSocketFactory sslSocketFactory, URL proxyUrl) { this.srfServerAddress = srfServerAddress; - this.tenantId = tenantId; httpclient = HttpClients.createDefault(); this.sslSocketFactory = sslSocketFactory; this.proxyHost = proxyUrl != null ? new HttpHost(proxyUrl.getHost(), proxyUrl.getPort()) : null; + + Properties systemProperties = System.getProperties(); + systemProperties.setProperty("https.proxyHost", proxyHost.getHostName()); + systemProperties.setProperty("http.proxyHost", proxyHost.getHostName()); + systemProperties.setProperty("https.proxyPort", String.valueOf(proxyHost.getPort())); + systemProperties.setProperty("http.proxyPort", String.valueOf(proxyHost.getPort())); + } + + public SrfClient(String srfServerAddress, String tenantId, SSLSocketFactory sslSocketFactory, URL proxyUrl) { + this(srfServerAddress, sslSocketFactory, proxyUrl); + this.tenantId = tenantId; } + /** + * SRF login with client's ID and secret, generated from SRF admin page + * @param clientId + * @param clientSecret + * @throws AuthorizationException + * @throws IOException + * @throws SrfException + */ public void login(String clientId, String clientSecret) throws AuthorizationException, IOException, SrfException { systemLogger.info(String.format("Logging with client's id: %s into %s", clientId, srfServerAddress)); String authorizationsAddress = srfServerAddress.concat("/rest/security/public/v2/authorizations/access-tokens"); @@ -81,6 +99,7 @@ public void login(String clientId, String clientSecret) throws AuthorizationExce JSONObject accessKeys = JSONObject.fromObject(response); accessToken = accessKeys.getString("accessToken"); workspaceId = accessKeys.getString("workspaceId"); + // tenantId = accessKeys.getString("tenantId"); wait till 1.61 is out if (accessToken == null || accessToken.isEmpty() || workspaceId == null || workspaceId.isEmpty()) { throw new SrfException(String.format("Received invalid access keys: access token %s ,workspace id %s", accessToken, workspaceId)); @@ -89,6 +108,14 @@ public void login(String clientId, String clientSecret) throws AuthorizationExce } + /** + * Execute SRF tests via test id or tags + * @param requestBody + * @return Jobs array + * @throws AuthorizationException + * @throws IOException + * @throws SrfException + */ public JSONArray executeTestsSet(JSONObject requestBody) throws AuthorizationException, IOException, SrfException { systemLogger.fine(String.format("executing %s", srfServerAddress)); String executionAddress = getAuthenticatedSrfApiAddress("/rest/jobmanager/v1/workspaces/%s/execution/jobs"); @@ -97,7 +124,7 @@ public JSONArray executeTestsSet(JSONObject requestBody) throws AuthorizationExc return JSONObject.fromObject(response).getJSONArray("jobs"); } - public void cancelJob(String jobId) { + public void cancelJob(String jobId) throws SrfException { systemLogger.fine(String.format("Cancelling job id: %s", jobId)); String jobCancelAddress = getAuthenticatedSrfApiAddress("/rest/jobmanager/v1/workspaces/%s/execution/jobs/{0}", new String[]{jobId}); @@ -110,6 +137,14 @@ public void cancelJob(String jobId) { } + /** + * Retrieve SRF test runs + * @param jobIds + * @return TestRuns array + * @throws AuthorizationException + * @throws IOException + * @throws SrfException + */ public JSONArray getTestRuns(JSONArray jobIds) throws AuthorizationException, IOException, SrfException { JSONArray testRuns = new JSONArray(); for (int i = 0; i < jobIds.size(); i++) { @@ -120,6 +155,14 @@ public JSONArray getTestRuns(JSONArray jobIds) throws AuthorizationException, IO return testRuns; } + /** + * Retrieve SRF test run + * @param jobId + * @return Test run + * @throws IOException + * @throws AuthorizationException + * @throws SrfException + */ public JSONArray getTestRun(String jobId) throws IOException, AuthorizationException, SrfException { String testRunAddress = getAuthenticatedSrfApiAddress("/rest/test-manager/workspaces/%s/test-runs") .concat(String.format("&id=%s&include=resource,script-runs,script-steps", jobId)); @@ -159,7 +202,7 @@ private String sendRequest(URL url, HttpMethod method) throws IOException, SrfEx return response.toString(); } - private String sendPostRequest(URL url, JSONObject body) throws IOException, SrfException, AuthorizationException { + private String sendPostRequest(URL url, JSONObject body) throws IOException, SrfException, AuthorizationException { OutputStreamWriter writer = null; OutputStream out = null; BufferedReader bufferedReader = null; @@ -201,21 +244,24 @@ private String sendPostRequest(URL url, JSONObject body) throws IOException, Srf } catch (Exception e) { throw e; } finally { - out.close(); - writer.close(); - bufferedReader.close(); + if (out != null) out.close(); + if (writer != null) writer.close(); + if (bufferedReader != null) bufferedReader.close(); } return response.toString(); } - private String getAuthenticatedSrfApiAddress(String path) { + private String getAuthenticatedSrfApiAddress(String path) throws SrfException { + if (tenantId == null || tenantId.isEmpty()) { + throw new SrfException("Tenant id is null or empty"); + } return srfServerAddress .concat(String.format(path, workspaceId)) .concat(String.format("?access-token=%s&TENANTID=%s", accessToken, tenantId)); } - private String getAuthenticatedSrfApiAddress(String path, String[] pathParams) { + private String getAuthenticatedSrfApiAddress(String path, String[] pathParams) throws SrfException { String parametizesUrl = MessageFormat.format(path, pathParams); return getAuthenticatedSrfApiAddress(parametizesUrl); } diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java index ab358055c7..62691d03c0 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java @@ -168,11 +168,11 @@ private static void handleStepRole(StringBuilder htmlSteps, JSONObject step, int } } - private static String getStepDescription(JSONObject step, int k) { + private static String getStepDescription(JSONObject step, int stepIndex) { String stepDescription = step.getString("description"); if (stepDescription == null || stepDescription.isEmpty()) { String scriptRunId = step.getString("scriptRunId"); - systemLogger.warning(String.format("Received step with no description, step index: %d, script run id: %s", k, scriptRunId)); + systemLogger.warning(String.format("Received step with no description, step index: %d, script run id: %s", stepIndex, scriptRunId)); return "Missing step description"; } return stepDescription; diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java new file mode 100644 index 0000000000..4abfbd85a9 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java @@ -0,0 +1,74 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ +package com.hpe.application.automation.tools.srf.utilities; + +import javax.net.ssl.SSLEngine; +import javax.net.ssl.X509ExtendedTrustManager; +import javax.net.ssl.X509TrustManager; +import java.net.Socket; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +public class SrfTrustManager extends X509ExtendedTrustManager implements X509TrustManager { + + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { + // Empty body + } + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { + // Empty body + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine engine) throws CertificateException { + // Empty body + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { + // Empty body + } + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + // Empty body + } + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + // Empty body + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + +} diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly index 9a5a4fd0c3..4cb6a9dd88 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/global.jelly @@ -111,23 +111,23 @@ - + - + - + - + - + diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html new file mode 100644 index 0000000000..a5044edbf5 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfAppName.html @@ -0,0 +1,37 @@ + + +
    + Use an SRF client ID and secret to access SRF remotely. + For more details, see the SRF Help Center. +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html new file mode 100644 index 0000000000..a5044edbf5 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfSecretName.html @@ -0,0 +1,37 @@ + + +
    + Use an SRF client ID and secret to access SRF remotely. + For more details, see the SRF Help Center. +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html new file mode 100644 index 0000000000..04908cc3d1 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfServerName.html @@ -0,0 +1,38 @@ + + +
    + Use one of the following URLs:
    + AMS: https://ftaas.saas.hpe.com
    + EMEA: https://ftaas-eu1.saas.hpe.com +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html new file mode 100644 index 0000000000..8f0326b194 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/settings/SrfServerSettingsBuilder/help-srfTunnelPath.html @@ -0,0 +1,39 @@ + + +
    + SRF tunnels enable you to open secure connections between SRF and apps stored locally, or behind a corporate firewall.
    + Enter the path to your tunnel client with the syntax used in the following example:
    + /var/tunnelClient/ftaas
    + For more details, see the SRF Help Center +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly index dafa80cd7a..5d92da461f 100644 --- a/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/srf/run/CreateTunnelBuilder/config.jelly @@ -33,19 +33,8 @@ - - + - + diff --git a/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly index 758eba97a4..5dc55b41fc 100644 --- a/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/srf/run/RunFromSrfBuilder/config.jelly @@ -45,26 +45,26 @@ - + - + - + - + - + - + - + diff --git a/src/main/resources/hudson/tasks/junit/TestResult/body.jelly b/src/main/resources/hudson/tasks/junit/TestResult/body.jelly index 9fbc7dfa28..c4a597deef 100644 --- a/src/main/resources/hudson/tasks/junit/TestResult/body.jelly +++ b/src/main/resources/hudson/tasks/junit/TestResult/body.jelly @@ -59,7 +59,7 @@ -

    ${%All Tests}

    +

    ${%All SRF Tests}

    @@ -87,13 +87,13 @@ - +
    - + From 51ca4f2d49b6f7fb24a7bad259514b2d949b4f5b Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Tue, 3 Jul 2018 13:31:46 +0300 Subject: [PATCH 0366/2502] Implement rebranding for every product It is no longer required that each product will implement the rebranding to retain backward compatibility after package name change. --- .../tools/common/CompatibilityRebrander.java | 98 ++++++++++++++++++- .../tools/run/RunFromFileBuilder.java | 9 -- 2 files changed, 93 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java index 36bb61b9e5..214e460560 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java +++ b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java @@ -1,10 +1,18 @@ package com.hpe.application.automation.tools.common; +import hudson.init.InitMilestone; +import hudson.init.Initializer; import hudson.model.Items; import hudson.model.Run; import javax.annotation.Nonnull; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; import java.util.logging.Logger; /** @@ -23,6 +31,7 @@ public class CompatibilityRebrander { private final static String COM_HPE = "com.hpe"; private final static String COM_HP = "com.hp"; private final static String COM_MICROFOCUS = "com.microfocus"; + private final static String PACKAGE_NAME = "com.microfocus.application.automation.tools"; private final static Logger LOG = Logger.getLogger(CompatibilityRebrander.class.getName()); /** @@ -36,14 +45,15 @@ public class CompatibilityRebrander { * @see hudson.model.Run#XSTREAM2 * @since 5.5 */ - public static void addAliases(@Nonnull Class newClass) { + + + private static void addAliases(@Nonnull Class newClass) { String newClassName = newClass.toString().replaceFirst("class ", ""); String oldHpeClassName = newClassName.replaceFirst(COM_MICROFOCUS, COM_HPE); String oldHpClassName = newClassName.replaceFirst(COM_MICROFOCUS, COM_HP); - LOG.info("Starting the rebranding aliasing"); - addAliasesForSingleClass(newClass, oldHpClassName, COM_HP); - addAliasesForSingleClass(newClass, oldHpeClassName, COM_HPE); + invokeXstreamCompatibilityAlias(newClass, oldHpClassName); + invokeXstreamCompatibilityAlias(newClass, oldHpeClassName); } /** @@ -58,7 +68,6 @@ private static void addAliasesForSingleClass(@Nonnull Class newClass, String old * invokeXstreamCompatibilityAlias invokes the XSTREAM2 functions required for the rebranding */ private static void invokeXstreamCompatibilityAlias(@Nonnull Class newClass, String oldClassName) { - LOG.info(String.format("Adding alias from %s to %s", oldClassName, newClass)); Items.XSTREAM2.addCompatibilityAlias(oldClassName, newClass); Run.XSTREAM2.addCompatibilityAlias(oldClassName, newClass); } @@ -71,4 +80,83 @@ private static void handleReceivedWrongParameters(@Nonnull Class newClass, Strin if (!oldClassName.contains(beforeBrand)) LOG.warning(String.format("The %s class name doesn't contain: %s class name", newClass.toString(), beforeBrand)); } + + /** + * Scans all classes accessible from the context class loader which belong to the given package and subpackages. + * + * @param packageName The base package + * @return The classes + * @throws ClassNotFoundException + * @throws IOException + */ + + private static Class[] getClasses(String packageName) throws ClassNotFoundException, IOException { + Thread thread = Thread.currentThread(); + ClassLoader tempClassLoader = thread.getContextClassLoader(); + assert tempClassLoader != null; + thread.setContextClassLoader(CompatibilityRebrander.class.getClassLoader()); + ClassLoader classLoader = thread.getContextClassLoader(); + String path = packageName.replace('.', '/'); + Enumeration resources = classLoader.getResources(path); + List dirs = new ArrayList(); + + while (resources.hasMoreElements()) { + URL resource = (URL) resources.nextElement(); + dirs.add(new File(resource.getFile())); + } + ArrayList classes = new ArrayList(); + + for (Object directory : dirs) { + classes.addAll(findClasses((File)directory, packageName)); + } + return (Class[]) classes.toArray(new Class[classes.size()]); + } + + /** + * Recursive method used to find all classes in a given directory and subdirs. + * + * @param directory The base directory + * @param packageName The package name for classes found inside the base directory + * @return The classes + * @throws ClassNotFoundException + */ + + private static List findClasses(File directory, String packageName) throws ClassNotFoundException { + List classes = new ArrayList(); + + if (!directory.exists()) { + return classes; + } + File[] files = directory.listFiles(); + + for (File file : files) { + if (file.isDirectory()) { + assert !file.getName().contains("."); + classes.addAll(findClasses(file, packageName + "." + file.getName())); + + } else if (file.getName().endsWith(".class")) { + classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6))); + } + } + + return classes; + } + + /** + * This function hooks to the Jenkins milestone when the plugins are prepared to load + * And adds aliases for all package found classes + */ + @Initializer(before = InitMilestone.PLUGINS_PREPARED) + public static void addAliasesToAllClasses() { + LOG.info("Adding alias for in old package names to add backward compatibility"); + try { + Class[] classes = getClasses(PACKAGE_NAME); + for (Class c: classes) { + addAliases(c); + } + } + catch(ClassNotFoundException | IOException e) { + LOG.warning(e.getMessage()); + } + } } \ No newline at end of file diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 7d8bcac23d..2b64fb479f 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -631,15 +631,6 @@ public boolean isApplicable( return true; } - /** - * The function needs to be used in every the inner class of the describable which extends any kind of descriptor - * For example: BuildStepDescriptor - */ - @Initializer(before = InitMilestone.PLUGINS_STARTED) - public static void addAliases() { - CompatibilityRebrander.addAliases(RunFromFileBuilder.class); - } - /** * Gets job id. * If there is already a job created by jenkins plugin, and exists then return this job id, From 7466fc9944e9c3b047d76ea8a08a8a6c21f73397 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Tue, 3 Jul 2018 13:50:17 +0300 Subject: [PATCH 0367/2502] Modify to comply with SonarLint With minor documentation change --- .../tools/common/CompatibilityRebrander.java | 70 +++++++------------ 1 file changed, 25 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java index 214e460560..129cbf3d7e 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java +++ b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java @@ -24,15 +24,34 @@ * Important note to mention is this class will only work after: *
      *
    • Package path is renamed from the old brand to the new one - *
    • Only the various Descriptors (e.g. BuildStepDescriptor) use this function *
    */ public class CompatibilityRebrander { - private final static String COM_HPE = "com.hpe"; - private final static String COM_HP = "com.hp"; - private final static String COM_MICROFOCUS = "com.microfocus"; - private final static String PACKAGE_NAME = "com.microfocus.application.automation.tools"; - private final static Logger LOG = Logger.getLogger(CompatibilityRebrander.class.getName()); + private static final String COM_HPE = "com.hpe"; + private static final String COM_HP = "com.hp"; + private static final String COM_MICROFOCUS = "com.microfocus"; + private static final String PACKAGE_NAME = "com.microfocus.application.automation.tools"; + private static final Logger LOG = Logger.getLogger(CompatibilityRebrander.class.getName()); + + private CompatibilityRebrander() {} + + /** + * This function hooks to the Jenkins milestone when the plugins are prepared to load + * And adds aliases for all package found classes + */ + @Initializer(before = InitMilestone.PLUGINS_PREPARED) + public static void addAliasesToAllClasses() { + LOG.info("Adding alias for in old package names to add backward compatibility"); + try { + Class[] classes = getClasses(PACKAGE_NAME); + for (Class c: classes) { + addAliases(c); + } + } + catch(ClassNotFoundException | IOException e) { + LOG.warning(e.getMessage()); + } + } /** * addAliases is the actual function who does the rebranding part for all the old package names @@ -45,8 +64,6 @@ public class CompatibilityRebrander { * @see hudson.model.Run#XSTREAM2 * @since 5.5 */ - - private static void addAliases(@Nonnull Class newClass) { String newClassName = newClass.toString().replaceFirst("class ", ""); String oldHpeClassName = newClassName.replaceFirst(COM_MICROFOCUS, COM_HPE); @@ -56,14 +73,6 @@ private static void addAliases(@Nonnull Class newClass) { invokeXstreamCompatibilityAlias(newClass, oldHpeClassName); } - /** - * addAliasesForSingleClass responsible for handling the rebranding for a single class - */ - private static void addAliasesForSingleClass(@Nonnull Class newClass, String oldClassName, String beforeBrand) { - handleReceivedWrongParameters(newClass, oldClassName, beforeBrand); - invokeXstreamCompatibilityAlias(newClass, oldClassName); - } - /** * invokeXstreamCompatibilityAlias invokes the XSTREAM2 functions required for the rebranding */ @@ -72,15 +81,6 @@ private static void invokeXstreamCompatibilityAlias(@Nonnull Class newClass, Str Run.XSTREAM2.addCompatibilityAlias(oldClassName, newClass); } - /** - * handleReceivedWrongParameters logs a warning when the passed newClass doesn't contain any of the package names - * we trying to add alias to - */ - private static void handleReceivedWrongParameters(@Nonnull Class newClass, String oldClassName, String beforeBrand) { - if (!oldClassName.contains(beforeBrand)) - LOG.warning(String.format("The %s class name doesn't contain: %s class name", newClass.toString(), beforeBrand)); - } - /** * Scans all classes accessible from the context class loader which belong to the given package and subpackages. * @@ -89,7 +89,6 @@ private static void handleReceivedWrongParameters(@Nonnull Class newClass, Strin * @throws ClassNotFoundException * @throws IOException */ - private static Class[] getClasses(String packageName) throws ClassNotFoundException, IOException { Thread thread = Thread.currentThread(); ClassLoader tempClassLoader = thread.getContextClassLoader(); @@ -120,7 +119,6 @@ private static Class[] getClasses(String packageName) throws ClassNotFoundExcept * @return The classes * @throws ClassNotFoundException */ - private static List findClasses(File directory, String packageName) throws ClassNotFoundException { List classes = new ArrayList(); @@ -141,22 +139,4 @@ private static List findClasses(File directory, String packageName) throws Class return classes; } - - /** - * This function hooks to the Jenkins milestone when the plugins are prepared to load - * And adds aliases for all package found classes - */ - @Initializer(before = InitMilestone.PLUGINS_PREPARED) - public static void addAliasesToAllClasses() { - LOG.info("Adding alias for in old package names to add backward compatibility"); - try { - Class[] classes = getClasses(PACKAGE_NAME); - for (Class c: classes) { - addAliases(c); - } - } - catch(ClassNotFoundException | IOException e) { - LOG.warning(e.getMessage()); - } - } } \ No newline at end of file From 7c0a1d3083b9a421ce58658c3eaae3926c75fabc Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Tue, 3 Jul 2018 16:09:59 +0300 Subject: [PATCH 0368/2502] Refactor to functions --- .../tools/common/CompatibilityRebrander.java | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java index 129cbf3d7e..019457e031 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java +++ b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java @@ -1,6 +1,5 @@ package com.hpe.application.automation.tools.common; - import hudson.init.InitMilestone; import hudson.init.Initializer; import hudson.model.Items; @@ -15,6 +14,7 @@ import java.util.List; import java.util.logging.Logger; + /** * CompatibilityRebrander is an interface for all related to the company rebranding phase. *

    @@ -90,25 +90,46 @@ private static void invokeXstreamCompatibilityAlias(@Nonnull Class newClass, Str * @throws IOException */ private static Class[] getClasses(String packageName) throws ClassNotFoundException, IOException { - Thread thread = Thread.currentThread(); - ClassLoader tempClassLoader = thread.getContextClassLoader(); - assert tempClassLoader != null; - thread.setContextClassLoader(CompatibilityRebrander.class.getClassLoader()); - ClassLoader classLoader = thread.getContextClassLoader(); + ClassLoader classLoader = getContextClassLoader(); String path = packageName.replace('.', '/'); Enumeration resources = classLoader.getResources(path); - List dirs = new ArrayList(); + List directories = getDirectories(resources); + ArrayList classes = getClassesArrayList(directories, packageName); - while (resources.hasMoreElements()) { - URL resource = (URL) resources.nextElement(); - dirs.add(new File(resource.getFile())); - } + return (Class[]) classes.toArray(new Class[classes.size()]); + } + + private static ArrayList getClassesArrayList(List directories, String packageName) throws ClassNotFoundException, IOException { ArrayList classes = new ArrayList(); - for (Object directory : dirs) { + for (Object directory : directories) { classes.addAll(findClasses((File)directory, packageName)); } - return (Class[]) classes.toArray(new Class[classes.size()]); + + return classes; + } + + private static List getDirectories(Enumeration resources) { + List directories = new ArrayList(); + + while (resources.hasMoreElements()) { + URL resource = (URL) resources.nextElement(); + directories.add(new File(resource.getFile())); + } + + return directories; + } + + /** + * The context that is supplied was Jenkins and the project itself, it required the following workaround. + * @return ClassLoader that is related to the project context + */ + private static ClassLoader getContextClassLoader() { + Thread thread = Thread.currentThread(); + ClassLoader tempClassLoader = thread.getContextClassLoader(); + assert tempClassLoader != null; + thread.setContextClassLoader(CompatibilityRebrander.class.getClassLoader()); + return thread.getContextClassLoader(); } /** @@ -139,4 +160,5 @@ private static List findClasses(File directory, String packageName) throws Class return classes; } -} \ No newline at end of file +} + From 2865cbc904ad8107107fa949622a70e217b3d79b Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Tue, 3 Jul 2018 17:47:28 +0300 Subject: [PATCH 0369/2502] Added display controller feature for freestyle builds. --- .../LoadRunnerTestStep/config.jelly | 2 +- .../tools/run/RunFromFileBuilder/config.jelly | 3 ++ .../help-displayController.html | 36 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-displayController.html diff --git a/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly index f3026fb543..e5eb4db9da 100644 --- a/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly @@ -64,7 +64,7 @@ - + diff --git a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly index e7fcf42edb..7833862596 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -88,6 +88,9 @@ + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-displayController.html b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-displayController.html new file mode 100644 index 0000000000..b8da510550 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-displayController.html @@ -0,0 +1,36 @@ + + +

    + Display the controller while the scenario is running. +
    From 62f52bb5bcd2e81965c367d1ebba843b9630d653 Mon Sep 17 00:00:00 2001 From: gullery Date: Tue, 3 Jul 2018 22:40:59 +0300 Subject: [PATCH 0370/2502] tech: adding support for SVN in workflow job --- .../tools/octane/events/RunListenerImpl.java | 7 +- .../tools/octane/events/SCMListenerImpl.java | 61 ++- .../tools/octane/model/ModelFactory.java | 2 +- .../processors/scm/GenericSCMProcessor.java | 78 ++-- .../model/processors/scm/GitSCMProcessor.java | 374 ++++++++---------- .../model/processors/scm/SCMProcessor.java | 6 +- .../model/processors/scm/SvnSCMProcessor.java | 124 +++--- 7 files changed, 303 insertions(+), 349 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index cbcdd227fc..29c4e4bb45 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -173,7 +173,6 @@ public void onFinalized(Run r) { } - private CIEvent getCiEvent(Run r, SCMProcessor.CommonOriginRevision commonOriginRevision, boolean hasTests, CIBuildResult result) { return dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.FINISHED) @@ -212,12 +211,12 @@ private CIBuildResult getCiBuildResult(Run r) { } private SCMProcessor.CommonOriginRevision getCommonOriginRevision(Run r) { - SCMProcessor.CommonOriginRevision commonOriginRevision=null; - if(r instanceof AbstractBuild) { + SCMProcessor.CommonOriginRevision commonOriginRevision = null; + if (r instanceof AbstractBuild) { final SCM scm = ((AbstractBuild) r).getProject().getScm(); if (scm != null) { SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); - if(scmProcessor!=null) { + if (scmProcessor != null) { commonOriginRevision = scmProcessor.getCommonOriginRevision(r); } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 41bdf79756..6f32f4db28 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -81,8 +81,8 @@ public void onCheckout(Run build, SCM scm, FilePath workspace, TaskListene } @Override - public void onChangeLogParsed(Run r, SCM scm, TaskListener listener, ChangeLogSet changelog) throws Exception { - super.onChangeLogParsed(r, scm, listener, changelog); + public void onChangeLogParsed(Run run, SCM scm, TaskListener listener, ChangeLogSet changelog) throws Exception { + super.onChangeLogParsed(run, scm, listener, changelog); if (ConfigurationService.getServerConfiguration() != null && !ConfigurationService.getServerConfiguration().isValid()) { return; @@ -91,52 +91,41 @@ public void onChangeLogParsed(Run r, SCM scm, TaskListener listener, Chang return; } - CIEvent event; - if (r.getParent() instanceof MatrixConfiguration || r instanceof AbstractBuild) { - AbstractBuild build = (AbstractBuild) r; - if (changelog != null && !changelog.isEmptySet()) { // if there are any commiters - SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); - if (scmProcessor != null) { - event = createSCMEvent(r, build, scmProcessor); - OctaneSDK.getInstance().getEventsService().publishEvent(event); - } else { - logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); - } + SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); + if (scmProcessor == null) { + logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); + return; + } + + SCMData scmData = null; + if (run.getParent() instanceof MatrixConfiguration || run instanceof AbstractBuild) { + AbstractBuild build = (AbstractBuild) run; + if (changelog != null && !changelog.isEmptySet()) { + scmData = scmProcessor.getSCMData(build, scm); } - } else if (r.getParent() instanceof WorkflowJob) { - WorkflowRun wRun = (WorkflowRun) r; + } else if (run.getParent() instanceof WorkflowJob) { + WorkflowRun wRun = (WorkflowRun) run; if (changelog != null && !changelog.isEmptySet() || !wRun.getChangeSets().isEmpty()) { - SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); - if (scmProcessor != null) { - List scmDataList = scmProcessor.getSCMData(wRun); - for (SCMData scmData : scmDataList) { - event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.SCM) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setNumber(String.valueOf(r.getNumber())) - .setScmData(scmData); - OctaneSDK.getInstance().getEventsService().publishEvent(event); - } - } else { - logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); - } + scmData = scmProcessor.getSCMData(wRun, scm); } } + + if (scmData != null) { + CIEvent event = createSCMEvent(run, scmData); + OctaneSDK.getInstance().getEventsService().publishEvent(event); + } else { + logger.warn("SCM changes found, but FAILED to extract SCM data; SCM type: " + scm.getClass() + ", processor used: " + scmProcessor.getClass().getSimpleName()); + } } - private CIEvent createSCMEvent(Run run, AbstractBuild build, SCMProcessor scmProcessor) { - CIEvent event; - SCMData scmData = scmProcessor.getSCMData(build); - event = dtoFactory.newDTO(CIEvent.class) + private CIEvent createSCMEvent(Run run, SCMData scmData) { + return dtoFactory.newDTO(CIEvent.class) .setEventType(CIEventType.SCM) .setProject(BuildHandlerUtils.getJobCiId(run)) .setBuildCiId(BuildHandlerUtils.getBuildCiId(run)) .setCauses(CIEventCausesFactory.processCauses(extractCauses(run))) .setNumber(String.valueOf(run.getNumber())) .setScmData(scmData); - return event; } private List extractCauses(Run r) { diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java b/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java index 9b1d5d987b..0fbb1d77fd 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/ModelFactory.java @@ -144,7 +144,7 @@ public static SnapshotNode createSnapshotItem(Run build, boolean metaOnly) { snapshotNode.setDuration(build.getDuration()); snapshotNode.setEstimatedDuration(build.getEstimatedDuration()); if (build instanceof AbstractBuild) { - snapshotNode.setScmData(scmProcessor == null ? null : scmProcessor.getSCMData((AbstractBuild) build)); + snapshotNode.setScmData(scmProcessor == null ? null : scmProcessor.getSCMData((AbstractBuild) build, ((AbstractBuild) build).getProject().getScm())); } snapshotNode.setStartTime(build.getStartTimeInMillis()); snapshotNode.setParameters(ParameterProcessors.getInstances(build)); diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java index a68b51c289..ca48b40636 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GenericSCMProcessor.java @@ -44,6 +44,7 @@ import hudson.model.User; import hudson.model.UserProperty; import hudson.scm.ChangeLogSet; +import hudson.scm.SCM; import hudson.tasks.Mailer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -56,32 +57,20 @@ * Created by benmeior on 9/8/2016. */ -public class GenericSCMProcessor implements SCMProcessor { +class GenericSCMProcessor implements SCMProcessor { private static final Logger logger = LogManager.getLogger(GenericSCMProcessor.class); private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - GenericSCMProcessor() { - } - @Override - public SCMData getSCMData(AbstractBuild build) { - SCMData result; - SCMRepository repository = buildScmRepository(); - - ChangeLogSet changes = build.getChangeSet(); - ArrayList tmpCommits = buildScmCommits(changes); - - result = dtoFactory.newDTO(SCMData.class) - .setCommits(tmpCommits) - .setRepository(repository); - - return result; + public SCMData getSCMData(AbstractBuild build, SCM scm) { + List> changes = new ArrayList<>(); + changes.add(build.getChangeSet()); + return extractSCMData(scm, changes); } @Override - public List getSCMData(WorkflowRun run) { - // todo: implement default - yanivl - return null; + public SCMData getSCMData(WorkflowRun run, SCM scm) { + return extractSCMData(scm, run.getChangeSets()); } @Override @@ -89,36 +78,49 @@ public CommonOriginRevision getCommonOriginRevision(Run run) { return null; } - private ArrayList buildScmCommits(ChangeLogSet changes) { - ArrayList tmpCommits = new ArrayList<>(); - ArrayList tmpChanges; + private SCMData extractSCMData(SCM scm, List> changes) { + logger.info("building generic scm data for SCM of type " + scm.getType()); + + SCMRepository repository = buildScmRepository(); + List tmpCommits = extractCommits(changes); + + return dtoFactory.newDTO(SCMData.class) + .setRepository(repository) + .setCommits(tmpCommits); + } + + private List extractCommits(List> changes) { + List tmpCommits = new ArrayList<>(); + List tmpChanges; SCMChange tmpChange; - for (ChangeLogSet.Entry c : changes) { - User user = c.getAuthor(); - String userEmail = null; + for (ChangeLogSet set : changes) { + for (ChangeLogSet.Entry change : set) { + User user = change.getAuthor(); + String userEmail = null; - tmpChanges = new ArrayList<>(); + tmpChanges = new ArrayList<>(); - for (ChangeLogSet.AffectedFile item : c.getAffectedFiles()) { - tmpChange = dtoFactory.newDTO(SCMChange.class) - .setType(item.getEditType().getName()) - .setFile(item.getPath()); - tmpChanges.add(tmpChange); - } + for (ChangeLogSet.AffectedFile item : change.getAffectedFiles()) { + tmpChange = dtoFactory.newDTO(SCMChange.class) + .setType(item.getEditType().getName()) + .setFile(item.getPath()); + tmpChanges.add(tmpChange); + } - for (UserProperty property : user.getAllProperties()) { - if (property instanceof Mailer.UserProperty) { - userEmail = ((Mailer.UserProperty) property).getAddress(); + for (UserProperty property : user.getAllProperties()) { + if (property instanceof Mailer.UserProperty) { + userEmail = ((Mailer.UserProperty) property).getAddress(); + } } + SCMCommit tmpCommit = buildScmCommit(tmpChanges, change, userEmail); + tmpCommits.add(tmpCommit); } - SCMCommit tmpCommit = buildScmCommit(tmpChanges, c, userEmail); - tmpCommits.add(tmpCommit); } return tmpCommits; } - private SCMCommit buildScmCommit(ArrayList tmpChanges, ChangeLogSet.Entry commit, String userEmail) { + private SCMCommit buildScmCommit(List tmpChanges, ChangeLogSet.Entry commit, String userEmail) { return dtoFactory.newDTO(SCMCommit.class) .setTime(commit.getTimestamp()) .setUser(commit.getAuthor().getId()) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index 1db5c0c234..c552511956 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -68,244 +68,204 @@ import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; /** * Created by gullery on 31/03/2015. */ -public class GitSCMProcessor implements SCMProcessor { - private static final Logger logger = LogManager.getLogger(GitSCMProcessor.class); - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - private static final String MASTER = "refs/remotes/origin/master"; +class GitSCMProcessor implements SCMProcessor { + private static final Logger logger = LogManager.getLogger(GitSCMProcessor.class); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + private static final String MASTER = "refs/remotes/origin/master"; - GitSCMProcessor() { - } - - @Override - public SCMData getSCMData(AbstractBuild build) { - AbstractProject project = build.getProject(); - SCMData result = null; - GitSCM scmGit; - SCMRepository scmRepository; - String builtCommitRevId = null; - ChangeLogSet changes = build.getChangeSet(); - BuildData buildData; - - if (project.getScm() instanceof GitSCM) { - scmGit = (GitSCM) project.getScm(); - buildData = scmGit.getBuildData(build); - if (buildData != null) { - scmRepository = getSCMRepository(scmGit, build); - if (buildData.getLastBuiltRevision() != null) { - builtCommitRevId = buildData.getLastBuiltRevision().getSha1String(); - } - - List commits = getCommits(changes); + @Override + public SCMData getSCMData(AbstractBuild build, SCM scm) { + List> changes = new ArrayList<>(); + changes.add(build.getChangeSet()); + return extractSCMData(build, scm, changes); + } - result = dtoFactory.newDTO(SCMData.class) - .setRepository(scmRepository) - .setBuiltRevId(builtCommitRevId) - .setCommits(commits); - } - } - return result; - } + @Override + public SCMData getSCMData(WorkflowRun run, SCM scm) { + return extractSCMData(run, scm, run.getChangeSets()); + } - @Override - public List getSCMData(WorkflowRun run) { - List result = new ArrayList<>(); - SCMRepository scmRepository; - String builtCommitRevId = null; - List> changes = run.getChangeSets(); - List buildData; + @Override + public CommonOriginRevision getCommonOriginRevision(final Run run) { + //for phase 1 this is hard coded since its not possible to calculate it, and configuration from outside will complicate the feature + //so for this phase we keep it hardcoded. + CommonOriginRevision commonOriginRevision = new CommonOriginRevision(); - buildData = run.getActions(BuildData.class); + try { + final AbstractBuild abstractBuild = (AbstractBuild) run; + FilePath workspace = ((AbstractBuild) run).getWorkspace(); + if (workspace != null) { + commonOriginRevision = workspace.act(new FilePath.FileCallable() { + @Override + public CommonOriginRevision invoke(File file, VirtualChannel channel) throws IOException { + CommonOriginRevision result = new CommonOriginRevision(); + File repoDir = new File(getRemoteString(abstractBuild) + File.separator + ".git"); + Git git = Git.open(repoDir); + Repository repo = git.getRepository(); + final RevWalk walk = new RevWalk(repo); - if (buildData != null && !buildData.isEmpty()) { - scmRepository = getSCMRepository(buildData); - if (buildData.get(0).getLastBuiltRevision() != null) { - builtCommitRevId = buildData.get(0).getLastBuiltRevision().getSha1String(); - } + ObjectId resolveForCurrentBranch = repo.resolve(Constants.HEAD); + RevCommit currentBranchCommit = walk.parseCommit(resolveForCurrentBranch); + ObjectId resolveForMaster = repo.resolve(MASTER); + RevCommit masterCommit = walk.parseCommit(resolveForMaster); - for (ChangeLogSet changeLogSet : changes) { - List commits = getCommits(changeLogSet); - result.add(dtoFactory.newDTO(SCMData.class) - .setRepository(scmRepository) - .setBuiltRevId(builtCommitRevId) - .setCommits(commits)); - } - } - return result; - } - @Override - public CommonOriginRevision getCommonOriginRevision(final Run run) { - //for phase 1 this is hard coded since its not possible to calculate it, and configuration from outside will complicate the feature - //so for this phase we keep it hardcoded. - CommonOriginRevision commonOriginRevision = new CommonOriginRevision(); + walk.reset(); + walk.setRevFilter(RevFilter.MERGE_BASE); + walk.markStart(currentBranchCommit); + walk.markStart(masterCommit); + final RevCommit base = walk.next(); + if (base == null) + return result; + final RevCommit base2 = walk.next(); + if (base2 != null) { + throw new NoMergeBaseException(NoMergeBaseException.MergeBaseFailureReason.MULTIPLE_MERGE_BASES_NOT_SUPPORTED, + MessageFormat.format(JGitText.get().multipleMergeBasesFor, currentBranchCommit.name(), masterCommit.name(), base.name(), base2.name())); + } + result.revision = base.getId().getName(); + result.branch = getBranchName(run); + return result; + } - try { - final AbstractBuild abstractBuild = (AbstractBuild) run; - FilePath workspace = ((AbstractBuild) run).getWorkspace(); - if (workspace != null) { - commonOriginRevision = workspace.act(new FilePath.FileCallable() { - @Override - public CommonOriginRevision invoke(File file, VirtualChannel channel) throws IOException, InterruptedException { - CommonOriginRevision result = new CommonOriginRevision(); - File repoDir = new File(getRemoteString(abstractBuild) + File.separator + ".git"); - Git git = Git.open(repoDir); - Repository repo = git.getRepository(); - final RevWalk walk = new RevWalk(repo); + @Override + public void checkRoles(RoleChecker roleChecker) throws SecurityException { + if (roleChecker != null) { + logger.info("Note : roleChecker is not empty, but no action was taken"); + } + } + }); + } + logger.info("most recent common revision resolved to " + commonOriginRevision.revision + " (branch: " + commonOriginRevision.branch + ")"); + } catch (Exception e) { + logger.error("failed to resolve most recent common revision", e); + return commonOriginRevision; + } + return commonOriginRevision; + } - ObjectId resolveForCurrentBranch = repo.resolve(Constants.HEAD); - RevCommit currentBranchCommit = walk.parseCommit(resolveForCurrentBranch); - ObjectId resolveForMaster = repo.resolve(MASTER); - RevCommit masterCommit = walk.parseCommit(resolveForMaster); + private SCMData extractSCMData(Run run, SCM scm, List> changes) { + if (!(scm instanceof GitSCM)) { + throw new IllegalArgumentException("GitSCM type of SCM was expected here, found '" + scm.getClass().getName() + "'"); + } - walk.reset(); - walk.setRevFilter(RevFilter.MERGE_BASE); - walk.markStart(currentBranchCommit); - walk.markStart(masterCommit); - final RevCommit base = walk.next(); - if (base == null) - return result; - final RevCommit base2 = walk.next(); - if (base2 != null) { - throw new NoMergeBaseException(NoMergeBaseException.MergeBaseFailureReason.MULTIPLE_MERGE_BASES_NOT_SUPPORTED, - MessageFormat.format(JGitText.get().multipleMergeBasesFor, currentBranchCommit.name(), masterCommit.name(), base.name(), base2.name())); - } - result.revision = base.getId().getName(); - result.branch = getBranchName(run); - return result; - } + GitSCM gitData = (GitSCM) scm; + SCMRepository repository; + List tmpCommits; + String builtRevId = null; - @Override - public void checkRoles(RoleChecker roleChecker) throws SecurityException { - if(roleChecker!=null) { - logger.info("Note : roleChecker is not empty, but no action was taken"); - } - } - }); - } - logger.info("most recent common revision resolved to " + commonOriginRevision.revision + " (branch: " + commonOriginRevision.branch + ")"); - } catch (Exception e) { - logger.error("failed to resolve most recent common revision", e); - return commonOriginRevision; - } - return commonOriginRevision; - } + repository = getRepository(run, gitData); - public String getBranchName(Run r) { - try { - SCM scm = ((AbstractBuild) r).getProject().getScm(); - if (scm instanceof GitSCM) { - GitSCM git = (GitSCM) scm; - List branches = git.getBranches(); - String rawBranchName = branches.get(0).toString(); - String branchName = rawBranchName.substring(2); //trunk the '*/' from the '*/' in order to get clean branch name - return branchName; - } + BuildData buildData = gitData.getBuildData(run); + if (buildData != null && buildData.getLastBuiltRevision() != null) { + builtRevId = buildData.getLastBuiltRevision().getSha1String(); + } - } catch (Exception e) { + tmpCommits = extractCommits(changes); + return dtoFactory.newDTO(SCMData.class) + .setRepository(repository) + .setBuiltRevId(builtRevId) + .setCommits(tmpCommits); + } - } - return null; - } + private String getBranchName(Run r) { + try { + SCM scm = ((AbstractBuild) r).getProject().getScm(); + GitSCM git = (GitSCM) scm; + List branches = git.getBranches(); + String rawBranchName = branches.get(0).toString(); + return rawBranchName.substring(2); //trunk the '*/' from the '*/' in order to get clean branch name + } catch (Exception e) { + logger.error("failed to extract branch name", e); + } + return null; + } - private static String getRemoteString(AbstractBuild r){ + private static String getRemoteString(AbstractBuild r) { final DescribableList extensions = ((GitSCM) (r.getProject()).getScm()).getExtensions(); String relativeTargetDir = ""; - if(extensions!=null){ + if (extensions != null) { final RelativeTargetDirectory relativeTargetDirectory = extensions.get(RelativeTargetDirectory.class); - if(relativeTargetDirectory!=null && relativeTargetDirectory.getRelativeTargetDir()!=null ){ - relativeTargetDir = File.separator+relativeTargetDirectory.getRelativeTargetDir(); + if (relativeTargetDirectory != null && relativeTargetDirectory.getRelativeTargetDir() != null) { + relativeTargetDir = File.separator + relativeTargetDirectory.getRelativeTargetDir(); } } - if(r.getWorkspace().isRemote()) - { - VirtualChannel vc = r.getWorkspace().getChannel(); - String fp = r.getWorkspace().getRemote(); - String remote = new FilePath(vc, fp).getRemote(); - return remote+relativeTargetDir; - } - else { + if (r.getWorkspace().isRemote()) { + VirtualChannel vc = r.getWorkspace().getChannel(); + String fp = r.getWorkspace().getRemote(); + String remote = new FilePath(vc, fp).getRemote(); + return remote + relativeTargetDir; + } else { String remote = r.getWorkspace().getRemote(); - return remote+relativeTargetDir; - } - + return remote + relativeTargetDir; + } } - private List getCommits(ChangeLogSet changes) { - List commits = new ArrayList<>(); - for (ChangeLogSet.Entry c : changes) { - if (c instanceof GitChangeSet) { - GitChangeSet commit = (GitChangeSet) c; - User user = commit.getAuthor(); - String userEmail = null; - - List tmpChanges = new ArrayList(); - for (GitChangeSet.Path item : commit.getAffectedFiles()) { - SCMChange tmpChange = dtoFactory.newDTO(SCMChange.class) - .setType(item.getEditType().getName()) - .setFile(item.getPath()); - tmpChanges.add(tmpChange); - } + private SCMRepository getRepository(Run run, GitSCM gitData) { + SCMRepository result = null; + String url = null; + String branch = null; + if (gitData != null && gitData.getBuildData(run) != null) { + BuildData buildData = gitData.getBuildData(run); + if (buildData != null) { + if (buildData.getRemoteUrls() != null && !buildData.getRemoteUrls().isEmpty()) { + url = (String) buildData.getRemoteUrls().toArray()[0]; + } + if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { + branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); + } + result = dtoFactory.newDTO(SCMRepository.class) + .setType(SCMType.GIT) + .setUrl(url) + .setBranch(branch); + } else { + logger.warn("failed to obtain BuildData; no SCM repository info will be available"); + } + } + return result; + } - for (UserProperty property : user.getAllProperties()) { - if (property instanceof Mailer.UserProperty) { - userEmail = ((Mailer.UserProperty) property).getAddress(); - } - } + private List extractCommits(List> changes) { + List commits = new LinkedList<>(); + for (ChangeLogSet set : changes) { + for (ChangeLogSet.Entry change : set) { + if (change instanceof GitChangeSet) { + GitChangeSet commit = (GitChangeSet) change; + User user = commit.getAuthor(); + String userEmail = null; - SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) - .setTime(commit.getTimestamp()) - .setUser(user.getId()) - .setUserEmail(userEmail) - .setRevId(commit.getCommitId()) - .setParentRevId(commit.getParentCommit()) - .setComment(commit.getComment().trim()) - .setChanges(tmpChanges); + List tmpChanges = new ArrayList<>(); + for (GitChangeSet.Path item : commit.getAffectedFiles()) { + SCMChange tmpChange = dtoFactory.newDTO(SCMChange.class) + .setType(item.getEditType().getName()) + .setFile(item.getPath()); + tmpChanges.add(tmpChange); + } - commits.add(tmpCommit); - } - } - return commits; - } + for (UserProperty property : user.getAllProperties()) { + if (property instanceof Mailer.UserProperty) { + userEmail = ((Mailer.UserProperty) property).getAddress(); + } + } - private SCMRepository getSCMRepository(GitSCM gitData, AbstractBuild build) { - SCMRepository result = null; - String url = null; - String branch = null; - if (gitData != null && gitData.getBuildData(build) != null) { - BuildData buildData = gitData.getBuildData(build); - if (!buildData.getRemoteUrls().isEmpty()) { - url = (String) buildData.getRemoteUrls().toArray()[0]; - } - if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { - branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); - } - result = dtoFactory.newDTO(SCMRepository.class) - .setType(SCMType.GIT) - .setUrl(url) - .setBranch(branch); - } - return result; - } + SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) + .setTime(commit.getTimestamp()) + .setUser(user.getId()) + .setUserEmail(userEmail) + .setRevId(commit.getCommitId()) + .setParentRevId(commit.getParentCommit()) + .setComment(commit.getComment().trim()) + .setChanges(tmpChanges); - private SCMRepository getSCMRepository(List buildData) { - SCMRepository result = null; - String url = null; - String branch = null; - if (!buildData.get(0).getRemoteUrls().isEmpty()) { - url = (String) buildData.get(0).getRemoteUrls().toArray()[0]; - } - if (buildData.get(0).getLastBuiltRevision() != null && !buildData.get(0).getLastBuiltRevision().getBranches().isEmpty()) { - branch = ((Branch)buildData.get(0).getLastBuiltRevision().getBranches().toArray()[0]).getName(); - } - result = dtoFactory.newDTO(SCMRepository.class) - .setType(SCMType.GIT) - .setUrl(url) - .setBranch(branch); - return result; - } + commits.add(tmpCommit); + } + } + } + return commits; + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java index 09ca8a8962..a11fe3e061 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java @@ -36,10 +36,10 @@ import com.hp.octane.integrations.dto.scm.SCMData; import hudson.model.AbstractBuild; import hudson.model.Run; +import hudson.scm.SCM; import org.jenkinsci.plugins.workflow.job.WorkflowRun; import java.io.Serializable; -import java.util.List; /** * API definition for SCM content processor/transformer for an Octane context @@ -47,9 +47,9 @@ */ public interface SCMProcessor { - SCMData getSCMData(AbstractBuild build); + SCMData getSCMData(AbstractBuild build, SCM scm); - List getSCMData(WorkflowRun run); + SCMData getSCMData(WorkflowRun run, SCM scm); CommonOriginRevision getCommonOriginRevision(Run run); diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java index 968f76e674..a1cf92b2cd 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java @@ -41,6 +41,7 @@ import com.hp.octane.integrations.dto.scm.SCMType; import hudson.model.*; import hudson.scm.ChangeLogSet; +import hudson.scm.SCM; import hudson.scm.SubversionChangeLogSet; import hudson.scm.SubversionSCM; import hudson.tasks.Mailer; @@ -50,6 +51,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -59,41 +61,21 @@ */ @SuppressWarnings({"squid:S2221", "squid:S00105"}) -public class SvnSCMProcessor implements SCMProcessor { +class SvnSCMProcessor implements SCMProcessor { private static final Logger logger = LogManager.getLogger(SvnSCMProcessor.class); private static final DTOFactory dtoFactory = DTOFactory.getInstance(); private static final int PARENT_COMMIT_INDEX = 1; @Override - public SCMData getSCMData(AbstractBuild build) { - AbstractProject project = build.getProject(); - SCMData result = null; - SubversionSCM svnData; - SCMRepository scmRepository; - ArrayList tmpCommits; - ChangeLogSet changes = build.getChangeSet(); - String builtRevId; - - if (project.getScm() instanceof SubversionSCM) { - svnData = (SubversionSCM) project.getScm(); - scmRepository = getSCMRepository(svnData); - - builtRevId = getBuiltRevId(build, svnData, scmRepository.getUrl()); - - tmpCommits = buildScmCommits(changes); - - result = dtoFactory.newDTO(SCMData.class) - .setRepository(scmRepository) - .setBuiltRevId(builtRevId) - .setCommits(tmpCommits); - } - return result; + public SCMData getSCMData(AbstractBuild build, SCM scm) { + List> changes = new ArrayList<>(); + changes.add(build.getChangeSet()); + return extractSCMData(build, scm, changes); } @Override - public List getSCMData(WorkflowRun run) { - // todo: add implementatiohn - yanivl - return null; + public SCMData getSCMData(WorkflowRun run, SCM scm) { + return extractSCMData(run, scm, run.getChangeSets()); } @Override @@ -101,52 +83,74 @@ public CommonOriginRevision getCommonOriginRevision(Run run) { return null; } - private ArrayList buildScmCommits(ChangeLogSet changes) { - ArrayList tmpCommits; + private SCMData extractSCMData(Run run, SCM scm, List> changes) { + if (!(scm instanceof SubversionSCM)) { + throw new IllegalArgumentException("SubversionSCM type of SCM was expected here, found '" + scm.getClass().getName() + "'"); + } + + SubversionSCM svnData = (SubversionSCM) scm; + SCMRepository repository; + List tmpCommits; + String builtRevId; + + repository = getSCMRepository(svnData); + builtRevId = getBuiltRevId(run, svnData, repository.getUrl()); + tmpCommits = extractCommits(changes); + + return dtoFactory.newDTO(SCMData.class) + .setRepository(repository) + .setBuiltRevId(builtRevId) + .setCommits(tmpCommits); + } + + private List extractCommits(List> changes) { + List tmpCommits; List tmpChanges; SCMChange tmpChange; - tmpCommits = new ArrayList<>(); - for (ChangeLogSet.Entry c : changes) { - if (c instanceof SubversionChangeLogSet.LogEntry) { - SubversionChangeLogSet.LogEntry commit = (SubversionChangeLogSet.LogEntry) c; - User user = commit.getAuthor(); - String userEmail = null; - - tmpChanges = new ArrayList<>(); - for (SubversionChangeLogSet.Path item : commit.getAffectedFiles()) { - tmpChange = dtoFactory.newDTO(SCMChange.class) - .setType(item.getEditType().getName()) - .setFile(item.getPath()); - tmpChanges.add(tmpChange); - } + tmpCommits = new LinkedList<>(); + for (ChangeLogSet set : changes) { + for (ChangeLogSet.Entry change : set) { + if (change instanceof SubversionChangeLogSet.LogEntry) { + SubversionChangeLogSet.LogEntry commit = (SubversionChangeLogSet.LogEntry) change; + User user = commit.getAuthor(); + String userEmail = null; + + tmpChanges = new ArrayList<>(); + for (SubversionChangeLogSet.Path item : commit.getAffectedFiles()) { + tmpChange = dtoFactory.newDTO(SCMChange.class) + .setType(item.getEditType().getName()) + .setFile(item.getPath()); + tmpChanges.add(tmpChange); + } - for (UserProperty property : user.getAllProperties()) { - if (property instanceof Mailer.UserProperty) { - userEmail = ((Mailer.UserProperty) property).getAddress(); + for (UserProperty property : user.getAllProperties()) { + if (property instanceof Mailer.UserProperty) { + userEmail = ((Mailer.UserProperty) property).getAddress(); + } } - } - String parentRevId = getParentRevId(commit); - - SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) - .setTime(commit.getTimestamp()) - .setUser(commit.getAuthor().getId()) - .setUserEmail(userEmail) - .setRevId(commit.getCommitId()) - .setParentRevId(parentRevId) - .setComment(commit.getMsg().trim()) - .setChanges(tmpChanges); - tmpCommits.add(tmpCommit); + String parentRevId = getParentRevId(commit); + + SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) + .setTime(commit.getTimestamp()) + .setUser(commit.getAuthor().getId()) + .setUserEmail(userEmail) + .setRevId(commit.getCommitId()) + .setParentRevId(parentRevId) + .setComment(commit.getMsg().trim()) + .setChanges(tmpChanges); + tmpCommits.add(tmpCommit); + } } } return tmpCommits; } - private String getBuiltRevId(AbstractBuild build, SubversionSCM svnData, String scmRepositoryUrl) { + private String getBuiltRevId(Run run, SubversionSCM svnData, String scmRepositoryUrl) { String builtRevId = null; try { - String revisionStateStr = String.valueOf(svnData.calcRevisionsFromBuild(build, null, null)); + String revisionStateStr = String.valueOf(svnData.calcRevisionsFromBuild(run, null, null, null)); builtRevId = getRevisionIdFromBuild(revisionStateStr, scmRepositoryUrl); } catch (IOException | InterruptedException e) { logger.error("failed to get revision state", e); From 2e78052688f222cbeddbf654850675b223d4b80a Mon Sep 17 00:00:00 2001 From: gullery Date: Wed, 4 Jul 2018 00:07:18 +0300 Subject: [PATCH 0371/2502] tech: adding support for SVN in workflow job --- pom.xml | 2 +- .../tools/octane/CIJenkinsServicesImpl.java | 32 +++++++++---------- .../octane/buildLogs/RunListenerForLogs.java | 10 +++--- .../tools/octane/events/SCMListenerImpl.java | 6 ++-- .../model/processors/scm/SvnSCMProcessor.java | 28 +++++----------- 5 files changed, 31 insertions(+), 47 deletions(-) diff --git a/pom.xml b/pom.xml index 381a023597..33212122e8 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5.19 + 1.5.20 diff --git a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java index 2358f19f8e..3325583369 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -87,6 +87,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.net.URL; import java.net.URLDecoder; import java.util.ArrayList; import java.util.Collection; @@ -158,13 +159,13 @@ public OctaneConfiguration getOctaneConfiguration() { } @Override - public CIProxyConfiguration getProxyConfiguration(String targetHost) { + public CIProxyConfiguration getProxyConfiguration(URL targetUrl) { CIProxyConfiguration result = null; ProxyConfiguration proxy = getJenkins().proxy; if (proxy != null) { boolean noProxyHost = false; for (Pattern pattern : proxy.getNoProxyHostPatterns()) { - if (pattern.matcher(targetHost).matches()) { + if (pattern.matcher(targetUrl.getHost()).matches()) { noProxyHost = true; break; } @@ -221,9 +222,9 @@ public CIJobsList getJobsList(boolean includeParameters) { } else if (jobClassName.equals(JobProcessorFactory.WORKFLOW_MULTI_BRANCH_JOB_NAME)) { tmpConfig = createPipelineNodeFromJobName(name); list.add(tmpConfig); - } else if (jobClassName.equals(JobProcessorFactory.GITHUB_ORGANIZATION_FOLDER)){ - for(Item item : ((OrganizationFolder) tmpItem).getItems()){ - tmpConfig = createPipelineNodeFromJobNameAndFolder(item.getDisplayName(),name); + } else if (jobClassName.equals(JobProcessorFactory.GITHUB_ORGANIZATION_FOLDER)) { + for (Item item : ((OrganizationFolder) tmpItem).getItems()) { + tmpConfig = createPipelineNodeFromJobNameAndFolder(item.getDisplayName(), name); list.add(tmpConfig); } } else { @@ -259,11 +260,10 @@ private PipelineNode createPipelineNodeFromJobName(String name) { .setName(name); } - private PipelineNode createPipelineNodeFromJobNameAndFolder(String name,String folderName) { - PipelineNode tmpConfig = dtoFactory.newDTO(PipelineNode.class) + private PipelineNode createPipelineNodeFromJobNameAndFolder(String name, String folderName) { + return dtoFactory.newDTO(PipelineNode.class) .setJobCiId(folderName + "/" + name) .setName(folderName + "/" + name); - return tmpConfig; } @@ -288,10 +288,10 @@ public PipelineNode getPipeline(String rootJobCiId) { } else { Item item = getItemByRefId(rootJobCiId); //todo: check error message(s) - if(item!=null && item.getClass().getName().equals(JobProcessorFactory.WORKFLOW_MULTI_BRANCH_JOB_NAME)){ + if (item != null && item.getClass().getName().equals(JobProcessorFactory.WORKFLOW_MULTI_BRANCH_JOB_NAME)) { result = createPipelineNodeFromJobName(rootJobCiId); result.setMultiBranchType(MultiBranchType.MULTI_BRANCH_PARENT); - }else { + } else { logger.warn("Failed to get project from jobRefId: '" + rootJobCiId + "' check plugin user Job Read/Overall Read permissions / project name"); throw new ConfigurationException(404); } @@ -402,24 +402,24 @@ public InputStream getBuildLog(String jobCiId, String buildCiId) { } } - private InputStream getOctaneLogFile(Run build) { + private InputStream getOctaneLogFile(Run run) { InputStream result = null; - String octaneLogFilePath = build.getLogFile().getParent() + File.separator + "octane_log"; + String octaneLogFilePath = run.getLogFile().getParent() + File.separator + "octane_log"; File logFile = new File(octaneLogFilePath); if (!logFile.exists()) { try (FileOutputStream fileOutputStream = new FileOutputStream(logFile); - InputStream logStream = build.getLogInputStream(); + InputStream logStream = run.getLogInputStream(); PlainTextConsoleOutputStream out = new PlainTextConsoleOutputStream(fileOutputStream)) { IOUtils.copy(logStream, out); out.flush(); } catch (IOException ioe) { - logger.error("failed to transfer native log to Octane's one for " + build); + logger.error("failed to transfer native log to Octane's one for " + run); } } try { result = new FileInputStream(octaneLogFilePath); } catch (IOException ioe) { - logger.error("failed to obtain log for " + build); + logger.error("failed to obtain log for " + run); } return result; } @@ -568,7 +568,7 @@ private Item getItemByRefId(String itemRefId) { String newItemRefId = itemRefIdUncoded.substring(0, itemRefIdUncoded.indexOf("/")); Item item = getTopLevelItem(newItemRefId); if (item != null && item.getClass().getName().equals(JobProcessorFactory.GITHUB_ORGANIZATION_FOLDER)) { - Collection allItems = ((OrganizationFolder)item).getItems(); + Collection allItems = ((OrganizationFolder) item).getItems(); for (Item multibranchItem : allItems) { if (itemRefIdUncoded.endsWith(multibranchItem.getName())) { result = multibranchItem; diff --git a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java index 447c255eda..294aad4ea1 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/buildLogs/RunListenerForLogs.java @@ -37,7 +37,6 @@ import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; import com.hpe.application.automation.tools.octane.tests.build.BuildHandlerUtils; import hudson.Extension; -import hudson.model.AbstractBuild; import hudson.model.Run; import hudson.model.listeners.RunListener; import org.apache.logging.log4j.LogManager; @@ -53,15 +52,14 @@ public class RunListenerForLogs extends RunListener { private static Logger logger = LogManager.getLogger(RunListenerForLogs.class); @Override - public void onFinalized(Run r) { + public void onFinalized(Run run) { if (ConfigurationService.getModel().isSuspend()) { return; } - if (r instanceof AbstractBuild && ConfigurationService.getServerConfiguration() != null && ConfigurationService.getServerConfiguration().isValid()) { - AbstractBuild build = (AbstractBuild) r; - String jobCiId = BuildHandlerUtils.getJobCiId(build); - String buildCiId = BuildHandlerUtils.getBuildCiId(build); + if (ConfigurationService.getServerConfiguration() != null && ConfigurationService.getServerConfiguration().isValid()) { + String jobCiId = BuildHandlerUtils.getJobCiId(run); + String buildCiId = BuildHandlerUtils.getBuildCiId(run); logger.info("enqueued build '" + jobCiId + " #" + buildCiId + "' for log submission"); OctaneSDK.getInstance().getLogsService().enqueuePushBuildLog(jobCiId, buildCiId); } else { diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 6f32f4db28..5881ff6f25 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -100,12 +100,12 @@ public void onChangeLogParsed(Run run, SCM scm, TaskListener listener, Cha SCMData scmData = null; if (run.getParent() instanceof MatrixConfiguration || run instanceof AbstractBuild) { AbstractBuild build = (AbstractBuild) run; - if (changelog != null && !changelog.isEmptySet()) { + if (build.getChangeSet() != null && !build.getChangeSet().isEmptySet()) { scmData = scmProcessor.getSCMData(build, scm); } } else if (run.getParent() instanceof WorkflowJob) { WorkflowRun wRun = (WorkflowRun) run; - if (changelog != null && !changelog.isEmptySet() || !wRun.getChangeSets().isEmpty()) { + if (wRun.getChangeSets() != null && !wRun.getChangeSets().isEmpty()) { scmData = scmProcessor.getSCMData(wRun, scm); } } @@ -113,8 +113,6 @@ public void onChangeLogParsed(Run run, SCM scm, TaskListener listener, Cha if (scmData != null) { CIEvent event = createSCMEvent(run, scmData); OctaneSDK.getInstance().getEventsService().publishEvent(event); - } else { - logger.warn("SCM changes found, but FAILED to extract SCM data; SCM type: " + scm.getClass() + ", processor used: " + scmProcessor.getClass().getSimpleName()); } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java index a1cf92b2cd..00503fc27a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java @@ -42,6 +42,7 @@ import hudson.model.*; import hudson.scm.ChangeLogSet; import hudson.scm.SCM; +import hudson.scm.SVNRevisionState; import hudson.scm.SubversionChangeLogSet; import hudson.scm.SubversionSCM; import hudson.tasks.Mailer; @@ -53,8 +54,6 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * Created by benmeior on 5/15/2016. @@ -146,12 +145,13 @@ private List extractCommits(List 0 && svnData.getLocations()[0] != null) { url = svnData.getLocations()[0].getURL(); } - result = dtoFactory.newDTO(SCMRepository.class) + return dtoFactory.newDTO(SCMRepository.class) .setType(SCMType.SVN) .setUrl(url); - return result; } } From 72ea79a1bc7b7d8c66bdf40b3b8e4233beba88fc Mon Sep 17 00:00:00 2001 From: gullery Date: Wed, 4 Jul 2018 01:05:30 +0300 Subject: [PATCH 0372/2502] tech: adding support for SVN in workflow job --- .../tools/octane/model/processors/scm/SvnSCMProcessor.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java index 00503fc27a..0e7b35fb96 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SvnSCMProcessor.java @@ -59,7 +59,6 @@ * Created by benmeior on 5/15/2016. */ -@SuppressWarnings({"squid:S2221", "squid:S00105"}) class SvnSCMProcessor implements SCMProcessor { private static final Logger logger = LogManager.getLogger(SvnSCMProcessor.class); private static final DTOFactory dtoFactory = DTOFactory.getInstance(); @@ -118,7 +117,7 @@ private List extractCommits(List Date: Wed, 4 Jul 2018 09:08:54 +0300 Subject: [PATCH 0373/2502] tech: adding support for SVN in workflow job --- .../automation/tools/octane/events/SCMListenerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 5881ff6f25..1b3dea7231 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -93,7 +93,7 @@ public void onChangeLogParsed(Run run, SCM scm, TaskListener listener, Cha SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); if (scmProcessor == null) { - logger.info("SCM changes detected, but no processors found for SCM provider of type " + scm.getClass().getName()); + logger.info("no processors found for SCM provider of type '" + scm.getType() + "', SCM data won't be extracted"); return; } From e3c0ed8b8c3289cade91bd5bda0b28c183b0b030 Mon Sep 17 00:00:00 2001 From: gullery Date: Wed, 4 Jul 2018 09:18:39 +0300 Subject: [PATCH 0374/2502] tech: adding support for SVN in workflow job --- .../tools/octane/events/SCMListenerImpl.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 1b3dea7231..2c430a4fc8 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -69,7 +69,6 @@ */ @Extension -@SuppressWarnings("squid:S1872") public class SCMListenerImpl extends SCMListener { private static final Logger logger = LogManager.getLogger(SCMListenerImpl.class); private static final DTOFactory dtoFactory = DTOFactory.getInstance(); @@ -97,23 +96,27 @@ public void onChangeLogParsed(Run run, SCM scm, TaskListener listener, Cha return; } - SCMData scmData = null; + SCMData scmData = extractSCMData(run, scm, scmProcessor); + if (scmData != null) { + CIEvent event = createSCMEvent(run, scmData); + OctaneSDK.getInstance().getEventsService().publishEvent(event); + } + } + + private SCMData extractSCMData(Run run, SCM scm, SCMProcessor scmProcessor) { + SCMData result = null; if (run.getParent() instanceof MatrixConfiguration || run instanceof AbstractBuild) { AbstractBuild build = (AbstractBuild) run; if (build.getChangeSet() != null && !build.getChangeSet().isEmptySet()) { - scmData = scmProcessor.getSCMData(build, scm); + result = scmProcessor.getSCMData(build, scm); } } else if (run.getParent() instanceof WorkflowJob) { WorkflowRun wRun = (WorkflowRun) run; if (wRun.getChangeSets() != null && !wRun.getChangeSets().isEmpty()) { - scmData = scmProcessor.getSCMData(wRun, scm); + result = scmProcessor.getSCMData(wRun, scm); } } - - if (scmData != null) { - CIEvent event = createSCMEvent(run, scmData); - OctaneSDK.getInstance().getEventsService().publishEvent(event); - } + return result; } private CIEvent createSCMEvent(Run run, SCMData scmData) { From e8998be32d947c7b62f8e4900e369b2490738a7b Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Wed, 4 Jul 2018 10:29:43 +0300 Subject: [PATCH 0375/2502] Discard assertions for better error handling --- .../tools/common/CompatibilityRebrander.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java index 019457e031..86371dc73a 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java +++ b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java @@ -48,13 +48,13 @@ public static void addAliasesToAllClasses() { addAliases(c); } } - catch(ClassNotFoundException | IOException e) { + catch(ClassNotFoundException | NullPointerException | IOException e) { LOG.warning(e.getMessage()); } } /** - * addAliases is the actual function who does the rebranding part for all the old package names + * addAliases is the actual function who does the re-branding part for all the old package names *

    * Items.XSTREAM2.addCompatibilityAlias is for serializing project configurations. * Run.XSTREAM2.addCompatibilityAlias is for serializing builds and its associated Actions. @@ -74,7 +74,7 @@ private static void addAliases(@Nonnull Class newClass) { } /** - * invokeXstreamCompatibilityAlias invokes the XSTREAM2 functions required for the rebranding + * invokeXstreamCompatibilityAlias invokes the XSTREAM2 functions required for the re-branding */ private static void invokeXstreamCompatibilityAlias(@Nonnull Class newClass, String oldClassName) { Items.XSTREAM2.addCompatibilityAlias(oldClassName, newClass); @@ -94,12 +94,12 @@ private static Class[] getClasses(String packageName) throws ClassNotFoundExcept String path = packageName.replace('.', '/'); Enumeration resources = classLoader.getResources(path); List directories = getDirectories(resources); - ArrayList classes = getClassesArrayList(directories, packageName); + ArrayList classes = getClassesForDirectories(directories, packageName); return (Class[]) classes.toArray(new Class[classes.size()]); } - private static ArrayList getClassesArrayList(List directories, String packageName) throws ClassNotFoundException, IOException { + private static ArrayList getClassesForDirectories(List directories, String packageName) throws ClassNotFoundException { ArrayList classes = new ArrayList(); for (Object directory : directories) { @@ -124,17 +124,20 @@ private static List getDirectories(Enumeration resources) { * The context that is supplied was Jenkins and the project itself, it required the following workaround. * @return ClassLoader that is related to the project context */ - private static ClassLoader getContextClassLoader() { + private static ClassLoader getContextClassLoader(){ Thread thread = Thread.currentThread(); ClassLoader tempClassLoader = thread.getContextClassLoader(); - assert tempClassLoader != null; + + if (tempClassLoader == null) { + throw new NullPointerException("Context ClassLoader not found: re-branding will not work"); + } + thread.setContextClassLoader(CompatibilityRebrander.class.getClassLoader()); return thread.getContextClassLoader(); } /** - * Recursive method used to find all classes in a given directory and subdirs. - * + * Recursive method used to find all classes in a given directory and subdirectories. * @param directory The base directory * @param packageName The package name for classes found inside the base directory * @return The classes @@ -149,10 +152,8 @@ private static List findClasses(File directory, String packageName) throws Class File[] files = directory.listFiles(); for (File file : files) { - if (file.isDirectory()) { - assert !file.getName().contains("."); + if (file.isDirectory() && !file.getName().contains(".")) { classes.addAll(findClasses(file, packageName + "." + file.getName())); - } else if (file.getName().endsWith(".class")) { classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6))); } From 20d02cb0e27a235007052d7ae5b498356fc45d72 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Thu, 5 Jul 2018 12:13:55 +0300 Subject: [PATCH 0376/2502] [maven-release-plugin] prepare release hpe-application-automation-tools-plugin-5.4.2-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 989f54a08d..8e8c96834b 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ hp-application-automation-tools-plugin - 5.4.2-beta-SNAPSHOT + 5.4.2-beta hpi HPE Application Automation Tools The plugin integrates Jenkins with the following MicroFocus products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -82,7 +82,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - HEAD + hpe-application-automation-tools-plugin-5.4.2-beta From 7104109097df3f755e7e25fce62d7866dfbcad01 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Thu, 5 Jul 2018 13:07:26 +0300 Subject: [PATCH 0377/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8e8c96834b..fc053bb7b7 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ hp-application-automation-tools-plugin - 5.4.2-beta + 5.4.3-beta-SNAPSHOT hpi HPE Application Automation Tools The plugin integrates Jenkins with the following MicroFocus products - Service Virtualization, LoadRunner, Performance Center, Unified Functional Testing, QuickTest Professional, Service Test, Mobile Center, Application Lifecycle Management and Application Lifecycle Management Octane. @@ -82,7 +82,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - hpe-application-automation-tools-plugin-5.4.2-beta + HEAD From 00a2deb14c224fc31c4b72e2f125d9ba7c3cc4ed Mon Sep 17 00:00:00 2001 From: danieldanan Date: Thu, 5 Jul 2018 18:34:09 +0300 Subject: [PATCH 0378/2502] JENKINS-52393: Adding date and time to log events --- .../automation/tools/pc/PcClient.java | 137 +++++++------ .../automation/tools/run/PcBuilder.java | 187 +++++++++++------- 2 files changed, 194 insertions(+), 130 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java index 4ad4154039..82229d0489 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java @@ -48,6 +48,7 @@ import java.io.PrintStream; import java.nio.file.*; import java.util.*; +import java.text.*; import hudson.console.HyperlinkNote; import org.apache.commons.io.IOUtils; @@ -60,6 +61,8 @@ public class PcClient { + private SimpleDateFormat _simpleDateFormat = new SimpleDateFormat ("E MM.dd.yyyy 'at' hh:mm:ss a zzz"); + private PcModel model; private PcRestProxy restProxy; private boolean loggedIn; @@ -70,12 +73,12 @@ public PcClient(PcModel pcModel, PrintStream logger) { model = pcModel; if(model.getProxyOutURL(true) != null && !model.getProxyOutURL(true).isEmpty()){ - logger.println("Using proxy: " + model.getProxyOutURL(true)); + logger.println(String.format("%s - Using proxy: %s", _simpleDateFormat.format(new Date()), model.getProxyOutURL(true))); } restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(true), model.getAlmDomain(true), model.getAlmProject(true), model.getProxyOutURL(true),model.getProxyOutUser(true),model.getProxyOutPassword(true)); this.logger = logger; }catch (PcException e){ - logger.println(e.getMessage()); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), e.getMessage())); } } @@ -89,28 +92,19 @@ public PcClient(PcModel pcModel, PrintStream logger, T p public boolean login() { try { String user = model.getAlmUserName(true); - logger.println(String.format("Trying to login\n[PCServer='%s://%s', User='%s']",model.isHTTPSProtocol(), model.getPcServerName(true), user)); + logger.println(String.format("%s - Trying to login\n[PCServer='%s://%s', User='%s']", _simpleDateFormat.format(new Date()), model.isHTTPSProtocol(), model.getPcServerName(true), user)); loggedIn = restProxy.authenticate(user, model.getAlmPassword(true).toString()); } catch (PcException e) { - logger.println(e.getMessage()); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), e.getMessage())); // stackTraceToString(e); } catch (Exception e) { - logger.println(e); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), e)); // stackTraceToString(e); } - logger.println(String.format("Login %s", loggedIn ? "succeeded" : "failed")); + logger.println(String.format("%s - Login %s",_simpleDateFormat.format(new Date()), loggedIn ? "succeeded" : "failed")); return loggedIn; } -// public void stackTraceToString(Throwable e) { -// StringBuilder sb = new StringBuilder(); -// logger.println("DEBUGMSG - STACKTRACE"); -// for (StackTraceElement element : e.getStackTrace()) { -// logger.println("DEBUGMSG - " + element.toString()); -// } -// } - - public boolean isLoggedIn() { return loggedIn; @@ -125,14 +119,14 @@ public int startRun() throws NumberFormatException, ClientProtocolException, PcE int testInstance = getCorrectTestInstanceID(testID); setCorrectTrendReportID(); - logger.println(String.format("\nExecuting Load Test: \n====================\nTest ID: %s \nTest Instance ID: %s \nTimeslot Duration: %s \nPost Run Action: %s \nUse VUDS: %s\n====================\n", Integer.parseInt(model.getTestId(true)), testInstance, model.getTimeslotDuration() ,model.getPostRunAction().getValue(),model.isVudsMode())); + logger.println(String.format("%s - \nExecuting Load Test: \n====================\nTest ID: %s \nTest Instance ID: %s \nTimeslot Duration: %s \nPost Run Action: %s \nUse VUDS: %s\n====================\n", _simpleDateFormat.format(new Date()), Integer.parseInt(model.getTestId(true)), testInstance, model.getTimeslotDuration() ,model.getPostRunAction().getValue(),model.isVudsMode())); // logger.println("Sending run request:\n" + model.runParamsToString()); PcRunResponse response = restProxy.startRun(testID, testInstance, model.getTimeslotDuration(), model.getPostRunAction().getValue(), model.isVudsMode()); - logger.println(String.format("\nRun started (TestID: %s, RunID: %s, TimeslotID: %s)\n", + logger.println(String.format("%s - \nRun started (TestID: %s, RunID: %s, TimeslotID: %s)\n",_simpleDateFormat.format(new Date()), response.getTestID(), response.getID(), response.getTimeslotID())); return response.getID(); } @@ -142,33 +136,33 @@ private int getCorrectTestInstanceID(int testID) throws IOException, PcException try { - logger.println("Searching for available Test Instance"); + logger.println(String.format("%s - Searching for available Test Instance", _simpleDateFormat.format(new Date()))); PcTestInstances pcTestInstances = restProxy.getTestInstancesByTestId(testID); - int testInstanceID = 0; + int testInstanceID; if (pcTestInstances != null && pcTestInstances.getTestInstancesList() != null){ PcTestInstance pcTestInstance = pcTestInstances.getTestInstancesList().get(pcTestInstances.getTestInstancesList().size()-1); testInstanceID = pcTestInstance.getInstanceId(); - logger.println("Found testInstanceId: " + testInstanceID); + logger.println(String.format("%s - Found testInstanceId: %d", _simpleDateFormat.format(new Date()), testInstanceID)); }else{ - logger.println("Could not find available TestInstanceID, Creating Test Instance."); - logger.println("Searching for available TestSet"); + logger.println(String.format("%s - Could not find available TestInstanceID, Creating Test Instance.", _simpleDateFormat.format(new Date()))); + logger.println(String.format("%s - Searching for available TestSet", _simpleDateFormat.format(new Date()))); // Get a random TestSet PcTestSets pcTestSets = restProxy.GetAllTestSets(); if (pcTestSets !=null && pcTestSets.getPcTestSetsList() !=null){ PcTestSet pcTestSet = pcTestSets.getPcTestSetsList().get(pcTestSets.getPcTestSetsList().size()-1); int testSetID = pcTestSet.getTestSetID(); - logger.println(String.format("Creating Test Instance with testID: %s and TestSetID: %s", testID,testSetID)); + logger.println(String.format("%s - Creating Test Instance with testID: %s and TestSetID: %s",_simpleDateFormat.format(new Date()), testID,testSetID)); testInstanceID = restProxy.createTestInstance(testID,testSetID); - logger.println(String.format("Test Instance with ID : %s has been created successfully.", testInstanceID)); + logger.println(String.format("%s - Test Instance with ID : %s has been created successfully.", _simpleDateFormat.format(new Date()), testInstanceID)); }else{ String msg = "No TestSetID available in project, please create a testset from Performance Center UI"; - logger.println(msg); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), msg)); throw new PcException(msg); } } return testInstanceID; } catch (Exception e){ - logger.println(String.format("getCorrectTestInstanceID failed, reason: %s",e)); + logger.println(String.format("%s - getCorrectTestInstanceID failed, reason: %s",_simpleDateFormat.format(new Date()), e)); return Integer.parseInt(null); } } @@ -239,26 +233,43 @@ private PcRunResponse waitForRunState(int runId, RunState completionState, int i RunState[] states = {RunState.BEFORE_COLLATING_RESULTS,RunState.BEFORE_CREATING_ANALYSIS_DATA}; PcRunResponse response = null; RunState lastState = RunState.UNDEFINED; + int threeStrikes = 3; do { - response = restProxy.getRunData(runId); - RunState currentState = RunState.get(response.getRunState()); - if (lastState.ordinal() < currentState.ordinal()) { - lastState = currentState; - logger.println(String.format("RunID: %s - State = %s", runId, currentState.value())); - } + try { - // In case we are in state before collate or before analyze, we will wait 1 minute for the state to change otherwise we exit - // because the user probably stopped the run from PC or timeslot has reached the end. - if (Arrays.asList(states).contains(currentState)){ - counter++; - Thread.sleep(1000); - if(counter > 60 ){ - logger.println(String.format("RunID: %s - Stopped from Performance Center side with state = %s", runId, currentState.value())); - break; + if (threeStrikes < 3) { + logger.println(String.format("%s - Cannot get response from PC about the state of RunID: %s %d time(s) consecutively",_simpleDateFormat.format(new Date()), runId, (3 - threeStrikes))); + if(threeStrikes==0) { + logger.println(String.format("%s - stopping monitoring on RunID: %s", _simpleDateFormat.format(new Date()), runId)); + break; + } + Thread.sleep(2000); } - }else{ - counter = 0; - Thread.sleep(interval); + response = restProxy.getRunData(runId); + RunState currentState = RunState.get(response.getRunState()); + if (lastState.ordinal() < currentState.ordinal()) { + lastState = currentState; + logger.println(String.format("%s - RunID: %s - State = %s",_simpleDateFormat.format(new Date()), runId, currentState.value())); + } + + // In case we are in state before collate or before analyze, we will wait 1 minute for the state to change otherwise we exit + // because the user probably stopped the run from PC or timeslot has reached the end. + if (Arrays.asList(states).contains(currentState)) { + counter++; + Thread.sleep(1000); + if (counter > 60) { + logger.println(String.format("%s - RunID: %s - Stopped from Performance Center side with state = %s",_simpleDateFormat.format(new Date()), runId, currentState.value())); + break; + } + } else { + counter = 0; + Thread.sleep(interval); + } + threeStrikes = 3; + } + catch(Exception e) + { + threeStrikes--; } } while (lastState.ordinal() < completionState.ordinal()); return response; @@ -272,7 +283,7 @@ public FilePath publishRunReport(int runId, String reportDirectory) throws IOExc File dir = new File(reportDirectory); dir.mkdirs(); String reportArchiveFullPath = dir.getCanonicalPath() + IOUtils.DIR_SEPARATOR + PcBuilder.pcReportArchiveName; - logger.println("Publishing analysis report"); + logger.println(String.format("%s - Publishing analysis report", _simpleDateFormat.format(new Date()))); restProxy.GetRunResultData(runId, result.getID(), reportArchiveFullPath); FilePath fp = new FilePath(new File(reportArchiveFullPath)); fp.unzip(fp.getParent()); @@ -283,7 +294,7 @@ public FilePath publishRunReport(int runId, String reportDirectory) throws IOExc } } } - logger.println("Failed to get run report"); + logger.println(String.format("%s - Failed to get run report", _simpleDateFormat.format(new Date()))); return null; } @@ -296,25 +307,25 @@ public boolean logout() { logoutSucceeded = restProxy.logout(); loggedIn = !logoutSucceeded; } catch (PcException e) { - logger.println(e.getMessage()); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), e.getMessage())); } catch (Exception e) { logger.println(e); } - logger.println(String.format("Logout %s", logoutSucceeded ? "succeeded" : "failed")); + logger.println(String.format("%s - Logout %s",_simpleDateFormat.format(new Date()), logoutSucceeded ? "succeeded" : "failed")); return logoutSucceeded; } public boolean stopRun(int runId) { boolean stopRunSucceeded = false; try { - logger.println("Stopping run"); + logger.println(String.format("%s - Stopping run", _simpleDateFormat.format(new Date()))); stopRunSucceeded = restProxy.stopRun(runId, "stop"); } catch (PcException e) { - logger.println(e.getMessage()); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), e.getMessage())); } catch (Exception e) { - logger.println(e); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), e)); } - logger.println(String.format("Stop run %s", stopRunSucceeded ? "succeeded" : "failed")); + logger.println(String.format("%s - Stop run %s",_simpleDateFormat.format(new Date()), stopRunSucceeded ? "succeeded" : "failed")); return stopRunSucceeded; } @@ -322,9 +333,9 @@ public PcRunEventLog getRunEventLog(int runId){ try { return restProxy.getRunEventLog(runId); } catch (PcException e) { - logger.println(e.getMessage()); + logger.println(String.format("%s - " + e.getMessage(), _simpleDateFormat.format(new Date()))); } catch (Exception e) { - logger.println(e); + logger.println(String.format("%s - %s",_simpleDateFormat.format(new Date()), e)); } return null; } @@ -333,16 +344,16 @@ public void addRunToTrendReport(int runId, String trendReportId) { TrendReportRequest trRequest = new TrendReportRequest(model.getAlmProject(true), runId, null); - logger.println("Adding run: " + runId + " to trend report: " + trendReportId); + logger.println(String.format("%s - Adding run: %d to trend report: %s", _simpleDateFormat.format(new Date()), runId, trendReportId)); try { restProxy.updateTrendReport(trendReportId, trRequest); - logger.println("Publishing run: " + runId + " on trend report: " + trendReportId); + logger.println(String.format("%s - Publishing run: %d on trend report: %s", _simpleDateFormat.format(new Date()), runId, trendReportId)); } catch (PcException e) { - logger.println("Failed to add run to trend report: " + e.getMessage()); + logger.println(String.format("%s - Failed to add run to trend report: %s", _simpleDateFormat.format(new Date()), e.getMessage())); } catch (IOException e) { - logger.println("Failed to add run to trend report: Problem connecting to PC Server"); + logger.println(String.format("%s - Failed to add run to trend report: Problem connecting to PC Server", _simpleDateFormat.format(new Date()))); } } @@ -363,7 +374,7 @@ public void waitForRunToPublishOnTrendReport(int runId, String trendReportId) th if (result.getState().equals(PcBuilder.TRENDED) || result.getState().equals(PcBuilder.ERROR)){ publishEnded = true; - logger.println("Run: " + runId + " publishing status: "+ result.getState()); + logger.println(String.format("%s - Run: %d publishing status: %s", _simpleDateFormat.format(new Date()), runId, result.getState())); break; }else{ Thread.sleep(5000); @@ -382,7 +393,7 @@ public boolean downloadTrendReportAsPdf(String trendReportId, String directory) try { - logger.println("Downloading trend report: " + trendReportId + " in PDF format"); + logger.println(String.format("%s - Downloading trend report: %d in PDF format", _simpleDateFormat.format(new Date()), trendReportId)); InputStream in = restProxy.getTrendingPDF(trendReportId); File dir = new File(directory); if(!dir.exists()){ @@ -391,11 +402,11 @@ public boolean downloadTrendReportAsPdf(String trendReportId, String directory) String filePath = directory + IOUtils.DIR_SEPARATOR + "trendReport" + trendReportId + ".pdf"; Path destination = Paths.get(filePath); Files.copy(in, destination, StandardCopyOption.REPLACE_EXISTING); - logger.println("Trend report: " + trendReportId + " was successfully downloaded"); + logger.println(String.format("%s - Trend report: %d was successfully downloaded", _simpleDateFormat.format(new Date()), trendReportId)); } catch (Exception e) { - logger.println("Failed to download trend report: " + e.getMessage()); + logger.println(String.format("%s - Failed to download trend report: %s", _simpleDateFormat.format(new Date()), e.getMessage())); throw new PcException(e.getMessage()); } @@ -407,7 +418,7 @@ public void publishTrendReport(String filePath, String trendReportId){ if (filePath == null){return;} // return String.format( HyperlinkNote.encodeTo(filePath, "View trend report " + trendReportId)); - logger.println( HyperlinkNote.encodeTo(filePath, "View trend report " + trendReportId)); + logger.println(String.format("%s - %s",_simpleDateFormat.format(new Date()), HyperlinkNote.encodeTo(filePath, "View trend report " + trendReportId))); } @@ -451,7 +462,7 @@ public Map getTrendReportByXML(String trendReportId, int runId, // logger.println("No such method exception: " + e); } catch (Exception e){ - logger.println("Error on getTrendReportByXML: " + e); + logger.println(String.format("%s - Error on getTrendReportByXML: %s ", _simpleDateFormat.format(new Date()), e)); } } diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index 55d7f7412b..a472091696 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -82,19 +82,19 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ private static final String artifactsDirectoryName = "archive"; - public static final String artifactsResourceName = "artifact"; - public static final String runReportStructure = "%s/%s/performanceTestsReports/pcRun"; - public static final String trendReportStructure = "%s/%s/performanceTestsReports/TrendReports"; + private static final String artifactsResourceName = "artifact"; + private static final String runReportStructure = "%s/%s/performanceTestsReports/pcRun"; + private static final String trendReportStructure = "%s/%s/performanceTestsReports/TrendReports"; public static final String pcReportArchiveName = "Reports.zip"; public static final String pcReportFileName = "Report.html"; private static final String RUNID_BUILD_VARIABLE = "HP_RUN_ID"; public static final String TRENDED = "Trended"; public static final String PENDING = "Pending"; - public static final String PUBLISHING = "Publishing"; + //public static final String PUBLISHING = "Publishing"; public static final String ERROR = "Error"; - private final PcModel pcModel; + private PcModel pcModel; private final String almPassword; @@ -107,7 +107,32 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ private String junitResultsFileName; private PrintStream logger; private File WorkspacePath; - + private SimpleDateFormat _simpleDateFormat = new SimpleDateFormat ("E MM.dd.yyyy 'at' hh:mm:ss a zzz"); + + private String _ServerAndPort; + private String _PCServerName; + private String _ALMUserName; + private String _ALMPassword; + private String _ALMDomain; + private String _ALMProject; + private String _TestId; + private String _TestInstanceId; + private String _AutoTestInstanceID; + private String _TimeslotDurationHours; + private String _TimeslotDurationMinutes; + private PostRunAction _PostRunAction; + private boolean _VudsMode; + private boolean _StatusBySLA; + private String _Description; + private String _AddRunToTrendReport; + private String _TrendReportId; + private boolean _HTTPSProtocol; + private String _ProxyOutURL; + private String _ProxyOutUser; + private String _ProxyOutPassword; + + + @DataBoundConstructor public PcBuilder( String serverAndPort, @@ -137,30 +162,30 @@ public PcBuilder( this.timeslotDurationMinutes = timeslotDurationMinutes; this.statusBySLA = statusBySLA; - pcModel = - new PcModel( - serverAndPort.trim(), - pcServerName.trim(), - almUserName.trim(), - almPassword, - almDomain.trim(), - almProject.trim(), - testId.trim(), - autoTestInstanceID, - testInstanceId.trim(), - timeslotDurationHours.trim(), - timeslotDurationMinutes.trim(), - postRunAction, - vudsMode, - description, - addRunToTrendReport, - trendReportId, - HTTPSProtocol, - proxyOutURL, - proxyOutUser, - proxyOutPassword); + _ServerAndPort = serverAndPort; + _PCServerName = pcServerName; + _ALMUserName = almUserName; + _ALMPassword = almPassword; + _ALMDomain = almDomain; + _ALMProject = almProject; + _TestId = testId; + _TestInstanceId = testInstanceId; + _AutoTestInstanceID = autoTestInstanceID; + _TimeslotDurationHours = timeslotDurationHours; + _TimeslotDurationMinutes = timeslotDurationMinutes; + _PostRunAction = postRunAction; + _VudsMode = vudsMode; + _StatusBySLA = statusBySLA; + _Description = description; + _AddRunToTrendReport = addRunToTrendReport; + _TrendReportId = trendReportId; + _HTTPSProtocol = HTTPSProtocol; + _ProxyOutURL = proxyOutURL; + _ProxyOutUser = proxyOutUser; + _ProxyOutPassword = proxyOutPassword; + } - + @Override public DescriptorImpl getDescriptor() { @@ -170,18 +195,23 @@ public DescriptorImpl getDescriptor() { @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { - WorkspacePath = new File(build.getWorkspace().toURI()); + if(build.getWorkspace() != null) + WorkspacePath = new File(build.getWorkspace().toURI()); + else + WorkspacePath = null; try { pcModel.setBuildParameters(((AbstractBuild)build).getBuildVariables().toString()); } catch (Exception ex) { } - perform(build, build.getWorkspace(), launcher, listener); - + if(build.getWorkspace() != null) + perform(build, build.getWorkspace(), launcher, listener); + else + return false; return true; } - public File getWorkspacePath(){ + private File getWorkspacePath(){ return WorkspacePath; } - public PcModel getPcModel() { + private PcModel getPcModel() { return pcModel; } @@ -196,32 +226,32 @@ public static String getArtifactsDirectoryName() { return artifactsDirectoryName; } - public static String getArtifactsResourceName() { - - return artifactsResourceName; - } +// public static String getArtifactsResourceName() { +// +// return artifactsResourceName; +// } public static String getRunReportStructure() { return runReportStructure; } - public static String getPcReportArchiveName() { - - return pcReportArchiveName; - } +// public static String getPcReportArchiveName() { +// +// return pcReportArchiveName; +// } - public static String getPcreportFileName() { - - return pcReportFileName; - } +// public static String getPcreportFileName() { +// +// return pcReportFileName; +// } private Testsuites execute(PcClient pcClient, Run build) throws InterruptedException,NullPointerException { try { try { pcModel.setBuildParameters(((AbstractBuild)build).getBuildVariables().toString()); } catch (Exception ex) { } if (!StringUtils.isBlank(pcModel.getDescription())) - logger.println("- - -\nTest description: " + pcModel.getDescription()); + logger.println(String.format("%s - \n- - -\nTest description: %s", _simpleDateFormat.format(new Date()), pcModel.getDescription())); if (!beforeRun(pcClient)) return null; @@ -232,9 +262,9 @@ private Testsuites execute(PcClient pcClient, Run build) pcClient.stopRun(runId); throw e; } catch (NullPointerException e) { - logger.println("Error: Run could not start!"); + logger.println(String.format("%s - Error: Run could not start!", _simpleDateFormat.format(new Date()))); } catch (Exception e) { - logger.println(e); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), e)); } finally { pcClient.logout(); } @@ -290,7 +320,7 @@ private Testsuites run(PcClient pcClient, Run build) } catch (PcException e) { errorMessage = e.getMessage(); - logger.println("Error: " + errorMessage); + logger.println(String.format("%s - Error: %s", _simpleDateFormat.format(new Date()), errorMessage)); } Testsuites ret = new Testsuites(); @@ -338,12 +368,34 @@ private String getTrendReportsDirectory(Run build) { @Override @Deprecated public boolean perform(Build build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + pcModel = + new PcModel( + _ServerAndPort.trim(), + _PCServerName.trim(), + _ALMUserName.trim(), + _ALMPassword, + _ALMDomain.trim(), + _ALMProject.trim(), + _TestId.trim(), + _AutoTestInstanceID, + _TestInstanceId.trim(), + _TimeslotDurationHours.trim(), + _TimeslotDurationMinutes.trim(), + _PostRunAction, + _VudsMode, + _Description, + _AddRunToTrendReport, + _TrendReportId, + _HTTPSProtocol, + _ProxyOutURL, + _ProxyOutUser, + _ProxyOutPassword); return super.perform(build, launcher, listener); } private boolean validatePcForm() { - logger.println("Validating parameters before run"); + logger.println(String.format("%s - Validating parameters before run", _simpleDateFormat.format(new Date()))); String prefix = "doCheck"; boolean ret = true; Method[] methods = getDescriptor().getClass().getMethods(); @@ -403,7 +455,7 @@ private boolean validateTrendReportIdIsNumeric(String trendReportId, boolean add } } - logger.println(res.toString().replace(":

    ","")); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), res.toString().replace(":
    ",""))); return res.equals(FormValidation.ok()); } @@ -444,12 +496,12 @@ private Testsuites parsePcTrendResponse(Testsuites ret,Run build,PcClient // Updating all CSV files for plot plugin // this helps to show the transaction of each result if (isPluginActive("Plot plugin")) { - logger.println("Updating csv files for Trending Charts."); + logger.println(String.format("%s Updating csv files for Trending Charts.", _simpleDateFormat.format(new Date()))); updateCSVFilesForPlot(pcClient, runID); String plotUrlPath = "/job/" + build.getParent().getName() + "/plot"; - logger.println(HyperlinkNote.encodeTo(plotUrlPath, "Trending Charts")); // + HyperlinkNote.encodeTo("https://wiki.jenkins-ci.org/display/JENKINS/HP+Application+Automation+Tools#HPApplicationAutomationTools-RunningPerformanceTestsusingHPPerformanceCenter","More Info")); + logger.println(String.format("%s - %s",_simpleDateFormat.format(new Date()), HyperlinkNote.encodeTo(plotUrlPath, "Trending Charts"))); // + HyperlinkNote.encodeTo("https://wiki.jenkins-ci.org/display/JENKINS/HP+Application+Automation+Tools#HPApplicationAutomationTools-RunningPerformanceTestsusingHPPerformanceCenter","More Info")); }else{ - logger.println("You can view Trending Charts directly from Jenkins using Plot Plugin, see more details on the " + HyperlinkNote.encodeTo("https://wiki.jenkins.io/display/JENKINS/HPE+Application+Automation+Tools#HPEApplicationAutomationTools-RunningPerformanceTestsusingHPEPerformanceCenter","documentation") + "(Performance Center 12.55 and Later)."); + logger.println(String.format("%s - You can view Trending Charts directly from Jenkins using Plot Plugin, see more details on the %s (Performance Center 12.55 and Later).",_simpleDateFormat.format(new Date()), HyperlinkNote.encodeTo("https://wiki.jenkins.io/display/JENKINS/HPE+Application+Automation+Tools#HPEApplicationAutomationTools-RunningPerformanceTestsusingHPEPerformanceCenter","documentation"))); } } return ret; @@ -546,10 +598,10 @@ private boolean saveFileToWorkspacePath(PcClient pcClient, String trendReportID, writer.print(value + ","); } writer.close(); - // logger.println(fileName + " Created."); + // logger.println(String.format("%s - %s Created.", _simpleDateFormat.format(new Date()), fileName); return true; } catch (IOException e) { - logger.println("Error saving file: "+ fileName + " with Error: " + e.getMessage()); + logger.println(String.format("%s - Error saving file: %s with Error: %s",_simpleDateFormat.format(new Date()), fileName + e.getMessage())); return false; } @@ -580,7 +632,7 @@ private void setError(Testcase testCase, String message, String eventLog) { testCase.getSystemErr().add(eventLog); testCase.getError().add(error); testCase.setStatus(JUnitTestCaseStatus.ERROR); - logger.println(String.format("%s %s", message ,eventLog)); + logger.println(String.format("%s - %s %s", _simpleDateFormat.format(new Date()) , message ,eventLog)); } private void setFailure(Testcase testCase, String message, String eventLog) { @@ -590,14 +642,14 @@ private void setFailure(Testcase testCase, String message, String eventLog) { testCase.getSystemErr().add(eventLog); testCase.getFailure().add(failure); testCase.setStatus(JUnitTestCaseStatus.FAILURE); - logger.println(String.format("Failure: %s %s", message ,eventLog)); + logger.println(String.format("%s - Failure: %s %s", _simpleDateFormat.format(new Date()), message ,eventLog)); } private String getOutputForReportLinks(Run build) { String urlPattern = getArtifactsUrlPattern(build); String viewUrl = String.format(urlPattern + "/%s", pcReportFileName); String downloadUrl = String.format(urlPattern + "/%s", "*zip*/pcRun"); - logger.println(HyperlinkNote.encodeTo(viewUrl, "View analysis report of run " + runId)); + logger.println(String.format("%s - %s", _simpleDateFormat.format(new Date()), HyperlinkNote.encodeTo(viewUrl, "View analysis report of run " + runId))); return String.format("Load Test Run ID: %s\n\nView analysis report:\n%s\n\nDownload Report:\n%s", runId, pcModel.getserverAndPort() + "/" + build.getUrl() + viewUrl, pcModel.getserverAndPort() + "/" + build.getUrl() + downloadUrl); } @@ -613,8 +665,8 @@ private String getArtifactsUrlPattern(Run build) { private void provideStepResultStatus(Result resultStatus, Run build) { String runIdStr = (runId > 0) ? String.format(" (PC RunID: %s)", String.valueOf(runId)) : ""; - logger.println(String.format( - "Result Status%s: %s\n- - -", + logger.println(String.format("%s - Result Status%s: %s\n- - -", + _simpleDateFormat.format(new Date()), runIdStr, resultStatus.toString())); build.setResult(resultStatus); @@ -631,18 +683,19 @@ private Result createRunResults(FilePath filePath, Testsuites testsuites) { marshaller.marshal(testsuites, writer); filePath.write(writer.toString(), null); if (containsErrorsOrFailures(testsuites.getTestsuite())) { - ret = Result.UNSTABLE; + ret = Result.FAILURE; } } else { - logger.println("Empty Results"); - ret = Result.UNSTABLE; + logger.println(String.format("%s - Empty Results", _simpleDateFormat.format(new Date()))); + ret = Result.FAILURE; } } catch (Exception cause) { logger.print(String.format( - "Failed to create run results, Exception: %s", + "%s - Failed to create run results, Exception: %s", + _simpleDateFormat.format(new Date()), cause.getMessage())); - ret = Result.UNSTABLE; + ret = Result.FAILURE; } return ret; } From 6c09d80fcfb3026ad43234f10102a2f3c5b8e31c Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 6 Jul 2018 15:40:21 +0300 Subject: [PATCH 0379/2502] Rebranding HpTools Launcher, Aborter and Tests. --- .gitignore | 16 ++++++++-------- HpToolsAborter/HpToolsAborter.csproj | 6 +++--- HpToolsLauncher/HpToolsLauncher.csproj | 2 +- .../HpToolsLauncherTests.csproj | 2 +- HpToolsLauncher/Program.cs | 4 ++-- .../automation/tools/AlmToolsUtils.java | 6 +++--- .../automation/tools/run/RunFromAlmBuilder.java | 10 +++++----- .../automation/tools/run/RunFromFileBuilder.java | 10 +++++----- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 3aa508fc20..f696be34cc 100644 --- a/.gitignore +++ b/.gitignore @@ -81,14 +81,14 @@ HpToolsLauncher/.vs/ HpToolsLauncher/Service References/ #Binaries -src/main/resources/HpToolsAborter.exe.config -src/main/resources/HpToolsAborter.exe -src/main/resources/HpToolsAborter.pdb -src/main/resources/HpToolsLauncher.exe.config -src/main/resources/HpToolsLauncher.exe -src/main/resources/HpToolsLauncher.pdb -src/main/resources/HpToolsLauncher.vshost.exe -src/main/resources/HpToolsLauncher.vshost.exe.config +src/main/resources/MicroFocusToolsAborter.exe.config +src/main/resources/MicroFocusToolsAborter.exe +src/main/resources/MicroFocusToolsAborter.pdb +src/main/resources/MicroFocusToolsLauncher.exe.config +src/main/resources/MicroFocusToolsLauncher.exe +src/main/resources/MicroFocusToolsLauncher.pdb +src/main/resources/MicroFocusToolsLauncher.vshost.exe +src/main/resources/MicroFocusToolsLauncher.vshost.exe.config src/main/resources/LRAnalysisLauncher.exe.config src/main/resources/LRAnalysisLauncher.pdb src/main/resources/LRAnalysisLauncher.exe diff --git a/HpToolsAborter/HpToolsAborter.csproj b/HpToolsAborter/HpToolsAborter.csproj index f3c483145f..b03aa53b28 100644 --- a/HpToolsAborter/HpToolsAborter.csproj +++ b/HpToolsAborter/HpToolsAborter.csproj @@ -9,7 +9,7 @@ Exe Properties HpToolsAborter - HpToolsAborter + MicroFocusToolsAborter v4.0 @@ -35,10 +35,10 @@ 4 - + False .exe - ..\..\bin\HpToolsLauncher.exe + ..\..\bin\MicroFocusToolsLauncher.exe diff --git a/HpToolsLauncher/HpToolsLauncher.csproj b/HpToolsLauncher/HpToolsLauncher.csproj index bbb7728e8d..a54e207da5 100644 --- a/HpToolsLauncher/HpToolsLauncher.csproj +++ b/HpToolsLauncher/HpToolsLauncher.csproj @@ -9,7 +9,7 @@ Exe Properties HpToolsLauncher - HpToolsLauncher + MicroFocusToolsLauncher v4.0 diff --git a/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj b/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj index 712b60e165..aa532548b3 100644 --- a/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj +++ b/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj @@ -10,7 +10,7 @@ Library Properties HpToolsLauncherTests - HpToolsLauncherTests + MicroFocusToolsLauncherTests v4.0 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} diff --git a/HpToolsLauncher/Program.cs b/HpToolsLauncher/Program.cs index c7acf100a9..f0e7c2acb3 100644 --- a/HpToolsLauncher/Program.cs +++ b/HpToolsLauncher/Program.cs @@ -58,9 +58,9 @@ static void Main(string[] args) private static void ShowHelp() { - Console.WriteLine("HPE Automation Tools Command Line Executer"); + Console.WriteLine("Micro Focus Automation Tools Command Line Executer"); Console.WriteLine(); - Console.Write("Usage: HpToolsLauncher.exe"); + Console.Write("Usage: MicroFocusToolsLauncher.exe"); Console.Write(" -paramfile "); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(" "); diff --git a/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java b/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java index 6e6005aabf..17fffc9b11 100644 --- a/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java @@ -104,10 +104,10 @@ public static void runHpToolsAborterOnBuildEnv( ArgumentListBuilder args = new ArgumentListBuilder(); PrintStream out = listener.getLogger(); - String hpToolsAborter_exe = "HpToolsAborter.exe"; + String microFocusToolsAborter_exe = "MicroFocusToolsAborter.exe"; - URL hpToolsAborterUrl = Jenkins.getInstance().pluginManager.uberClassLoader.getResource("HpToolsAborter.exe"); - FilePath hpToolsAborterFile = runWorkspace.child(hpToolsAborter_exe); + URL hpToolsAborterUrl = Jenkins.getInstance().pluginManager.uberClassLoader.getResource("MicroFocusToolsAborter.exe"); + FilePath hpToolsAborterFile = runWorkspace.child(microFocusToolsAborter_exe); args.add(hpToolsAborterFile); args.add(paramFileName); diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java index 510ad9b8e2..b60364efb4 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromAlmBuilder.java @@ -78,7 +78,7 @@ public class RunFromAlmBuilder extends Builder implements SimpleBuildStep { private final RunFromAlmModel runFromAlmModel; - private final static String HpToolsLauncher_SCRIPT_NAME = "HpToolsLauncher.exe"; + private final static String MICRO_FOCUS_TOOLS_LAUNCHER_SCRIPT_NAME = "MicroFocusToolsLauncher.exe"; private String ResultFilename = "ApiResults.xml"; private String ParamFileName = "ApiRun.txt"; //private String KillFileName = ""; @@ -232,14 +232,14 @@ public void perform(Run build, FilePath workspace, Launcher launcher, // Get the URL to the Script used to run the test, which is bundled // in the plugin URL cmdExeUrl = - Hudson.getInstance().pluginManager.uberClassLoader.getResource(HpToolsLauncher_SCRIPT_NAME); + Hudson.getInstance().pluginManager.uberClassLoader.getResource(MICRO_FOCUS_TOOLS_LAUNCHER_SCRIPT_NAME); if (cmdExeUrl == null) { - listener.fatalError(HpToolsLauncher_SCRIPT_NAME + " not found in resources"); + listener.fatalError(MICRO_FOCUS_TOOLS_LAUNCHER_SCRIPT_NAME + " not found in resources"); return; } FilePath propsFileName = projectWS.child(ParamFileName); - FilePath CmdLineExe = projectWS.child(HpToolsLauncher_SCRIPT_NAME); + FilePath CmdLineExe = projectWS.child(MICRO_FOCUS_TOOLS_LAUNCHER_SCRIPT_NAME); try { // create a file for the properties file, and save the properties @@ -254,7 +254,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, } try { - // Run the HpToolsLauncher.exe + // Run the MicroFocusToolsLauncher.exe AlmToolsUtils.runOnBuildEnv(build, launcher, listener, CmdLineExe, ParamFileName); } catch (IOException ioe) { Util.displayIOException(ioe, listener); diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 7d8bcac23d..4b93362f35 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -89,7 +89,7 @@ public class RunFromFileBuilder extends Builder implements SimpleBuildStep { private String ResultFilename = "ApiResults.xml"; private String ParamFileName = "ApiRun.txt"; private final RunFromFileSystemModel runFromFileModel; - private static final String HP_TOOLS_LAUNCHER_EXE = "HpToolsLauncher.exe"; + private static final String MICRO_FOCUS_TOOLS_LAUNCHER_EXE = "MicroFocusToolsLauncher.exe"; private static final String LRANALYSIS_LAUNCHER_EXE = "LRAnalysisLauncher.exe"; /** @@ -496,9 +496,9 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn // Get the URL to the Script used to run the test, which is bundled // in the plugin @SuppressWarnings("squid:S2259") - URL cmdExeUrl = Jenkins.getInstance().pluginManager.uberClassLoader.getResource(HP_TOOLS_LAUNCHER_EXE); + URL cmdExeUrl = Jenkins.getInstance().pluginManager.uberClassLoader.getResource(MICRO_FOCUS_TOOLS_LAUNCHER_EXE); if (cmdExeUrl == null) { - listener.fatalError(HP_TOOLS_LAUNCHER_EXE + " not found in resources"); + listener.fatalError(MICRO_FOCUS_TOOLS_LAUNCHER_EXE + " not found in resources"); return; } @@ -510,7 +510,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } FilePath propsFileName = workspace.child(ParamFileName); - CmdLineExe = workspace.child(HP_TOOLS_LAUNCHER_EXE); + CmdLineExe = workspace.child(MICRO_FOCUS_TOOLS_LAUNCHER_EXE); FilePath CmdLineExe2 = workspace.child(LRANALYSIS_LAUNCHER_EXE); try { @@ -529,7 +529,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } try { - // Run the HpToolsLauncher.exe + // Run the MicroFocusToolsLauncher.exe AlmToolsUtils.runOnBuildEnv(build, launcher, listener, CmdLineExe, ParamFileName); // Has the report been successfully generated? } catch (IOException ioe) { From 59bdd87566839797e91a3c946d59856d0a7edeba Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 6 Jul 2018 17:24:05 +0300 Subject: [PATCH 0380/2502] Assembly and Console Output messages rebranding --- HpToolsAborter/Program.cs | 4 ++-- HpToolsAborter/Properties/AssemblyInfo.cs | 8 ++++---- .../HpToolsLauncherTests/Properties/AssemblyInfo.cs | 8 ++++---- HpToolsLauncher/Properties/AssemblyInfo.cs | 8 ++++---- LRAnalysisLauncher/Properties/AssemblyInfo.cs | 4 ++-- .../hpe/application/automation/tools/AlmToolsUtils.java | 2 +- .../automation/tools/run/RunFromFileBuilder.java | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/HpToolsAborter/Program.cs b/HpToolsAborter/Program.cs index 64cab146ad..ceb04f501f 100644 --- a/HpToolsAborter/Program.cs +++ b/HpToolsAborter/Program.cs @@ -34,7 +34,7 @@ static void Main(string[] args) { if (args == null || args.Length ==0) { - Console.Out.WriteLine("Usage: HpToolsAborter paramfile"); + Console.Out.WriteLine("Usage: MicroFocusToolsAborter paramfile"); return; } @@ -91,7 +91,7 @@ static void Main(string[] args) } catch (Exception ex) { - Console.Out.WriteLine(string.Format("Error in HpToolsAborter: {0} ",ex.Message)); + Console.Out.WriteLine(string.Format("Error in MicroFocusToolsAborter: {0} ",ex.Message)); } } diff --git a/HpToolsAborter/Properties/AssemblyInfo.cs b/HpToolsAborter/Properties/AssemblyInfo.cs index d35670bcec..4f65cb721b 100644 --- a/HpToolsAborter/Properties/AssemblyInfo.cs +++ b/HpToolsAborter/Properties/AssemblyInfo.cs @@ -22,12 +22,12 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("HpToolsAborter")] +[assembly: AssemblyTitle("MicroFocusToolsAborter")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HpToolsAborter")] -[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyCompany("Micro Focus Company")] +[assembly: AssemblyProduct("MicroFocusToolsAborter")] +[assembly: AssemblyCopyright("Copyright © Micro Focus Company 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs b/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs index 524ab8605e..2c55eed062 100644 --- a/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs +++ b/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs @@ -10,12 +10,12 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("HpToolsLauncherTests")] +[assembly: AssemblyTitle("MicroFocusToolsLauncherTests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Hewlett-Packard Company")] -[assembly: AssemblyProduct("HpToolsLauncherTests")] -[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2012")] +[assembly: AssemblyCompany("Micro Focus Company")] +[assembly: AssemblyProduct("MicroFocusToolsLauncherTests")] +[assembly: AssemblyCopyright("Copyright © Micro Focus 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/HpToolsLauncher/Properties/AssemblyInfo.cs b/HpToolsLauncher/Properties/AssemblyInfo.cs index e5e26aed36..24f8c3138d 100644 --- a/HpToolsLauncher/Properties/AssemblyInfo.cs +++ b/HpToolsLauncher/Properties/AssemblyInfo.cs @@ -10,12 +10,12 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("HpToolsLauncher")] +[assembly: AssemblyTitle("MicroFocusToolsLauncher")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Hewlett-Packard Company")] -[assembly: AssemblyProduct("HpToolsLauncher")] -[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2012")] +[assembly: AssemblyCompany("Micro Focus Company")] +[assembly: AssemblyProduct("MicroFocusToolsLauncher")] +[assembly: AssemblyCopyright("Copyright © Micro Focus Company 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/LRAnalysisLauncher/Properties/AssemblyInfo.cs b/LRAnalysisLauncher/Properties/AssemblyInfo.cs index 948ff1cca9..c072367a7e 100644 --- a/LRAnalysisLauncher/Properties/AssemblyInfo.cs +++ b/LRAnalysisLauncher/Properties/AssemblyInfo.cs @@ -26,9 +26,9 @@ [assembly: AssemblyTitle("LRAnalysisLauncher")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Hewlett-Packard Company")] +[assembly: AssemblyCompany("Micro Focus Company")] [assembly: AssemblyProduct("LRAnalysisLauncher")] -[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2013")] +[assembly: AssemblyCopyright("Copyright © Micro Focus Company 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java b/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java index 17fffc9b11..3b4fef5b8c 100644 --- a/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java +++ b/src/main/java/com/hpe/application/automation/tools/AlmToolsUtils.java @@ -119,7 +119,7 @@ public static void runHpToolsAborterOnBuildEnv( try { hpToolsAborterFile.delete(); } catch (Exception e) { - listener.error("failed copying HpToolsAborter" + e); + listener.error("failed copying MicroFocusToolsAborter" + e); } diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 4b93362f35..cafe033991 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -535,12 +535,12 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } catch (IOException ioe) { Util.displayIOException(ioe, listener); build.setResult(Result.FAILURE); - listener.error("Failed running HpToolsLauncher " + ioe); + listener.error("Failed running MicroFocusToolsLauncher " + ioe); return; } catch (InterruptedException e) { build.setResult(Result.ABORTED); PrintStream out = listener.getLogger(); - listener.error("Failed running HpToolsLauncher - build aborted " + e); + listener.error("Failed running MicroFocusToolsLauncher - build aborted " + e); try { AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); @@ -549,7 +549,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn build.setResult(Result.FAILURE); return; } catch (InterruptedException e1) { - listener.error("Failed running HpToolsAborter " + e1); + listener.error("Failed running MicroFocusToolsAborter " + e1); } out.println("Operation Was aborted by user."); } From 3d7a530eadb7c470862f47a04ad2b0635c946372 Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 6 Jul 2018 17:48:58 +0300 Subject: [PATCH 0381/2502] Fixed typo in assembly company. --- HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs b/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs index 2c55eed062..6400b654b7 100644 --- a/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs +++ b/HpToolsLauncher/HpToolsLauncherTests/Properties/AssemblyInfo.cs @@ -15,7 +15,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Micro Focus Company")] [assembly: AssemblyProduct("MicroFocusToolsLauncherTests")] -[assembly: AssemblyCopyright("Copyright © Micro Focus 2018")] +[assembly: AssemblyCopyright("Copyright © Micro Focus Company 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] From b0f7a726a2204c20c25e4fcb65c0a102018ffe16 Mon Sep 17 00:00:00 2001 From: danieldanan Date: Sun, 8 Jul 2018 17:16:03 +0300 Subject: [PATCH 0382/2502] canceling irrelevant changes that were related to another fix handled separately --- .../automation/tools/run/PcBuilder.java | 124 ++++++------------ 1 file changed, 40 insertions(+), 84 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index a472091696..2845e3d437 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -82,16 +82,16 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ private static final String artifactsDirectoryName = "archive"; - private static final String artifactsResourceName = "artifact"; - private static final String runReportStructure = "%s/%s/performanceTestsReports/pcRun"; - private static final String trendReportStructure = "%s/%s/performanceTestsReports/TrendReports"; + public static final String artifactsResourceName = "artifact"; + public static final String runReportStructure = "%s/%s/performanceTestsReports/pcRun"; + public static final String trendReportStructure = "%s/%s/performanceTestsReports/TrendReports"; public static final String pcReportArchiveName = "Reports.zip"; public static final String pcReportFileName = "Report.html"; private static final String RUNID_BUILD_VARIABLE = "HP_RUN_ID"; public static final String TRENDED = "Trended"; public static final String PENDING = "Pending"; - //public static final String PUBLISHING = "Publishing"; + public static final String PUBLISHING = "Publishing"; public static final String ERROR = "Error"; private PcModel pcModel; @@ -109,28 +109,6 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ private File WorkspacePath; private SimpleDateFormat _simpleDateFormat = new SimpleDateFormat ("E MM.dd.yyyy 'at' hh:mm:ss a zzz"); - private String _ServerAndPort; - private String _PCServerName; - private String _ALMUserName; - private String _ALMPassword; - private String _ALMDomain; - private String _ALMProject; - private String _TestId; - private String _TestInstanceId; - private String _AutoTestInstanceID; - private String _TimeslotDurationHours; - private String _TimeslotDurationMinutes; - private PostRunAction _PostRunAction; - private boolean _VudsMode; - private boolean _StatusBySLA; - private String _Description; - private String _AddRunToTrendReport; - private String _TrendReportId; - private boolean _HTTPSProtocol; - private String _ProxyOutURL; - private String _ProxyOutUser; - private String _ProxyOutPassword; - @DataBoundConstructor @@ -162,28 +140,28 @@ public PcBuilder( this.timeslotDurationMinutes = timeslotDurationMinutes; this.statusBySLA = statusBySLA; - _ServerAndPort = serverAndPort; - _PCServerName = pcServerName; - _ALMUserName = almUserName; - _ALMPassword = almPassword; - _ALMDomain = almDomain; - _ALMProject = almProject; - _TestId = testId; - _TestInstanceId = testInstanceId; - _AutoTestInstanceID = autoTestInstanceID; - _TimeslotDurationHours = timeslotDurationHours; - _TimeslotDurationMinutes = timeslotDurationMinutes; - _PostRunAction = postRunAction; - _VudsMode = vudsMode; - _StatusBySLA = statusBySLA; - _Description = description; - _AddRunToTrendReport = addRunToTrendReport; - _TrendReportId = trendReportId; - _HTTPSProtocol = HTTPSProtocol; - _ProxyOutURL = proxyOutURL; - _ProxyOutUser = proxyOutUser; - _ProxyOutPassword = proxyOutPassword; - + pcModel = + new PcModel( + serverAndPort.trim(), + pcServerName.trim(), + almUserName.trim(), + almPassword, + almDomain.trim(), + almProject.trim(), + testId.trim(), + autoTestInstanceID, + testInstanceId.trim(), + timeslotDurationHours.trim(), + timeslotDurationMinutes.trim(), + postRunAction, + vudsMode, + description, + addRunToTrendReport, + trendReportId, + HTTPSProtocol, + proxyOutURL, + proxyOutUser, + proxyOutPassword); } @Override @@ -207,11 +185,11 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen return true; } - private File getWorkspacePath(){ + public File getWorkspacePath(){ return WorkspacePath; } - private PcModel getPcModel() { + public PcModel getPcModel() { return pcModel; } @@ -226,25 +204,25 @@ public static String getArtifactsDirectoryName() { return artifactsDirectoryName; } -// public static String getArtifactsResourceName() { -// -// return artifactsResourceName; -// } + public static String getArtifactsResourceName() { + + return artifactsResourceName; + } public static String getRunReportStructure() { return runReportStructure; } -// public static String getPcReportArchiveName() { -// -// return pcReportArchiveName; -// } + public static String getPcReportArchiveName() { + + return pcReportArchiveName; + } -// public static String getPcreportFileName() { -// -// return pcReportFileName; -// } + public static String getPcreportFileName() { + + return pcReportFileName; + } private Testsuites execute(PcClient pcClient, Run build) throws InterruptedException,NullPointerException { @@ -368,28 +346,6 @@ private String getTrendReportsDirectory(Run build) { @Override @Deprecated public boolean perform(Build build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { - pcModel = - new PcModel( - _ServerAndPort.trim(), - _PCServerName.trim(), - _ALMUserName.trim(), - _ALMPassword, - _ALMDomain.trim(), - _ALMProject.trim(), - _TestId.trim(), - _AutoTestInstanceID, - _TestInstanceId.trim(), - _TimeslotDurationHours.trim(), - _TimeslotDurationMinutes.trim(), - _PostRunAction, - _VudsMode, - _Description, - _AddRunToTrendReport, - _TrendReportId, - _HTTPSProtocol, - _ProxyOutURL, - _ProxyOutUser, - _ProxyOutPassword); return super.perform(build, launcher, listener); } From 4d5af19b82986ba9a9595f1a43a139e1a69f58bc Mon Sep 17 00:00:00 2001 From: danieldanan Date: Sun, 8 Jul 2018 19:19:01 +0300 Subject: [PATCH 0383/2502] using %s instead of %d (safest in case of something wrong). --- .../application/automation/tools/pc/PcClient.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java index 82229d0489..6d52828e2c 100644 --- a/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/hpe/application/automation/tools/pc/PcClient.java @@ -142,7 +142,7 @@ private int getCorrectTestInstanceID(int testID) throws IOException, PcException if (pcTestInstances != null && pcTestInstances.getTestInstancesList() != null){ PcTestInstance pcTestInstance = pcTestInstances.getTestInstancesList().get(pcTestInstances.getTestInstancesList().size()-1); testInstanceID = pcTestInstance.getInstanceId(); - logger.println(String.format("%s - Found testInstanceId: %d", _simpleDateFormat.format(new Date()), testInstanceID)); + logger.println(String.format("%s - Found testInstanceId: %s", _simpleDateFormat.format(new Date()), testInstanceID)); }else{ logger.println(String.format("%s - Could not find available TestInstanceID, Creating Test Instance.", _simpleDateFormat.format(new Date()))); logger.println(String.format("%s - Searching for available TestSet", _simpleDateFormat.format(new Date()))); @@ -238,7 +238,7 @@ private PcRunResponse waitForRunState(int runId, RunState completionState, int i try { if (threeStrikes < 3) { - logger.println(String.format("%s - Cannot get response from PC about the state of RunID: %s %d time(s) consecutively",_simpleDateFormat.format(new Date()), runId, (3 - threeStrikes))); + logger.println(String.format("%s - Cannot get response from PC about the state of RunID: %s %s time(s) consecutively",_simpleDateFormat.format(new Date()), runId, (3 - threeStrikes))); if(threeStrikes==0) { logger.println(String.format("%s - stopping monitoring on RunID: %s", _simpleDateFormat.format(new Date()), runId)); break; @@ -344,10 +344,10 @@ public void addRunToTrendReport(int runId, String trendReportId) { TrendReportRequest trRequest = new TrendReportRequest(model.getAlmProject(true), runId, null); - logger.println(String.format("%s - Adding run: %d to trend report: %s", _simpleDateFormat.format(new Date()), runId, trendReportId)); + logger.println(String.format("%s - Adding run: %s to trend report: %s", _simpleDateFormat.format(new Date()), runId, trendReportId)); try { restProxy.updateTrendReport(trendReportId, trRequest); - logger.println(String.format("%s - Publishing run: %d on trend report: %s", _simpleDateFormat.format(new Date()), runId, trendReportId)); + logger.println(String.format("%s - Publishing run: %s on trend report: %s", _simpleDateFormat.format(new Date()), runId, trendReportId)); } catch (PcException e) { logger.println(String.format("%s - Failed to add run to trend report: %s", _simpleDateFormat.format(new Date()), e.getMessage())); @@ -374,7 +374,7 @@ public void waitForRunToPublishOnTrendReport(int runId, String trendReportId) th if (result.getState().equals(PcBuilder.TRENDED) || result.getState().equals(PcBuilder.ERROR)){ publishEnded = true; - logger.println(String.format("%s - Run: %d publishing status: %s", _simpleDateFormat.format(new Date()), runId, result.getState())); + logger.println(String.format("%s - Run: %s publishing status: %s", _simpleDateFormat.format(new Date()), runId, result.getState())); break; }else{ Thread.sleep(5000); @@ -393,7 +393,7 @@ public boolean downloadTrendReportAsPdf(String trendReportId, String directory) try { - logger.println(String.format("%s - Downloading trend report: %d in PDF format", _simpleDateFormat.format(new Date()), trendReportId)); + logger.println(String.format("%s - Downloading trend report: %s in PDF format", _simpleDateFormat.format(new Date()), trendReportId)); InputStream in = restProxy.getTrendingPDF(trendReportId); File dir = new File(directory); if(!dir.exists()){ @@ -402,7 +402,7 @@ public boolean downloadTrendReportAsPdf(String trendReportId, String directory) String filePath = directory + IOUtils.DIR_SEPARATOR + "trendReport" + trendReportId + ".pdf"; Path destination = Paths.get(filePath); Files.copy(in, destination, StandardCopyOption.REPLACE_EXISTING); - logger.println(String.format("%s - Trend report: %d was successfully downloaded", _simpleDateFormat.format(new Date()), trendReportId)); + logger.println(String.format("%s - Trend report: %s was successfully downloaded", _simpleDateFormat.format(new Date()), trendReportId)); } catch (Exception e) { From a7d7613f018f8f90fafc319793173174f45318b3 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Mon, 9 Jul 2018 07:43:13 +0300 Subject: [PATCH 0384/2502] Change NullPointerException to IllegalArgumentException They are confusing because most people will assume that the virtual machine threw it. --- .../automation/tools/common/CompatibilityRebrander.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java index 86371dc73a..ed484fe559 100644 --- a/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java +++ b/src/main/java/com/hpe/application/automation/tools/common/CompatibilityRebrander.java @@ -48,7 +48,7 @@ public static void addAliasesToAllClasses() { addAliases(c); } } - catch(ClassNotFoundException | NullPointerException | IOException e) { + catch(ClassNotFoundException | IllegalArgumentException | IOException e) { LOG.warning(e.getMessage()); } } @@ -122,6 +122,7 @@ private static List getDirectories(Enumeration resources) { /** * The context that is supplied was Jenkins and the project itself, it required the following workaround. + * @throws IllegalArgumentException * @return ClassLoader that is related to the project context */ private static ClassLoader getContextClassLoader(){ @@ -129,7 +130,7 @@ private static ClassLoader getContextClassLoader(){ ClassLoader tempClassLoader = thread.getContextClassLoader(); if (tempClassLoader == null) { - throw new NullPointerException("Context ClassLoader not found: re-branding will not work"); + throw new IllegalArgumentException("Context ClassLoader not found: re-branding will not work"); } thread.setContextClassLoader(CompatibilityRebrander.class.getClassLoader()); From 7e930f4bea6753f0e784e1dc210eb0a0690c0c8e Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Mon, 9 Jul 2018 09:18:57 +0300 Subject: [PATCH 0385/2502] LoadRunner UI Rebranding --- .../tools/pipelineSteps/LoadRunnerTestStep/config.properties | 2 +- .../automation/tools/run/RunFromFileBuilder/config.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.properties b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.properties index 3087492762..a9794cf19c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.properties +++ b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.properties @@ -31,6 +31,6 @@ # # -DontForgetThePublisher=Make sure to enable the Publish HPE \ +DontForgetThePublisher=Make sure to enable the Publish Micro Focus \ tests result option in the Post-build \ Actions section. This allows the tests results to be published. \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.properties b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.properties index 3087492762..a9794cf19c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.properties +++ b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.properties @@ -31,6 +31,6 @@ # # -DontForgetThePublisher=Make sure to enable the Publish HPE \ +DontForgetThePublisher=Make sure to enable the Publish Micro Focus \ tests result option in the Post-build \ Actions section. This allows the tests results to be published. \ No newline at end of file From 67079480c339f29d56c28e544c7ad31e7f1ddb52 Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Mon, 9 Jul 2018 09:21:49 +0300 Subject: [PATCH 0386/2502] Build Step rebranding for LR --- .../application/automation/tools/run/RunFromFileBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 7d8bcac23d..d900d71cd4 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -706,7 +706,7 @@ public String getMcServerUrl(String serverName) { @Override public String getDisplayName() { - return "Execute HPE tests from file system"; + return "Execute Micro Focus tests from file system"; } /** From 5855b1c997931147ccf4718c765b9fb61cf7bc94 Mon Sep 17 00:00:00 2001 From: Roy Lu Date: Mon, 9 Jul 2018 16:35:37 +0800 Subject: [PATCH 0387/2502] Remove the inaccurate part of the help doc. --- .../settings/AlmServerSettingsBuilder/help-almServerName.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder/help-almServerName.html b/src/main/resources/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder/help-almServerName.html index 1e6043edac..a010eac79b 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder/help-almServerName.html +++ b/src/main/resources/com/hpe/application/automation/tools/settings/AlmServerSettingsBuilder/help-almServerName.html @@ -32,5 +32,5 @@ -->
    - The name of the ALM Server. This will be used in the "Execute HPE functional test from ALM" build step configuration. + The name of the ALM Server.
    From 81cbbd376a7f6b0ec7f54a9e3999caa0db96e74a Mon Sep 17 00:00:00 2001 From: gullery Date: Mon, 9 Jul 2018 11:54:27 +0300 Subject: [PATCH 0388/2502] tech: updating SDK, adding SDK's logging configuration --- pom.xml | 2 +- src/main/resources/log4j2.xml | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/log4j2.xml diff --git a/pom.xml b/pom.xml index 989f54a08d..90d4b2f3e5 100644 --- a/pom.xml +++ b/pom.xml @@ -464,7 +464,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5.20 + 1.5-SNAPSHOT diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000000..9d952f169a --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,50 @@ + + + + + + + %d{dd/MM/yyyy HH:mm:ss,SSS} %-5p [%t] - %c{1}: %m%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 7a625b20fed6eea82af004e3a9d79a88bbec461a Mon Sep 17 00:00:00 2001 From: Michael Seldin Date: Mon, 9 Jul 2018 14:26:04 +0300 Subject: [PATCH 0389/2502] userstory #649003 --- .../application/automation/tools/octane/Messages.properties | 6 +++--- .../automation/tools/octane/OctanePlugin/global.properties | 4 ++-- .../cucumber/CucumberTestResultsActionPublisher/help.html | 2 +- .../configuration/ConfigurationAction/index.properties | 2 +- .../settings/OctaneServerSettingsBuilder/global.properties | 4 ++-- src/main/resources/index.jelly | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties b/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties index 6a258ade8c..62d353b88b 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties +++ b/src/main/resources/com/hpe/application/automation/tools/octane/Messages.properties @@ -31,7 +31,7 @@ # # -PluginName=HPE ALM Octane CI Plugin +PluginName=ALM Octane CI Plugin ServerName=ALM Octane server ConfigurationSaveFailed=Unable to save configuration ConfigurationUrlNotSpecified=URL must be specified @@ -39,7 +39,7 @@ ConfigurationUrInvalid=Invalid URL ApplicationContextNotFound=Application context not found in URL UnexpectedSharedSpace=Unexpected shared space parameter value MissingSharedSpace=Missing shared space parameter -ConfigurationLabel=HPE ALM Octane Pipelines +ConfigurationLabel=ALM Octane Pipelines TooManyResults=Too many matches. Use a more specific filter. ConnectionSuccess=Connection successful @@ -54,7 +54,7 @@ CommunicationProblem=Problem with communication with ALM Octane server UnexpectedFailure=Connectivity test failed with unexpected failure #Cucumber results action -CucumberReporterName=HPE Octane Cucumber test reporter +CucumberReporterName=Octane Cucumber test reporter CucumberResultsActionEmptyConfiguration=Cucumber report XMLs configuration is empty. Looking for \"%s\". CucumberResultsActionCollecting=Collecting Cucumber results to send to Octane. CucumberResultsActionNotFound=Cucumber result XMLs for Octane were not found. Configuration error? diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.properties b/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.properties index 2547d1929a..38a9cf649e 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.properties +++ b/src/main/resources/com/hpe/application/automation/tools/octane/OctanePlugin/global.properties @@ -31,8 +31,8 @@ # # -global.config.description=HPE ALM Octane CI Plugin -global.config.server.title=HPE ALM Octane Server Configuration +global.config.description=ALM Octane CI Plugin +global.config.server.title=ALM Octane Server Configuration global.config.location.title=Location global.config.location.description=Location of the ALM Octane application global.config.domain.title=Domain diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher/help.html b/src/main/resources/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher/help.html index babb1687f6..73bd3465e2 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher/help.html +++ b/src/main/resources/com/hpe/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher/help.html @@ -33,7 +33,7 @@
    When using this action, Jenkins understands and reads the Cucumber test report XML structure. - After reading the structure, Jenkins can provide useful information about Cucumber tests results to HPE ALM Octane. + After reading the structure, Jenkins can provide useful information about Cucumber tests results to ALM Octane.

    To use the feature, ensure that you have added a Publish JUnit test results post-build action to your build. diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction/index.properties b/src/main/resources/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction/index.properties index 14a9f87819..3ba2b19496 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction/index.properties +++ b/src/main/resources/com/hpe/application/automation/tools/octane/configuration/ConfigurationAction/index.properties @@ -31,4 +31,4 @@ # # -mqm.configuration.title=HPE ALM Octane Pipelines \ No newline at end of file +mqm.configuration.title=ALM Octane Pipelines \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties index 3c2b617766..bf73e57664 100644 --- a/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties +++ b/src/main/resources/com/hpe/application/automation/tools/settings/OctaneServerSettingsBuilder/global.properties @@ -31,8 +31,8 @@ # # -global.config.description=HPE ALM Octane CI Plugin -global.config.server.title=HPE ALM Octane Server Configuration +global.config.description=ALM Octane CI Plugin +global.config.server.title=ALM Octane Server Configuration global.config.location.title=Location global.config.location.description=Location of the ALM Octane application global.config.domain.title=Domain diff --git a/src/main/resources/index.jelly b/src/main/resources/index.jelly index fa1f09a5d3..1f405a1bbb 100644 --- a/src/main/resources/index.jelly +++ b/src/main/resources/index.jelly @@ -36,5 +36,5 @@ -->

    - This plugin enables integration with HPE products, such as: ALM, ALM Octane, Unified Functional Testing, LoadRunner, and Performance Center. + This plugin enables integration with ALM, ALM Octane, Unified Functional Testing, LoadRunner, and Performance Center.
    From 3494d5d747eaa8474283691372c493508ed973da Mon Sep 17 00:00:00 2001 From: Daniel Shmaya Date: Mon, 9 Jul 2018 15:52:15 +0300 Subject: [PATCH 0390/2502] us #584005: Branch Compare : expand Jenkins Plugin Capabilities - cleanup --- .../tools/octane/events/RunListenerImpl.java | 381 +++++++++--------- .../model/processors/scm/GitSCMProcessor.java | 243 +++++------ .../model/processors/scm/SCMProcessor.java | 8 +- 3 files changed, 322 insertions(+), 310 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java index 43cb191f39..6a0e2d9998 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/RunListenerImpl.java @@ -77,216 +77,215 @@ @Extension @SuppressWarnings({"squid:S2259", "squid:S1872", "squid:S1698", "squid:S1132"}) public final class RunListenerImpl extends RunListener { - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + private ExecutorService executor = new ThreadPoolExecutor(0, 5, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue()); - @Inject - private TestListener testListener; + @Inject + private TestListener testListener; - @Override - public void onStarted(final Run r, TaskListener listener) { - if (!ConfigurationService.getServerConfiguration().isValid()) { - return; - } - if (ConfigurationService.getModel().isSuspend()) { - return; - } + @Override + public void onStarted(final Run r, TaskListener listener) { + if (!ConfigurationService.getServerConfiguration().isValid()) { + return; + } + if (ConfigurationService.getModel().isSuspend()) { + return; + } - CIEvent event; - if (r.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowRun")) { - event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.STARTED) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) - .setNumber(String.valueOf(r.getNumber())) - .setStartTime(r.getStartTimeInMillis()) - .setPhaseType(PhaseType.POST) - .setEstimatedDuration(r.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))); + CIEvent event; + if (r.getClass().getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowRun")) { + event = dtoFactory.newDTO(CIEvent.class) + .setEventType(CIEventType.STARTED) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setNumber(String.valueOf(r.getNumber())) + .setStartTime(r.getStartTimeInMillis()) + .setPhaseType(PhaseType.POST) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))); - if (r.getParent().getParent() != null && r.getParent().getParent().getClass().getName().equals(JobProcessorFactory.WORKFLOW_MULTI_BRANCH_JOB_NAME)) { - event - .setParentCiId(r.getParent().getParent().getFullName()) - .setMultiBranchType(MultiBranchType.MULTI_BRANCH_CHILD) - .setProjectDisplayName(r.getParent().getFullName()); - } + if (r.getParent().getParent() != null && r.getParent().getParent().getClass().getName().equals(JobProcessorFactory.WORKFLOW_MULTI_BRANCH_JOB_NAME)) { + event + .setParentCiId(r.getParent().getParent().getFullName()) + .setMultiBranchType(MultiBranchType.MULTI_BRANCH_CHILD) + .setProjectDisplayName(r.getParent().getFullName()); + } - OctaneSDK.getInstance().getEventsService().publishEvent(event); - //events on the internal stages of the workflowRun are handled in this place: - // com.hpe.application.automation.tools.octane.workflow.WorkflowGraphListener + OctaneSDK.getInstance().getEventsService().publishEvent(event); + //events on the internal stages of the workflowRun are handled in this place: + // com.hpe.application.automation.tools.octane.workflow.WorkflowGraphListener - } else { - if (r.getParent() instanceof MatrixConfiguration) { - event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.STARTED) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) - .setNumber(String.valueOf(r.getNumber())) - .setStartTime(r.getStartTimeInMillis()) - .setEstimatedDuration(r.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setParameters(ParameterProcessors.getInstances(r)); - if (isInternal(r)) { - event.setPhaseType(PhaseType.INTERNAL); - } else { - event.setPhaseType(PhaseType.POST); - } - OctaneSDK.getInstance().getEventsService().publishEvent(event); - } else if (r instanceof AbstractBuild) { - event = dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.STARTED) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) - .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) - .setNumber(String.valueOf(r.getNumber())) - .setStartTime(r.getStartTimeInMillis()) - .setEstimatedDuration(r.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setParameters(ParameterProcessors.getInstances(r)); - if (isInternal(r)) { - event.setPhaseType(PhaseType.INTERNAL); - } else { - event.setPhaseType(PhaseType.POST); - } - OctaneSDK.getInstance().getEventsService().publishEvent(event); - } - } - } + } else { + if (r.getParent() instanceof MatrixConfiguration) { + event = dtoFactory.newDTO(CIEvent.class) + .setEventType(CIEventType.STARTED) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setNumber(String.valueOf(r.getNumber())) + .setStartTime(r.getStartTimeInMillis()) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setParameters(ParameterProcessors.getInstances(r)); + if (isInternal(r)) { + event.setPhaseType(PhaseType.INTERNAL); + } else { + event.setPhaseType(PhaseType.POST); + } + OctaneSDK.getInstance().getEventsService().publishEvent(event); + } else if (r instanceof AbstractBuild) { + event = dtoFactory.newDTO(CIEvent.class) + .setEventType(CIEventType.STARTED) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setNumber(String.valueOf(r.getNumber())) + .setStartTime(r.getStartTimeInMillis()) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setParameters(ParameterProcessors.getInstances(r)); + if (isInternal(r)) { + event.setPhaseType(PhaseType.INTERNAL); + } else { + event.setPhaseType(PhaseType.POST); + } + OctaneSDK.getInstance().getEventsService().publishEvent(event); + } + } + } - @Override - public void onFinalized(Run r) { - if (onFinelizedValidations()) return; + @Override + public void onFinalized(Run r) { + if (onFinelizedValidations()) return; - CommonOriginRevision commonOriginRevision= getCommonOriginRevision(r); + CommonOriginRevision commonOriginRevision = getCommonOriginRevision(r); - boolean hasTests = testListener.processBuild(r); + boolean hasTests = testListener.processBuild(r); - CIBuildResult result; - result = getCiBuildResult(r); - CIEvent event = getCiEvent(r, commonOriginRevision, hasTests, result); + CIBuildResult result; + result = getCiBuildResult(r); + CIEvent event = getCiEvent(r, commonOriginRevision, hasTests, result); - if (r instanceof AbstractBuild) { - event.setParameters(ParameterProcessors.getInstances(r)) - .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)); - } - OctaneSDK.getInstance().getEventsService().publishEvent(event); - } + if (r instanceof AbstractBuild) { + event.setParameters(ParameterProcessors.getInstances(r)) + .setProjectDisplayName(BuildHandlerUtils.getJobCiId(r)); + } + OctaneSDK.getInstance().getEventsService().publishEvent(event); + } + private CIEvent getCiEvent(Run r, CommonOriginRevision commonOriginRevision, boolean hasTests, CIBuildResult result) { + return dtoFactory.newDTO(CIEvent.class) + .setEventType(CIEventType.FINISHED) + .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) + .setNumber(String.valueOf(r.getNumber())) + .setProject(BuildHandlerUtils.getJobCiId(r)) + .setStartTime(r.getStartTimeInMillis()) + .setEstimatedDuration(r.getEstimatedDuration()) + .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) + .setResult(result) + .setDuration(r.getDuration()) + .setCommonHashId(commonOriginRevision != null ? commonOriginRevision.revision : null) + .setBranchName(commonOriginRevision != null ? commonOriginRevision.branch : null) + .setTestResultExpected(hasTests); + } - private CIEvent getCiEvent(Run r, CommonOriginRevision commonOriginRevision, boolean hasTests, CIBuildResult result) { - return dtoFactory.newDTO(CIEvent.class) - .setEventType(CIEventType.FINISHED) - .setBuildCiId(BuildHandlerUtils.getBuildCiId(r)) - .setNumber(String.valueOf(r.getNumber())) - .setProject(BuildHandlerUtils.getJobCiId(r)) - .setStartTime(r.getStartTimeInMillis()) - .setEstimatedDuration(r.getEstimatedDuration()) - .setCauses(CIEventCausesFactory.processCauses(extractCauses(r))) - .setResult(result) - .setDuration(r.getDuration()) - .setCommonHashId(commonOriginRevision != null ? commonOriginRevision.revision : null) - .setBranchName(commonOriginRevision != null ? commonOriginRevision.branch : null) - .setTestResultExpected(hasTests); - } + private boolean onFinelizedValidations() { + return (!ConfigurationService.getServerConfiguration().isValid() || + ConfigurationService.getModel().isSuspend()); + } - private boolean onFinelizedValidations() { - return (!ConfigurationService.getServerConfiguration().isValid() || - ConfigurationService.getModel().isSuspend()); - } + private CIBuildResult getCiBuildResult(Run r) { + CIBuildResult result; + if (r.getResult() == Result.SUCCESS) { + result = CIBuildResult.SUCCESS; + } else if (r.getResult() == Result.ABORTED) { + result = CIBuildResult.ABORTED; + } else if (r.getResult() == Result.FAILURE) { + result = CIBuildResult.FAILURE; + } else if (r.getResult() == Result.UNSTABLE) { + result = CIBuildResult.UNSTABLE; + } else { + result = CIBuildResult.UNAVAILABLE; + } + return result; + } - private CIBuildResult getCiBuildResult(Run r) { - CIBuildResult result; - if (r.getResult() == Result.SUCCESS) { - result = CIBuildResult.SUCCESS; - } else if (r.getResult() == Result.ABORTED) { - result = CIBuildResult.ABORTED; - } else if (r.getResult() == Result.FAILURE) { - result = CIBuildResult.FAILURE; - } else if (r.getResult() == Result.UNSTABLE) { - result = CIBuildResult.UNSTABLE; - } else { - result = CIBuildResult.UNAVAILABLE; - } - return result; - } + private CommonOriginRevision getCommonOriginRevision(Run r) { + CommonOriginRevision commonOriginRevision = null; + if (r instanceof AbstractBuild) { + final SCM scm = ((AbstractBuild) r).getProject().getScm(); + if (scm != null) { + SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); + if (scmProcessor != null) { + commonOriginRevision = scmProcessor.getCommonOriginRevision(r); + } + } + } + return commonOriginRevision; + } - private CommonOriginRevision getCommonOriginRevision(Run r) { - CommonOriginRevision commonOriginRevision = null; - if (r instanceof AbstractBuild) { - final SCM scm = ((AbstractBuild) r).getProject().getScm(); - if (scm != null) { - SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); - if (scmProcessor != null) { - commonOriginRevision = scmProcessor.getCommonOriginRevision(r); - } - } - } - return commonOriginRevision; - } + // TODO: [YG] this method should be part of causes factory or something like this, it is not suitable for merged build as well + private boolean isInternal(Run r) { + boolean result = false; - // TODO: [YG] this method should be part of causes factory or something like this, it is not suitable for merged build as well - private boolean isInternal(Run r) { - boolean result = false; + // get upstream cause, if any + Cause.UpstreamCause upstreamCause = null; + for (Cause cause : (List) r.getCauses()) { + if (cause instanceof Cause.UpstreamCause) { + upstreamCause = (Cause.UpstreamCause) cause; + break; // TODO: here we are breaking the merged build support + } + } - // get upstream cause, if any - Cause.UpstreamCause upstreamCause = null; - for (Cause cause : (List) r.getCauses()) { - if (cause instanceof Cause.UpstreamCause) { - upstreamCause = (Cause.UpstreamCause) cause; - break; // TODO: here we are breaking the merged build support - } - } + if (upstreamCause != null) { + String causeJobName = upstreamCause.getUpstreamProject(); + TopLevelItem parent = Jenkins.getInstance().getItem(causeJobName); + if (parent == null) { + if (causeJobName.contains("/") && !causeJobName.contains(",")) { + parent = getJobFromFolder(causeJobName); + if (parent == null) { + result = false; + } + } + } else { + if (parent.getClass().getName().equals(JobProcessorFactory.WORKFLOW_JOB_NAME)) { + result = true; + } else { + List phases = JobProcessorFactory.getFlowProcessor((Job) parent).getInternals(); + for (PipelinePhase p : phases) { + for (PipelineNode n : p.getJobs()) { + if (n != null && n.getName().equals(r.getParent().getName())) { + return true; + } + } + } + return false; + } + } + } + return result; + } - if (upstreamCause != null) { - String causeJobName = upstreamCause.getUpstreamProject(); - TopLevelItem parent = Jenkins.getInstance().getItem(causeJobName); - if (parent == null) { - if (causeJobName.contains("/") && !causeJobName.contains(",")) { - parent = getJobFromFolder(causeJobName); - if (parent == null) { - result = false; - } - } - } else { - if (parent.getClass().getName().equals(JobProcessorFactory.WORKFLOW_JOB_NAME)) { - result = true; - } else { - List phases = JobProcessorFactory.getFlowProcessor((Job) parent).getInternals(); - for (PipelinePhase p : phases) { - for (PipelineNode n : p.getJobs()) { - if (n != null && n.getName().equals(r.getParent().getName())) { - return true; - } - } - } - return false; - } - } - } - return result; - } + private static TopLevelItem getJobFromFolder(String causeJobName) { + String newJobRefId = causeJobName.substring(0, causeJobName.indexOf('/')); + TopLevelItem item = Jenkins.getInstance().getItem(newJobRefId); + if (item != null) { + Collection allJobs = item.getAllJobs(); + for (Job job : allJobs) { + if (causeJobName.endsWith(job.getName())) { + return (TopLevelItem) job; + } + } + return null; + } + return null; + } - private static TopLevelItem getJobFromFolder(String causeJobName) { - String newJobRefId = causeJobName.substring(0, causeJobName.indexOf('/')); - TopLevelItem item = Jenkins.getInstance().getItem(newJobRefId); - if (item != null) { - Collection allJobs = item.getAllJobs(); - for (Job job : allJobs) { - if (causeJobName.endsWith(job.getName())) { - return (TopLevelItem) job; - } - } - return null; - } - return null; - } - - private static List extractCauses(Run r) { - if (r.getParent() instanceof MatrixConfiguration) { - return ((MatrixRun) r).getParentBuild().getCauses(); - } - return r.getCauses(); - } + private static List extractCauses(Run r) { + if (r.getParent() instanceof MatrixConfiguration) { + return ((MatrixRun) r).getParentBuild().getCauses(); + } + return r.getCauses(); + } } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index 4983ae6327..3bcc61ab32 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -76,27 +76,27 @@ */ class GitSCMProcessor implements SCMProcessor { - private static final Logger logger = LogManager.getLogger(GitSCMProcessor.class); - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); - private static final String MASTER = "refs/remotes/origin/master"; - - @Override - public SCMData getSCMData(AbstractBuild build, SCM scm) { - List> changes = new ArrayList<>(); - changes.add(build.getChangeSet()); - return extractSCMData(build, scm, changes); - } - - @Override - public SCMData getSCMData(WorkflowRun run, SCM scm) { - return extractSCMData(run, scm, run.getChangeSets()); - } - - @Override - public CommonOriginRevision getCommonOriginRevision(final Run run) { - //for phase 1 this is hard coded since its not possible to calculate it, and configuration from outside will complicate the feature - //so for this phase we keep it hardcoded. - CommonOriginRevision commonOriginRevision = new CommonOriginRevision(); + private static final Logger logger = LogManager.getLogger(GitSCMProcessor.class); + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + private static final String MASTER = "refs/remotes/origin/master"; + + @Override + public SCMData getSCMData(AbstractBuild build, SCM scm) { + List> changes = new ArrayList<>(); + changes.add(build.getChangeSet()); + return extractSCMData(build, scm, changes); + } + + @Override + public SCMData getSCMData(WorkflowRun run, SCM scm) { + return extractSCMData(run, scm, run.getChangeSets()); + } + + @Override + public CommonOriginRevision getCommonOriginRevision(final Run run) { + //for phase 1 this is hard coded since its not possible to calculate it, and configuration from outside will complicate the feature + //so for this phase we keep it hardcoded. + CommonOriginRevision commonOriginRevision = new CommonOriginRevision(); commonOriginRevision.branch = getBranchName(run); try { @@ -127,29 +127,43 @@ public String invoke(File rootDir, VirtualChannel channel) throws IOException { Git git = Git.open(repoDir); Repository repo = git.getRepository(); + if(repo==null){ + return ""; + } final RevWalk walk = new RevWalk(repo); - - ObjectId resolveForCurrentBranch = repo.resolve(Constants.HEAD); - RevCommit currentBranchCommit = walk.parseCommit(resolveForCurrentBranch); - ObjectId resolveForMaster = repo.resolve(MASTER); - RevCommit masterCommit = walk.parseCommit(resolveForMaster); - - walk.reset(); - walk.setRevFilter(RevFilter.MERGE_BASE); - walk.markStart(currentBranchCommit); - walk.markStart(masterCommit); - final RevCommit base = walk.next(); - if (base == null) - return ""; - final RevCommit base2 = walk.next(); - if (base2 != null) { - throw new NoMergeBaseException(NoMergeBaseException.MergeBaseFailureReason.MULTIPLE_MERGE_BASES_NOT_SUPPORTED, - MessageFormat.format(JGitText.get().multipleMergeBasesFor, currentBranchCommit.name(), masterCommit.name(), base.name(), base2.name())); - } - return base.getId().getName(); + if(walk==null){ + return ""; + } + ObjectId resolveForCurrentBranch = repo.resolve(Constants.HEAD); + if(resolveForCurrentBranch==null){ + return ""; + } + RevCommit currentBranchCommit = walk.parseCommit(resolveForCurrentBranch); + if(currentBranchCommit==null){ + return ""; + } + ObjectId resolveForMaster = repo.resolve(MASTER); + if(resolveForMaster==null){ + return ""; + } + RevCommit masterCommit = walk.parseCommit(resolveForMaster); + + walk.reset(); + walk.setRevFilter(RevFilter.MERGE_BASE); + walk.markStart(currentBranchCommit); + walk.markStart(masterCommit); + final RevCommit base = walk.next(); + if (base == null) + return ""; + final RevCommit base2 = walk.next(); + if (base2 != null) { + throw new NoMergeBaseException(NoMergeBaseException.MergeBaseFailureReason.MULTIPLE_MERGE_BASES_NOT_SUPPORTED, + MessageFormat.format(JGitText.get().multipleMergeBasesFor, currentBranchCommit.name(), masterCommit.name(), base.name(), base2.name())); + } + return base.getId().getName(); - } + } } private SCMData extractSCMData(Run run, SCM scm, List> changes) { @@ -193,85 +207,86 @@ public String getBranchName(Run r) { return null; } - private static String getRemoteString(AbstractBuild r){ - final DescribableList extensions = ((GitSCM) (r.getProject()).getScm()).getExtensions(); - String relativeTargetDir = ""; - if(extensions!=null){ - final RelativeTargetDirectory relativeTargetDirectory = extensions.get(RelativeTargetDirectory.class); - if(relativeTargetDirectory!=null && relativeTargetDirectory.getRelativeTargetDir()!=null ){ - relativeTargetDir = File.separator+relativeTargetDirectory.getRelativeTargetDir(); - } - } - if(r.getWorkspace().isRemote()){ + private static String getRemoteString(AbstractBuild r) { + final DescribableList extensions = ((GitSCM) (r.getProject()).getScm()).getExtensions(); + String relativeTargetDir = ""; + if (extensions != null) { + final RelativeTargetDirectory relativeTargetDirectory = extensions.get(RelativeTargetDirectory.class); + if (relativeTargetDirectory != null && relativeTargetDirectory.getRelativeTargetDir() != null) { + relativeTargetDir = File.separator + relativeTargetDirectory.getRelativeTargetDir(); + } + } + if (r.getWorkspace().isRemote()) { VirtualChannel vc = r.getWorkspace().getChannel(); String fp = r.getWorkspace().getRemote(); String remote = new FilePath(vc, fp).getRemote(); - return remote+relativeTargetDir; - } - else { - String remote = r.getWorkspace().getRemote(); - return remote+relativeTargetDir; - }} - - private SCMRepository getRepository(Run run, GitSCM gitData) { - SCMRepository result = null; - String url = null; - String branch = null; - if (gitData != null && gitData.getBuildData(run) != null) { - BuildData buildData = gitData.getBuildData(run); - if (buildData != null) { - if (buildData.getRemoteUrls() != null && !buildData.getRemoteUrls().isEmpty()) { - url = (String) buildData.getRemoteUrls().toArray()[0]; - } - if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { - branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); - } - result = dtoFactory.newDTO(SCMRepository.class) - .setType(SCMType.GIT) - .setUrl(url) - .setBranch(branch); - } else { - logger.warn("failed to obtain BuildData; no SCM repository info will be available"); - } - } - return result;} - - private List extractCommits(List> changes) { - List commits = new LinkedList<>(); - for (ChangeLogSet set : changes) { - for (ChangeLogSet.Entry change : set) { - if (change instanceof GitChangeSet) { - GitChangeSet commit = (GitChangeSet) change; - User user = commit.getAuthor(); - String userEmail = null; - - List tmpChanges = new ArrayList<>(); - for (GitChangeSet.Path item : commit.getAffectedFiles()) { - SCMChange tmpChange = dtoFactory.newDTO(SCMChange.class) - .setType(item.getEditType().getName()) - .setFile(item.getPath()); - tmpChanges.add(tmpChange); - } - - for (UserProperty property : user.getAllProperties()) { - if (property instanceof Mailer.UserProperty) { - userEmail = ((Mailer.UserProperty) property).getAddress(); - } - } - - SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) - .setTime(commit.getTimestamp()) - .setUser(user.getId()) - .setUserEmail(userEmail) - .setRevId(commit.getCommitId()) - .setParentRevId(commit.getParentCommit()) - .setComment(commit.getComment().trim()) - .setChanges(tmpChanges); - - commits.add(tmpCommit); + return remote + relativeTargetDir; + } else { + String remote = r.getWorkspace().getRemote(); + return remote + relativeTargetDir; + } + } + + private SCMRepository getRepository(Run run, GitSCM gitData) { + SCMRepository result = null; + String url = null; + String branch = null; + if (gitData != null && gitData.getBuildData(run) != null) { + BuildData buildData = gitData.getBuildData(run); + if (buildData != null) { + if (buildData.getRemoteUrls() != null && !buildData.getRemoteUrls().isEmpty()) { + url = (String) buildData.getRemoteUrls().toArray()[0]; + } + if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { + branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); + } + result = dtoFactory.newDTO(SCMRepository.class) + .setType(SCMType.GIT) + .setUrl(url) + .setBranch(branch); + } else { + logger.warn("failed to obtain BuildData; no SCM repository info will be available"); } } + return result; + } + + private List extractCommits(List> changes) { + List commits = new LinkedList<>(); + for (ChangeLogSet set : changes) { + for (ChangeLogSet.Entry change : set) { + if (change instanceof GitChangeSet) { + GitChangeSet commit = (GitChangeSet) change; + User user = commit.getAuthor(); + String userEmail = null; + + List tmpChanges = new ArrayList<>(); + for (GitChangeSet.Path item : commit.getAffectedFiles()) { + SCMChange tmpChange = dtoFactory.newDTO(SCMChange.class) + .setType(item.getEditType().getName()) + .setFile(item.getPath()); + tmpChanges.add(tmpChange); + } + + for (UserProperty property : user.getAllProperties()) { + if (property instanceof Mailer.UserProperty) { + userEmail = ((Mailer.UserProperty) property).getAddress(); + } + } + + SCMCommit tmpCommit = dtoFactory.newDTO(SCMCommit.class) + .setTime(commit.getTimestamp()) + .setUser(user.getId()) + .setUserEmail(userEmail) + .setRevId(commit.getCommitId()) + .setParentRevId(commit.getParentCommit()) + .setComment(commit.getComment().trim()) + .setChanges(tmpChanges); + + commits.add(tmpCommit); + } + } } return commits; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java index 4028732bf5..3175849e7a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/SCMProcessor.java @@ -39,17 +39,15 @@ import hudson.scm.SCM; import org.jenkinsci.plugins.workflow.job.WorkflowRun; -import java.util.List; - /** * API definition for SCM content processor/transformer for an Octane context * Created by gullery on 31/03/2015. */ public interface SCMProcessor { - SCMData getSCMData(AbstractBuild build, SCM scm); + SCMData getSCMData(AbstractBuild build, SCM scm); - SCMData getSCMData(WorkflowRun run, SCM scm); + SCMData getSCMData(WorkflowRun run, SCM scm); - CommonOriginRevision getCommonOriginRevision(Run run); + CommonOriginRevision getCommonOriginRevision(Run run); } From 9f6df57494be5b31a9ef8e5f7223ca12a2e69211 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Mon, 9 Jul 2018 16:03:57 +0300 Subject: [PATCH 0391/2502] Modify Jenkinsfile to work build only on windows --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a229fa5176..954335c334 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1 +1 @@ -buildPlugin() +buildPlugin(platforms: ['windows']) From 3d07c4bcfd4341158b1d6524ecea22672eff6b48 Mon Sep 17 00:00:00 2001 From: Daniel Shmaya Date: Mon, 9 Jul 2018 16:23:22 +0300 Subject: [PATCH 0392/2502] us #584005: Branch Compare : expand Jenkins Plugin Capabilities - cleanup2 --- .../octane/model/processors/scm/GitSCMProcessor.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index 3bcc61ab32..915194e760 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -190,19 +190,15 @@ private SCMData extractSCMData(Run run, SCM scm, List branches = git.getBranches(); String rawBranchName = branches.get(0).toString(); - String branchName = rawBranchName.substring(2); //trunk the '*/' from the '*/' in order to get clean branch name - return branchName; - } - + return rawBranchName.substring(2); //trunk the '*/' from the '*/' in order to get clean branch name } catch (Exception e) { - logger.error("failed to extract branch name from the run", e); + logger.error("failed to extract branch name", e); } return null; } @@ -217,7 +213,6 @@ private static String getRemoteString(AbstractBuild r) { } } if (r.getWorkspace().isRemote()) { - VirtualChannel vc = r.getWorkspace().getChannel(); String fp = r.getWorkspace().getRemote(); String remote = new FilePath(vc, fp).getRemote(); From 07eb20cbfb9bf472fd7294f5f0036e452edb9ba1 Mon Sep 17 00:00:00 2001 From: danieldanan Date: Mon, 9 Jul 2018 21:27:51 +0300 Subject: [PATCH 0393/2502] JENKINS-51631: Rebranding some remaining expression + adding version of plugin in logs (already implemented) --- .../automation/tools/run/PcBuilder.java | 19 +++++++++++++++++++ .../tools/run/PcBuilder/config.properties | 2 +- .../automation/tools/pc/TestPcClient.java | 4 ++-- .../pc/TestPcClientNegativeScenrios.java | 6 +++--- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index 2845e3d437..fc0aed0cb0 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -46,6 +46,7 @@ import com.hpe.application.automation.tools.sse.result.model.junit.Testcase; import com.hpe.application.automation.tools.sse.result.model.junit.Testsuite; import com.hpe.application.automation.tools.sse.result.model.junit.Testsuites; +import com.hpe.application.automation.tools.octane.configuration.ConfigurationService; import hudson.Extension; import hudson.FilePath; import hudson.Launcher; @@ -224,9 +225,27 @@ public static String getPcreportFileName() { return pcReportFileName; } + private String getVersion() { + try { + String completeVersion = ConfigurationService.getPluginVersion(); + if(completeVersion != null) { + String[] partsOfCompleteVersion = completeVersion.split(" [(]"); + if (partsOfCompleteVersion != null) + return partsOfCompleteVersion[0]; + } + } + catch(Exception e) + { + } + return "unknown"; + } + private Testsuites execute(PcClient pcClient, Run build) throws InterruptedException,NullPointerException { try { + String pomVersionget = getVersion(); + if(!(pomVersionget == null || pomVersionget =="unknown")) + logger.println(String.format("%s - plugin version is '%s'",_simpleDateFormat.format(new Date()), getVersion())); try { pcModel.setBuildParameters(((AbstractBuild)build).getBuildVariables().toString()); } catch (Exception ex) { } if (!StringUtils.isBlank(pcModel.getDescription())) logger.println(String.format("%s - \n- - -\nTest description: %s", _simpleDateFormat.format(new Date()), pcModel.getDescription())); diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.properties b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.properties index bd4f9f56d0..5e52a77432 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.properties +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/config.properties @@ -31,7 +31,7 @@ # # -DontForgetThePublisher=Don''t forget to enable the Publish HPE \ +DontForgetThePublisher=Don''t forget to enable the Publish Micro Focus \ tests result option in the Post-build \ Actions section so that the tests results are published. ParametrizationMessage= The following fields can be parametrized: ''PC Server'', ''User name'', ''Domain'', \ diff --git a/src/test/java/com/hpe/application/automation/tools/pc/TestPcClient.java b/src/test/java/com/hpe/application/automation/tools/pc/TestPcClient.java index 325908b64f..a5daf60358 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/TestPcClient.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/TestPcClient.java @@ -64,7 +64,7 @@ public static void setUp() { @Test public void testLogin(){ - System.out.println("Testing Login to HPE PC server"); + System.out.println("Testing Login to PC server"); Assert.assertTrue("Failed to login with pcClient", pcClient.login()); } @@ -113,7 +113,7 @@ public void testPublishRunReport(){ @Test public void testLogout() { - System.out.println("Testing Logout from HPE PC server"); + System.out.println("Testing Logout from PC server"); Assert.assertTrue("Failed to logout with pcClient", pcClient.logout()); } diff --git a/src/test/java/com/hpe/application/automation/tools/pc/TestPcClientNegativeScenrios.java b/src/test/java/com/hpe/application/automation/tools/pc/TestPcClientNegativeScenrios.java index 816d0d4d48..2377e47dd6 100644 --- a/src/test/java/com/hpe/application/automation/tools/pc/TestPcClientNegativeScenrios.java +++ b/src/test/java/com/hpe/application/automation/tools/pc/TestPcClientNegativeScenrios.java @@ -62,7 +62,7 @@ public class TestPcClientNegativeScenrios { @BeforeClass public static void setUp() { - System.out.println("Starting HPEPerformance Center client negative testing scenarios:"); + System.out.println("Starting Performance Center client negative testing scenarios:"); try { PcRestProxy resetProxy = new MockPcRestProxyBadResponses(PcTestBase.WEB_PROTOCOL,PcTestBase.PC_SERVER_NAME, PcTestBase.ALM_DOMAIN, PcTestBase.ALM_PROJECT,PcTestBase.LOGGER); @@ -79,13 +79,13 @@ public void write(int b) throws IOException {} @AfterClass public static void tearDown() { - System.out.println("End of HPEPerformance Center client negative testing scenarios"); + System.out.println("End of Performance Center client negative testing scenarios"); } @Test public void testLoginWithWrongCredentials() { - System.out.println("Testing Login to HPE PC server with wrong credentials"); + System.out.println("Testing Login to PC server with wrong credentials"); Assert.assertFalse("Login to PC server with wrong creadentials should have failed", pcClient.login()); } From d71a8fdca31302adbbfaaa0569a70e026ed0caf3 Mon Sep 17 00:00:00 2001 From: danieldanan Date: Tue, 10 Jul 2018 15:12:31 +0300 Subject: [PATCH 0394/2502] JENKINS-51631: Rebranding some remaining expression + adding version of plugin in logs (already implemented) --- .../automation/tools/run/PcBuilder.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java index fc0aed0cb0..e965f2c194 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/PcBuilder.java @@ -226,26 +226,20 @@ public static String getPcreportFileName() { } private String getVersion() { - try { - String completeVersion = ConfigurationService.getPluginVersion(); - if(completeVersion != null) { - String[] partsOfCompleteVersion = completeVersion.split(" [(]"); - if (partsOfCompleteVersion != null) - return partsOfCompleteVersion[0]; - } - } - catch(Exception e) - { - } + String completeVersion = ConfigurationService.getPluginVersion(); + if(completeVersion != null) { + String[] partsOfCompleteVersion = completeVersion.split(" [(]"); + return partsOfCompleteVersion[0]; + } return "unknown"; } private Testsuites execute(PcClient pcClient, Run build) throws InterruptedException,NullPointerException { try { - String pomVersionget = getVersion(); - if(!(pomVersionget == null || pomVersionget =="unknown")) - logger.println(String.format("%s - plugin version is '%s'",_simpleDateFormat.format(new Date()), getVersion())); + String version = getVersion(); + if(!(version == null || version.equals("unknown"))) + logger.println(String.format("%s - plugin version is '%s'",_simpleDateFormat.format(new Date()), version)); try { pcModel.setBuildParameters(((AbstractBuild)build).getBuildVariables().toString()); } catch (Exception ex) { } if (!StringUtils.isBlank(pcModel.getDescription())) logger.println(String.format("%s - \n- - -\nTest description: %s", _simpleDateFormat.format(new Date()), pcModel.getDescription())); From 690f2e72e3323d70e6b997f969f6e807dbb3a434 Mon Sep 17 00:00:00 2001 From: gullery Date: Tue, 10 Jul 2018 19:08:12 +0300 Subject: [PATCH 0395/2502] tech: updating SDK, adding SDK's logging configuration --- pom.xml | 2 +- .../tools/octane/events/SCMListenerImpl.java | 2 +- .../executor/UftTestDiscoveryDispatcher.java | 759 +++++++++--------- 3 files changed, 381 insertions(+), 382 deletions(-) diff --git a/pom.xml b/pom.xml index 90d4b2f3e5..f206e7df97 100644 --- a/pom.xml +++ b/pom.xml @@ -464,7 +464,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 1.5-SNAPSHOT + 1.5.22 diff --git a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java index 2c430a4fc8..5a1a0f7a8a 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/events/SCMListenerImpl.java @@ -92,7 +92,7 @@ public void onChangeLogParsed(Run run, SCM scm, TaskListener listener, Cha SCMProcessor scmProcessor = SCMProcessors.getAppropriate(scm.getClass().getName()); if (scmProcessor == null) { - logger.info("no processors found for SCM provider of type '" + scm.getType() + "', SCM data won't be extracted"); + logger.debug("no processors found for SCM provider of type '" + scm.getType() + "', SCM data won't be extracted"); return; } diff --git a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java index d4832b4020..d3d4873a77 100644 --- a/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java +++ b/src/main/java/com/hpe/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java @@ -60,7 +60,6 @@ import java.io.IOException; import java.util.*; - /** * This class is responsible to send discovered uft tests to Octane. * Class uses file-based queue so if octane or jenkins will be down before sending, @@ -71,384 +70,384 @@ @Extension public class UftTestDiscoveryDispatcher extends AbstractSafeLoggingAsyncPeriodWork implements ConfigurationListener { - private final static Logger logger = LogManager.getLogger(UftTestDiscoveryDispatcher.class); - - private final static int MAX_DISPATCH_TRIALS = 5; - private static final String OCTANE_VERSION_SUPPORTING_TEST_RENAME = "12.60.3"; - private static String OCTANE_VERSION = null; - - private UftTestDiscoveryQueue queue; - - public UftTestDiscoveryDispatcher() { - super("Uft Test Discovery Dispatcher"); - } - - - @Override - protected void doExecute(TaskListener listener) throws IOException, InterruptedException { - if (queue.peekFirst() == null) { - return; - } - - logger.warn("Queue size " + queue.size()); - - if (!OctaneSDK.getInstance().getConfigurationService().isConfigurationValid()) { - logger.warn("There are pending discovered UFT tests, but MQM server configuration is not valid, results can't be submitted"); - return; - } - - EntitiesService entitiesService = OctaneSDK.getInstance().getEntitiesService(); - ResultQueue.QueueItem item = null; - try { - while ((item = queue.peekFirst()) != null) { - - Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); - if (project == null) { - logger.warn("Project [" + item.getProjectName() + "] no longer exists, pending discovered tests can't be submitted"); - queue.remove(); - continue; - } - - Run build = project.getBuildByNumber(item.getBuildNumber()); - if (build == null) { - logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer exists, pending discovered tests can't be submitted"); - queue.remove(); - continue; - } - - UftTestDiscoveryResult result = UFTTestDetectionService.readDetectionResults(build); - if (result == null) { - logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer contains valid detection result file"); - queue.remove(); - continue; - } - - logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "]"); - dispatchDetectionResults(item, entitiesService, result); - queue.remove(); - } - } catch (Exception e) { - if (item != null) { - item.incrementFailCount(); - if (item.incrementFailCount() > MAX_DISPATCH_TRIALS) { - queue.remove(); - logger.warn("Failed to persist discovery of [" + item.getProjectName() + "#" + item.getBuildNumber() + "] after " + MAX_DISPATCH_TRIALS + " trials"); - } - } - } - } - - private static void dispatchDetectionResults(ResultQueue.QueueItem item, EntitiesService entitiesService, UftTestDiscoveryResult result) { - //Check if there is diff in discovery and server status - //for example : discovery found new test , but it already exist in server , instead of create new tests we will do update test - if (result.isFullScan()) { - UftTestDispatchUtils.prepareDispatchingForFullSync(entitiesService, result); - - } else { - if (isOctaneSupportTestRename(entitiesService)) { - handleMovedTests(result); - handleMovedDataTables(result); - } - - validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(entitiesService, result); - validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(entitiesService, result); - - - UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllTests()); - UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllScmResourceFiles()); - } - - //publish final results - FreeStyleProject project = (FreeStyleProject) Jenkins.getInstance().getItemByFullName(item.getProjectName()); - FilePath subWorkspace = project.getWorkspace().child("_Final_Detection_Results"); - try { - if (!subWorkspace.exists()) { - subWorkspace.mkdirs(); - } - File reportXmlFile = new File(subWorkspace.getRemote(), "final_detection_result_build_" + item.getBuildNumber() + ".xml"); - result.writeToFile(reportXmlFile); - } catch (IOException | InterruptedException | JAXBException e) { - logger.error("Failed to write final_detection_result file :" + e.getMessage()); - } - - //dispatch - JobRunContext jobRunContext = JobRunContext.create(item.getProjectName(), item.getBuildNumber()); - UftTestDispatchUtils.dispatchDiscoveryResult(entitiesService, result, jobRunContext); - } - - - private static boolean validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { - boolean hasDiff = false; - Set allNames = new HashSet<>(); - for (ScmResourceFile file : result.getAllScmResourceFiles()) { - if (file.getIsMoved()) { - allNames.add(file.getOldName()); - } else { - allNames.add(file.getName()); - } - } - - //GET DataTables FROM OCTANE - Map octaneEntityMapByRelativePath = UftTestDispatchUtils.getDataTablesFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allNames); - - - //MATCHING - for (ScmResourceFile file : result.getAllScmResourceFiles()) { - - String key = file.getIsMoved() ? file.getOldRelativePath() : file.getRelativePath(); - Entity octaneFile = octaneEntityMapByRelativePath.get(key); - - boolean octaneFileFound = (octaneFile != null); - if (octaneFileFound) { - file.setId(octaneFile.getId()); - } - - switch (file.getOctaneStatus()) { - case DELETED: - if (!octaneFileFound) { - //file that is marked to be deleted - doesn't exist in Octane - do nothing - hasDiff = true; - file.setOctaneStatus(OctaneStatus.NONE); - } - break; - case MODIFIED: - if (!octaneFileFound) { - //updated file that has no matching in Octane, possibly was remove from Octane. So we move it to new - hasDiff = true; - file.setOctaneStatus(OctaneStatus.NEW); - } - break; - case NEW: - if (octaneFileFound) { - //new file was found in Octane - do nothing(there is nothing to update) - hasDiff = true; - file.setOctaneStatus(OctaneStatus.NONE); - } - break; - default: - //do nothing - } - } - - return hasDiff; - } - - /** - * This method try to find ids of updated and deleted tests for scm change detection - * if test is found on server - update id of discovered test - * if test is not found and test is marked for update - move it to new tests (possibly test was deleted on server) - * - * @return true if there were changes comparing to discoverede results - */ - private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { - boolean hasDiff = false; - - Set allTestNames = new HashSet<>(); - for (AutomatedTest test : result.getAllTests()) { - if (test.getIsMoved()) { - allTestNames.add(test.getOldName()); - } else { - allTestNames.add(test.getName()); - } - } - - //GET TESTS FROM OCTANE - Map octaneTestsMapByKey = UftTestDispatchUtils.getTestsFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allTestNames); - - - //MATCHING - for (AutomatedTest discoveredTest : result.getAllTests()) { - String key = discoveredTest.getIsMoved() - ? UftTestDispatchUtils.createKey(discoveredTest.getOldPackage(), discoveredTest.getOldName()) - : UftTestDispatchUtils.createKey(discoveredTest.getPackage(), discoveredTest.getName()); - Entity octaneTest = octaneTestsMapByKey.get(key); - boolean octaneTestFound = (octaneTest != null); - if (octaneTestFound) { - discoveredTest.setId(octaneTest.getId()); - } - switch (discoveredTest.getOctaneStatus()) { - case DELETED: - if (!octaneTestFound) { - //discoveredTest that is marked to be deleted - doesn't exist in Octane - do nothing - hasDiff = true; - discoveredTest.setOctaneStatus(OctaneStatus.NONE); - } - break; - case MODIFIED: - if (!octaneTestFound) { - //updated discoveredTest that has no matching in Octane, possibly was remove from Octane. So we move it to new tests - hasDiff = true; - discoveredTest.setOctaneStatus(OctaneStatus.NEW); - } else { - boolean testsEqual = UftTestDispatchUtils.checkTestEquals(discoveredTest, octaneTest); - if (testsEqual) { //if equal - skip - discoveredTest.setOctaneStatus(OctaneStatus.NONE); - } - } - break; - case NEW: - if (octaneTestFound) { - //new discoveredTest was found in Octane - move it to update - hasDiff = true; - discoveredTest.setOctaneStatus(OctaneStatus.MODIFIED); - } - break; - default: - //do nothing - } - } - - return hasDiff; - } - - @Override - public long getRecurrencePeriod() { - String value = System.getProperty("UftTestDiscoveryDispatcher.Period"); // let's us config the recurrence period. default is 60 seconds. - if (!SdkStringUtils.isEmpty(value)) { - return Long.valueOf(value); - } - return TimeUnit2.SECONDS.toMillis(30); - } - - @Inject - public void setTestResultQueue(UftTestDiscoveryQueue queue) { - this.queue = queue; - } - - /** - * Queue that current run contains discovered tests - * - * @param projectName - * @param buildNumber - */ - public void enqueueResult(String projectName, int buildNumber) { - queue.add(projectName, buildNumber); - } - - private static void handleMovedTests(UftTestDiscoveryResult result) { - List newTests = result.getNewTests(); - List deletedTests = result.getDeletedTests(); - if (!newTests.isEmpty() && !deletedTests.isEmpty()) { - Map dst2Test = new HashMap<>(); - Map deleted2newMovedTests = new HashMap<>(); - for (AutomatedTest newTest : newTests) { - if (SdkStringUtils.isNotEmpty(newTest.getChangeSetDst())) { - dst2Test.put(newTest.getChangeSetDst(), newTest); - } - } - for (AutomatedTest deletedTest : deletedTests) { - if (SdkStringUtils.isNotEmpty(deletedTest.getChangeSetDst()) && dst2Test.containsKey(deletedTest.getChangeSetDst())) { - AutomatedTest newTest = dst2Test.get(deletedTest.getChangeSetDst()); - deleted2newMovedTests.put(deletedTest, newTest); - } - } - - for (Map.Entry entry : deleted2newMovedTests.entrySet()) { - AutomatedTest deletedTest = entry.getKey(); - AutomatedTest newTest = entry.getValue(); - - newTest.setIsMoved(true); - newTest.setOldName(deletedTest.getName()); - newTest.setOldPackage(deletedTest.getPackage()); - newTest.setOctaneStatus(OctaneStatus.MODIFIED); - - result.getAllTests().remove(deletedTest); - } - } - } - - private static void handleMovedDataTables(UftTestDiscoveryResult result) { - List newItems = result.getNewScmResourceFiles(); - List deletedItems = result.getDeletedScmResourceFiles(); - if (!newItems.isEmpty() && !deletedItems.isEmpty()) { - Map dst2File = new HashMap<>(); - Map deleted2newMovedFiles = new HashMap<>(); - for (ScmResourceFile newFile : newItems) { - if (SdkStringUtils.isNotEmpty(newFile.getChangeSetDst())) { - dst2File.put(newFile.getChangeSetDst(), newFile); - } - } - for (ScmResourceFile deletedFile : deletedItems) { - if (SdkStringUtils.isNotEmpty(deletedFile.getChangeSetDst()) && dst2File.containsKey(deletedFile.getChangeSetDst())) { - ScmResourceFile newFile = dst2File.get(deletedFile.getChangeSetDst()); - deleted2newMovedFiles.put(deletedFile, newFile); - } - } - - for (Map.Entry entry : deleted2newMovedFiles.entrySet()) { - ScmResourceFile deletedFile = entry.getKey(); - ScmResourceFile newFile = entry.getValue(); - - newFile.setIsMoved(true); - newFile.setOldName(deletedFile.getName()); - newFile.setOldRelativePath(deletedFile.getRelativePath()); - newFile.setOctaneStatus(OctaneStatus.MODIFIED); - - result.getAllScmResourceFiles().remove(deletedFile); - } - } - } - - private static boolean isOctaneSupportTestRename(EntitiesService entitiesService) { - String octane_version = getOctaneVersion(entitiesService); - boolean supportTestRename = (octane_version != null && versionCompare(OCTANE_VERSION_SUPPORTING_TEST_RENAME, octane_version) <= 0); - logger.warn("Support test rename = " + supportTestRename); - return supportTestRename; - } - - private static String getOctaneVersion(EntitiesService entitiesService) { - - if (OCTANE_VERSION == null) { - List entities = entitiesService.getEntities(null, "server_version", null, null); - if (entities.size() == 1) { - Entity entity = entities.get(0); - OCTANE_VERSION = entity.getStringValue("version"); - logger.warn("Received Octane version - " + OCTANE_VERSION); - - } else { - logger.error(String.format("Request for Octane version returned %s items. return version is not defined.", entities.size())); - } - } - - return OCTANE_VERSION; - } - - @Override - public void onChanged(ServerConfiguration conf, ServerConfiguration oldConf) { - OCTANE_VERSION = null; - } - - /** - * Compares two version strings. - *

    - * Use this instead of String.compareTo() for a non-lexicographical - * comparison that works for version strings. e.g. "1.10".compareTo("1.6"). - * - * @param str1 a string of ordinal numbers separated by decimal points. - * @param str2 a string of ordinal numbers separated by decimal points. - * @return The result is a negative integer if str1 is _numerically_ less than str2. - * The result is a positive integer if str1 is _numerically_ greater than str2. - * The result is zero if the strings are _numerically_ equal. - * @note It does not work if "1.10" is supposed to be equal to "1.10.0". - */ - private static Integer versionCompare(String str1, String str2) { - String[] vals1 = str1.split("\\."); - String[] vals2 = str2.split("\\."); - int i = 0; - // set index to first non-equal ordinal or length of shortest version string - while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) { - i++; - } - // compare first non-equal ordinal number - if (i < vals1.length && i < vals2.length) { - int diff = Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i])); - return Integer.signum(diff); - } - // the strings are equal or one string is a substring of the other - // e.g. "1.2.3" = "1.2.3" or "1.2.3" < "1.2.3.4" - else { - return Integer.signum(vals1.length - vals2.length); - } - } + private final static Logger logger = LogManager.getLogger(UftTestDiscoveryDispatcher.class); + + private final static int MAX_DISPATCH_TRIALS = 5; + private static final String OCTANE_VERSION_SUPPORTING_TEST_RENAME = "12.60.3"; + private static String OCTANE_VERSION = null; + + private UftTestDiscoveryQueue queue; + + public UftTestDiscoveryDispatcher() { + super("Uft Test Discovery Dispatcher"); + } + + + @Override + protected void doExecute(TaskListener listener) { + if (queue.peekFirst() == null) { + return; + } + + logger.warn("Queue size " + queue.size()); + + if (!OctaneSDK.getInstance().getConfigurationService().isConfigurationValid()) { + logger.warn("There are pending discovered UFT tests, but MQM server configuration is not valid, results can't be submitted"); + return; + } + + EntitiesService entitiesService = OctaneSDK.getInstance().getEntitiesService(); + ResultQueue.QueueItem item = null; + try { + while ((item = queue.peekFirst()) != null) { + + Job project = (Job) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + if (project == null) { + logger.warn("Project [" + item.getProjectName() + "] no longer exists, pending discovered tests can't be submitted"); + queue.remove(); + continue; + } + + Run build = project.getBuildByNumber(item.getBuildNumber()); + if (build == null) { + logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer exists, pending discovered tests can't be submitted"); + queue.remove(); + continue; + } + + UftTestDiscoveryResult result = UFTTestDetectionService.readDetectionResults(build); + if (result == null) { + logger.warn("Build [" + item.getProjectName() + "#" + item.getBuildNumber() + "] no longer contains valid detection result file"); + queue.remove(); + continue; + } + + logger.warn("Persistence [" + item.getProjectName() + "#" + item.getBuildNumber() + "]"); + dispatchDetectionResults(item, entitiesService, result); + queue.remove(); + } + } catch (Exception e) { + if (item != null) { + item.incrementFailCount(); + if (item.incrementFailCount() > MAX_DISPATCH_TRIALS) { + queue.remove(); + logger.warn("Failed to persist discovery of [" + item.getProjectName() + "#" + item.getBuildNumber() + "] after " + MAX_DISPATCH_TRIALS + " trials"); + } + } + } + } + + private static void dispatchDetectionResults(ResultQueue.QueueItem item, EntitiesService entitiesService, UftTestDiscoveryResult result) { + //Check if there is diff in discovery and server status + //for example : discovery found new test , but it already exist in server , instead of create new tests we will do update test + if (result.isFullScan()) { + UftTestDispatchUtils.prepareDispatchingForFullSync(entitiesService, result); + + } else { + if (isOctaneSupportTestRename(entitiesService)) { + handleMovedTests(result); + handleMovedDataTables(result); + } + + validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(entitiesService, result); + validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(entitiesService, result); + + + UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllTests()); + UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllScmResourceFiles()); + } + + //publish final results + FreeStyleProject project = (FreeStyleProject) Jenkins.getInstance().getItemByFullName(item.getProjectName()); + FilePath subWorkspace = project.getWorkspace().child("_Final_Detection_Results"); + try { + if (!subWorkspace.exists()) { + subWorkspace.mkdirs(); + } + File reportXmlFile = new File(subWorkspace.getRemote(), "final_detection_result_build_" + item.getBuildNumber() + ".xml"); + result.writeToFile(reportXmlFile); + } catch (IOException | InterruptedException | JAXBException e) { + logger.error("Failed to write final_detection_result file :" + e.getMessage()); + } + + //dispatch + JobRunContext jobRunContext = JobRunContext.create(item.getProjectName(), item.getBuildNumber()); + UftTestDispatchUtils.dispatchDiscoveryResult(entitiesService, result, jobRunContext, null); + } + + + private static boolean validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { + boolean hasDiff = false; + Set allNames = new HashSet<>(); + for (ScmResourceFile file : result.getAllScmResourceFiles()) { + if (file.getIsMoved()) { + allNames.add(file.getOldName()); + } else { + allNames.add(file.getName()); + } + } + + //GET DataTables FROM OCTANE + Map octaneEntityMapByRelativePath = UftTestDispatchUtils.getDataTablesFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allNames); + + + //MATCHING + for (ScmResourceFile file : result.getAllScmResourceFiles()) { + + String key = file.getIsMoved() ? file.getOldRelativePath() : file.getRelativePath(); + Entity octaneFile = octaneEntityMapByRelativePath.get(key); + + boolean octaneFileFound = (octaneFile != null); + if (octaneFileFound) { + file.setId(octaneFile.getId()); + } + + switch (file.getOctaneStatus()) { + case DELETED: + if (!octaneFileFound) { + //file that is marked to be deleted - doesn't exist in Octane - do nothing + hasDiff = true; + file.setOctaneStatus(OctaneStatus.NONE); + } + break; + case MODIFIED: + if (!octaneFileFound) { + //updated file that has no matching in Octane, possibly was remove from Octane. So we move it to new + hasDiff = true; + file.setOctaneStatus(OctaneStatus.NEW); + } + break; + case NEW: + if (octaneFileFound) { + //new file was found in Octane - do nothing(there is nothing to update) + hasDiff = true; + file.setOctaneStatus(OctaneStatus.NONE); + } + break; + default: + //do nothing + } + } + + return hasDiff; + } + + /** + * This method try to find ids of updated and deleted tests for scm change detection + * if test is found on server - update id of discovered test + * if test is not found and test is marked for update - move it to new tests (possibly test was deleted on server) + * + * @return true if there were changes comparing to discoverede results + */ + private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { + boolean hasDiff = false; + + Set allTestNames = new HashSet<>(); + for (AutomatedTest test : result.getAllTests()) { + if (test.getIsMoved()) { + allTestNames.add(test.getOldName()); + } else { + allTestNames.add(test.getName()); + } + } + + //GET TESTS FROM OCTANE + Map octaneTestsMapByKey = UftTestDispatchUtils.getTestsFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allTestNames); + + + //MATCHING + for (AutomatedTest discoveredTest : result.getAllTests()) { + String key = discoveredTest.getIsMoved() + ? UftTestDispatchUtils.createKey(discoveredTest.getOldPackage(), discoveredTest.getOldName()) + : UftTestDispatchUtils.createKey(discoveredTest.getPackage(), discoveredTest.getName()); + Entity octaneTest = octaneTestsMapByKey.get(key); + boolean octaneTestFound = (octaneTest != null); + if (octaneTestFound) { + discoveredTest.setId(octaneTest.getId()); + } + switch (discoveredTest.getOctaneStatus()) { + case DELETED: + if (!octaneTestFound) { + //discoveredTest that is marked to be deleted - doesn't exist in Octane - do nothing + hasDiff = true; + discoveredTest.setOctaneStatus(OctaneStatus.NONE); + } + break; + case MODIFIED: + if (!octaneTestFound) { + //updated discoveredTest that has no matching in Octane, possibly was remove from Octane. So we move it to new tests + hasDiff = true; + discoveredTest.setOctaneStatus(OctaneStatus.NEW); + } else { + boolean testsEqual = UftTestDispatchUtils.checkTestEquals(discoveredTest, octaneTest); + if (testsEqual) { //if equal - skip + discoveredTest.setOctaneStatus(OctaneStatus.NONE); + } + } + break; + case NEW: + if (octaneTestFound) { + //new discoveredTest was found in Octane - move it to update + hasDiff = true; + discoveredTest.setOctaneStatus(OctaneStatus.MODIFIED); + } + break; + default: + //do nothing + } + } + + return hasDiff; + } + + @Override + public long getRecurrencePeriod() { + String value = System.getProperty("UftTestDiscoveryDispatcher.Period"); // let's us config the recurrence period. default is 60 seconds. + if (!SdkStringUtils.isEmpty(value)) { + return Long.valueOf(value); + } + return TimeUnit2.SECONDS.toMillis(30); + } + + @Inject + public void setTestResultQueue(UftTestDiscoveryQueue queue) { + this.queue = queue; + } + + /** + * Queue that current run contains discovered tests + * + * @param projectName + * @param buildNumber + */ + public void enqueueResult(String projectName, int buildNumber) { + queue.add(projectName, buildNumber); + } + + private static void handleMovedTests(UftTestDiscoveryResult result) { + List newTests = result.getNewTests(); + List deletedTests = result.getDeletedTests(); + if (!newTests.isEmpty() && !deletedTests.isEmpty()) { + Map dst2Test = new HashMap<>(); + Map deleted2newMovedTests = new HashMap<>(); + for (AutomatedTest newTest : newTests) { + if (SdkStringUtils.isNotEmpty(newTest.getChangeSetDst())) { + dst2Test.put(newTest.getChangeSetDst(), newTest); + } + } + for (AutomatedTest deletedTest : deletedTests) { + if (SdkStringUtils.isNotEmpty(deletedTest.getChangeSetDst()) && dst2Test.containsKey(deletedTest.getChangeSetDst())) { + AutomatedTest newTest = dst2Test.get(deletedTest.getChangeSetDst()); + deleted2newMovedTests.put(deletedTest, newTest); + } + } + + for (Map.Entry entry : deleted2newMovedTests.entrySet()) { + AutomatedTest deletedTest = entry.getKey(); + AutomatedTest newTest = entry.getValue(); + + newTest.setIsMoved(true); + newTest.setOldName(deletedTest.getName()); + newTest.setOldPackage(deletedTest.getPackage()); + newTest.setOctaneStatus(OctaneStatus.MODIFIED); + + result.getAllTests().remove(deletedTest); + } + } + } + + private static void handleMovedDataTables(UftTestDiscoveryResult result) { + List newItems = result.getNewScmResourceFiles(); + List deletedItems = result.getDeletedScmResourceFiles(); + if (!newItems.isEmpty() && !deletedItems.isEmpty()) { + Map dst2File = new HashMap<>(); + Map deleted2newMovedFiles = new HashMap<>(); + for (ScmResourceFile newFile : newItems) { + if (SdkStringUtils.isNotEmpty(newFile.getChangeSetDst())) { + dst2File.put(newFile.getChangeSetDst(), newFile); + } + } + for (ScmResourceFile deletedFile : deletedItems) { + if (SdkStringUtils.isNotEmpty(deletedFile.getChangeSetDst()) && dst2File.containsKey(deletedFile.getChangeSetDst())) { + ScmResourceFile newFile = dst2File.get(deletedFile.getChangeSetDst()); + deleted2newMovedFiles.put(deletedFile, newFile); + } + } + + for (Map.Entry entry : deleted2newMovedFiles.entrySet()) { + ScmResourceFile deletedFile = entry.getKey(); + ScmResourceFile newFile = entry.getValue(); + + newFile.setIsMoved(true); + newFile.setOldName(deletedFile.getName()); + newFile.setOldRelativePath(deletedFile.getRelativePath()); + newFile.setOctaneStatus(OctaneStatus.MODIFIED); + + result.getAllScmResourceFiles().remove(deletedFile); + } + } + } + + private static boolean isOctaneSupportTestRename(EntitiesService entitiesService) { + String octane_version = getOctaneVersion(entitiesService); + boolean supportTestRename = (octane_version != null && versionCompare(OCTANE_VERSION_SUPPORTING_TEST_RENAME, octane_version) <= 0); + logger.warn("Support test rename = " + supportTestRename); + return supportTestRename; + } + + private static String getOctaneVersion(EntitiesService entitiesService) { + + if (OCTANE_VERSION == null) { + List entities = entitiesService.getEntities(null, "server_version", null, null); + if (entities.size() == 1) { + Entity entity = entities.get(0); + OCTANE_VERSION = entity.getStringValue("version"); + logger.warn("Received Octane version - " + OCTANE_VERSION); + + } else { + logger.error(String.format("Request for Octane version returned %s items. return version is not defined.", entities.size())); + } + } + + return OCTANE_VERSION; + } + + @Override + public void onChanged(ServerConfiguration conf, ServerConfiguration oldConf) { + OCTANE_VERSION = null; + } + + /** + * Compares two version strings. + *

    + * Use this instead of String.compareTo() for a non-lexicographical + * comparison that works for version strings. e.g. "1.10".compareTo("1.6"). + * + * @param str1 a string of ordinal numbers separated by decimal points. + * @param str2 a string of ordinal numbers separated by decimal points. + * @return The result is a negative integer if str1 is _numerically_ less than str2. + * The result is a positive integer if str1 is _numerically_ greater than str2. + * The result is zero if the strings are _numerically_ equal. + * @note It does not work if "1.10" is supposed to be equal to "1.10.0". + */ + private static Integer versionCompare(String str1, String str2) { + String[] vals1 = str1.split("\\."); + String[] vals2 = str2.split("\\."); + int i = 0; + // set index to first non-equal ordinal or length of shortest version string + while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) { + i++; + } + // compare first non-equal ordinal number + if (i < vals1.length && i < vals2.length) { + int diff = Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i])); + return Integer.signum(diff); + } + // the strings are equal or one string is a substring of the other + // e.g. "1.2.3" = "1.2.3" or "1.2.3" < "1.2.3.4" + else { + return Integer.signum(vals1.length - vals2.length); + } + } } From 63eaaf83c1208899eb235881fd4be6595f9ba1c0 Mon Sep 17 00:00:00 2001 From: Roy Lu Date: Wed, 11 Jul 2018 10:11:50 +0800 Subject: [PATCH 0396/2502] Fix the build issue by removing an unused import. --- .../tools/sse/sdk/authenticator/AuthenticationTool.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java index 46bc7de84c..fde34469d7 100644 --- a/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java +++ b/src/main/java/com/hpe/application/automation/tools/sse/sdk/authenticator/AuthenticationTool.java @@ -34,7 +34,6 @@ package com.hpe.application.automation.tools.sse.sdk.authenticator; import com.hpe.application.automation.tools.common.SSEException; -import com.hpe.application.automation.tools.sse.sdk.Args; import com.hpe.application.automation.tools.sse.sdk.Client; import com.hpe.application.automation.tools.sse.sdk.Logger; import com.hpe.application.automation.tools.sse.sdk.ResourceAccessLevel; From 4dfa556a2250170fadedde701a5fd977fea77c3c Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Wed, 11 Jul 2018 09:14:12 +0300 Subject: [PATCH 0397/2502] Raise Jenkins version and java level Add additional dependencies to comply with it. Update to the latest Jenkins parent pom. And move to Java level 8 as Jenkins. --- pom.xml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index fc053bb7b7..5b0e2c8cd8 100644 --- a/pom.xml +++ b/pom.xml @@ -36,8 +36,7 @@ org.jenkins-ci.plugins plugin - 2.14 - + 3.17 hp-application-automation-tools-plugin @@ -59,11 +58,12 @@ 1 C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Release - 1.642.4 + 2.60.3 2.2 false 1.8 1.8 + 8 @@ -253,7 +253,6 @@ true - org.codehaus.mojo exec-maven-plugin @@ -651,6 +650,16 @@ + + + org.jenkins-ci.plugins + script-security + 1.18 + + + org.jenkins-ci.plugins + scm-api + 1.2 + - From 1678417e95c7a85b8e3ba602eaf7917662141ef7 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Wed, 11 Jul 2018 10:27:12 +0300 Subject: [PATCH 0398/2502] Change back Jenkins parent pom It seems that Octane has some conflicts with the change. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b0e2c8cd8..d1b340b818 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ org.jenkins-ci.plugins plugin - 3.17 + 2.14 hp-application-automation-tools-plugin From 81c9179d71575a07f398a7f1e2398d74c2711e77 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Wed, 11 Jul 2018 11:24:38 +0300 Subject: [PATCH 0399/2502] Change sonar-project to java 1.8 --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 46a3cf1032..2a78efdc96 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -52,7 +52,7 @@ module1.sonar.sources=src\\main\\java module1.sonar.projectName=JenkinsPlugin module1.sonar.tests=src\\test\\java module1.sonar.language=java -module1.sonar.java.source=1.7 +module1.sonar.java.source=1.8 # Module 2 CS - HpToolsLauncher HpToolsLauncher.sonar.sources=.\\ From 32cae7713c3180546bb7045fe4dc82e36a25175d Mon Sep 17 00:00:00 2001 From: danieldanan Date: Wed, 11 Jul 2018 19:21:39 +0300 Subject: [PATCH 0400/2502] JENKINS-52366: Error saving jobs utilizing the HPE Application Automation Tools plugin - "TimeslotDuration" class error BTW: JENKINS-47722 "Local Proxy" textbox tooltip: the text slides outside of the visible area --- src/main/resources/META-INF/hudson.remoting.ClassFilter | 2 ++ .../automation/tools/run/PcBuilder/help-proxyOutURL.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/META-INF/hudson.remoting.ClassFilter diff --git a/src/main/resources/META-INF/hudson.remoting.ClassFilter b/src/main/resources/META-INF/hudson.remoting.ClassFilter new file mode 100644 index 0000000000..f4048a40da --- /dev/null +++ b/src/main/resources/META-INF/hudson.remoting.ClassFilter @@ -0,0 +1,2 @@ +# TimeslotDuration class from com.microfocus.adm.performancecenter.plugins.common.pcEntities package is safe to be used. +com.microfocus.adm.performancecenter.plugins.common.pcEntities.TimeslotDuration \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html index ce1e3c9644..462164e4b5 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html +++ b/src/main/resources/com/hpe/application/automation/tools/run/PcBuilder/help-proxyOutURL.html @@ -34,5 +34,5 @@

    Add your local proxy as following: http(s)://<host>:<port> or Leave empty if not using a local proxy.
    - PAC (proxy auto-config) or Automatic configuration script are not supported. + PAC (proxy auto-config) or
    Automatic configuration script are not supported.
    \ No newline at end of file From 0d8b6a0b3069b598139c376b86e74c64f60ea152 Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Thu, 12 Jul 2018 18:21:53 +0300 Subject: [PATCH 0401/2502] Added: - text box for analysis template file path - rich reports button - modified transaction summary html from Report3.html to TransactionSummary.html - fixed transaction summary graphs by adding .js files to the master directory --- HpToolsLauncher/Helper.cs | 12 ++ HpToolsLauncher/Launcher.cs | 11 +- .../Runners/FileSystemTestsRunner.cs | 8 +- .../TestRunners/PerformanceTestRunner.cs | 6 +- LRAnalysisLauncher/Program.cs | 7 +- .../tools/model/RunFromFileSystemModel.java | 30 +++- .../pipelineSteps/LoadRunnerTestStep.java | 20 +++ .../tools/results/RichReportAction.java | 158 ++++++++++++++++++ .../tools/results/RunResultRecorder.java | 158 ++++++++++++++++-- .../tools/run/RunFromFileBuilder.java | 15 +- .../LoadRunnerTestStep/config.jelly | 3 + .../help-analysisTemplate.html | 36 ++++ .../results/RichReportAction/index.jelly | 69 ++++++++ .../tools/results/SummaryReport/index.jelly | 2 +- .../tools/run/RunFromFileBuilder/config.jelly | 7 +- .../help-analysisTemplate.html | 36 ++++ 16 files changed, 549 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java create mode 100644 src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/help-analysisTemplate.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-analysisTemplate.html diff --git a/HpToolsLauncher/Helper.cs b/HpToolsLauncher/Helper.cs index 56492fbf0b..cf4d7bed73 100644 --- a/HpToolsLauncher/Helper.cs +++ b/HpToolsLauncher/Helper.cs @@ -198,6 +198,18 @@ public static List ValidateFiles(IEnumerable tests) return validTests; } + public static bool FileExists(string filePath) + { + bool isFileValid = true; + if (!File.Exists(filePath)) { + ConsoleWriter.WriteLine(string.Format(">>>> File not found: '{0}'", filePath)); + isFileValid = false; + Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; + } + + return isFileValid; + } + public static bool IsTestingToolsInstalled(TestStorageType type) { //we want to check if we have Service Test, QTP installed on a machine diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 776bcd89fe..b99388046e 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -323,6 +323,7 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) } } + string analysisTemplate = (_ciParams.ContainsKey("analysisTemplate") ? _ciParams["analysisTemplate"] : ""); //get the tests IEnumerable tests = GetParamsWithPrefix("Test"); @@ -393,7 +394,11 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) ConsoleWriter.WriteLine(Resources.LauncherNoValidTests); return null; } - + + if (!analysisTemplate.Equals("") && !Helper.FileExists(analysisTemplate)) { + return null; + } + //--MC connection info McConnectionInfo mcConnectionInfo = new McConnectionInfo(); if (_ciParams.ContainsKey("MobileHostAddress")) @@ -533,11 +538,11 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) { string uftRunMode = "Fast"; uftRunMode = _ciParams["fsUftRunMode"]; - runner = new FileSystemTestsRunner(validTests, timeout, uftRunMode, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, displayController); + runner = new FileSystemTestsRunner(validTests, timeout, uftRunMode, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, displayController, analysisTemplate); } else { - runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, displayController); + runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, displayController, analysisTemplate); } break; diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index a1268e8d86..b4c1beb169 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -23,6 +23,7 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable private int _errors, _fail; private bool _useUFTLicense; private bool _displayController; + private string _analysisTemplate; private TimeSpan _timeout = TimeSpan.MaxValue; private readonly string _uftRunMode; private Stopwatch _stopwatch = null; @@ -63,8 +64,9 @@ public FileSystemTestsRunner(List sources, McConnectionInfo mcConnection, string mobileInfo, bool displayController, + string analysisTemplate, bool useUFTLicense = false) - :this(sources, timeout, ControllerPollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnection, mobileInfo, displayController, useUFTLicense) + :this(sources, timeout, ControllerPollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnection, mobileInfo, displayController, analysisTemplate, useUFTLicense) { _uftRunMode = uftRunMode; } @@ -85,6 +87,7 @@ public FileSystemTestsRunner(List sources, McConnectionInfo mcConnection, string mobileInfo, bool displayController, + string analysisTemplate, bool useUFTLicense = false) { _jenkinsEnvVariables = jenkinsEnvVariables; @@ -105,6 +108,7 @@ public FileSystemTestsRunner(List sources, _useUFTLicense = useUFTLicense; _displayController = displayController; + _analysisTemplate = analysisTemplate; _tests = new List(); _mcConnection = mcConnection; @@ -309,7 +313,7 @@ private TestRunResults RunHPToolsTest(TestInfo testinf, ref string errorReason) break; case TestType.LoadRunner: AppDomain.CurrentDomain.AssemblyResolve += Helper.HPToolsAssemblyResolver; - runner = new PerformanceTestRunner(this, _timeout, _pollingInterval, _perScenarioTimeOutMinutes, _ignoreErrorStrings, _displayController); + runner = new PerformanceTestRunner(this, _timeout, _pollingInterval, _perScenarioTimeOutMinutes, _ignoreErrorStrings, _displayController, _analysisTemplate); break; } diff --git a/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs b/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs index 8c3a60bbed..31a87ac72d 100644 --- a/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs +++ b/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs @@ -47,6 +47,7 @@ public class PerformanceTestRunner : IFileSysTestRunner private TimeSpan _perScenarioTimeOutMinutes; private RunCancelledDelegate _runCancelled; private bool _displayController; + private string _analysisTemplate; private bool _scenarioEnded; private bool _scenarioEndedEvent; @@ -84,7 +85,7 @@ private class ControllerError Dictionary _errors; int _errorsCount; - public PerformanceTestRunner(IAssetRunner runner, TimeSpan timeout, int pollingInterval, TimeSpan perScenarioTimeOut, List ignoreErrorStrings, bool displayController) + public PerformanceTestRunner(IAssetRunner runner, TimeSpan timeout, int pollingInterval, TimeSpan perScenarioTimeOut, List ignoreErrorStrings, bool displayController, string analysisTemplate) { this._runner = runner; this._timeout = timeout; @@ -92,6 +93,7 @@ public PerformanceTestRunner(IAssetRunner runner, TimeSpan timeout, int pollingI this._perScenarioTimeOutMinutes = perScenarioTimeOut; this._ignoreErrorStrings = ignoreErrorStrings; this._displayController = displayController; + this._analysisTemplate = analysisTemplate; this._scenarioEnded = false; _engine = null; this._errors = null; @@ -432,7 +434,7 @@ private void generateAnalysisReport(TestRunResults runDesc) ProcessStartInfo analysisRunner = new ProcessStartInfo(); analysisRunner.FileName = ANALYSIS_LAUNCHER; - analysisRunner.Arguments = "\""+lrrLocation + "\" \"" + lraLocation + "\" \"" + htmlLocation+"\""; + analysisRunner.Arguments = "\""+lrrLocation + "\" \"" + lraLocation + "\" \"" + htmlLocation + "\" \"" + _analysisTemplate + "\""; analysisRunner.UseShellExecute = false; analysisRunner.RedirectStandardOutput = true; diff --git a/LRAnalysisLauncher/Program.cs b/LRAnalysisLauncher/Program.cs index 94d1a8bfbc..53d098f5d3 100644 --- a/LRAnalysisLauncher/Program.cs +++ b/LRAnalysisLauncher/Program.cs @@ -59,7 +59,7 @@ static int Main(string[] args) int iPassed = (int)Launcher.ExitCodeEnum.Passed;//variable to keep track of whether all of the SLAs passed try { - if (args.Length != 3) + if (args.Length != 3 && args.Length != 4) { ShowHelp(); return (int)Launcher.ExitCodeEnum.Aborted; @@ -68,13 +68,14 @@ static int Main(string[] args) string lrrlocation = args[0]; string lralocation = args[1]; string htmlLocation = args[2]; + string analysisTemplateLocation = (args.Length == 4 ? args[3] : ""); log("creating analysis COM object"); LrAnalysis analysis = new LrAnalysis(); Session session = analysis.Session; log("creating analysis session"); - if (session.Create(lralocation, lrrlocation)) + if (session.CreateWithTemplateFile(lralocation, lrrlocation, analysisTemplateLocation)) { log("analysis session created"); log("creating HTML reports"); @@ -478,7 +479,7 @@ private static void ShowHelp() log(); Console.Write("Usage: LRAnalysisLauncher.exe"); Console.ForegroundColor = ConsoleColor.Cyan; - Console.Write("[.lrr file location] [.lra output location] [html report output folder]"); + Console.Write("[.lrr file location] [.lra output location] [html report output folder] [.tem file location(optional)]"); Console.ResetColor(); Environment.Exit((int)Launcher.ExitCodeEnum.Failed); } diff --git a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java index 7d42eb39ea..c762917c27 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java @@ -66,6 +66,7 @@ public class RunFromFileSystemModel { private String controllerPollingInterval; private String perScenarioTimeOut; private String ignoreErrorStrings; + private String analysisTemplate; private String displayController; private String mcServerName; private String fsUserName; @@ -93,6 +94,7 @@ public class RunFromFileSystemModel { * @param controllerPollingInterval the controller polling interval in minutes * @param perScenarioTimeOut the per scenario time out in minutes * @param ignoreErrorStrings the ignore error strings + * @param analysisTemplate the analysis template * @param displayController the display controller * @param mcServerName the mc server name * @param fsUserName the fs user name @@ -112,7 +114,7 @@ public class RunFromFileSystemModel { */ @SuppressWarnings("squid:S00107") public RunFromFileSystemModel(String fsTests, String fsTimeout, String fsUftRunMode, String controllerPollingInterval,String perScenarioTimeOut, - String ignoreErrorStrings, String displayController, String mcServerName, String fsUserName, String fsPassword, String mcTenantId, + String ignoreErrorStrings, String analysisTemplate, String displayController, String mcServerName, String fsUserName, String fsPassword, String mcTenantId, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, String fsExtraApps, String fsJobId, ProxySettings proxySettings, boolean useSSL) { @@ -125,6 +127,7 @@ public RunFromFileSystemModel(String fsTests, String fsTimeout, String fsUftRunM this.perScenarioTimeOut = perScenarioTimeOut; this.controllerPollingInterval = controllerPollingInterval; this.ignoreErrorStrings = ignoreErrorStrings; + this.analysisTemplate = analysisTemplate; this.displayController = displayController; this.mcServerName = mcServerName; @@ -165,6 +168,7 @@ public RunFromFileSystemModel(String fsTests) { this.perScenarioTimeOut = "10"; this.ignoreErrorStrings = ""; this.displayController = "false"; + this.analysisTemplate = ""; } @@ -553,6 +557,24 @@ public void setControllerPollingInterval(String controllerPollingInterval) { this.controllerPollingInterval = controllerPollingInterval; } + /** + * Gets analysis template. + * + * @return the analysis template + */ + public String getAnalysisTemplate() { + return analysisTemplate; + } + + /** + * Sets analysis template. + * + * @param analysisTemplate the analysis template + */ + public void setAnalysisTemplate(String analysisTemplate) { + this.analysisTemplate = analysisTemplate; + } + /** * Gets display controller. * @@ -693,6 +715,12 @@ private Properties createProperties(EnvVars envVars) { props.put("controllerPollingInterval", "" + controllerPollingInterval); } + if (StringUtils.isEmpty(analysisTemplate)) { + props.put("analysisTemplate", ""); + } else{ + props.put("analysisTemplate", analysisTemplate); + } + if (StringUtils.isEmpty(displayController) || displayController.equals("false")){ props.put("displayController", "0"); } diff --git a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java index 44f1169562..84a3418d33 100644 --- a/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java +++ b/src/main/java/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep.java @@ -165,6 +165,26 @@ public void setIgnoreErrorStrings(String ignoreErrorStrings) { runFromFileBuilder.setIgnoreErrorStrings(ignoreErrorStrings); } + /** + * Gets analysis template. + * + * @return the analysis template + */ + public String getAnalysisTemplate() { + return runFromFileBuilder.getRunFromFileModel().getAnalysisTemplate(); + } + + /** + * Sets analysis template. + * + * @param analysisTemplate the analysis template + */ + @DataBoundSetter + public void setAnalysisTemplate(String analysisTemplate) { + runFromFileBuilder.setAnalysisTemplate(analysisTemplate); + } + + /** * Gets display controller. * diff --git a/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java new file mode 100644 index 0000000000..b6bf905fdd --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java @@ -0,0 +1,158 @@ + +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + +package com.hpe.application.automation.tools.results; + +import hudson.FilePath; +import hudson.model.Action; +import hudson.model.DirectoryBrowserSupport; +import hudson.model.Run; +import hudson.tasks.test.TestResultProjectAction; +import jenkins.tasks.SimpleBuildStep; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + + +public class RichReportAction implements Action, SimpleBuildStep.LastBuildAction { + + private static final String RICH_REPORT_FOLDER = "RichReport"; + private static final String REPORT_INDEX = "report.index"; + + private Map richReportMap = new LinkedHashMap(); + private final List projectActionList; + + + private final Run build; + + public RichReportAction(Run build) throws IOException { + this.build = build; + File reportFolder = new File(build.getRootDir(), RICH_REPORT_FOLDER); + if (reportFolder.exists()) { + File indexFile = new File(reportFolder, REPORT_INDEX); + if (indexFile.exists()) { + File file = new File(build.getRootDir(), RICH_REPORT_FOLDER); + DirectoryBrowserSupport dbs = new DirectoryBrowserSupport(this, new FilePath(file), "report", "graph.gif", false); + + + createRichIndexFile(build, indexFile, dbs); + } + } + projectActionList = new ArrayList(); + } + + private void createRichIndexFile(Run build, File indexFile, DirectoryBrowserSupport dbs) throws IOException { + BufferedReader br = new BufferedReader(new FileReader(indexFile)); + String line; + boolean rolling = true; + while ((line = br.readLine()) != null) { + String[] values = line.split("\t"); + if (values.length < 1) + continue; + DetailReport report = new DetailReport(build, values[0], dbs); + if (rolling) { + report.setColor("#FFF"); + rolling = false; + } else { + report.setColor("#F1F1F1"); + rolling = true; + } + if (values.length >= 2) + report.setDuration(values[1]); + else + report.setDuration("##"); + if (values.length >= 3) + report.setPass(values[2]); + else + report.setPass("##"); + if (values.length >= 4) + report.setFail(values[3]); + else + report.setFail("##"); + richReportMap.put(values[0], report); + } + br.close(); + } + + @Override + public String getIconFileName() { + return "/plugin/hp-application-automation-tools-plugin/PerformanceReport/LoadRunner.png"; + } + + @Override + public String getDisplayName() { + return "Rich Report"; + } + + @Override + public String getUrlName() { + return "RichReport"; + } + + @SuppressWarnings("squid:S1452") + public Run getBuild() { + return build; + } + + public Map getRichReportMap() { + return richReportMap; + } + + + public Object getDynamic(String name, StaplerRequest req, StaplerResponse rsp) { + if (richReportMap.containsKey(name)) + return richReportMap.get(name); + return null; + } + + @Override + public Collection getProjectActions() { +// List projectActions = new ArrayList<>(); +// projectActions.add(new PerformanceProjectAction(build.getParent())); +// projectActions.add(new TestResultProjectAction(build.getParent())); +// return projectActions; + return Collections.emptySet(); + + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index 2d11747b98..dd911284da 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -106,6 +106,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import java.util.Scanner; import static com.hpe.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNode; import static com.hpe.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNodeAttr; @@ -125,11 +126,13 @@ public class RunResultRecorder extends Recorder implements Serializable, MatrixA private static final String PERFORMANCE_REPORT_FOLDER = "PerformanceReport"; private static final String IE_REPORT_FOLDER = "IE"; private static final String HTML_REPORT_FOLDER = "HTML"; + private static final String LRA_FOLDER = "LRA"; private static final String INDEX_HTML_NAME = "index.html"; private static final String REPORT_INDEX_NAME = "report.index"; private static final String REPORTMETADATE_XML = "report_metadata.xml"; private static final String TRANSACTION_SUMMARY_FOLDER = "TransactionSummary"; - private static final String TRANSACTION_REPORT_NAME = "Report3"; + private static final String RICH_REPORT_FOLDER = "RichReport"; + private static final String TRANSACTION_REPORT_NAME = "TransactionReport"; private static final String SLA_ACTUAL_VALUE_LABEL = "ActualValue"; private static final String SLA_GOAL_VALUE_LABEL = "GoalValue"; public static final String SLA_ULL_NAME = "FullName"; @@ -271,6 +274,14 @@ private void publishLrReports(@Nonnull Run build) throws IOException { build.replaceAction(new TransactionSummaryAction(build)); } } + + File richDirectory = new File(build.getRootDir(), RICH_REPORT_FOLDER); + if (richDirectory.exists()) { + File htmlIndexFile = new File(richDirectory, INDEX_HTML_NAME); + if (htmlIndexFile.exists()) { + build.replaceAction(new RichReportAction(build)); + } + } } /** @@ -386,6 +397,7 @@ private void archiveTestsReport( zipFileNames.add(zipFileName); } + createRichReports(reportFolder, testFolderPath, artifactsDir, reportNames, testResult); createHtmlReport(reportFolder, testFolderPath, artifactsDir, reportNames, testResult); createTransactionSummary(reportFolder, testFolderPath, artifactsDir, reportNames, testResult); try { @@ -820,12 +832,101 @@ private void createHtmlReport(FilePath reportFolder, FileUtils.moveDirectory(new File(reportDirectory, IE_REPORT_FOLDER), new File(reportDirectory, newFolderName)); tmpZipFile.delete(); - outputReportFiles(reportNames, reportDirectory, testResult, false); + outputReportFiles(reportNames, reportDirectory, testResult, "Performance Report", "HTML.html"); } } } } + private void createRichReports(FilePath reportFolder, + String testFolderPath, + File artifactsDir, + List reportNames, + TestResult testResult) throws IOException, InterruptedException { + File testFolderPathFile = new File(testFolderPath); + FilePath htmlReportPath = new FilePath(reportFolder, LRA_FOLDER); + if (htmlReportPath.exists()) { + File reportDirectory = new File(artifactsDir.getParent(), RICH_REPORT_FOLDER); + if (!reportDirectory.exists()) { + reportDirectory.mkdir(); + } + String newFolderName = org.apache.commons.io.FilenameUtils.getName(testFolderPathFile.getPath()); + File testDirectory = new File(reportDirectory, newFolderName); + if (!testDirectory.exists()) { + testDirectory.mkdir(); + } + + FilePath dstReportPath = new FilePath(testDirectory); + FileFilter reportFileFilter = new WildcardFileFilter("*.pdf"); + List reporFiles = htmlReportPath.list(reportFileFilter); + + + List richReportNames = new ArrayList(); + for (FilePath fileToCopy : reporFiles) { + FilePath dstFilePath = new FilePath(dstReportPath, fileToCopy.getName()); + fileToCopy.copyTo(dstFilePath); + richReportNames.add(dstFilePath.getName()); + } + + outputReportFiles(reportNames, reportDirectory, testResult, "Rich Reports", "index.html"); + createRichReportsIndex(testDirectory, richReportNames, "Rich Reports"); + } + } + + private void createRichReportsIndex(File reportDirectory, List richReportNames, String title) + throws IOException { + + String htmlFileContents = "" + + "" + + "" + + "" + title + "<TITLE>" + + "</HEAD>" + + "<BODY>"; + + if (richReportNames.size() == 0) { + htmlFileContents += "Template contains no rich reports."; + } else { + for (String richReportName : richReportNames) { + htmlFileContents += "<iframe src=\"./" + richReportName + "\" width=\"100%%\" height=\"800px\" frameBorder=\"0\"></iframe>"; + } + } + + htmlFileContents += "<BODY>"; + + File htmlIndexFile = new File(reportDirectory, "HTML.html"); + BufferedWriter writer = new BufferedWriter(new FileWriter(htmlIndexFile)); + writer.write(htmlFileContents); + writer.flush(); + writer.close(); + /*writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); + writer.write("<HTML><HEAD>"); + writer.write("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"); + writer.write(String.format("<TITLE>%s", title)); + writer.write(""); + writer.write(""); + + if (richReportNames.size() == 0) { + writer.write("Template contains no rich reports."); + } + for (String richReportName : richReportNames) { + writer.write( + String.format( + "", richReportName + ) + ); + } + + writer.write("");*/ + + } + + private void writeToFile(File file, String contents) { + BufferedWriter writer = new BufferedWriter(new FileWriter(file)); + writer.write(contents); + writer.flush(); + writer.close(); + } + /** * creates index files as index for the different scenarios. * @@ -836,13 +937,12 @@ private void createHtmlReport(FilePath reportFolder, * @throws IOException */ private void outputReportFiles(List reportNames, File reportDirectory, TestResult testResult, - boolean tranSummary) throws IOException { - + String title, String htmlFileName) throws IOException { if (reportNames.isEmpty()) { return; } - String title = (tranSummary) ? "Transaction Summary" : "Performance Report"; - String htmlFileName = (tranSummary) ? (TRANSACTION_REPORT_NAME + ".html") : "HTML.html"; + //String title = (tranSummary) ? "Transaction Summary" : "Performance Report"; + //String htmlFileName = (tranSummary) ? (TRANSACTION_REPORT_NAME + ".html") : "HTML.html"; File htmlIndexFile = new File(reportDirectory, INDEX_HTML_NAME); BufferedWriter writer = new BufferedWriter(new FileWriter(htmlIndexFile)); writer.write("%n"); @@ -875,6 +975,7 @@ private void outputReportFiles(List reportNames, File reportDirectory, T rolling = true; } } + writer.write("
    %n"); writer.write("%n"); writer.flush(); @@ -969,12 +1070,37 @@ private void createTransactionSummary(FilePath reportFolder, } FilePath dstReportPath = new FilePath(testDirectory); - FileFilter reportFileFilter = new WildcardFileFilter(TRANSACTION_REPORT_NAME + ".*"); - List reporFiles = htmlReportPath.list(reportFileFilter); - for (FilePath fileToCopy : reporFiles) { - FilePath dstFilePath = new FilePath(dstReportPath, fileToCopy.getName()); - fileToCopy.copyTo(dstFilePath); + FileFilter reportFileFilter = new WildcardFileFilter("Report*.html"); + List reportFiles = htmlReportPath.list(reportFileFilter); + boolean doesTransactionSummaryFileExist = false; + for (FilePath fileToCopy : reportFiles) { + Scanner s = new Scanner(fileToCopy.read()).useDelimiter("\\A"); + + while (s.hasNextLine()) { + String myStr = s.nextLine(); + if (myStr.toLowerCase().contains("transaction summary")) { + FilePath dstFilePath = new FilePath(dstReportPath, TRANSACTION_REPORT_NAME + ".html"); + fileToCopy.copyTo(dstFilePath); + doesTransactionSummaryFileExist = true; + } + } + } + + if (!doesTransactionSummaryFileExist) { + File htmlIndexFile = new File(testDirectory, TRANSACTION_REPORT_NAME + ".html"); + BufferedWriter writer = new BufferedWriter(new FileWriter(htmlIndexFile)); + writer.write(""); + writer.write(""); + writer.write(""); + writer.write(String.format("%s", "Testing")); + writer.write(""); + writer.write(""); + writer.write("Template contains no transaction summary report."); + writer.write(""); + writer.flush(); + writer.close(); } + FilePath cssFilePath = new FilePath(htmlReportPath, "Properties.css"); if (cssFilePath.exists()) { FilePath dstFilePath = new FilePath(dstReportPath, cssFilePath.getName()); @@ -986,10 +1112,16 @@ private void createTransactionSummary(FilePath reportFolder, pngFilePath.copyTo(dstFilePath); } - outputReportFiles(reportNames, reportDirectory, testResult, true); + FilePath jsDstReportPath = new FilePath(testDirectory); + FileFilter jsReportFileFilter = new WildcardFileFilter("*.js"); + List jsReporFiles = htmlReportPath.list(jsReportFileFilter); + for (FilePath fileToCopy : jsReporFiles) { + FilePath dstFilePath = new FilePath(jsDstReportPath, fileToCopy.getName()); + fileToCopy.copyTo(dstFilePath); + } + outputReportFiles(reportNames, reportDirectory, testResult, "Transaction Summary", TRANSACTION_REPORT_NAME + ".html"); } - } /* diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 3347232399..0a31856e26 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -126,6 +126,7 @@ public RunFromFileBuilder(RunFromFileSystemModel runFromFileModel) { * @param controllerPollingInterval the controller polling interval * @param perScenarioTimeOut the per scenario time out * @param ignoreErrorStrings the ignore error strings + * @param analysisTemplate the analysis template * @param displayController the display controller * @param mcServerName the mc server name * @param fsUserName the fs user name @@ -146,13 +147,13 @@ public RunFromFileBuilder(RunFromFileSystemModel runFromFileModel) { @SuppressWarnings("squid:S00107") @Deprecated public RunFromFileBuilder(String fsTests, String fsTimeout, String fsUftRunMode, String controllerPollingInterval, - String perScenarioTimeOut, String ignoreErrorStrings, String displayController, String mcServerName, String fsUserName, + String perScenarioTimeOut, String ignoreErrorStrings, String displayController, String analysisTemplate, String mcServerName, String fsUserName, String fsPassword, String mcTenantId, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, String fsExtraApps, String fsJobId, ProxySettings proxySettings, boolean useSSL) { runFromFileModel = new RunFromFileSystemModel(fsTests, fsTimeout, fsUftRunMode, controllerPollingInterval, - perScenarioTimeOut, ignoreErrorStrings, displayController, mcServerName, fsUserName, fsPassword, mcTenantId, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, fsAutActions, fsLaunchAppName, + perScenarioTimeOut, ignoreErrorStrings, displayController, analysisTemplate, mcServerName, fsUserName, fsPassword, mcTenantId, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, fsAutActions, fsLaunchAppName, fsDevicesMetrics, fsInstrumented, fsExtraApps, fsJobId, proxySettings, useSSL); } @@ -205,6 +206,16 @@ public void setDisplayController(String displayController) { runFromFileModel.setDisplayController(displayController); } + /** + * Sets analysis template. + * + * @param analysisTemplate the analysis template + */ + @DataBoundSetter + public void setAnalysisTemplate(String analysisTemplate) { + runFromFileModel.setAnalysisTemplate(analysisTemplate); + } + /** * Sets fs timeout. * diff --git a/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly index e5eb4db9da..3965cad39c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/config.jelly @@ -63,6 +63,9 @@ + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/help-analysisTemplate.html b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/help-analysisTemplate.html new file mode 100644 index 0000000000..e91ec4dff0 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/pipelineSteps/LoadRunnerTestStep/help-analysisTemplate.html @@ -0,0 +1,36 @@ + + +
    + Apply a template for the build (path to a .tem file). Leave blank in order to use the default template. +
    diff --git a/src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly new file mode 100644 index 0000000000..fffa00506f --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly @@ -0,0 +1,69 @@ + + + + + + +

    LoadRunner Rich Report

    + + + + + + + + + + + + + + + ${c.printFourCoverageColumns()} + + +
    NameDurationPassFail
    + ${c.getName()} + + ${c.getDuration()} + + ${c.getPass()} + + ${c.getFail()} +
    + + +
    +
    +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly index 716a17abf9..f8e6a89eed 100644 --- a/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly @@ -37,7 +37,7 @@

    Transaction Summary

    ${it.name}

    - +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly index 7833862596..b01cd56e89 100644 --- a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -88,9 +88,12 @@ + + + - - + + diff --git a/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-analysisTemplate.html b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-analysisTemplate.html new file mode 100644 index 0000000000..e91ec4dff0 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-analysisTemplate.html @@ -0,0 +1,36 @@ + + +
    + Apply a template for the build (path to a .tem file). Leave blank in order to use the default template. +
    From 05530c6092bb8479889a7e2dfd0f7d8b9b7cea53 Mon Sep 17 00:00:00 2001 From: Ionut Florin Tamas Date: Thu, 12 Jul 2018 18:47:49 +0300 Subject: [PATCH 0402/2502] ParallelRunner support for RunFromFileSytem. --- HpToolsAborter/Program.cs | 113 ++++ HpToolsLauncher/ElevatedProcess.cs | 231 +++++++ HpToolsLauncher/Helper.cs | 113 +++- HpToolsLauncher/HpToolsLauncher.csproj | 9 + HpToolsLauncher/HpToolsLauncher.sln | 19 +- .../HpToolsLauncherTests.csproj | 1 + .../ParallelRunnerEnvironmentUtilTests.cs | 417 ++++++++++++ HpToolsLauncher/IProcessAdapter.cs | 137 ++++ HpToolsLauncher/Launcher.cs | 53 +- HpToolsLauncher/MtbxManager.cs | 8 +- HpToolsLauncher/NativeProcess.cs | 541 +++++++++++++++ .../ParallelRunnerEnvironmentUtil.cs | 436 ++++++++++++ .../ParallelTestRunConfiguration.cs | 165 +++++ HpToolsLauncher/ProcessExtensions.cs | 51 ++ .../Properties/Resources.Designer.cs | 9 + HpToolsLauncher/Properties/Resources.resx | 3 + .../Runners/FileSystemTestsRunner.cs | 69 +- HpToolsLauncher/TestData.cs | 25 + HpToolsLauncher/TestInfo.cs | 28 +- .../Out/AgentRestart.dat | Bin 0 -> 365 bytes .../Out/AgentRestart.dat | Bin 0 -> 365 bytes .../Out/AgentRestart.dat | Bin 0 -> 365 bytes .../TestRunners/ParallelTestRunner.cs | 362 ++++++++++ .../tools/model/FileSystemTestModel.java | 149 +++++ .../tools/model/FileSystemTestSetModel.java | 144 ++++ .../model/ParallelRunnerEnvironmentModel.java | 283 ++++++++ .../tools/model/RunFromFileSystemModel.java | 15 +- .../tools/results/HtmlBuildReportAction.java | 2 + .../tools/results/ReportMetaData.java | 7 + .../tools/results/RunResultRecorder.java | 69 +- .../tools/run/RunFromFileBuilder.java | 141 +++- .../model/FileSystemTestModel/config.jelly | 66 ++ .../model/FileSystemTestModel/help-tests.html | 3 + .../model/FileSystemTestSetModel/config.jelly | 40 ++ .../help-fileSystemTestSet.html | 3 + .../config.jelly | 81 +++ .../help-environment.html | 3 + .../results/HtmlBuildReportAction/index.jelly | 25 +- .../tools/run/RunFromFileBuilder/config.jelly | 15 +- .../help-isParallelRunnerEnabled.html | 5 + .../resources/lib/custom/customEntry.jelly | 55 ++ .../lib/custom/customOptionalBlock.jelly | 93 +++ .../lib/custom/customRepeatable.jelly | 140 ++++ .../lib/custom/customRepeatableProperty.jelly | 36 + src/main/resources/lib/custom/taglib | 0 .../ParallelRunner/icons/png/chrome.png | Bin 0 -> 1302 bytes .../ParallelRunner/icons/png/chrome@2x.png | Bin 0 -> 2648 bytes .../ParallelRunner/icons/png/chrome@3x.png | Bin 0 -> 4069 bytes .../ParallelRunner/icons/png/explorer.png | Bin 0 -> 1263 bytes .../ParallelRunner/icons/png/explorer@2x.png | Bin 0 -> 2510 bytes .../ParallelRunner/icons/png/explorer@3x.png | Bin 0 -> 3828 bytes .../ParallelRunner/icons/png/firefox.png | Bin 0 -> 1118 bytes .../ParallelRunner/icons/png/firefox@2x.png | Bin 0 -> 2424 bytes .../ParallelRunner/icons/png/firefox@3x.png | Bin 0 -> 3736 bytes .../ParallelRunner/icons/svg/chrome.svg | 25 + .../ParallelRunner/icons/svg/explorer.svg | 23 + .../ParallelRunner/icons/svg/firefox.svg | 23 + src/main/webapp/css/PARALLEL_RUNNER_UI.css | 113 ++++ src/main/webapp/icons/report/html_report.svg | 1 + .../icons/report/parallel_html_report.svg | 1 + src/main/webapp/parallelRunnerEnvironment.js | 628 ++++++++++++++++++ 61 files changed, 4899 insertions(+), 80 deletions(-) create mode 100644 HpToolsLauncher/ElevatedProcess.cs create mode 100644 HpToolsLauncher/HpToolsLauncherTests/ParallelRunnerEnvironmentUtilTests.cs create mode 100644 HpToolsLauncher/IProcessAdapter.cs create mode 100644 HpToolsLauncher/NativeProcess.cs create mode 100644 HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs create mode 100644 HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs create mode 100644 HpToolsLauncher/ProcessExtensions.cs create mode 100644 HpToolsLauncher/TestData.cs create mode 100644 HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_16_02/Out/AgentRestart.dat create mode 100644 HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_19_32/Out/AgentRestart.dat create mode 100644 HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-27 15_09_14/Out/AgentRestart.dat create mode 100644 HpToolsLauncher/TestRunners/ParallelTestRunner.cs create mode 100644 src/main/java/com/hpe/application/automation/tools/model/FileSystemTestModel.java create mode 100644 src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java create mode 100644 src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java create mode 100644 src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/help-tests.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/help-fileSystemTestSet.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly create mode 100644 src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/help-environment.html create mode 100644 src/main/resources/com/hpe/application/automation/tools/run/RunFromFileBuilder/help-isParallelRunnerEnabled.html create mode 100644 src/main/resources/lib/custom/customEntry.jelly create mode 100644 src/main/resources/lib/custom/customOptionalBlock.jelly create mode 100644 src/main/resources/lib/custom/customRepeatable.jelly create mode 100644 src/main/resources/lib/custom/customRepeatableProperty.jelly create mode 100644 src/main/resources/lib/custom/taglib create mode 100644 src/main/webapp/ParallelRunner/icons/png/chrome.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/chrome@2x.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/chrome@3x.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/explorer.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/explorer@2x.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/explorer@3x.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/firefox.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/firefox@2x.png create mode 100644 src/main/webapp/ParallelRunner/icons/png/firefox@3x.png create mode 100644 src/main/webapp/ParallelRunner/icons/svg/chrome.svg create mode 100644 src/main/webapp/ParallelRunner/icons/svg/explorer.svg create mode 100644 src/main/webapp/ParallelRunner/icons/svg/firefox.svg create mode 100644 src/main/webapp/css/PARALLEL_RUNNER_UI.css create mode 100644 src/main/webapp/icons/report/html_report.svg create mode 100644 src/main/webapp/icons/report/parallel_html_report.svg create mode 100644 src/main/webapp/parallelRunnerEnvironment.js diff --git a/HpToolsAborter/Program.cs b/HpToolsAborter/Program.cs index 64cab146ad..f15c12dadd 100644 --- a/HpToolsAborter/Program.cs +++ b/HpToolsAborter/Program.cs @@ -23,6 +23,7 @@ using System.Diagnostics; using System.IO; using HpToolsLauncher; +using System.Runtime.InteropServices; namespace HpToolsAborter { @@ -73,6 +74,7 @@ static void Main(string[] args) { KillQtpAutomationProcess(); KillLoadRunnerAutomationProcess(); + KillParallelRunnerAutomatonProcesses(); } if (runType=="Alm") @@ -117,6 +119,49 @@ private static void KillLoadRunnerAutomationProcess() } + private static void KillParllelRunnerAutomationProcess(Process parallelRunner) + { + if(parallelRunner != null) + { + List children = new List(); + GetProcessChildren(parallelRunner.Id, children); + + foreach(var child in children) + { + var proc = Process.GetProcessById(child.ID); + + if(proc != null) + { + KillProcess(proc); + } + } + + KillProcess(parallelRunner); + } + } + + private static void KillParallelRunnerAutomatonProcesses() + { + Process[] paralelRunnerProcesses = Process.GetProcessesByName("ParallelRunner"); + + // kill every parallel runner process + foreach(var proc in paralelRunnerProcesses) + { + // we are sending SIGINT as ParallelRunner will handle this message + // gracefully and will set the test status to aborted + bool closed = SendSigIntToProcess(proc); + + // let's give SIGINT a chance to execute + proc.WaitForExit(500); + + // if ctr-c has failed, just kill the process... + if (!closed || !proc.HasExited) + { + KillParllelRunnerAutomationProcess(proc); + } + } + } + private static void KillQtpAutomationProcess() { @@ -247,6 +292,65 @@ private static void KillProcess(Process process) } } + private static bool SendSigIntToProcess(Process process) + { + const int waitMs = 500; + + // we can only be attached to one console at a time + if (!FreeConsole()) + return false; + + // try to attach the console to the process + // that we want to send the signal to + if (!AttachConsole((uint)process.Id)) + return false; + + // disable the ctrl handler for our process + // so we do not close ourselvles + if (!SetConsoleCtrlHandler(null, true)) + { + FreeConsole(); + AllocConsole(); + + return false; + } + + // Now generate the event and free the console + // that we have attached ourselvles to + if (GenerateConsoleCtrlEvent(CtrlTypes.CTRL_C_EVENT, 0)) + { + process.WaitForExit(waitMs); + } + + // free the console for the process that we have attached to + FreeConsole(); + + // alloc a new console for current process + // as we might need to display something + AllocConsole(); + + SetConsoleCtrlHandler(null, false); + + return true; + } + + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool AttachConsole(uint dwProcessId); + + [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)] + static extern bool FreeConsole(); + + [DllImport("kernel32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool GenerateConsoleCtrlEvent(CtrlTypes dwCtrlEvent, uint dwProcessGroupId); + + public delegate bool HandlerRoutine(CtrlTypes CtrlType); + + [DllImport("kernel32")] + public static extern bool SetConsoleCtrlHandler(HandlerRoutine Handler, bool Add); + + [DllImport("kernel32")] + static extern bool AllocConsole(); } public class ProcessData @@ -261,4 +365,13 @@ public ProcessData(int id, string name) public string Name { get; private set; } } + enum CtrlTypes : uint + { + CTRL_C_EVENT = 0, + CTRL_BREAK_EVENT, + CTRL_CLOSE_EVENT, + CTRL_LOGOFF_EVENT = 5, + CTRL_SHUTDOWN_EVENT + } + } diff --git a/HpToolsLauncher/ElevatedProcess.cs b/HpToolsLauncher/ElevatedProcess.cs new file mode 100644 index 0000000000..93e15a2128 --- /dev/null +++ b/HpToolsLauncher/ElevatedProcess.cs @@ -0,0 +1,231 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace HpToolsLauncher +{ + public class ElevatedProcessException : Exception + { + public ElevatedProcessException(string message) : base(message) { } + public ElevatedProcessException(string message, Exception innerException) : base(message, innerException) { } + } + + public class ElevatedProcess : IDisposable + { + private readonly string _path; + private readonly string _arguments; + private readonly string _workDirectory; + private NativeProcess.PROCESS_INFORMATION _processInformation; + private const uint STILL_ACTIVE = 259; + private const uint INFINITE = 0xFFFFFFFF; + + public ElevatedProcess(string path,string arguments,string workDirectory) + { + _path = path; + _arguments = arguments; + _workDirectory = workDirectory; + } + + public string ExecutablePath + { + get { return _path; } + } + + public string Arguments + { + get { return _arguments; } + } + + public string WorkDirectory + { + get { return _workDirectory; } + } + + private int GetExitCode() + { + uint exitCode = 0; + + if (!NativeProcess.GetExitCodeProcess(_processInformation.hProcess, out exitCode)) + { + return 0; + } + + return (int)exitCode; + } + + public int ExitCode + { + get + { + return GetExitCode(); + } + } + + public bool HasExited + { + get + { + return GetExitCode() != STILL_ACTIVE; + } + } + + public void StartElevated() + { + Process process = null; + try + { + process = Process.GetProcessesByName("explorer").FirstOrDefault(); + }catch(InvalidOperationException e) + { + throw new ElevatedProcessException("Unable to find explorer process: ", e); + } + + if(process == null) + { + throw new ElevatedProcessException("No process with the name 'explorer' found!"); + } + + // we can retrieve the token information from explorer + int explorerPid = process.Id; + + // open the explorer process with the necessary flags + IntPtr hProcess = NativeProcess.OpenProcess(NativeProcess.ProcessAccessFlags.DuplicateHandle | NativeProcess.ProcessAccessFlags.QueryInformation, + false, explorerPid); + + if (hProcess == IntPtr.Zero) + { + throw new ElevatedProcessException("OpenProcess() failed with error code: " + Marshal.GetLastWin32Error()); + } + + IntPtr hUser = IntPtr.Zero; + + // get the secondary token from the explorer process + if (!NativeProcess.OpenProcessToken(hProcess, NativeProcess.TOKEN_QUERY | NativeProcess.TOKEN_DUPLICATE | NativeProcess.TOKEN_ASSIGN_PRIMARY, out hUser)) + { + NativeProcess.CloseHandle(hProcess); + + throw new ElevatedProcessException("OpenProcessToken() failed with error code: " + Marshal.GetLastWin32Error()); + } + + IntPtr userToken = IntPtr.Zero; + + // convert the secondary token to a primary token + if (!NativeProcess.DuplicateTokenEx(hUser, NativeProcess.MAXIMUM_ALLOWED, IntPtr.Zero, NativeProcess.SECURITY_IMPERSONATION_LEVEL.SecurityIdentification, + NativeProcess.TOKEN_TYPE.TokenPrimary, out userToken)) + { + NativeProcess.CloseHandle(hUser); + NativeProcess.CloseHandle(hProcess); + + throw new ElevatedProcessException("DuplicateTokenEx() failed with error code: " + Marshal.GetLastWin32Error()); + } + + // the explorer session id will be used in order to launch + // the given executable + uint sessionId = 0; + + if (!NativeProcess.ProcessIdToSessionId((uint)explorerPid, out sessionId)) + { + throw new ElevatedProcessException("ProcessIdToSessionId() failed with error code: " + Marshal.GetLastWin32Error()); + } + + uint tokenInformationLen = (uint)Marshal.SizeOf(sessionId); + + // set the session id + if (!NativeProcess.SetTokenInformation(userToken, NativeProcess.TOKEN_INFORMATION_CLASS.TokenSessionId, ref sessionId, tokenInformationLen)) + { + NativeProcess.CloseHandle(hUser); + NativeProcess.CloseHandle(hProcess); + NativeProcess.CloseHandle(userToken); + + throw new ElevatedProcessException("SetTokenInformation failed with: " + Marshal.GetLastWin32Error()); + } + + if (!NativeProcess.ImpersonateLoggedOnUser(userToken)) + { + NativeProcess.CloseHandle(hUser); + NativeProcess.CloseHandle(hProcess); + NativeProcess.CloseHandle(userToken); + + throw new ElevatedProcessException("ImpersonateLoggedOnUser failed with error code: " + Marshal.GetLastWin32Error()); + } + + // these handles are no longer needed + NativeProcess.CloseHandle(hUser); + NativeProcess.CloseHandle(hProcess); + + NativeProcess.STARTUPINFO startupInfo = new NativeProcess.STARTUPINFO(); + NativeProcess.PROCESS_INFORMATION pInfo = new NativeProcess.PROCESS_INFORMATION(); + startupInfo.cb = Marshal.SizeOf(pInfo); + + string commandLine = _path + " " + _arguments; + + IntPtr pEnv = IntPtr.Zero; + + // create a new environment block for the process + if (!NativeProcess.CreateEnvironmentBlock(out pEnv, userToken, false)) + { + throw new ElevatedProcessException("CreateEnvironmentBlock() failed with error code: " + Marshal.GetLastWin32Error()); + } + + // create the process with the retrieved token + if (!NativeProcess.CreateProcessAsUser(userToken, null, commandLine, IntPtr.Zero, IntPtr.Zero, false, + NativeProcess.CreateProcessFlags.CREATE_UNICODE_ENVIRONMENT | NativeProcess.CreateProcessFlags.CREATE_SUSPENDED | + NativeProcess.CreateProcessFlags.CREATE_NO_WINDOW, pEnv, _workDirectory, ref startupInfo, out pInfo)) + { + NativeProcess.CloseHandle(userToken); + + if (pEnv != IntPtr.Zero) + { + NativeProcess.DestroyEnvironmentBlock(pEnv); + } + + throw new ElevatedProcessException("CreateProcessAsUser() failed with error code: " + Marshal.GetLastWin32Error()); + } + + NativeProcess.ResumeThread(pInfo.hThread); + + // the environment block can be destroyed now + if (pEnv != IntPtr.Zero) + { + NativeProcess.DestroyEnvironmentBlock(pEnv); + } + + // save the process information + _processInformation = pInfo; + + NativeProcess.RevertToSelf(); + } + + public void WaitForExit() + { + NativeProcess.WaitForSingleObject(_processInformation.hProcess, INFINITE); + } + + public bool WaitForExit(int milliseconds) + { + NativeProcess.WaitForSingleObject(_processInformation.hProcess, (uint)milliseconds); + + return HasExited; + } + + public void Kill() + { + NativeProcess.TerminateProcess(_processInformation.hProcess, 0); + } + + public void Dispose() + { + Close(); + } + + public void Close() + { + // close the handles before the object is destroyed + NativeProcess.CloseHandle(_processInformation.hProcess); + NativeProcess.CloseHandle(_processInformation.hThread); + } + } +} diff --git a/HpToolsLauncher/Helper.cs b/HpToolsLauncher/Helper.cs index 56492fbf0b..b4ccb84fab 100644 --- a/HpToolsLauncher/Helper.cs +++ b/HpToolsLauncher/Helper.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using System.Security; using System.Text; using System.Timers; using System.Web.UI; @@ -27,6 +28,7 @@ public enum TestType QTP, ST, LoadRunner, + ParallelRunner } public enum TestState @@ -180,14 +182,14 @@ public static string GetRootDirectoryPath() //verify that files/fodlers exist (does not recurse into folders) - public static List ValidateFiles(IEnumerable tests) + public static List ValidateFiles(IEnumerable tests) { - List validTests = new List(); - foreach (string test in tests) + List validTests = new List(); + foreach (TestData test in tests) { - if (!File.Exists(test) && !Directory.Exists(test)) + if (!File.Exists(test.Tests) && !Directory.Exists(test.Tests)) { - ConsoleWriter.WriteLine(string.Format(">>>> File/Folder not found: '{0}'", test)); + ConsoleWriter.WriteLine(string.Format(">>>> File/Folder not found: '{0}'", test.Tests)); Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; } else @@ -551,6 +553,95 @@ public static bool CanUftProcessStart(out string reason) return true; } + public static string GetUFTDirectory() + { + try + { + return Environment.GetEnvironmentVariable("ST_INSTALL_PATH"); + } + catch (SecurityException) + { + return null; + } + } + + public static string GetParallelRunnerDirectory(string parallelRunnerExecutable) + { + if (parallelRunnerExecutable == null) return null; + + var uftFolder = GetUFTDirectory(); + + if (uftFolder == null) return null; + + return uftFolder + @"bin\" + parallelRunnerExecutable; + } + + public static void ChangeDCOMSettingToInteractiveUser() + { + string errorMsg = "Unable to change DCOM settings. To chage it manually: " + + "run dcomcnfg.exe -> My Computer -> DCOM Config -> QuickTest Professional Automation -> Identity -> and select The Interactive User"; + + string interactiveUser = "Interactive User"; + string runAs = "RunAs"; + + try + { + var regKey = GetQuickTestProfessionalAutomationRegKey(RegistryView.Registry32); + + if (regKey == null) + { + regKey = GetQuickTestProfessionalAutomationRegKey(RegistryView.Registry64); + } + + if (regKey == null) + throw new Exception(@"Unable to find in registry SOFTWARE\Classes\AppID\{A67EB23A-1B8F-487D-8E38-A6A3DD150F0B"); + + object runAsKey = regKey.GetValue(runAs); + + if (runAsKey == null || !runAsKey.ToString().Equals(interactiveUser)) + { + regKey.SetValue(runAs, interactiveUser); + } + + } + catch (Exception ex) + { + throw new Exception(errorMsg + "detailed error is : " + ex.Message); + } + } + + public static RegistryKey GetQuickTestProfessionalAutomationRegKey(RegistryView registry32) + { + RegistryKey localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64); + localKey = localKey.OpenSubKey(@"SOFTWARE\Classes\AppID\{A67EB23A-1B8F-487D-8E38-A6A3DD150F0B}", true); + + return localKey; + } + + /// + /// Return the path of the available results folder for the parallel runner. + /// + /// The test information. + /// + /// the path to the results folder + /// + public static string GetNextResFolder(string reportPath) + { + // since ParallelRunner will store the report as "Res1...ResN" + // we need to know before parallel runner creates the result folder + // what the folder name will be + // so we know which result is ours(or if there was any result) + string resultFolderName = "Res"; + int resultFolderIndex = 1; + + while (Directory.Exists(Path.Combine(reportPath, resultFolderName + resultFolderIndex))) + { + resultFolderIndex += 1; + } + + return reportPath + "\\" + resultFolderName + resultFolderIndex; + } + #region Report Related /// @@ -716,7 +807,6 @@ public static TestState GetTestStateFromLRReport(TestRunResults runDesc, string[ return runDesc.TestState; } - public static TestState GetTestStateFromReport(TestRunResults runDesc) { try @@ -730,6 +820,7 @@ public static TestState GetTestStateFromReport(TestRunResults runDesc) } //if there is Result.xml -> UFT //if there is sla.xml file -> LR + //if there is parallelrun_results.xml -> ParallelRunner string[] resultFiles = Directory.GetFiles(runDesc.ReportLocation, "Results.xml", SearchOption.TopDirectoryOnly); @@ -748,6 +839,15 @@ public static TestState GetTestStateFromReport(TestRunResults runDesc) return GetTestStateFromLRReport(runDesc, resultFiles); } + resultFiles = Directory.GetFiles(runDesc.ReportLocation, "parallelrun_results.html", SearchOption.TopDirectoryOnly); + + // the overall status is given by parallel runner + // at the end of the run + if (resultFiles != null && resultFiles.Length > 0) + { + return runDesc.TestState; + } + //no LR or UFT => error runDesc.ErrorDesc = string.Format("no results file found for " + runDesc.TestName); runDesc.TestState = TestState.Error; @@ -760,7 +860,6 @@ public static TestState GetTestStateFromReport(TestRunResults runDesc) } - private static TestState GetTestStateFromLRReport(string resultFileFullPath, out string desc) { desc = ""; diff --git a/HpToolsLauncher/HpToolsLauncher.csproj b/HpToolsLauncher/HpToolsLauncher.csproj index bbb7728e8d..d85d44164a 100644 --- a/HpToolsLauncher/HpToolsLauncher.csproj +++ b/HpToolsLauncher/HpToolsLauncher.csproj @@ -74,6 +74,7 @@ False + @@ -84,6 +85,8 @@ + + @@ -100,12 +103,18 @@ code + + + + + + diff --git a/HpToolsLauncher/HpToolsLauncher.sln b/HpToolsLauncher/HpToolsLauncher.sln index 908e40a21c..7be42d16c7 100644 --- a/HpToolsLauncher/HpToolsLauncher.sln +++ b/HpToolsLauncher/HpToolsLauncher.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2018 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HpToolsLauncher", "HpToolsLauncher.csproj", "{11BC441C-87A6-41B9-82AE-1F2F606AF45E}" EndProject @@ -26,56 +26,71 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Debug|Any CPU.ActiveCfg = Debug|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Debug|x64.ActiveCfg = Debug|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Debug|x86.ActiveCfg = Debug|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Debug|x86.Build.0 = Debug|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Release|Any CPU.ActiveCfg = Release|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Release|Mixed Platforms.ActiveCfg = Release|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Release|Mixed Platforms.Build.0 = Release|x86 + {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Release|x64.ActiveCfg = Release|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Release|x86.ActiveCfg = Release|x86 {11BC441C-87A6-41B9-82AE-1F2F606AF45E}.Release|x86.Build.0 = Release|x86 {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Debug|x64.ActiveCfg = Debug|Any CPU + {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Debug|x64.Build.0 = Debug|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Debug|x86.ActiveCfg = Debug|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Release|Any CPU.ActiveCfg = Release|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Release|Any CPU.Build.0 = Release|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Release|x64.ActiveCfg = Release|Any CPU + {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Release|x64.Build.0 = Release|Any CPU {A1DAB8E0-DAB0-40F8-AA44-B5B4C2913301}.Release|x86.ActiveCfg = Release|Any CPU {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Debug|Any CPU.ActiveCfg = Debug|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Debug|x64.ActiveCfg = Debug|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Debug|x86.ActiveCfg = Debug|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Debug|x86.Build.0 = Debug|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Release|Any CPU.ActiveCfg = Release|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Release|Mixed Platforms.ActiveCfg = Release|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Release|Mixed Platforms.Build.0 = Release|x86 + {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Release|x64.ActiveCfg = Release|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Release|x86.ActiveCfg = Release|x86 {49496A5D-3FD7-437E-9649-1E2CE2BA6838}.Release|x86.Build.0 = Release|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Debug|Any CPU.ActiveCfg = Debug|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Debug|x64.ActiveCfg = Debug|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Debug|x86.ActiveCfg = Debug|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Debug|x86.Build.0 = Debug|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Release|Any CPU.ActiveCfg = Release|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Release|Mixed Platforms.ActiveCfg = Release|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Release|Mixed Platforms.Build.0 = Release|x86 + {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Release|x64.ActiveCfg = Release|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Release|x86.ActiveCfg = Release|x86 {2DFF94C6-A748-4749-B716-6D8DFB936D43}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7A0855DE-8F59-478E-BADC-0559F9C32FEF} + EndGlobalSection GlobalSection(TestCaseManagementSettings) = postSolution CategoryFile = HpToolsLauncher1.vsmdi EndGlobalSection diff --git a/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj b/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj index 712b60e165..c59248b238 100644 --- a/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj +++ b/HpToolsLauncher/HpToolsLauncherTests/HpToolsLauncherTests.csproj @@ -53,6 +53,7 @@ + diff --git a/HpToolsLauncher/HpToolsLauncherTests/ParallelRunnerEnvironmentUtilTests.cs b/HpToolsLauncher/HpToolsLauncherTests/ParallelRunnerEnvironmentUtilTests.cs new file mode 100644 index 0000000000..9d724294b5 --- /dev/null +++ b/HpToolsLauncher/HpToolsLauncherTests/ParallelRunnerEnvironmentUtilTests.cs @@ -0,0 +1,417 @@ +using HpToolsLauncher; +using HpToolsLauncher.ParallelRunner; +using HpToolsLauncher.ParallelTestRunConfiguraion; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; + +namespace HpToolsLauncherTests +{ + [TestClass] + public class ParallelRunnerEnvironmentUtilTests + { + private static readonly string MobileEnvironment = "osType : Android,osVersion : 4.4.2,manufacturerAndModel : \"samsung GT-I9515\""; + private static readonly string WebEnvironment = "browser : chrome"; + + [TestMethod] + public void GetEnvironmentPropertiesTest_ValidEnvironment_ReturnsExpectedProperties() + { + Dictionary properties = ParallelRunnerEnvironmentUtil. + GetEnvironmentProperties(MobileEnvironment); + + // there should be 3 properties + Assert.AreEqual(properties.Count, 3); + + // check if all the properties are present + Assert.IsTrue(properties.ContainsKey("ostype")); + Assert.IsTrue(properties.ContainsKey("osversion")); + Assert.IsTrue(properties.ContainsKey("manufacturerandmodel")); + + Assert.AreEqual("android", properties["ostype"]); + Assert.AreEqual("4.4.2", properties["osversion"]); + Assert.AreEqual("\"samsung gt-i9515\"", properties["manufacturerandmodel"]); + } + + [TestMethod] + public void GetEnvironmentPropertiesTest_NoValueEnvironment_ReturnsEmptyDictionary() + { + string environment = "deviceId: "; + + Dictionary properties = ParallelRunnerEnvironmentUtil. + GetEnvironmentProperties(environment); + + // there should be 0 properties + Assert.AreEqual(0, properties.Count); + } + + [TestMethod] + public void GetEnvironmentPropertiesTest_NoKeyEnvironment_ReturnsEmptyDictionary() + { + string environment = ": Android "; + + Dictionary properties = ParallelRunnerEnvironmentUtil. + GetEnvironmentProperties(environment); + + // there should be 0 properties + Assert.AreEqual(0, properties.Count); + } + + [TestMethod] + public void GetEnvironmentPropertiesTest_NullEnvironment_ReturnsEmptyDictionary() + { + string environment = null; + + Dictionary properties = ParallelRunnerEnvironmentUtil. + GetEnvironmentProperties(environment); + + // there should be 0 properties + Assert.AreEqual(0, properties.Count); + } + + [TestMethod] + public void GetEnvironmentPropertiesTest_EmptyEnvironment_ReturnsEmptyDictionary() + { + string environment = ""; + + Dictionary properties = ParallelRunnerEnvironmentUtil. + GetEnvironmentProperties(environment); + + // there should be 0 properties + Assert.AreEqual(0, properties.Count); + } + + [TestMethod] + public void ParseMobileEnvironmentTest_ValidMobileEnvironment_ReturnsExpectedMobileEnvironment() + { + MobileEnvironment mobileEnvironment = ParallelRunnerEnvironmentUtil. + ParseMobileEnvironment(MobileEnvironment); + + // function suceeded + Assert.IsNotNull(mobileEnvironment); + + // propertes should be non-null + Assert.IsNotNull(mobileEnvironment.device); + Assert.IsNotNull(mobileEnvironment.lab); + + Device device = mobileEnvironment.device; + + // not present in the string + Assert.IsNull(device.deviceID); + + // only the manufacturer should be filled + Assert.IsNull(device.model); + + // must be present + Assert.IsNotNull(device.manufacturer); + Assert.IsNotNull(device.osType); + Assert.IsNotNull(device.osVersion); + + Assert.AreEqual("android", device.osType); + Assert.AreEqual("4.4.2", device.osVersion); + Assert.AreEqual("\"samsung gt-i9515\"", device.manufacturer); + } + + [TestMethod] + public void ParseMobileEnvironmentTest_InvalidKeyMobileEnvironment_ReturnsNull() + { + string invalidEnvironment = "invalid: android"; + + MobileEnvironment mobileEnvironment = ParallelRunnerEnvironmentUtil. + ParseMobileEnvironment(invalidEnvironment); + + // function suceeded + Assert.IsNull(mobileEnvironment); + } + + [TestMethod] + public void ParseMobileEnvironmentTest_NullMobileEnvironment_ReturnsNull() + { + MobileEnvironment mobileEnvironment = ParallelRunnerEnvironmentUtil. + ParseMobileEnvironment(null); + + // function suceeded + Assert.IsNull(mobileEnvironment); + } + + [TestMethod] + public void ParseMobileEnvironmentTest_EmptyMobileEnvironment_ReturnsNull() + { + MobileEnvironment mobileEnvironment = ParallelRunnerEnvironmentUtil. + ParseMobileEnvironment(""); + + // function suceeded + Assert.IsNull(mobileEnvironment); + } + + [TestMethod] + public void ParseWebEnvironmentTest_ValidWebEnvironment_ReturnsExpectedWebEnvironment() + { + WebEnvironment webEnvironment = ParallelRunnerEnvironmentUtil. + ParseWebEnvironment(WebEnvironment); + + // function suceeded + Assert.IsNotNull(webEnvironment); + + // browser should be present + Assert.IsNotNull(webEnvironment.browser); + + // local browser lab should be present + Assert.IsNotNull(webEnvironment.lab); + + // browser should be 'chrome' + Assert.AreEqual("chrome", webEnvironment.browser); + + Assert.AreEqual("LocalBrowser", webEnvironment.lab); + } + + [TestMethod] + public void ParseWebEnvironmentTest_InvalidKeyWebEnvironment_ReturnsExpectedWebEnvironment() + { + string invalidKey = "brows: Chrome"; + + WebEnvironment webEnvironment = ParallelRunnerEnvironmentUtil. + ParseWebEnvironment(invalidKey); + + // function suceeded + Assert.IsNull(webEnvironment); + } + + [TestMethod] + public void ParseWebEnvironmentTest_NullWebEnvironment_ReturnsExpectedWebEnvironment() + { + WebEnvironment webEnvironment = ParallelRunnerEnvironmentUtil. + ParseWebEnvironment(null); + + // function suceeded + Assert.IsNull(webEnvironment); + } + + [TestMethod] + public void ParseWebEnvironmentTest_EmptyWebEnvironment_ReturnsExpectedWebEnvironment() + { + WebEnvironment webEnvironment = ParallelRunnerEnvironmentUtil. + ParseWebEnvironment(""); + + // function suceeded + Assert.IsNull(webEnvironment); + } + + [TestMethod] + public void GetEvironmentTypeTest_ValidMobileEnvironment_ReturnMobileEnvironment() + { + EnvironmentType type = + ParallelRunnerEnvironmentUtil.GetEnvironmentType(MobileEnvironment); + + Assert.AreEqual(EnvironmentType.MOBILE, type); + } + + [TestMethod] + public void GetEvironmentTypeTest_ValidWebEnvironment_ReturnWebEnvironment() + { + EnvironmentType type = + ParallelRunnerEnvironmentUtil.GetEnvironmentType(WebEnvironment); + + Assert.AreEqual(EnvironmentType.WEB, type); + } + + [TestMethod] + public void GetEvironmentTypeTest_NullEnvironment_ReturnUnknownEnvironment() + { + EnvironmentType type = + ParallelRunnerEnvironmentUtil.GetEnvironmentType(null); + + Assert.AreEqual(EnvironmentType.UNKNOWN, type); + } + + [TestMethod] + public void GetEvironmentTypeTest_EnvironmentEmpty_ReturnUnknownEnvironment() + { + EnvironmentType type = + ParallelRunnerEnvironmentUtil.GetEnvironmentType(""); + + Assert.AreEqual(EnvironmentType.UNKNOWN, type); + } + + [TestMethod] + public void ParseEnvironmentStringsTest_ValidEnvironments_ReturnValidRunConfiguration() + { + IList environments = new List{ + MobileEnvironment, + WebEnvironment + }; + + TestInfo mockTesInfo = new TestInfo("c:\tests\test1", + "c:\tests\test1", "1", "Test1"); + + mockTesInfo.ReportPath = mockTesInfo.TestPath; + + ParallelTestRunConfiguration configuration = null; + + try + { + configuration = ParallelRunnerEnvironmentUtil. + ParseEnvironmentStrings(environments, mockTesInfo); + } + catch (ParallelRunnerConfigurationException) + { + // since the environments are valid there should be no exception + Assert.Fail(); + } + + // report paths should be equal + Assert.AreEqual(mockTesInfo.ReportPath, configuration.reportPath); + + // we have two parallel runs + // one for web and one for mobile + Assert.AreEqual(2, configuration.parallelRuns.Length); + } + + [TestMethod] + [ExpectedException(typeof(ParallelRunnerConfigurationException), + "Invalid environments were allowed!")] + public void ParseEnvironmentStringsTest_InvalidEnvironments_ThrowException() + { + // the list of supported browsers + IList environments = new List{ + "browser: unknown", + }; + + TestInfo mockTesInfo = new TestInfo("c:\tests\test1", + "c:\tests\test1", "1", "Test1"); + + mockTesInfo.ReportPath = mockTesInfo.TestPath; + + ParallelTestRunConfiguration configuration = ParallelRunnerEnvironmentUtil. + ParseEnvironmentStrings(environments, mockTesInfo); + } + + [TestMethod] + public void ParseEnvironmentStringsTest_UnknownEnvironments_ReturnEmptyConfiguration() + { + // the list of supported browsers + IList environments = new List{ + "test: ", + }; + + TestInfo mockTesInfo = new TestInfo("c:\tests\test1", + "c:\tests\test1", "1", "Test1"); + + mockTesInfo.ReportPath = mockTesInfo.TestPath; + ParallelTestRunConfiguration configuration = null; + + try + { + configuration = ParallelRunnerEnvironmentUtil. + ParseEnvironmentStrings(environments, mockTesInfo); + }catch(ParallelRunnerConfigurationException) + { + Assert.Fail(); + } + + Assert.AreEqual(0, configuration.parallelRuns.Length); + } + + [TestMethod] + public void GetMCProxySettingsTest_ValidMCSettings_ReturnsExpectedProxySettings() + { + McConnectionInfo mcConnectionInfo = new McConnectionInfo(); + mcConnectionInfo.MobileProxySetting_Address = "192.168.1.1"; + mcConnectionInfo.MobileProxySetting_Port = 8080; + mcConnectionInfo.MobileProxySetting_Authentication = 1; + mcConnectionInfo.MobileProxySetting_UserName = "test"; + mcConnectionInfo.MobileProxySetting_Password = "test"; + + ProxySettings settings = ParallelRunnerEnvironmentUtil.GetMCProxySettings(mcConnectionInfo); + + Assert.IsNotNull(settings); + Assert.IsNotNull(settings.authentication); + + Assert.AreEqual(mcConnectionInfo.MobileProxySetting_UserName, settings.authentication.username); + Assert.AreEqual(mcConnectionInfo.MobileProxySetting_Address, settings.hostname); + Assert.AreEqual(mcConnectionInfo.MobileProxySetting_Port, settings.port); + } + + [TestMethod] + public void GetMCProxySettingsTest_InvalidMCSettings_ReturnsNullProxySettings() + { + McConnectionInfo mcConnectionInfo = new McConnectionInfo(); + + ProxySettings settings = ParallelRunnerEnvironmentUtil.GetMCProxySettings(mcConnectionInfo); + + Assert.IsNull(settings); + } + + [TestMethod] + public void ParseMCSettingsTest_ValidMCSettingsSSL_ReturnsExpectedSettings() + { + McConnectionInfo mcConnectionInfo = new McConnectionInfo(); + mcConnectionInfo.MobileHostAddress = "192.168.1.1"; + mcConnectionInfo.MobileHostPort = "8080"; + mcConnectionInfo.MobileUserName = "test"; + mcConnectionInfo.MobilePassword = "test"; + mcConnectionInfo.MobileUseSSL = 1; + + UFTSettings settings = ParallelRunnerEnvironmentUtil.ParseMCSettings(mcConnectionInfo); + + Assert.IsNotNull(settings); + Assert.IsNotNull(settings.mc); + + Assert.AreEqual(mcConnectionInfo.MobileHostAddress, settings.mc.hostname); + Assert.AreEqual(mcConnectionInfo.MobileHostPort, settings.mc.port.ToString()); + Assert.AreEqual(mcConnectionInfo.MobileUserName, settings.mc.username); + Assert.AreEqual("https", settings.mc.protocol); + } + + [TestMethod] + public void ParseMCSettingsTest_ValidMCSettingsNonSSL_ReturnsExpectedSettings() + { + McConnectionInfo mcConnectionInfo = new McConnectionInfo(); + mcConnectionInfo.MobileHostAddress = "192.168.1.1"; + mcConnectionInfo.MobileHostPort = "8080"; + mcConnectionInfo.MobileUserName = "test"; + mcConnectionInfo.MobilePassword = "test"; + + UFTSettings settings = ParallelRunnerEnvironmentUtil.ParseMCSettings(mcConnectionInfo); + + Assert.IsNotNull(settings); + Assert.IsNotNull(settings.mc); + + Assert.AreEqual(mcConnectionInfo.MobileHostAddress, settings.mc.hostname); + Assert.AreEqual(mcConnectionInfo.MobileHostPort, settings.mc.port.ToString()); + Assert.AreEqual(mcConnectionInfo.MobileUserName, settings.mc.username); + Assert.AreEqual("http", settings.mc.protocol); + } + + [TestMethod] + public void ParseMCSettingsTest_InvalidMCSettings_ReturnsNullSettings() + { + McConnectionInfo mcConnectionInfo = new McConnectionInfo(); + + UFTSettings settings = ParallelRunnerEnvironmentUtil.ParseMCSettings(mcConnectionInfo); + + Assert.IsNull(settings); + } + + [TestMethod] + public void IsKnownMobilePropertyTest_KnownProperty_ReturnsTrue() + { + bool isKnown = ParallelRunnerEnvironmentUtil.IsKnownMobileProperty("deviceId") + && ParallelRunnerEnvironmentUtil.IsKnownMobileProperty("osVersion") + && ParallelRunnerEnvironmentUtil.IsKnownMobileProperty("osType") + && ParallelRunnerEnvironmentUtil.IsKnownMobileProperty("manufacturerAndModel"); + + Assert.IsTrue(isKnown); + } + + [TestMethod] + public void IsKnownMobilePropertyTest_UnknownProperty_ReturnsTrue() + { + bool isKnown = ParallelRunnerEnvironmentUtil.IsKnownMobileProperty("unknown"); + Assert.IsFalse(isKnown); + } + } +} diff --git a/HpToolsLauncher/IProcessAdapter.cs b/HpToolsLauncher/IProcessAdapter.cs new file mode 100644 index 0000000000..2c05467fcf --- /dev/null +++ b/HpToolsLauncher/IProcessAdapter.cs @@ -0,0 +1,137 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; + +namespace HpToolsLauncher +{ + public interface IProcessAdapter + { + int ExitCode { get; } + + bool HasExited { get; } + + void Start(); + + void WaitForExit(); + + bool WaitForExit(int milliseconds); + + void Kill(); + + void Close(); + } + + public class ProcessAdapter : IProcessAdapter + { + private Process Process { get; set; } + + public int ExitCode + { + get + { + return Process.ExitCode; + } + } + + public bool HasExited + { + get + { + return Process.HasExited; + } + } + + public ProcessAdapter(Process process) { Process = process; } + + public void Start() + { + Process.Start(); + } + + public void WaitForExit() + { + Process.WaitForExit(); + } + + public bool WaitForExit(int milliseconds) + { + return Process.WaitForExit(milliseconds); + } + + public void Kill() + { + Process.Kill(); + } + + public void Close() + { + Process.Close(); + } + } + + public class ElevatedProcessAdapter : IProcessAdapter + { + private ElevatedProcess ElevatedProcess { get; set; } + + public int ExitCode + { + get + { + return ElevatedProcess.ExitCode; + } + } + + public bool HasExited + { + get + { + return ElevatedProcess.HasExited; + } + } + + public ElevatedProcessAdapter(ElevatedProcess elevatedProcess) { this.ElevatedProcess = elevatedProcess; } + + public void Start() + { + ElevatedProcess.StartElevated(); + } + + public void WaitForExit() + { + ElevatedProcess.WaitForExit(); + } + + public bool WaitForExit(int milliseconds) + { + return ElevatedProcess.WaitForExit(milliseconds); + } + + public void Kill() + { + ElevatedProcess.Kill(); + } + + public void Close() + { + ElevatedProcess.Close(); + } + } + + public static class ProcessAdapterFactory + { + /// + /// Create a process adapter based on the type of process. + /// + /// the process object + /// an adapter for the given process, null if no adapter available + public static IProcessAdapter CreateAdapter(object process) + { + if (process is Process) return new ProcessAdapter((Process)process); + if (process is ElevatedProcess) return new ElevatedProcessAdapter((ElevatedProcess)process ); + + return null; + } + } +} diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 776bcd89fe..b687e9df59 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -323,9 +323,16 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) } } + Dictionary testsKeyValue = GetKeyValuesWithPrefix("Test"); + List tests = new List(); + + foreach(var item in testsKeyValue) + { + tests.Add(new TestData(item.Value, item.Key)); + } //get the tests - IEnumerable tests = GetParamsWithPrefix("Test"); + //IEnumerable tests = GetParamsWithPrefix("Test"); IEnumerable jenkinsEnvVariablesWithCommas = GetParamsWithPrefix("JenkinsEnv"); Dictionary jenkinsEnvVariables = new Dictionary(); @@ -386,7 +393,7 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) WriteToConsole(Resources.LauncherNoTestsFound); } - List validTests = Helper.ValidateFiles(tests); + List validTests = Helper.ValidateFiles(tests); if (tests != null && tests.Count() > 0 && validTests.Count == 0) { @@ -481,7 +488,8 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) { // data is something like "16.105.9.23:8080" string[] strArray4ProxyAddr = proxyAddress.Split(new Char[] { ':' }); - if (strArray.Length == 2) + + if (strArray4ProxyAddr.Length == 2) { mcConnectionInfo.MobileProxySetting_Address = strArray4ProxyAddr[0]; mcConnectionInfo.MobileProxySetting_Port = int.Parse(strArray4ProxyAddr[1]); @@ -529,15 +537,30 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) mobileinfo = _ciParams["mobileinfo"]; } + Dictionary> parallelRunnerEnvironments = new Dictionary>(); + + // retrieve the parallel runner environment for each test + if(_ciParams.ContainsKey("parallelRunnerMode")) + { + foreach(var test in validTests) + { + string envKey = "Parallel" + test.Id + "Env"; + List testEnvironments = GetParamsWithPrefix(envKey); + + // add the environments for all the valid tests + parallelRunnerEnvironments.Add(test.Id, testEnvironments); + } + } + if (_ciParams.ContainsKey("fsUftRunMode")) { string uftRunMode = "Fast"; uftRunMode = _ciParams["fsUftRunMode"]; - runner = new FileSystemTestsRunner(validTests, timeout, uftRunMode, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, displayController); + runner = new FileSystemTestsRunner(validTests, timeout, uftRunMode, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, parallelRunnerEnvironments, displayController); } else { - runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, displayController); + runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, parallelRunnerEnvironments,displayController); } break; @@ -565,6 +588,26 @@ private List GetParamsWithPrefix(string prefix) return parameters; } + private Dictionary GetKeyValuesWithPrefix(string prefix) + { + int idx = 1; + + Dictionary dict = new Dictionary(); + + while(_ciParams.ContainsKey(prefix + idx)) + { + string set = _ciParams[prefix + idx]; + if (set.StartsWith("Root\\")) + set = set.Substring(5); + set = set.TrimEnd("\\".ToCharArray()); + string key = prefix + idx; + dict[key] = set.TrimEnd(); + ++idx; + } + + return dict; + } + /// /// used by the run fuction to run the tests /// diff --git a/HpToolsLauncher/MtbxManager.cs b/HpToolsLauncher/MtbxManager.cs index e9b1eb86f0..d96d30e9f8 100644 --- a/HpToolsLauncher/MtbxManager.cs +++ b/HpToolsLauncher/MtbxManager.cs @@ -149,7 +149,7 @@ public static List LoadMtbx(string xmlContent, Dictionary LoadMtbx(string xmlContent, Dictionary paramNames = new HashSet(); foreach (var param in GetElements(test, "Parameter")) diff --git a/HpToolsLauncher/NativeProcess.cs b/HpToolsLauncher/NativeProcess.cs new file mode 100644 index 0000000000..cbb3d5cda6 --- /dev/null +++ b/HpToolsLauncher/NativeProcess.cs @@ -0,0 +1,541 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace HpToolsLauncher +{ + public static class NativeProcess + { + //Use these for DesiredAccess + public const UInt32 STANDARD_RIGHTS_REQUIRED = 0x000F0000; + public const UInt32 STANDARD_RIGHTS_READ = 0x00020000; + public const UInt32 TOKEN_ASSIGN_PRIMARY = 0x0001; + public const UInt32 TOKEN_DUPLICATE = 0x0002; + public const UInt32 TOKEN_IMPERSONATE = 0x0004; + public const UInt32 TOKEN_QUERY = 0x0008; + public const UInt32 TOKEN_QUERY_SOURCE = 0x0010; + public const UInt32 TOKEN_ADJUST_PRIVILEGES = 0x0020; + public const UInt32 TOKEN_ADJUST_GROUPS = 0x0040; + public const UInt32 TOKEN_ADJUST_DEFAULT = 0x0080; + public const UInt32 TOKEN_ADJUST_SESSIONID = 0x0100; + public const UInt32 TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY); + public const UInt32 TOKEN_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | + TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | + TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | + TOKEN_ADJUST_SESSIONID); + + public const uint MAXIMUM_ALLOWED = 0x02000000; + + public const Int32 INFINITE = -1; + public const Int32 WAIT_ABANDONED = 0x80; + public const Int32 WAIT_OBJECT_0 = 0x00; + public const Int32 WAIT_TIMEOUT = 0x102; + public const Int32 WAIT_FAILED = -1; + + public enum ShowWindowCommands : uint + { + /// + /// Hides the window and activates another window. + /// + SW_HIDE = 0, + + /// + /// Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time. + /// + SW_SHOWNORMAL = 1, + + /// + /// Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time. + /// + SW_NORMAL = 1, + + /// + /// Activates the window and displays it as a minimized window. + /// + SW_SHOWMINIMIZED = 2, + + /// + /// Activates the window and displays it as a maximized window. + /// + SW_SHOWMAXIMIZED = 3, + + /// + /// Maximizes the specified window. + /// + SW_MAXIMIZE = 3, + + /// + /// Displays a window in its most recent size and position. This value is similar to , except the window is not activated. + /// + SW_SHOWNOACTIVATE = 4, + + /// + /// Activates the window and displays it in its current size and position. + /// + SW_SHOW = 5, + + /// + /// Minimizes the specified window and activates the next top-level window in the z-order. + /// + SW_MINIMIZE = 6, + + /// + /// Displays the window as a minimized window. This value is similar to , except the window is not activated. + /// + SW_SHOWMINNOACTIVE = 7, + + /// + /// Displays the window in its current size and position. This value is similar to , except the window is not activated. + /// + SW_SHOWNA = 8, + + /// + /// Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window. + /// + SW_RESTORE = 9 + } + + public enum ProcessAccessFlags : uint + { + All = 0x001F0FFF, + Terminate = 0x00000001, + CreateThread = 0x00000002, + VirtualMemoryOperation = 0x00000008, + VirtualMemoryRead = 0x00000010, + VirtualMemoryWrite = 0x00000020, + DuplicateHandle = 0x00000040, + CreateProcess = 0x000000080, + SetQuota = 0x00000100, + SetInformation = 0x00000200, + QueryInformation = 0x00000400, + QueryLimitedInformation = 0x00001000, + Synchronize = 0x00100000 + }; + + public enum CreateProcessFlags + { + CREATE_BREAKAWAY_FROM_JOB = 0x01000000, + CREATE_DEFAULT_ERROR_MODE = 0x04000000, + CREATE_NEW_CONSOLE = 0x00000010, + CREATE_NEW_PROCESS_GROUP = 0x00000200, + CREATE_NO_WINDOW = 0x08000000, + CREATE_PROTECTED_PROCESS = 0x00040000, + CREATE_PRESERVE_CODE_AUTHZ_LEVEL = 0x02000000, + CREATE_SEPARATE_WOW_VDM = 0x00000800, + CREATE_SHARED_WOW_VDM = 0x00001000, + CREATE_SUSPENDED = 0x00000004, + CREATE_UNICODE_ENVIRONMENT = 0x00000400, + DEBUG_ONLY_THIS_PROCESS = 0x00000002, + DEBUG_PROCESS = 0x00000001, + DETACHED_PROCESS = 0x00000008, + EXTENDED_STARTUPINFO_PRESENT = 0x00080000, + INHERIT_PARENT_AFFINITY = 0x00010000 + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct STARTUPINFO + { + public Int32 cb; + public string lpReserved; + public string lpDesktop; + public string lpTitle; + public Int32 dwX; + public Int32 dwY; + public Int32 dwXSize; + public Int32 dwYSize; + public Int32 dwXCountChars; + public Int32 dwYCountChars; + public Int32 dwFillAttribute; + public Int32 dwFlags; + public Int16 wShowWindow; + public Int16 cbReserved2; + public IntPtr lpReserved2; + public IntPtr hStdInput; + public IntPtr hStdOutput; + public IntPtr hStdError; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct STARTUPINFOEX + { + public STARTUPINFO StartupInfo; + public IntPtr lpAttributeList; + } + + [StructLayout(LayoutKind.Sequential)] + public struct PROCESS_INFORMATION + { + public IntPtr hProcess; + public IntPtr hThread; + public int dwProcessId; + public int dwThreadId; + } + + [StructLayout(LayoutKind.Sequential)] + public struct SECURITY_ATTRIBUTES + { + public int nLength; + public IntPtr lpSecurityDescriptor; + public int bInheritHandle; + } + + public enum SECURITY_IMPERSONATION_LEVEL + { + SecurityAnonymous, + SecurityIdentification, + SecurityImpersonation, + SecurityDelegation + } + + public enum TOKEN_TYPE + { + TokenPrimary = 1, + TokenImpersonation + } + + public enum TOKEN_INFORMATION_CLASS + { + /// + /// The buffer receives a TOKEN_USER structure that contains the user account of the token. + /// + TokenUser = 1, + + /// + /// The buffer receives a TOKEN_GROUPS structure that contains the group accounts associated with the token. + /// + TokenGroups, + + /// + /// The buffer receives a TOKEN_PRIVILEGES structure that contains the privileges of the token. + /// + TokenPrivileges, + + /// + /// The buffer receives a TOKEN_OWNER structure that contains the default owner security identifier (SID) for newly created objects. + /// + TokenOwner, + + /// + /// The buffer receives a TOKEN_PRIMARY_GROUP structure that contains the default primary group SID for newly created objects. + /// + TokenPrimaryGroup, + + /// + /// The buffer receives a TOKEN_DEFAULT_DACL structure that contains the default DACL for newly created objects. + /// + TokenDefaultDacl, + + /// + /// The buffer receives a TOKEN_SOURCE structure that contains the source of the token. TOKEN_QUERY_SOURCE access is needed to retrieve this information. + /// + TokenSource, + + /// + /// The buffer receives a TOKEN_TYPE value that indicates whether the token is a primary or impersonation token. + /// + TokenType, + + /// + /// The buffer receives a SECURITY_IMPERSONATION_LEVEL value that indicates the impersonation level of the token. If the access token is not an impersonation token, the function fails. + /// + TokenImpersonationLevel, + + /// + /// The buffer receives a TOKEN_STATISTICS structure that contains various token statistics. + /// + TokenStatistics, + + /// + /// The buffer receives a TOKEN_GROUPS structure that contains the list of restricting SIDs in a restricted token. + /// + TokenRestrictedSids, + + /// + /// The buffer receives a DWORD value that indicates the Terminal Services session identifier that is associated with the token. + /// + TokenSessionId, + + /// + /// The buffer receives a TOKEN_GROUPS_AND_PRIVILEGES structure that contains the user SID, the group accounts, the restricted SIDs, and the authentication ID associated with the token. + /// + TokenGroupsAndPrivileges, + + /// + /// Reserved. + /// + TokenSessionReference, + + /// + /// The buffer receives a DWORD value that is nonzero if the token includes the SANDBOX_INERT flag. + /// + TokenSandBoxInert, + + /// + /// Reserved. + /// + TokenAuditPolicy, + + /// + /// The buffer receives a TOKEN_ORIGIN value. + /// + TokenOrigin, + + /// + /// The buffer receives a TOKEN_ELEVATION_TYPE value that specifies the elevation level of the token. + /// + TokenElevationType, + + /// + /// The buffer receives a TOKEN_LINKED_TOKEN structure that contains a handle to another token that is linked to this token. + /// + TokenLinkedToken, + + /// + /// The buffer receives a TOKEN_ELEVATION structure that specifies whether the token is elevated. + /// + TokenElevation, + + /// + /// The buffer receives a DWORD value that is nonzero if the token has ever been filtered. + /// + TokenHasRestrictions, + + /// + /// The buffer receives a TOKEN_ACCESS_INFORMATION structure that specifies security information contained in the token. + /// + TokenAccessInformation, + + /// + /// The buffer receives a DWORD value that is nonzero if virtualization is allowed for the token. + /// + TokenVirtualizationAllowed, + + /// + /// The buffer receives a DWORD value that is nonzero if virtualization is enabled for the token. + /// + TokenVirtualizationEnabled, + + /// + /// The buffer receives a TOKEN_MANDATORY_LABEL structure that specifies the token's integrity level. + /// + TokenIntegrityLevel, + + /// + /// The buffer receives a DWORD value that is nonzero if the token has the UIAccess flag set. + /// + TokenUIAccess, + + /// + /// The buffer receives a TOKEN_MANDATORY_POLICY structure that specifies the token's mandatory integrity policy. + /// + TokenMandatoryPolicy, + + /// + /// The buffer receives the token's logon security identifier (SID). + /// + TokenLogonSid, + + /// + /// The maximum value for this enumeration + /// + MaxTokenInfoClass + } + + public enum PROCESSINFOCLASS : int + { + ProcessBasicInformation = 0, // 0, q: PROCESS_BASIC_INFORMATION, PROCESS_EXTENDED_BASIC_INFORMATION + ProcessQuotaLimits, // qs: QUOTA_LIMITS, QUOTA_LIMITS_EX + ProcessIoCounters, // q: IO_COUNTERS + ProcessVmCounters, // q: VM_COUNTERS, VM_COUNTERS_EX + ProcessTimes, // q: KERNEL_USER_TIMES + ProcessBasePriority, // s: KPRIORITY + ProcessRaisePriority, // s: ULONG + ProcessDebugPort, // q: HANDLE + ProcessExceptionPort, // s: HANDLE + ProcessAccessToken, // s: PROCESS_ACCESS_TOKEN + ProcessLdtInformation, // 10 + ProcessLdtSize, + ProcessDefaultHardErrorMode, // qs: ULONG + ProcessIoPortHandlers, // (kernel-mode only) + ProcessPooledUsageAndLimits, // q: POOLED_USAGE_AND_LIMITS + ProcessWorkingSetWatch, // q: PROCESS_WS_WATCH_INFORMATION[]; s: void + ProcessUserModeIOPL, + ProcessEnableAlignmentFaultFixup, // s: BOOLEAN + ProcessPriorityClass, // qs: PROCESS_PRIORITY_CLASS + ProcessWx86Information, + ProcessHandleCount, // 20, q: ULONG, PROCESS_HANDLE_INFORMATION + ProcessAffinityMask, // s: KAFFINITY + ProcessPriorityBoost, // qs: ULONG + ProcessDeviceMap, // qs: PROCESS_DEVICEMAP_INFORMATION, PROCESS_DEVICEMAP_INFORMATION_EX + ProcessSessionInformation, // q: PROCESS_SESSION_INFORMATION + ProcessForegroundInformation, // s: PROCESS_FOREGROUND_BACKGROUND + ProcessWow64Information, // q: ULONG_PTR + ProcessImageFileName, // q: UNICODE_STRING + ProcessLUIDDeviceMapsEnabled, // q: ULONG + ProcessBreakOnTermination, // qs: ULONG + ProcessDebugObjectHandle, // 30, q: HANDLE + ProcessDebugFlags, // qs: ULONG + ProcessHandleTracing, // q: PROCESS_HANDLE_TRACING_QUERY; s: size 0 disables, otherwise enables + ProcessIoPriority, // qs: ULONG + ProcessExecuteFlags, // qs: ULONG + ProcessResourceManagement, + ProcessCookie, // q: ULONG + ProcessImageInformation, // q: SECTION_IMAGE_INFORMATION + ProcessCycleTime, // q: PROCESS_CYCLE_TIME_INFORMATION + ProcessPagePriority, // q: ULONG + ProcessInstrumentationCallback, // 40 + ProcessThreadStackAllocation, // s: PROCESS_STACK_ALLOCATION_INFORMATION, PROCESS_STACK_ALLOCATION_INFORMATION_EX + ProcessWorkingSetWatchEx, // q: PROCESS_WS_WATCH_INFORMATION_EX[] + ProcessImageFileNameWin32, // q: UNICODE_STRING + ProcessImageFileMapping, // q: HANDLE (input) + ProcessAffinityUpdateMode, // qs: PROCESS_AFFINITY_UPDATE_MODE + ProcessMemoryAllocationMode, // qs: PROCESS_MEMORY_ALLOCATION_MODE + ProcessGroupInformation, // q: USHORT[] + ProcessTokenVirtualizationEnabled, // s: ULONG + ProcessConsoleHostProcess, // q: ULONG_PTR + ProcessWindowInformation, // 50, q: PROCESS_WINDOW_INFORMATION + ProcessHandleInformation, // q: PROCESS_HANDLE_SNAPSHOT_INFORMATION // since WIN8 + ProcessMitigationPolicy, // s: PROCESS_MITIGATION_POLICY_INFORMATION + ProcessDynamicFunctionTableInformation, + ProcessHandleCheckingMode, + ProcessKeepAliveCount, // q: PROCESS_KEEPALIVE_COUNT_INFORMATION + ProcessRevokeFileHandles, // s: PROCESS_REVOKE_FILE_HANDLES_INFORMATION + MaxProcessInfoClass + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct PROCESS_BASIC_INFORMATION + { + public IntPtr ExitStatus; + public IntPtr PebBaseAddress; + public IntPtr AffinityMask; + public IntPtr BasePriority; + public UIntPtr UniqueProcessId; + public IntPtr InheritedFromUniqueProcessId; + + public int Size + { + get { return (int)Marshal.SizeOf(typeof(PROCESS_BASIC_INFORMATION)); } + } + } + + + [StructLayout(LayoutKind.Sequential)] + public struct LUID + { + public uint LowPart; + public int HighPart; + } + + [StructLayout(LayoutKind.Sequential)] + public struct LUID_AND_ATTRIBUTES + { + public LUID pLuid; + public UInt32 Attributes; + } + + public class TOKEN_PRIVILEGES + { + public UInt32 PrivilegeCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] + public LUID_AND_ATTRIBUTES[] Privileges = new LUID_AND_ATTRIBUTES[2]; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct TokPriv1Luid + { + public int Count; + public LUID Luid; + public UInt32 Attr; + } + + [StructLayout(LayoutKind.Sequential)] + public struct SID_AND_ATTRIBUTES + { + public IntPtr Sid; + public uint Attributes; + } + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds); + + + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern IntPtr OpenProcess(ProcessAccessFlags processAccess, bool bInheritHandle, int processId); + + public static IntPtr OpenProcess(Process proc, ProcessAccessFlags flags) + { + return OpenProcess(flags, false, proc.Id); + } + + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + public static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, + ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, + string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation); + + [DllImport("advapi32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle); + + [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)] + public extern static bool DuplicateTokenEx(IntPtr hExistingToken, uint dwDesiredAccess, IntPtr lpTokenAttributes, + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, TOKEN_TYPE TokenType, out IntPtr phNewToken); + + [DllImport("advapi32.dll", SetLastError = true)] + public static extern Boolean SetTokenInformation(IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, + ref UInt32 TokenInformation, UInt32 TokenInformationLength); + + [DllImport("Kernel32.dll", SetLastError = true)] + public static extern int CloseHandle(IntPtr hObject); + + [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)] + public static extern bool CreateProcessAsUser(IntPtr hToken, string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, + IntPtr lpThreadAttributes, bool bInheritHandles, CreateProcessFlags dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, + ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation); + + [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, out LUID lpLuid); + + [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] + public static extern bool AdjustTokenPrivileges(IntPtr htok, bool disableAllPrivileges, ref TokPriv1Luid newState, + int len, IntPtr prev, IntPtr relen); + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern uint ResumeThread(IntPtr hThread); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetExitCodeProcess(IntPtr hProcess, out uint lpExitCode); + [DllImport("kernel32.dll")] + public static extern bool ProcessIdToSessionId(uint dwProcessId, out uint pSessionId); + [DllImport("advapi32.dll", SetLastError = true)] + public static extern bool ConvertStringSidToSid(string StringSid, out IntPtr ptrSid); + + [DllImport("userenv.dll", SetLastError = true)] + public static extern bool CreateEnvironmentBlock(out IntPtr lpEnvironment, IntPtr hToken, bool bInherit); + + [DllImport("userenv.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DestroyEnvironmentBlock(IntPtr lpEnvironment); + + [DllImport("advapi32.dll", SetLastError = true)] + public static extern bool ImpersonateLoggedOnUser(IntPtr hToken); + + [DllImport("advapi32.dll", SetLastError = true)] + public static extern bool RevertToSelf(); + + [DllImport("Kernel32.dll", EntryPoint = "WTSGetActiveConsoleSessionId")] public static extern int WTSGetActiveConsoleSessionId(); + + [DllImport("NTDLL.DLL", SetLastError = true)] + public static extern int NtQueryInformationProcess(IntPtr hProcess, PROCESSINFOCLASS pic,ref PROCESS_BASIC_INFORMATION pbi, int cb, out int pSize); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool TerminateProcess(IntPtr hProcess, uint uExitCode); + } +} diff --git a/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs new file mode 100644 index 0000000000..550a8aafb1 --- /dev/null +++ b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs @@ -0,0 +1,436 @@ +using HpToolsLauncher.ParallelTestRunConfiguraion; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Web.Script.Serialization; + +namespace HpToolsLauncher.ParallelRunner +{ + [Serializable] + public class ParallelRunnerConfigurationException : Exception + { + public ParallelRunnerConfigurationException(string message) : base(message) + { + } + }; + + public enum EnvironmentType + { + WEB, + MOBILE, + UNKNOWN + } + + public class ParallelRunnerEnvironmentUtil + { + // the list of supported browsers + private static readonly IList BrowserNames = new List + { + "IE", + "IE64", + "CHROME", + "FIREFOX", + "FIREFOX64", + }.AsReadOnly(); + + // environment specific constants + private const char EnvironmentTokenSeparator = ','; + private const char EnvironmentKeyValueSeparator = ':'; + + // environment keys + private const string DeviceIdKey = "deviceId"; + private const string ManufacturerAndModelKey = "manufacturerAndModel"; + private const string OsVersionKey = "osVersion"; + private const string OsTypeKey = "osType"; + private const string BrowserKey = "browser"; + + // parallel runner config specific constants + private const string WebLab = "LocalBrowser"; + private const string MobileCenterLab = "MobileCenter"; + + // the list of mobile properties + private static readonly IList MobileProperties = new List + { + DeviceIdKey, + ManufacturerAndModelKey, + OsVersionKey, + OsTypeKey, + }.AsReadOnly(); + + /// + /// Parse the environment string and return a dictionary containing the values. + /// + /// The jenkins environment string. + /// the dictionary containing the key/value pairs + public static Dictionary GetEnvironmentProperties(string environment) + { + var dictionary = new Dictionary(); + + if (string.IsNullOrEmpty(environment)) + return dictionary; + + // the environment could be : "deviceId : 12412" + // or "manufacturerAndModel: Samsung S6, osVersion: > 6" + // or for web: "browser: Chrome" + + // the environment string is case-insensitive + environment = environment.Trim().ToLower(); + + // we get the key value pairs by splitting them + string[] tokens = environment.Split(EnvironmentTokenSeparator); + + foreach (var token in tokens) + { + string[] keyValuePair = token.Split(EnvironmentKeyValueSeparator); + + // invalid setting, there should be at least two values + if (keyValuePair.Length <= 1) continue; + + string key = keyValuePair[0].Trim(); + + if (string.IsNullOrEmpty(key)) continue; + + // we will also consider the case when we have something like + // "manufacturerAndModel : some:string:separated" + // so the first one will be the key and the rest will be the value + string value = string.Join("", keyValuePair.Skip(1).ToArray()) + .Trim(); + + // must have a value + if (string.IsNullOrEmpty(value)) continue; + + dictionary[key] = value; + } + + return dictionary; + } + /// + /// Parse the mobile environment provided in jenkins. + /// + /// the environment string + /// the MobileEnvironment for ParallelRunner + public static MobileEnvironment ParseMobileEnvironment(string environment) + { + var dictionary = GetEnvironmentProperties(environment); + + // invalid environment string + if (dictionary.Count == 0) return null; + + var device = new Device(); + + var mobileEnvironment = new MobileEnvironment + { + device = device, + lab = MobileCenterLab + }; + + if (dictionary.ContainsKey(DeviceIdKey.ToLower())) + { + if (!string.IsNullOrEmpty(dictionary[DeviceIdKey.ToLower()])) + { + device.deviceID = dictionary[DeviceIdKey.ToLower()]; + } + } + + if (dictionary.ContainsKey(ManufacturerAndModelKey.ToLower())) + { + if (!string.IsNullOrEmpty(dictionary[ManufacturerAndModelKey.ToLower()])) + { + device.manufacturer = dictionary[ManufacturerAndModelKey.ToLower()]; + } + } + + if (dictionary.ContainsKey(OsVersionKey.ToLower())) + { + if (!string.IsNullOrEmpty(dictionary[OsVersionKey.ToLower()])) + { + device.osVersion = dictionary[OsVersionKey.ToLower()]; + } + } + + if (dictionary.ContainsKey(OsTypeKey.ToLower())) + { + if (!string.IsNullOrEmpty(dictionary[OsTypeKey.ToLower()])) + { + device.osType = dictionary[OsTypeKey.ToLower()]; + } + } + + // the environment string should contain at least a valid property + // in order for PrallelRunner to be able to query MC for the specific device + if(device.deviceID == null && (device.osType == null && device.osVersion == null && device.manufacturer == null)) + { + return null; + } + + return mobileEnvironment; + } + + /// + /// Parse the web environment provided. + /// + /// the environment string + /// the WebEnvironmnet for ParallelRunner + public static WebEnvironment ParseWebEnvironment(string environment) + { + // example of environment string for web + // "browser: Chrome" + + var dictionary = GetEnvironmentProperties(environment); + + if (!dictionary.ContainsKey(BrowserKey.ToLower())) return null; + + WebEnvironment webEnvironment = new WebEnvironment { lab = WebLab }; + + var browser = dictionary[BrowserKey.ToLower()]; + + // try to find a browser that matches the one provided + foreach(var browserName in BrowserNames) + { + if(string.Equals(browserName,browser,StringComparison.CurrentCultureIgnoreCase)) + { + webEnvironment.browser = dictionary[BrowserKey.ToLower()]; + return webEnvironment; + } + } + + return null; + } + + /// + /// Check if a given propery is part of the mobile properties. + /// + /// the property to check + /// true if the given property is a mobile prop, false otherwise + public static bool IsKnownMobileProperty(string property) + { + foreach (var knownProp in MobileProperties) + { + if (knownProp.ToLower() == property.ToLower()) + { + return true; + } + } + + return false; + } + + /// + /// Return the environment type based on the environment string provided. + /// + /// the environment string + /// the environment type + public static EnvironmentType GetEnvironmentType(string environment) + { + if (string.IsNullOrEmpty(environment)) return EnvironmentType.UNKNOWN; + + environment = environment.Trim().ToLower(); + + Dictionary props = GetEnvironmentProperties(environment); + + // no valid property found + if(props.Count == 0) + { + return EnvironmentType.UNKNOWN; + } + + // web environment only contains the browser key + if (props.ContainsKey(BrowserKey.ToLower()) && props.Count == 1) + { + return EnvironmentType.WEB; + } + + // check if it's a mobile environment + foreach(var prop in props) + { + if(!IsKnownMobileProperty(prop.Key)) + { + return EnvironmentType.UNKNOWN; + } + } + + return EnvironmentType.MOBILE; + } + + /// + /// Parse all of the provided environment strings for this test. + /// + /// the environments list + /// the test information + /// the parallel test run configuration + public static ParallelTestRunConfiguration ParseEnvironmentStrings(IEnumerable environments, TestInfo testInfo) + { + var parallelTestRunConfiguration = new ParallelTestRunConfiguration + { + reportPath = testInfo.ReportPath + }; + + var items = new List(); + + foreach (var env in environments) + { + var environment = new ParallelTestRunConfiguraion.Environment(); + + // try to determine the environment type + var type = GetEnvironmentType(env); + + if (type == EnvironmentType.MOBILE) + { + environment.mobile = ParseMobileEnvironment(env); + + if(environment.mobile == null) + { + throw new ParallelRunnerConfigurationException("Invalid mobile configuration provided: " + env); + } + } + else if(type == EnvironmentType.WEB) + { + environment.web = ParseWebEnvironment(env); + + if(environment.web == null) + { + throw new ParallelRunnerConfigurationException("Invalid web configuration provided: " + env); + } + } + else + { + // environment might be an empty string, just ignore it + continue; + } + + var item = new ParallelTestRunConfigurationItem + { + test = testInfo.TestPath, + env = environment, + reportPath = testInfo.TestPath + }; + + items.Add(item); + } + + parallelTestRunConfiguration.parallelRuns = items.ToArray(); + + return parallelTestRunConfiguration; + } + + /// + /// Return the proxy settings. + /// + /// the mc connection info + /// + public static ProxySettings GetMCProxySettings(McConnectionInfo mcConnectionInfo) + { + if (String.IsNullOrEmpty(mcConnectionInfo.MobileProxySetting_Address)) + return null; + + AuthenticationSettings authenticationSettings = null; + + if (!string.IsNullOrEmpty(mcConnectionInfo.MobileProxySetting_UserName) + && !string.IsNullOrEmpty(mcConnectionInfo.MobileProxySetting_Password)) + { + authenticationSettings = new AuthenticationSettings + { + username = mcConnectionInfo.MobileProxySetting_UserName, + password = WinUserNativeMethods. + ProtectBSTRToBase64(mcConnectionInfo.MobileProxySetting_Password) + }; + } + + ProxySettings proxySettings = new ProxySettings + { + authentication = authenticationSettings, + hostname = mcConnectionInfo.MobileProxySetting_Address, + port = mcConnectionInfo.MobileProxySetting_Port, + type = mcConnectionInfo.MobileProxyType == 1 ? "system" : "http", + }; + + return proxySettings; + } + + /// + /// Parses the MC settings and returns the corresponding UFT settings. + /// + /// the mc settings + /// the parallel runner uft settings + public static UFTSettings ParseMCSettings(McConnectionInfo mcConnectionInfo) + { + if (string.IsNullOrEmpty(mcConnectionInfo.MobileHostAddress) || + string.IsNullOrEmpty(mcConnectionInfo.MobileUserName) || + string.IsNullOrEmpty(mcConnectionInfo.MobilePassword) || + string.IsNullOrEmpty(mcConnectionInfo.MobileHostPort)) + return null; + + MCSettings mcSettings = new MCSettings + { + username = mcConnectionInfo.MobileUserName, + password = WinUserNativeMethods.ProtectBSTRToBase64(mcConnectionInfo.MobilePassword), + hostname = mcConnectionInfo.MobileHostAddress, + port = Convert.ToInt32(mcConnectionInfo.MobileHostPort), + protocol = mcConnectionInfo.MobileUseSSL > 0 ? "https" : "http", + tenantId = mcConnectionInfo.MobileTenantId, + }; + + var proxy = GetMCProxySettings(mcConnectionInfo); + + // set the proxy information if we have it + if(proxy != null) + { + mcSettings.proxy = proxy; + } + + UFTSettings uftSettings = new UFTSettings + { + mc = mcSettings + }; + + return uftSettings; + } + + /// + /// Creates the json config file needed by the parallel runner and returns the path. + /// + /// The test information. + /// + /// the path of the newly generated config file + /// + public static string GetConfigFilePath(TestInfo testInfo, McConnectionInfo mcConnectionInfo,Dictionary> environments) + { + // no environment defined for this test + if (!environments.ContainsKey(testInfo.TestId)) + { + throw new ParallelRunnerConfigurationException("No parallel runner environments found for this test!"); + } + + // get the parallel run configuration + var config = ParseEnvironmentStrings(environments[testInfo.TestId], testInfo); + + // there were no valid environments provided + if (config.parallelRuns.Length == 0) + { + throw new ParallelRunnerConfigurationException("No valid environments found for this test!"); + } + + var mcSettings = ParseMCSettings(mcConnectionInfo); + + // set the mobile center settings if provided + if (mcSettings != null) + { + config.settings = mcSettings; + } + + var configFilePath = Path.Combine(testInfo.TestPath, testInfo.TestId + ".json"); + + JavaScriptSerializer serializer = new JavaScriptSerializer(); + + var configJson = serializer.Serialize(config); + + File.WriteAllText(configFilePath, configJson); + + return configFilePath; + } + } +} diff --git a/HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs b/HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs new file mode 100644 index 0000000000..7a38d47747 --- /dev/null +++ b/HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + +namespace HpToolsLauncher.ParallelTestRunConfiguraion +{ + public class UFTSettings + { + public MCSettings mc { get; set; } + } + public class MCSettings + { + public string protocol { get; set; } + public string hostname { get; set; } + public int port { get; set; } + public string pathname { get; set; } + public string account { get; set; } + public string username { get; set; } + public string password { get; set; } + public string tenantId { get; set; } + public string workspaceId { get; set; } + public ProxySettings proxy { get; set; } + } + public class ProxySettings + { + public string type { get; set; } + public string hostname { get; set; } + public int port { get; set; } + public string pathname { get; set; } + public AuthenticationSettings authentication { get; set; } + } + public class AuthenticationSettings + { + public string username { get; set; } + public string password { get; set; } + } + + public class TestRunConfigurationBase + { + /// + /// The Report Path + /// + public string reportPath { get; set; } + /// + /// The Log Folder + /// + public string logFolder { get; set; } + /// + /// The Log Level + /// + public string logLevel { get; set; } + /// + /// Run Mode: Normal|Fast , default is Fast + /// + public string runMode { get; set; } + + public UFTSettings settings { get; set; } + } + + public class ParallelTestRunConfiguration : TestRunConfigurationBase + { + /// + /// The Test Runs + /// + public ParallelTestRunConfigurationItem[] parallelRuns { get; set; } + } + + /// + /// TestRun Configuration for qtdrv + /// + public class TestRunConfiguration : TestRunConfigurationBase + { + /// + /// GUI Test Path + /// e.g. test = C:\GUITest1 + /// + public string test { get; set; } + /// + /// The Web|Mobile Environment (Optional) + /// + public Environment env { get; set; } + } + + /// + /// Test run result for ParallelRunner + /// + public class RunResult : TestRunConfiguration + { + public string errorMessage { get; set; } + } + + /// + /// TestRun Configuration for ParallelRunner + /// + public class ParallelTestRunConfigurationItem : TestRunConfiguration + { + /// + /// Report Suffix (Optional) + /// e.g. reportSuffix= ID_C3ZDU,reportPath = C:\parallelexecution\Res1, test= C:\GUITest1 + /// Full ReportPath = C:\parallelexecution\Res1\GUITest1_ID_C3ZDU + /// + public string reportSuffix { get; set; } + } + + public class Environment + { + /// + /// Web Environment + /// + public WebEnvironment web { get; set; } + /// + /// Mobile Environment + /// + public MobileEnvironment mobile { get; set; } + } + + #region Web Environment + /// + /// SRF Web Desktop Environment + /// + public class WebEnvironment + { + /// + /// Lab "LocalBrowser"|"MobileCenter"|"SRF" + /// + public string lab { get; set; } + public string platform { get; set; } + public string browser { get; set; } + public string resolution { get; set; } + public string tunnelName { get; set; } + } + + #endregion + + #region Mobile Environment + public class MobileEnvironment + { + /// + /// Lab "Disable"|"MobileCenter"|"SRF" + /// + public string lab { get; set; } + public Device device { get; set; } + } + + /// + /// Device Info + /// e.g. + /// "deviceID": "EYKNTO6999999999", + /// "model": "8681-A01", + /// "osVersion": "5.1", + /// "osType": "ANDROID", + /// "manufacturer": "QiKU" + /// + public class Device + { + public string deviceID { get; set; } + public string manufacturer { get; set; } + public string model { get; set; } + public string osVersion { get; set; } + public string osType { get; set; } + } + #endregion +} diff --git a/HpToolsLauncher/ProcessExtensions.cs b/HpToolsLauncher/ProcessExtensions.cs new file mode 100644 index 0000000000..a79c58d165 --- /dev/null +++ b/HpToolsLauncher/ProcessExtensions.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace HpToolsLauncher +{ + public static class ProcessExtensions + { + /// + /// Get the parent process for a given process handle. + /// + /// the process handle + /// The parent process + private static Process GetParentProcess(IntPtr hProcess) + { + NativeProcess.PROCESS_BASIC_INFORMATION pbi = new NativeProcess.PROCESS_BASIC_INFORMATION(); + int pbiLength = Marshal.SizeOf(pbi); + int returnLength = 0; + + int status = NativeProcess.NtQueryInformationProcess(hProcess,NativeProcess.PROCESSINFOCLASS.ProcessBasicInformation, + ref pbi,pbiLength,out returnLength); + + if(status != 0) + { + throw new Win32Exception(status); + } + + try + { + return Process.GetProcessById(pbi.InheritedFromUniqueProcessId.ToInt32()); + } + catch (ArgumentException) + { // Not found + return null; + } + } + /// + /// Returns the parent process of a given process + /// + /// the process for which to find the parent + /// the parent process + public static Process Parent(this Process process) + { + return GetParentProcess(process.Handle); + } + } +} diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 1fc1bb1b22..578693e18b 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -933,6 +933,15 @@ internal static string LuancherDisplayTimout { } } + /// + /// Looks up a localized string similar to . + /// + internal static string ParallelRunnerExecutableNotFound { + get { + return ResourceManager.GetString("ParallelRunnerExecutableNotFound", resourceCulture); + } + } + /// /// Looks up a localized string similar to QTPActivity.TestCleanup - exception {0}. /// diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index efba4bccd1..a82da2dcd1 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -439,6 +439,9 @@ Save the test in QuickTest and then run it again. UFT cannot start while HPE Sprinter is running. + + + Invalid report path provided: '{0}' diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index a1268e8d86..8ebafe7480 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -33,6 +33,8 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable private TimeSpan _perScenarioTimeOutMinutes; private List _ignoreErrorStrings; + // parallel runner related information + private Dictionary> _parallelRunnerEnvironments; //saves runners for cleaning up at the end. private Dictionary _colRunnersForCleanup = new Dictionary(); @@ -53,7 +55,7 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable /// /// /// - public FileSystemTestsRunner(List sources, + public FileSystemTestsRunner(List sources, TimeSpan timeout, string uftRunMode, int ControllerPollingInterval, @@ -62,9 +64,10 @@ public FileSystemTestsRunner(List sources, Dictionary jenkinsEnvVariables, McConnectionInfo mcConnection, string mobileInfo, + Dictionary> parallelRunnerEnvironments, bool displayController, bool useUFTLicense = false) - :this(sources, timeout, ControllerPollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnection, mobileInfo, displayController, useUFTLicense) + :this(sources, timeout, ControllerPollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnection, mobileInfo, parallelRunnerEnvironments, displayController, useUFTLicense) { _uftRunMode = uftRunMode; } @@ -76,7 +79,7 @@ public FileSystemTestsRunner(List sources, /// /// /// - public FileSystemTestsRunner(List sources, + public FileSystemTestsRunner(List sources, TimeSpan timeout, int ControllerPollingInterval, TimeSpan perScenarioTimeOutMinutes, @@ -84,6 +87,7 @@ public FileSystemTestsRunner(List sources, Dictionary jenkinsEnvVariables, McConnectionInfo mcConnection, string mobileInfo, + Dictionary> parallelRunnerEnvironments, bool displayController, bool useUFTLicense = false) { @@ -110,22 +114,24 @@ public FileSystemTestsRunner(List sources, _mcConnection = mcConnection; _mobileInfoForAllGuiTests = mobileInfo; + _parallelRunnerEnvironments = parallelRunnerEnvironments; + ConsoleWriter.WriteLine("Mc connection info is - " + _mcConnection.ToString()); //go over all sources, and create a list of all tests - foreach (string source in sources) + foreach (TestData source in sources) { List testGroup = new List(); try { //--handle directories which contain test subdirectories (recursively) - if (Helper.IsDirectory(source)) + if (Helper.IsDirectory(source.Tests)) { - var testsLocations = Helper.GetTestsLocations(source); + var testsLocations = Helper.GetTestsLocations(source.Tests); foreach (var loc in testsLocations) { - var test = new TestInfo(loc, loc, source); + var test = new TestInfo(loc, loc, source.Tests,source.Id); testGroup.Add(test); } } @@ -136,23 +142,30 @@ public FileSystemTestsRunner(List sources, //other files are dropped { testGroup = new List(); - FileInfo fi = new FileInfo(source); + FileInfo fi = new FileInfo(source.Tests); if (fi.Extension == Helper.LoadRunnerFileExtention) - testGroup.Add(new TestInfo(source, source, source)); + testGroup.Add(new TestInfo(source.Tests, source.Tests, source.Tests,source.Id)); else if (fi.Extension == ".mtb") //if (source.TrimEnd().EndsWith(".mtb", StringComparison.CurrentCultureIgnoreCase)) { MtbManager manager = new MtbManager(); - var paths = manager.Parse(source); + var paths = manager.Parse(source.Tests); foreach (var p in paths) { - testGroup.Add(new TestInfo(p, p, source)); + testGroup.Add(new TestInfo(p, p, source.Tests,source.Id)); } } else if (fi.Extension == ".mtbx") //if (source.TrimEnd().EndsWith(".mtb", StringComparison.CurrentCultureIgnoreCase)) { - testGroup = MtbxManager.Parse(source, _jenkinsEnvVariables, source); + testGroup = MtbxManager.Parse(source.Tests, _jenkinsEnvVariables, source.Tests); + + // set the test Id for each test from the group + // this is important for parallel runner + foreach(var testInfo in testGroup) + { + testInfo.TestId = source.Id; + } } } } @@ -177,7 +190,17 @@ public FileSystemTestsRunner(List sources, } ConsoleWriter.WriteLine(string.Format(Resources.FsRunnerTestsFound, _tests.Count)); - _tests.ForEach(t => ConsoleWriter.WriteLine("" + t.TestName)); + + foreach(var test in _tests) + { + ConsoleWriter.WriteLine("" + test.TestName); + if(parallelRunnerEnvironments.ContainsKey(test.TestId)) + { + parallelRunnerEnvironments[test.TestId].ForEach( + env => ConsoleWriter.WriteLine(" " + env)); + } + } + ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); } @@ -295,9 +318,24 @@ private bool CheckTimeout() /// private TestRunResults RunHPToolsTest(TestInfo testinf, ref string errorReason) { - var testPath = testinf.TestPath; var type = Helper.GetTestType(testPath); + + // if we have at leas one environment for parallel runner, + // then it must be enabled + var isParallelRunnerEnabled = _parallelRunnerEnvironments.Count > 0; + + if (isParallelRunnerEnabled && type == TestType.QTP) + { + type = TestType.ParallelRunner; + } + // if the current test is an api test ignore the parallel runner flag + // and just continue as usual + else if (isParallelRunnerEnabled && type == TestType.ST) + { + ConsoleWriter.WriteLine("ParallelRunner does not support API tests, treating as normal test."); + } + IFileSysTestRunner runner = null; switch (type) { @@ -311,6 +349,9 @@ private TestRunResults RunHPToolsTest(TestInfo testinf, ref string errorReason) AppDomain.CurrentDomain.AssemblyResolve += Helper.HPToolsAssemblyResolver; runner = new PerformanceTestRunner(this, _timeout, _pollingInterval, _perScenarioTimeOutMinutes, _ignoreErrorStrings, _displayController); break; + case TestType.ParallelRunner: + runner = new ParallelTestRunner(this, _timeout - _stopwatch.Elapsed, _mcConnection, _mobileInfoForAllGuiTests, _parallelRunnerEnvironments); + break; } if (runner != null) diff --git a/HpToolsLauncher/TestData.cs b/HpToolsLauncher/TestData.cs new file mode 100644 index 0000000000..4e7135f524 --- /dev/null +++ b/HpToolsLauncher/TestData.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace HpToolsLauncher +{ + public class TestData + { + public TestData(string tests,string id) + { + this.Tests = tests; + this.Id = id; + } + + public string Tests{get;set;} + public string Id { get; set; } + + public override string ToString() + { + return Id + ": " + Tests; + } + + } +} diff --git a/HpToolsLauncher/TestInfo.cs b/HpToolsLauncher/TestInfo.cs index 3b3f32546b..986db9687d 100644 --- a/HpToolsLauncher/TestInfo.cs +++ b/HpToolsLauncher/TestInfo.cs @@ -25,22 +25,22 @@ public string GenerateAPITestXmlForTest() XDocument doc = XDocument.Load(paramXmlFileName); string schemaStr = doc.Descendants("Schema").First().Elements().First().ToString(); XElement xArgs = doc.Descendants("Arguments").FirstOrDefault(); - if (xArgs!=null) - foreach (XElement arg in xArgs.Elements()) - { - string paramName = arg.Name.ToString().ToLower(); - if (paramDict.ContainsKey(paramName)) + if (xArgs != null) + foreach (XElement arg in xArgs.Elements()) { - var param = paramDict[paramName]; - arg.Value = NormalizeParamValue(param); + string paramName = arg.Name.ToString().ToLower(); + if (paramDict.ContainsKey(paramName)) + { + var param = paramDict[paramName]; + arg.Value = NormalizeParamValue(param); + } } - } string argumentSectionStr = doc.Descendants("Values").First().Elements().First().ToString(); try { XDocument doc1 = XDocument.Parse(argumentSectionStr); XmlSchema schema = XmlSchema.Read(new MemoryStream(Encoding.ASCII.GetBytes(schemaStr), false), null); - + XmlSchemaSet schemas = new XmlSchemaSet(); schemas.Add(schema); @@ -49,7 +49,7 @@ public string GenerateAPITestXmlForTest() { validationMessages += e.Message + Environment.NewLine; }); - + if (!string.IsNullOrWhiteSpace(validationMessages)) ConsoleWriter.WriteLine("parameter schema validation errors: \n" + validationMessages); } @@ -120,12 +120,12 @@ public TestInfo(string testPath, string testName, string testGroup) _testName = testName; } - public TestInfo(string testPath, string testName, string testGroup, string reportPath) + public TestInfo(string testPath, string testName, string testGroup, string testId) { _testPath = testPath; TestGroup = testGroup; _testName = testName; - ReportPath = reportPath; + TestId = testId; } List _paramList = new List(); @@ -153,7 +153,9 @@ public string TestPath } // the path where the report will be saved - public string ReportPath{ get;set; } + public string ReportPath { get; set; } + + public string TestId { get; set; } public List ParameterList { diff --git a/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_16_02/Out/AgentRestart.dat b/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_16_02/Out/AgentRestart.dat new file mode 100644 index 0000000000000000000000000000000000000000..b92f9ff313d6fe3fb73600d5b974b4e5c079fbca GIT binary patch literal 365 zcmZ`#y-veG3{KrbD-{F}z|aS%qC{2HsRQbO0z&+>>cU_pIj3Bk5vG6Cicrvt(PJZGE=AhUa-(3l|*@z&d>?vs!7Dvp!j%Su1#9V?1Jq0lB!V}4Du)+ z=3ywJAQ>ckZiC@J!c)?`qxz$LYssYMxXM-2&bCXeO%;pd64_StSe2`Sn8aa;^gx+m zyI?GuUZXo%Yo^jaGg5Tiy{#|%fnBz1Nx%d!1TY}f^7#4oezbXZE&DC!yWc@^a2Nmp literal 0 HcmV?d00001 diff --git a/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_19_32/Out/AgentRestart.dat b/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_19_32/Out/AgentRestart.dat new file mode 100644 index 0000000000000000000000000000000000000000..d48aa276c06e39218100e346018a9e2c64ea24da GIT binary patch literal 365 zcmZ`#%}N774Bn>I7HYvq=mV6crPQ8!kcv`7{AuYm&hBLEw7WAhlL7k>;tP25A-s6> z?h}d5ph7Qxfh2rM_>v^GBuTykVvIO|;M|4Et#PK{bg7&d<($1#CcO@+;_bqi(xt~M z(tMe%Dd%2yN!BT&CxcPikJjr>eaYU^M3ZML%3k-%XQj%|DU5GOPqO~77!~7UFp#6Z z7>d2P!T2BH1v%bP{n5S&q_8~Gg{g{Lh(lzR>f&SX8Q zwdY&MRHbKL$yU6#@fkj_%eDgvC;&6S98dxhU;(%SyaQB#YrswD`9rJOgkRjgo<4QN T`^n4E$D@9Gwy|Zu5qIR#w3W5a|PyrAt|Q>Op#tB2u-b*RZ>jsnhQ6$W8_u&TAPBx3eDpX3=gg(bYi+dTXrYWviy2#?bad@f#hba- zg^A9VRPi)hQO>>Yf@-65HHwp{@2%Gz+k$OPqlzroY0>Lm*{o3c1-bDxRimswkck}1 zI2K7i9i)4HgW*5Ib27Z6`lEg0$h783C3Vxywo9ySH4(=pva6V}F7FCr5=SM{J>{0& zf)mjU8sThXn9AtfD$()xwm#ekcG=L8fGJ=Gm;(wx0+fJDz*|5CxB^_eoB08><$3z__V6fQPZHm<-|{~E1~kiWP5=M^ literal 0 HcmV?d00001 diff --git a/HpToolsLauncher/TestRunners/ParallelTestRunner.cs b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs new file mode 100644 index 0000000000..09d42328b5 --- /dev/null +++ b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs @@ -0,0 +1,362 @@ +using HpToolsLauncher.ParallelRunner; +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading; +using System.Web.Script.Serialization; +using Environment = System.Environment; +using Resources = HpToolsLauncher.Properties.Resources; +namespace HpToolsLauncher.TestRunners +{ + /// + /// The ParallelTestRunner class + /// Contains all methods for running a file system test using parallel runner. + /// + class ParallelTestRunner : IFileSysTestRunner + { + // each test has a list of environments that it will run on + private readonly Dictionary> _environments; + private readonly IAssetRunner _runner; + private TimeSpan _timeout; + private readonly McConnectionInfo _mcConnectionInfo; + private readonly string _mobileInfo; + private const string ParallelRunnerExecutable = "ParallelRunner.exe"; + private string _parallelRunnerPath; + private RunCancelledDelegate _runCancelled; + private const int PollingTimeMs = 500; + private readonly bool _canRun = false; + private const string ParallelRunnerArguments = "-o static -c \"{0}\""; + + private List _configFiles = new List(); + + public ParallelTestRunner(IAssetRunner runner, TimeSpan timeout, McConnectionInfo mcConnectionInfo, + string mobileInfo, Dictionary> environments) + { + _runner = runner; + _timeout = timeout; + _mcConnectionInfo = mcConnectionInfo; + _mobileInfo = mobileInfo; + _environments = environments; + _canRun = TrySetupParallelRunner(); + } + + /// + /// Tries to find the parallel runner executable. + /// + /// + /// True if the executable has been found,False otherwise + /// + private bool TrySetupParallelRunner() + { + _parallelRunnerPath = Helper.GetParallelRunnerDirectory(ParallelRunnerExecutable); + + ConsoleWriter.WriteLine("Attempting to start parallel runner from: " + _parallelRunnerPath); + + return _parallelRunnerPath != null && File.Exists(_parallelRunnerPath); + } + + /// + /// Set the test run results based on the parallel runner exit code. + /// + /// + /// + /// + /// + private void RunResultsFromParallelRunnerExitCode(TestRunResults runResults, int exitCode, string failureReason, ref string errorReason) + { + // set the status of the build based on the exit code + switch (exitCode) + { + case (int)ParallelRunResult.Pass: + runResults.TestState = TestState.Passed; + break; + case (int)ParallelRunResult.Warning: + runResults.TestState = TestState.Warning; + break; + case (int)ParallelRunResult.Fail: + runResults.ErrorDesc = "ParallelRunner test has FAILED!"; + runResults.TestState = TestState.Failed; + break; + case (int)ParallelRunResult.Canceled: + runResults.ErrorDesc = "ParallelRunner was stopped since job has timed out!"; + ConsoleWriter.WriteErrLine(runResults.ErrorDesc); + runResults.TestState = TestState.Error; + break; + case (int)ParallelRunResult.Error: + errorReason = failureReason; + runResults.ErrorDesc = errorReason; + ConsoleWriter.WriteErrLine(runResults.ErrorDesc); + runResults.TestState = TestState.Error; + break; + default: + ConsoleWriter.WriteErrLine(errorReason); + runResults.ErrorDesc = errorReason; + runResults.TestState = TestState.Error; + break; + } + } + + /// + /// Runs the provided test on all the environments. + /// + /// The test information. + /// failure reason + /// delegate to RunCancelled + /// + /// The run results for the current test. + /// + public TestRunResults RunTest(TestInfo testInfo, ref string errorReason, RunCancelledDelegate runCancelled) + { + // change the DCOM setting for qtp application + Helper.ChangeDCOMSettingToInteractiveUser(); + + testInfo.ReportPath = testInfo.TestPath + @"\ParallelReport"; + + // this is to make sure that we do not overwrite the report + // when we run the same test multiple times on the same build + string resFolder = Helper.GetNextResFolder(testInfo.ReportPath); + + var runResults = new TestRunResults + { + ReportLocation = testInfo.ReportPath, + ErrorDesc = errorReason, + TestState = TestState.Unknown, + TestPath = testInfo.TestPath, + TestType = TestType.ParallelRunner.ToString() + }; + + // set the active test run + ConsoleWriter.ActiveTestRun = runResults; + + if (!_canRun) + { + ConsoleWriter.WriteLine("Could not find parallel runner executable!"); + errorReason = Resources.ParallelRunnerExecutableNotFound; + runResults.TestState = TestState.Error; + runResults.ErrorDesc = errorReason; + return runResults; + } + + // Try to create the ParalleReport path + try + { + Directory.CreateDirectory(runResults.ReportLocation); + }catch(Exception) + { + errorReason = string.Format(Resources.FailedToCreateTempDirError, runResults.ReportLocation); + runResults.TestState = TestState.Error; + runResults.ErrorDesc = errorReason; + + Environment.ExitCode = (int)Launcher.ExitCodeEnum.Failed; + return runResults; + } + + ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " => Using ParallelRunner to execute test: " + testInfo.TestPath); + + _runCancelled = runCancelled; + + // prepare the json file for the process + var configFilePath = string.Empty; + + try + { + configFilePath = ParallelRunnerEnvironmentUtil.GetConfigFilePath(testInfo,_mcConnectionInfo,_environments); + _configFiles.Add(configFilePath); + }catch(Exception ex) // invalid configuration + { + errorReason = ex.Message; + runResults.ErrorDesc = errorReason; + runResults.TestState = TestState.Error; + return runResults; + } + + // Parallel runner argument "-c" for config path and "-o static" so that + // the output from ParallelRunner is compatible with Jenkins + var arguments = String.Format(ParallelRunnerArguments, configFilePath); + + // the test can be started now + runResults.TestState = TestState.Running; + + var runTime = new Stopwatch(); + runTime.Start(); + + string failureReason = null; + runResults.ErrorDesc = null; + + // execute parallel runner and get the run result status + int exitCode = ExecuteProcess(_parallelRunnerPath, arguments, ref failureReason); + + // set the status of the build based on the exit code + RunResultsFromParallelRunnerExitCode(runResults, exitCode, failureReason, ref errorReason); + + // update the run time + runResults.Runtime = runTime.Elapsed; + + // update the report location as the report should be + // generated by now + runResults.ReportLocation = resFolder; + + return runResults; + } + + public void CleanUp() + { + // we need to remove the json config files as they are no longer needed + foreach(var configFile in _configFiles) + { + try + { + File.Delete(configFile); + } + catch (Exception) { + ConsoleWriter.WriteErrLine("Unable to remove configuration file: " + configFile); + } + } + } + + #region Process + + /// + /// Check if the parent of the current process is running in the user session. + /// + /// true if the parent process is running in the user session, false otherwise. + private bool IsParentProcessRunningInUserSession() + { + Process currentProcess = Process.GetCurrentProcess(); + Process parentProcess = currentProcess.Parent(); + + // if they are not in the same session we will assume it is a service + Process explorer = Process.GetProcessesByName("explorer")[0]; + return parentProcess.SessionId != explorer.SessionId; + } + + /// + /// Return the corresponding process object based on the type of jenkins instance. + /// + /// the filename to be ran + /// the arguments for the process + /// the corresponding process type, based on the jenkins instance + private object GetProcessTypForCurrentSession(string fileName,string arguments) + { + try + { + if (!IsParentProcessRunningInUserSession()) + { + Process process = new Process(); + + InitProcess(process, fileName, arguments); + + return process; + } + + ConsoleWriter.WriteLine("Starting ParallelRunner from service session!"); + + // the process must be started in the user session + ElevatedProcess elevatedProcess = new ElevatedProcess(fileName, arguments, Helper.GetSTInstallPath()); + return elevatedProcess; + } + catch (Exception) + { + return null; + } + } + + /// + /// executes the run of the test by using the Init and RunProcss routines + /// + /// the prcess file name + /// the arguments for the process + /// the reason why the process failed + /// the exit code of the process + private int ExecuteProcess(string fileName, string arguments, ref string failureReason) + { + IProcessAdapter processAdapter = ProcessAdapterFactory.CreateAdapter(GetProcessTypForCurrentSession(fileName, arguments)); + + if (processAdapter == null) + { + failureReason = "Could not create ProcessAdapter instance!"; + return (int)ParallelRunResult.Error; + } + + try + { + int exitCode = RunProcess(processAdapter); + + if (_runCancelled()) + { + if (!processAdapter.HasExited) + { + processAdapter.Kill(); + return (int)ParallelRunResult.Canceled; + } + } + + return exitCode; + } + catch (Exception e) + { + failureReason = e.Message; + return (int)ParallelRunResult.Error; + } + finally + { + if (processAdapter != null) + { + processAdapter.Close(); + } + } + } + + /// + /// Initializes the ParallelRunner process + /// + /// the process + /// the file name + /// the process arguments + private void InitProcess(Process proc, string fileName, string arguments) + { + var processStartInfo = new ProcessStartInfo + { + FileName = fileName, + Arguments = arguments, + WorkingDirectory = Directory.GetCurrentDirectory(), + WindowStyle = ProcessWindowStyle.Hidden + }; + + proc.StartInfo = processStartInfo; + } + + /// + /// runs the ParallelRunner process after initialization + /// + /// + /// + private int RunProcess(IProcessAdapter proc) + { + proc.Start(); + + proc.WaitForExit(PollingTimeMs); + + while (!_runCancelled() && !proc.HasExited) + { + proc.WaitForExit(PollingTimeMs); + } + + return proc.ExitCode; + } + + #endregion + } + + public enum ParallelRunResult : int + { + Pass = 1004, + Warning = 1005, + Fail = 1006, + Canceled = 1007, + Error = 1008, + } +} \ No newline at end of file diff --git a/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestModel.java b/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestModel.java new file mode 100644 index 0000000000..6561180f31 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestModel.java @@ -0,0 +1,149 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + +package com.hpe.application.automation.tools.model; + +import com.hpe.application.automation.tools.sse.common.StringUtils; +import hudson.EnvVars; +import hudson.Extension; +import hudson.model.AbstractDescribableImpl; +import hudson.model.Descriptor; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static com.hpe.application.automation.tools.model.RunFromFileSystemModel.isMtbxContent; + +/** + * Represents the tests that ParallelRunner should run and the environments on which to run them. + */ +public class FileSystemTestModel extends AbstractDescribableImpl { + private String tests; // tests to run + private List parallelRunnerEnvironments; // the environments to run on + + /** + * Constructs a new FileSystemTestModel + * @param tests the tests to be run + * @param parallelRunnerEnvironments the environments on which to run the tests on + */ + @DataBoundConstructor + public FileSystemTestModel(String tests,List parallelRunnerEnvironments) { + this.tests = tests; + this.parallelRunnerEnvironments = parallelRunnerEnvironments; + } + + /** + * Returns the tests. + * @return the tests + */ + public String getTests() { + if(this.tests == null) { + this.tests = "\n"; + } + else if(!this.tests.contains("\n")) { + this.tests+="\n"; + } + + return tests; + } + + /** + * Adds a new line to the tests string if not present (keep the expandableTextBox expanded). + * @param tests the tests + */ + private void setTestsWithNewLine(String tests) { + this.tests = tests.trim(); + + if (!this.tests.contains("\n")) { + this.tests += "\n"; + } + } + + /** + * Set the tests to be run by ParallelRunner. + * @param tests the tests to be run + */ + @DataBoundSetter + public void setTests(String tests) { + setTestsWithNewLine(tests); + } + + /** + * Returns the environments on which the tests will run. + * @return the parallel runner environments + */ + public List getParallelRunnerEnvironments() { + return parallelRunnerEnvironments; + } + + /** + * Sets the ParallelRunner environments. + * @param parallelRunnerEnvironments the parallel runner environments + */ + @DataBoundSetter + public void setParallelRunnerEnvironments(List parallelRunnerEnvironments) { + this.parallelRunnerEnvironments = parallelRunnerEnvironments; + } + + /** + * Expand the tests based on the environment variables. + * @param envVars the environment variables + * @return the parsed list of tests + */ + public List parseTests(EnvVars envVars) { + String expandedFsTests = envVars.expand(this.tests); + + List result = new ArrayList<>(); + + if(StringUtils.isNullOrEmpty(this.tests)) + return result; + + if (isMtbxContent(expandedFsTests)) { + result.add(expandedFsTests); + } else { + result = Arrays.asList(expandedFsTests.replaceAll("\r", "").split("\n")); + } + + return result; + } + + @Extension + public static class DescriptorImpl extends Descriptor { + @Nonnull + public String getDisplayName() {return "File System test model";} + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java b/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java new file mode 100644 index 0000000000..cb2ce0d855 --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java @@ -0,0 +1,144 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ + +package com.hpe.application.automation.tools.model; + +import hudson.EnvVars; +import hudson.Extension; +import hudson.model.AbstractDescribableImpl; +import hudson.model.Descriptor; +import hudson.util.VariableResolver; +import org.apache.commons.lang.StringUtils; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; +import java.util.Properties; + +/** + * Represents the list of tests and environments which ParallelRunner will execute. + */ +public class FileSystemTestSetModel extends AbstractDescribableImpl { + private List fileSystemTestSet; + + /** + * Construct a new FileSystemTestSetModel. + * @param fileSystemTestModels the list of tests and environments + */ + @DataBoundConstructor + public FileSystemTestSetModel(List fileSystemTestModels) { + this.fileSystemTestSet = fileSystemTestModels; + } + + /** + * Returns the list of tests and environments + * @return the list of tests and environments + */ + public List getFileSystemTestSet() { + return fileSystemTestSet; + } + + /** + * Sets the list of tests and environments + * @param fileSystemTestSet the list of tests and environments + */ + @DataBoundSetter + public void setFileSystemTestSet(List fileSystemTestSet) { + this.fileSystemTestSet = fileSystemTestSet; + } + + /** + * Remove the fsTests as ParallelRunner won't run those. + * @param props the properties + */ + private void removeFsTests(Properties props) { + int current = 1; + String key = "Test"; + + while(props.containsKey(key + current)) { + props.remove(key + current); + current+=1; + } + } + + /** + * Add the parallel runner tests and environments to the properties. + * @param props the properties + * @param envVars the environment variables + */ + public void addTestSetProperties(Properties props,EnvVars envVars) { + // enabled parallel runner for build + props.put("parallelRunnerMode","true"); + + // remove the tests set by fs + removeFsTests(props); + + int testNumber = 1; + + for(FileSystemTestModel testModel : this.fileSystemTestSet) { + List tests = testModel.parseTests(envVars); + + // these are the environments for each test + // from the tests list + List environmentModels = testModel.getParallelRunnerEnvironments(); + + for(String test: tests) { + test = test.trim(); + + // first add the test + props.put("Test" + testNumber,test); + + int envNumber = 1; + + // each parallel test environment will be of the form + // ParallelTest1Env1, ParallelTest1Env2,..., ParallelTest1EnvN + for(ParallelRunnerEnvironmentModel environment : environmentModels) { + // add the environment for each test + props.put("ParallelTest" + testNumber+ "Env" + envNumber,environment.getEnvironment()); + envNumber++; + } + + // increment the number of available tests + testNumber++; + } + } + } + + @Extension + public static class DescriptorImpl extends Descriptor { + @Nonnull + public String getDisplayName() {return "File System test set model";} + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java b/src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java new file mode 100644 index 0000000000..4cd8e214da --- /dev/null +++ b/src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java @@ -0,0 +1,283 @@ +/* + * © Copyright 2013 EntIT Software LLC + * Certain versions of software and/or documents (“Materialâ€) accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * Copyright (c) 2018 Micro Focus Company, L.P. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ___________________________________________________________________ + * + */ +package com.hpe.application.automation.tools.model; + +import hudson.Extension; +import hudson.model.AbstractDescribableImpl; +import hudson.model.Descriptor; +import hudson.util.FormValidation; +import org.apache.commons.lang.StringUtils; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; +import org.kohsuke.stapler.QueryParameter; + +import javax.annotation.Nonnull; +import java.util.*; + +/** + * Represents the environment that Parallel Runner uses to execute a test. + */ +public class ParallelRunnerEnvironmentModel extends AbstractDescribableImpl { + private String environment; + private String environmentType; // 'Web', 'Mobile' + + @DataBoundConstructor + public ParallelRunnerEnvironmentModel(String environment,String environmentType) { + this.environment = environment; + this.environmentType = environmentType; + } + + /** + * Returns the parallel runner environment string. + * @return the environment string + */ + public String getEnvironment() { + return environment; + } + + /** + * Set the parallel runner environment string. + * @param environment the parallel runner environment + */ + @DataBoundSetter + public void setEnvironment(String environment) { + this.environment = environment; + } + + /** + * Set the environment type + * @param environmentType the environment type + */ + @DataBoundSetter + public void setEnvironmentType(String environmentType) { this.environmentType = environmentType; } + + /** + * Returns the environment type + * @return the environment type + */ + public String getEnvironmentType() { return environmentType; } + + @Extension + public static class DescriptorImpl extends Descriptor { + private static final String DeviceIdKey = "deviceid"; + private static final String OsTypeKey = "ostype"; + private static final String OsVersionKey = "osversion"; + private static final String ManufacturerAndModelKey = "manufacturerandmodel"; + private static final String BrowserKey = "browser"; + + // the list of browsers that ParallelRunner supports + private static final List SupportedBrowsers = new ArrayList() { + { + add("IE"); + add("IE64"); + add("CHROME"); + add("FIREFOX"); + add("FIREFOX64"); + } + }; + + private static final List KnownProperties = new ArrayList() { + { + add(DeviceIdKey); + add(OsTypeKey); + add(OsVersionKey); + add(ManufacturerAndModelKey); + add(BrowserKey); + } + }; + + /** + * Instantiates a new Descriptor. + */ + public DescriptorImpl() { load(); } + + + /** + * Returns the display name. + */ + @Nonnull + public String getDisplayName() {return "Parallel Runner Environment model.";} + + /** + * Return the key value pairs from an environment string. + * @param environment the environment string + * @return a map containing the key value pairs + */ + private Map getEnvironmentKeyValuePairs(String environment) { + // environment string example: osType : Android,osVersion : 4.4.2,manufacturerAndModel : "samsung GT-I9515" + // or : browser : Chrome + Map pairs = new HashMap<>(); + + String [] tokens = environment.toLowerCase().split(","); + + for (String token : tokens) { + String [] keyValue = token.split(":"); + + // invalid key/value pair + if(keyValue.length < 2) { + continue; + } + + // we will treat the first value as the key + String key = keyValue[0].trim(); + + if(key.isEmpty()) + continue; + + // the rest of the list represents the value + String value = StringUtils. + join(Arrays.asList(keyValue).subList(1, keyValue.length),"") + .trim(); + + // we will always use the last provided key + pairs.put(key,value); + } + + // as result we will have + // { osType : Android} + // { osVersion : 4.4.2 } + // { manufacturerAndModel : "samsung GT-I9515" } + + return pairs; + } + + /** + * Checks if the provided browser is supported by ParallelRunner. + * @param browserName the name of the browser + * @return true if the browser is supported, false otherwise + */ + private boolean isSupportedBrowser(String browserName) { + for(String browser : SupportedBrowsers) { + if(browser.equalsIgnoreCase(browserName)){ + return true; + } + } + + return false; + } + + /** + * Check if the given property is known(valid). + * @param property the property + * @return true if the property is known, false otherwise + */ + private boolean isKnownProperty(String property) { + for(String knownProperty : KnownProperties) { + if(knownProperty.equalsIgnoreCase(property)){ + return true; + } + } + + return false; + } + + /** + * Validate the environment string. + * @param environment the environment string + */ + private void validateEnvironmentString(String environment) throws Exception { + Map pairs = this.getEnvironmentKeyValuePairs(environment); + + // check if any property was provided + if(pairs.isEmpty()) { + throw new Exception("No property provided. Enter properties using the following syntax: :"); + } + + // check if there are any invalid property names + for(String key : pairs.keySet()) { + if(!isKnownProperty(key)) { + throw new Exception("Invalid property name: " + key); + } + } + + // the environment must either be a mobile environment or a browser + // environment, and if no properties are present it is neither of those + //if(!pairs.containsKey(DeviceIdKey) && !pairs.containsKey(BrowserKey) && + //(!pairs.containsKey(OsTypeKey) && !pairs.containsKey(OsVersionKey) && !pairs.containsKey(ManufacturerAndModelKey))){ + //throw new Exception("Not enough parameters provided!"); + //} + + // if the key is present the value must be present too + if(pairs.containsKey(DeviceIdKey) && pairs.get(DeviceIdKey).trim().isEmpty()) { + throw new Exception("DeviceId value must not be empty!"); + } + + if(pairs.containsKey(OsVersionKey) && pairs.get(OsVersionKey).trim().isEmpty()) { + throw new Exception("OsVersion value must not be empty!"); + } + + if(pairs.containsKey(OsTypeKey) && pairs.get(OsTypeKey).trim().isEmpty()) { + throw new Exception("OsType value must not be empty!"); + } + + if(pairs.containsKey(ManufacturerAndModelKey) && pairs.get(ManufacturerAndModelKey).trim().isEmpty()) { + throw new Exception("ManufacturerAndModel value must not be empty!"); + } + + // if it's a browser environment + if(pairs.containsKey(BrowserKey)) { + String browserName = pairs.get(BrowserKey).trim(); + + // check if the value is present + if(browserName.isEmpty()) { + throw new Exception("Browser value must not be empty!"); + } + + // check if ParallelRunner supports the given browser + if(!isSupportedBrowser(browserName)) { + throw new Exception(String.format("Invalid browser. %s is not supported!", browserName.toUpperCase())); + } + } + } + + /** + * Sanity check for the environment string. + * @param value the environment string + * @return the result of the sanity check + */ + @SuppressWarnings("unused") + public FormValidation doCheckEnvironment(@QueryParameter String value) { + if(StringUtils.isEmpty(value)) { + return FormValidation.ok(); + } + + try{ + this.validateEnvironmentString(value); + }catch (Exception e) { + return FormValidation.error(e.getMessage()); + } + + return FormValidation.ok(); + } + } +} diff --git a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java index 7d42eb39ea..2f5685f208 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java @@ -33,6 +33,8 @@ package com.hpe.application.automation.tools.model; +import com.hpe.application.automation.tools.AlmToolsUtils; +import com.hpe.application.automation.tools.EncryptionUtils; import com.hpe.application.automation.tools.mc.JobConfigurationProxy; import hudson.EnvVars; import hudson.util.Secret; @@ -167,7 +169,6 @@ public RunFromFileSystemModel(String fsTests) { this.displayController = "false"; } - /** * Sets fs tests. * @@ -722,10 +723,20 @@ private Properties createProperties(EnvVars envVars) { props.put("MobileUseProxy", "1"); props.put("MobileProxyType","2"); props.put("MobileProxySetting_Address", proxySettings.getFsProxyAddress()); + if(isUseAuthentication()){ props.put(MOBILE_PROXY_SETTING_AUTHENTICATION,"1"); props.put(MOBILE_PROXY_SETTING_USER_NAME,proxySettings.getFsProxyUserName()); - props.put(MOBILE_PROXY_SETTING_PASSWORD_FIELD, proxySettings.getFsProxyPassword()); + String encryptedPassword = ""; + + try { + encryptedPassword = EncryptionUtils.Encrypt(proxySettings.getFsProxyPassword(), + EncryptionUtils.getSecretKey()); + }catch (Exception ex){ + return null; // cannot continue without proper config + } + + props.put(MOBILE_PROXY_SETTING_PASSWORD_FIELD, encryptedPassword); }else{ props.put(MOBILE_PROXY_SETTING_AUTHENTICATION,"0"); props.put(MOBILE_PROXY_SETTING_USER_NAME,""); diff --git a/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java index 4d596b477f..67443d334d 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/HtmlBuildReportAction.java @@ -125,6 +125,7 @@ private void readReportFromXMLFile(String filename, List listRep String dateTime = report.getAttribute("dateTime"); String status = report.getAttribute("status"); String isHtmlreport = report.getAttribute("isHtmlreport"); + String isParallelRunnerReport = report.getAttribute("isParallelRunnerReport"); reportmetadata.setDisPlayName(disPlayName); reportmetadata.setUrlName(urlName); @@ -132,6 +133,7 @@ private void readReportFromXMLFile(String filename, List listRep reportmetadata.setDateTime(dateTime); reportmetadata.setStatus(status); reportmetadata.setIsHtmlReport("true".equals(isHtmlreport)); + reportmetadata.setIsParallelRunnerReport("true".equals(isParallelRunnerReport)); listReport.add(reportmetadata); } diff --git a/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java b/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java index 1f85ce0eec..35006834fa 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java +++ b/src/main/java/com/hpe/application/automation/tools/results/ReportMetaData.java @@ -45,6 +45,7 @@ public class ReportMetaData { private String dateTime; private String status; private Boolean isHtmlReport; + private Boolean isParallelRunnerReport; public String getFolderPath() { return folderPath; @@ -101,4 +102,10 @@ public Boolean getIsHtmlReport() { public void setIsHtmlReport(Boolean isHtmlReport) { this.isHtmlReport = isHtmlReport; } + + public Boolean getIsParallelRunnerReport() { + return isParallelRunnerReport; + } + + public void setIsParallelRunnerReport(Boolean parallelRunnerReport) { isParallelRunnerReport = parallelRunnerReport; } } diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index 2d11747b98..69e4054995 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -101,11 +101,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.Serializable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; +import java.util.*; import static com.hpe.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNode; import static com.hpe.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNodeAttr; @@ -135,6 +131,9 @@ public class RunResultRecorder extends Recorder implements Serializable, MatrixA public static final String SLA_ULL_NAME = "FullName"; public static final String ARCHIVING_TEST_REPORTS_FAILED_DUE_TO_XML_PARSING_ERROR = "Archiving test reports failed due to xml parsing error: "; + private static final String PARALLEL_REPORT_FOLDER = "ParallelReport"; + private static final String PARALLEL_RESULT_FILE = "parallelrun_results.html"; + private final ResultsPublisherModel _resultsPublisherModel; private List runReportList; @@ -273,6 +272,18 @@ private void publishLrReports(@Nonnull Run build) throws IOException { } } + /** + * checks if the given report path is a parallel runner report + * + * @param reportPath the path containing the report files + * @throws IOException + * @throws InterruptedException + */ + private boolean isParallelRunnerReportPath(FilePath reportPath) throws IOException, InterruptedException { + FilePath parallelRunnerResultsFile = new FilePath(reportPath,PARALLEL_RESULT_FILE); + return parallelRunnerResultsFile.exists(); + } + /** * copies, archives and creates the Test reports of LR and UFT runs. * @@ -404,6 +415,8 @@ private void archiveTestsReport( } else { // UFT Test boolean reportIsHtml = false; NodeList testCasesNodes = ((Element) testSuiteNode).getElementsByTagName("testcase"); + Map fileNameCount = new HashMap<>(); + for (int i = 0; i < testCasesNodes.getLength(); i++) { Node nNode = testCasesNodes.item(i); @@ -418,6 +431,7 @@ private void archiveTestsReport( String reportFolderPath = eElement.getAttribute(REPORT_NAME_FIELD); // e.g. "C:\UFTTest\GuiTest1\Report" + String testFolderPath = eElement.getAttribute("name"); // e.g. "C:\UFTTest\GuiTest1" String testStatus = eElement.getAttribute("status"); // e.g. "pass" @@ -426,6 +440,7 @@ private void archiveTestsReport( String testDateTime = sysinfo.substring(0, 19); FilePath reportFolder = new FilePath(projectWS.getChannel(), reportFolderPath); + boolean isParallelRunnerReport = isParallelRunnerReportPath(reportFolder); reportFolders.add(reportFolder); @@ -434,7 +449,14 @@ private void archiveTestsReport( boolean archiveTestResult = false; //check for the new html report - FilePath htmlReport = new FilePath(reportFolder, "run_results.html"); + FilePath htmlReport = new FilePath(reportFolder, + isParallelRunnerReport ? PARALLEL_RESULT_FILE : "run_results.html"); + + // the report name is different for the parallel runner + /*if(isParallelRunnerReport) { + htmlReport = new FilePath(reportFolder,PARALLEL_RESULT_FILE); + }*/ + FilePath rrvReport = new FilePath(reportFolder, "Results.xml"); if (htmlReport.exists()) { reportIsHtml = true; @@ -445,12 +467,29 @@ private void archiveTestsReport( reportMetaData.setIsHtmlReport(true); reportMetaData.setDateTime(testDateTime); reportMetaData.setStatus(testStatus); - + reportMetaData.setIsParallelRunnerReport(isParallelRunnerReport); // we need to handle the type for this report File testFileFullName = new File(testFolderPath); String testName = org.apache.commons.io.FilenameUtils.getName(testFileFullName.getPath()); + + // we must consider the case when we run the same test + // in the same build + if(isParallelRunnerReport) { + Integer nameCount = 1; + + if(fileNameCount.containsKey(testName)) { + nameCount = fileNameCount.get(testName) + 1; + } + + // update the count for this file + fileNameCount.put(testName,nameCount); + + testName+="[" + nameCount + "]"; + } + String resourceUrl = "artifact/UFTReport/" + testName; reportMetaData.setResourceURL(resourceUrl); reportMetaData.setDisPlayName(testName); // use the name, not the full path + //don't know reportMetaData's URL path yet, we will generate it later. ReportInfoToCollect.add(reportMetaData); @@ -566,6 +605,7 @@ private void writeReportMetaData2XML(List htmlReportsInfo, Strin String dateTime = htmlReportInfo.getDateTime(); String status = htmlReportInfo.getStatus(); String isHtmlReport = htmlReportInfo.getIsHtmlReport() ? "true" : "false"; + String isParallelRunnerReport = htmlReportInfo.getIsParallelRunnerReport() ? "true" : "false"; Element elmReport = doc.createElement(REPORT_NAME_FIELD); elmReport.setAttribute("disPlayName", disPlayName); elmReport.setAttribute("urlName", urlName); @@ -573,6 +613,7 @@ private void writeReportMetaData2XML(List htmlReportsInfo, Strin elmReport.setAttribute("dateTime", dateTime); elmReport.setAttribute("status", status); elmReport.setAttribute("isHtmlreport", isHtmlReport); + elmReport.setAttribute("isParallelRunnerReport",isParallelRunnerReport); root.appendChild(elmReport); } @@ -615,13 +656,22 @@ private Boolean collectAndPrepareHtmlReports(Run build, TaskListener listener, L if (!htmlReportInfo.getIsHtmlReport()) { continue; } + String htmlReportDir = htmlReportInfo.getFolderPath(); // C:\UFTTest\GuiTest1\Report + //boolean isParallelRunner = htmlReportDir.contains(PARALLEL_REPORT_FOLDER); + // htmlReportDir.endsWith(PARALLEL_REPORT_FOLDER + "\\Res1"); + listener.getLogger().println("collectAndPrepareHtmlReports, collecting:" + htmlReportDir); listener.getLogger().println("workspace: " + runWorkspace); // copy to the subdirs of master FilePath source = new FilePath(runWorkspace, htmlReportDir); + + // if it's a parallel runner report path, we must change the + // resFileName + boolean isParallelRunner = isParallelRunnerReportPath(source); + listener.getLogger().println("source: " + source); String testName = htmlReportInfo.getDisPlayName(); // like "GuiTest1" String dest = testName; @@ -666,7 +716,10 @@ private Boolean collectAndPrepareHtmlReports(Run build, TaskListener listener, L // fill in the urlName of this report. we need a network path not a FS path String resourceUrl = htmlReportInfo.getResourceURL(); - String urlName = resourceUrl + "/run_results.html"; // like artifact/UFTReport/GuiTest1/run_results.html + String resFileName = isParallelRunner ? "/parallelrun_results.html" : "/run_results.html"; + + String urlName = resourceUrl + resFileName; // like artifact/UFTReport/GuiTest1/run_results.html + // or for Parallel runner /GuiTest1[1]/parallelrun_results.html listener.getLogger().println("set the report urlName to " + urlName); htmlReportInfo.setUrlName(urlName); diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 3347232399..e56497e5d3 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -37,9 +37,7 @@ import com.hpe.application.automation.tools.EncryptionUtils; import com.hpe.application.automation.tools.common.CompatibilityRebrander; import com.hpe.application.automation.tools.mc.JobConfigurationProxy; -import com.hpe.application.automation.tools.model.MCServerSettingsModel; -import com.hpe.application.automation.tools.model.ProxySettings; -import com.hpe.application.automation.tools.model.RunFromFileSystemModel; +import com.hpe.application.automation.tools.model.*; import com.hpe.application.automation.tools.settings.MCServerSettingsBuilder; import hudson.EnvVars; import hudson.Extension; @@ -75,10 +73,7 @@ import java.net.URL; import java.text.Format; import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.Objects; -import java.util.Properties; +import java.util.*; /** * Describs a regular jenkins build step from UFT or LR @@ -88,7 +83,10 @@ public class RunFromFileBuilder extends Builder implements SimpleBuildStep { private String ResultFilename = "ApiResults.xml"; private String ParamFileName = "ApiRun.txt"; - private final RunFromFileSystemModel runFromFileModel; + private RunFromFileSystemModel runFromFileModel; + private FileSystemTestSetModel fileSystemTestSetModel; + private boolean isParallelRunnerEnabled; + private static final String HP_TOOLS_LAUNCHER_EXE = "HpToolsLauncher.exe"; private static final String LRANALYSIS_LAUNCHER_EXE = "LRAnalysisLauncher.exe"; @@ -98,11 +96,37 @@ public class RunFromFileBuilder extends Builder implements SimpleBuildStep { * @param fsTests the fs tests */ @DataBoundConstructor - public RunFromFileBuilder(String fsTests) { + public RunFromFileBuilder(String fsTests, boolean isParallelRunnerEnabled, + FileSystemTestSetModel fileSystemTestSetModel) { + this.runFromFileModel = new RunFromFileSystemModel(fsTests); + this.fileSystemTestSetModel = fileSystemTestSetModel; + this.isParallelRunnerEnabled = isParallelRunnerEnabled; + } + + + public FileSystemTestSetModel getFileSystemTestSetModel() { + return fileSystemTestSetModel; + } + /** + * Gets the parallel runner flag. + * + * @return the current parallel runner flag state(enabled/disabled) + */ + public boolean getIsParallelRunnerEnabled() { + return isParallelRunnerEnabled; + } + + /** + * Instantiates a new Run from file builder. + * + * @param fsTests the fs tests + */ + public RunFromFileBuilder(String fsTests) { runFromFileModel = new RunFromFileSystemModel(fsTests); } + public void setFsTests(String fsTests){ runFromFileModel.setFsTests(fsTests); } @@ -113,7 +137,6 @@ public void setFsTests(String fsTests){ * @param runFromFileModel the run from file model */ public RunFromFileBuilder(RunFromFileSystemModel runFromFileModel) { - this.runFromFileModel = runFromFileModel; } @@ -149,8 +172,8 @@ public RunFromFileBuilder(String fsTests, String fsTimeout, String fsUftRunMode, String perScenarioTimeOut, String ignoreErrorStrings, String displayController, String mcServerName, String fsUserName, String fsPassword, String mcTenantId, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, String fsExtraApps, String fsJobId, - ProxySettings proxySettings, boolean useSSL) { - + ProxySettings proxySettings, boolean useSSL,boolean isParallelRunnerEnabled, List environments) { + this.isParallelRunnerEnabled = isParallelRunnerEnabled; runFromFileModel = new RunFromFileSystemModel(fsTests, fsTimeout, fsUftRunMode, controllerPollingInterval, perScenarioTimeOut, ignoreErrorStrings, displayController, mcServerName, fsUserName, fsPassword, mcTenantId, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, fsAutActions, fsLaunchAppName, fsDevicesMetrics, fsInstrumented, fsExtraApps, fsJobId, proxySettings, useSSL); @@ -384,10 +407,19 @@ public void setProxySettings(ProxySettings proxySettings) { runFromFileModel.setProxySettings(proxySettings); } + /** + * Sets the parallel runner flag + * + * @param isParallelRunnerEnabled the parallel runner flag + */ + @DataBoundSetter + private void setIsParallelRunnerEnabled(boolean isParallelRunnerEnabled) { + this.isParallelRunnerEnabled = isParallelRunnerEnabled; + } + @Override public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) - - throws InterruptedException, IOException { + throws IOException { // get the mc server settings MCServerSettingsModel mcServerSettingsModel = getMCServerSettingsModel(); @@ -447,7 +479,6 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn mergedProperties.putAll(runFromFileModel.getProperties(env)); } - int idx = 0; for (Iterator iterator = env.keySet().iterator(); iterator.hasNext(); ) { String key = iterator.next(); @@ -466,16 +497,34 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn mergedProperties.put("runType", AlmRunTypes.RunType.FileSystem.toString()); mergedProperties.put("resultsFilename", ResultFilename); - //handling mtbx file content : - // If we have mtbx content - it is located in Test1 property and there is no other test properties (like Test2 etc) - // We save mtbx content in workspace and replace content of Test1 by reference to saved file - String firstTestKey = "Test1"; - String firstTestContent = mergedProperties.getProperty(firstTestKey, ""); - if (RunFromFileSystemModel.isMtbxContent(firstTestContent)) { + // parallel runner is enabled + if(isParallelRunnerEnabled) { + // add the parallel runner properties + fileSystemTestSetModel.addTestSetProperties(mergedProperties,env); + + // we need to replace each mtbx test with mtbx file path + for(int index = 1; index < this.fileSystemTestSetModel.getFileSystemTestSet().size();index++) { + String key = "Test" + index; + String content = mergedProperties.getProperty(key + index,""); + try{ + replaceTestWithMtbxFile(workspace,mergedProperties,content,key,time,index); + }catch (Exception e){ + build.setResult(Result.FAILURE); + listener.error("Failed to save MTBX file : " + e.getMessage()); + } + } + } + else { + // handling mtbx file content : + // If we have mtbx content - it is located in Test1 property and there is no other test properties (like Test2 etc) + // We save mtbx content in workspace and replace content of Test1 by reference to saved file + // this only applies to the normal file system flow + String firstTestKey = "Test1"; + String firstTestContent = mergedProperties.getProperty(firstTestKey, ""); + try { - String mtbxFilePath = createMtbxFileInWs(workspace, firstTestContent, time); - mergedProperties.setProperty(firstTestKey, mtbxFilePath); - } catch (IOException | InterruptedException e) { + replaceTestWithMtbxFile(workspace,mergedProperties,firstTestContent,firstTestKey,time); + }catch (Exception e){ build.setResult(Result.FAILURE); listener.error("Failed to save MTBX file : " + e.getMessage()); } @@ -555,6 +604,50 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } } + /** + * Replace the fsTests given as mtbx with the actual mtbx file. + * @param workspace the current workspace + * @param props the properties + * @param content the mtbx content + * @param key the test key + * @param time current time string + * @param index the index for the prefix + * @throws Exception + */ + private static void replaceTestWithMtbxFile(FilePath workspace,Properties props,String content,String key,String time, int index) throws Exception { + if (RunFromFileSystemModel.isMtbxContent(content)) { + try { + String prefx = index > 0 ? index + "_" : ""; + String mtbxFilePath = prefx + createMtbxFileInWs(workspace, content, time); + props.setProperty(key, mtbxFilePath); + } catch (IOException | InterruptedException e) { + throw new Exception(e); + } + } + } + + /** + * Replace the fsTests given as mtbx with the actual mtbx file. + * @param workspace the current workspace + * @param props the properties + * @param content the mtbx content + * @param key the test key + * @param time current time string + * @throws Exception + */ + private static void replaceTestWithMtbxFile(FilePath workspace,Properties props,String content,String key,String time) throws Exception{ + replaceTestWithMtbxFile(workspace,props,content,key,time,0); + } + + /** + * Creates an .mtbx file with the provided mtbx content. + * @param workspace jenkins workspace + * @param mtbxContent the motbx content + * @param timeString current time represented as a String + * @return the remote file path + * @throws IOException + * @throws InterruptedException + */ private static String createMtbxFileInWs(FilePath workspace, String mtbxContent, String timeString) throws IOException, InterruptedException { String fileName = "test_suite_" + timeString + ".mtbx"; diff --git a/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/config.jelly new file mode 100644 index 0000000000..affd4851f5 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/config.jelly @@ -0,0 +1,66 @@ + + + + + + +
    + +
    + + +

    EXECUTION SET

    +

    + + +

    + Tests +
    + + +
    + +
    +
    + + + + + +
    +
    diff --git a/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/help-tests.html b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/help-tests.html new file mode 100644 index 0000000000..2c87183035 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestModel/help-tests.html @@ -0,0 +1,3 @@ +
    + List of tests or folders that contain tests, to run. Each line should contain a single test, folder, or MTB file. +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/config.jelly new file mode 100644 index 0000000000..7928084a0f --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/config.jelly @@ -0,0 +1,40 @@ + + + + + + + + diff --git a/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/help-fileSystemTestSet.html b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/help-fileSystemTestSet.html new file mode 100644 index 0000000000..8d85b3575b --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/model/FileSystemTestSetModel/help-fileSystemTestSet.html @@ -0,0 +1,3 @@ +
    + File system test set help. +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly b/src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly new file mode 100644 index 0000000000..190cb4bea9 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly @@ -0,0 +1,81 @@ + + + + + + + +
    +
    Environment
    + + + + +
    + +
    + + + + + + + + +
    + + + +
    +
    diff --git a/src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/help-environment.html b/src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/help-environment.html new file mode 100644 index 0000000000..ec4a7b30e4 --- /dev/null +++ b/src/main/resources/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel/help-environment.html @@ -0,0 +1,3 @@ +
    + Environment help string. +
    \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/results/HtmlBuildReportAction/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/HtmlBuildReportAction/index.jelly index a8b92629cd..9666261702 100644 --- a/src/main/resources/com/hpe/application/automation/tools/results/HtmlBuildReportAction/index.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/results/HtmlBuildReportAction/index.jelly @@ -86,9 +86,30 @@
    Html_report${s.disPlayName} + Html_parallel_report + ${s.disPlayName} + Html_report + ${s.disPlayName} RRV_report
    @@ -55,10 +57,21 @@ } + + + + + + + + + + + + + + + + + + +
    + +
    +
    ${header}
    + + + + +
    + + +
    + +
    ${header}
    + +
    +
    + + + + + +
    +
    ${header}
    + +
    +
    +
    + + +
    + + + + + + + + + + + + +
    + diff --git a/src/main/resources/lib/custom/customRepeatableProperty.jelly b/src/main/resources/lib/custom/customRepeatableProperty.jelly new file mode 100644 index 0000000000..0953626923 --- /dev/null +++ b/src/main/resources/lib/custom/customRepeatableProperty.jelly @@ -0,0 +1,36 @@ + + + + + + + + +
    +
    + +
    diff --git a/src/main/resources/lib/custom/taglib b/src/main/resources/lib/custom/taglib new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/webapp/ParallelRunner/icons/png/chrome.png b/src/main/webapp/ParallelRunner/icons/png/chrome.png new file mode 100644 index 0000000000000000000000000000000000000000..38f125e36a2184c8778721d77d9a3caa4a426061 GIT binary patch literal 1302 zcmV+x1?l>UP)Px(&`Cr=R7ef2R)0*CWgP!J&;5ks*B#t>Kqd!xD8ZW^||tz3~cmstLQ#wepTOVcK{!J4#cX_~>p&B~dI(t)7BA#mJrcklc3+=1`?dS6DX zXM1aA!d`JDYuR!?bXpG~(0f=4?^|p6FE2|^ILSjLoSGmxU2#5bN z(Y*8q=;Irt6jZWCoWb`a&Ho3(|G^Hht_~?vaAo6u7ZTJ42nXunZ>W<1bUVGU8MP?Mj6+rmU*#-^ z`ozEwaPe)tJl>6#-d3!sr~*Co8N_p)ptf9SKK=@f-<$ehooMJ7hEE9905v73S!6;@ zu@ThyIoQocMOl*hHdNUg7i{l#T?;z>F?Ipf8LObrD}>l`7@A#;AQ^M<$!{areR>FD zNGIqYn4j%+BVJ2!Z&m?tb1#^;2k`R>6a7#fROuV$Z6EcG1%o}pB)p;zrFp9W%HLDv z!x)?pu(`D#LbOuY8an#iSX+<=gW3l+elm;+nS}6sPVYzv;nvaKLTzv#!FOCL$t-~3R_W(57zW)SUMd3RwH zG)0pfL;gH?7QYO42Ju{zHinl2BtNR;&$rQ}HOj@}!@n9JFcC#oJyP^4S)bcrGUxB+ zeqekTCZ`VDZBF{tSU~NGInq4bxa#V`5yvqk@{{)Z5_32eV+Z&o9j|<&ZD7nF!v_IP zI%tWhSf1o)9 zB(jb<2{!C1s)a>o#)OaI{0$GfM|`mH%28m^BVIGzod=sB_P!>YBLGtSw^Oxo-=#(z z>``tlsX7z32veZQ=Pvs(xtzbjVilNlTxunX_H^_;B@A2mE?|0WzaDyc9V{UKf-8}LR$A|@j*5A1npDwOPX=>~pe9*cK1xX9RZtUaj#1XCm zqA`PJ)`H}G4e&Y{Jwjhs(aiMxit8$l_qCzZ*@ZrLKfWk!f`xj)E|i0bZjitZ7|KAB zD*@w^{1n71Wa3vq@rzg{B+%=$lz#@e&jY+=fWH^$=5qmqjCU;b53T~k-?G=AO#lD@ M07*qoM6N<$f{0&pdjJ3c literal 0 HcmV?d00001 diff --git a/src/main/webapp/ParallelRunner/icons/png/chrome@2x.png b/src/main/webapp/ParallelRunner/icons/png/chrome@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..ec0774bf8932a175b4518635dd4140eebeec9d2a GIT binary patch literal 2648 zcmV-e3a9mnP)Px<5=lfsRA>dwS_^a(Y;*yJc<=WDuqf5RTPe#8p`2Wo>D?WFyWDqU=s4qK4yCV-Rxv1+1<=c zmX?3dCinjTz2E$I{(tU&@1125HTbKEBBYCFAzi)*@#+;wh53*wegtZ3fVx^hU_f{T zSXej^5ecDZI#|Df5c&-OV&nZa3kMGCuwix^#KYe>zsGYSRo~S$LDnq=h6$7D`y>#b zpbNuYNxxyV687EOVc+{Xq&wyAm>r@SV_<`a!#M8+utAx+v9uf3)Cl{It*~#~2&ukK z_l4Cc3d6HtT<|hjdS5l-3K>m?NhgoOy6RO(w@VZt_mbf&X!yk(7#1!80s>WEN}XXg zE9~pvqm}w2{OM~{&yoa%)HE31Tm#m#w<@*v4I__cefifA&zw{RcrS%mP>{noVf6TR zFC+MrC@Y2a+3EL%QGA|KQxj~zeF5U09X_Yc2feRYRRt__pMrFws9li%hX8jfhS~GI zUfT1DH8#Myc;0<$6t~7k&%C(*ui6X~j~s@0>AY8^`(?nEvkcPlBOa&Yc`H(sWt}+* zV%{Z>O7~MI3k^fy&Mzq>>!O&J=dDO*hw(Sd6@vFGBh^&X*}AmN^o;I3$16@DGjfQd zi-$9YG2>yUIM5%BAG8SX3wOR&ohbLqTd~qwg(*jWg*6#D7|^+& zQ{ZMXEYlu?WVOf&Y6&5&4}=k;!TM%64p+n{(kbhCgQ&&SA}6od&f-02vNz%V{0-PT z^g~c63M3@K@boO$wr^I2$%4%=Oql`0^qD}Mf71|E6L1r9+`>k&5ntTg=jhI>DZu`c zuVoR#+=XC~Q8Mq1FwzYO+?NZ(qF37(RcjGZSZT#o`qmKrzi5sXJ9_5?>TLD$^)_Dp z7>~q`La?C|U=D%t`IlhL@$5`kNGOc2uZA$@QCXi8CABu}IDZ!h3+qr+rQFI%;Q<)i zBLvy~!_hTV-ZTpRjxvsCY{kX5@NL<53asqp=~$5ZjI)os|Llnn^Dir8n8}2It$P%K zsYvkeeDx{iR8CMIzOle@fb0Or_`)kjOp{BQsWiC@&h-lfMa`X|1AF(PFJ3l$Bg6{7$tj-w!q#h_dcDY%ADg_6X&uO~a69wD#)1iSmTGO* zQV2CRbr1YsZtTVNhMOKQQC`>aZRi3nud}&G%I_&)4j$aXtEKE!5P}4CB`uq1!@B&9 z9-;X`>#x=ZD=1kzwAcV4GB855;*mSYaH8UL8~L~p|Aj@d=2lot-HmTODNTlPW$ym% zk}^~p*u~TuS2sT>z7>{D$1x(9wXGPR?X|ih?7g*LG4XM!W(D67h6l%rW+_szsu%-# zZY^8U1-iL#8{C~vR#Gs264UX_I6XQDqf&xhmjOg_Yz-G$c(s%<4nlfZFSX*bT(z|t zTdr-Bc}^_Lih+T@|I*n6DjmF*70uJzmUj0aR8rUBaZRZZhBenXTF}%{JTWb1x8#hoWU(EAh%hQOHbCo>@}4XD{3yHVf(nAv!P;sUh9llWj9@6YW@A@R6c_Rz^5h zJgjZy_$u?&o-=?7J?^b?7o>*o-Fwv2=1e$pgW*v_)hoG4^2~epjla3|z>yX2n38}2 zDm-Nd$$Uz(GwFsXn*A=MTPqb^Y8fWbGfIcL$gM5dh^U}QjETvT z`?*nno|=e%mo!o;Q-=#>jVNo5PGW)$=oe?A(tsI*Tf6pV1gZ3GNVYpNo+cuc=D`A5 zUP{b7@jQ4Wucz_+Y(A9{vXfe}X+1a&9bOv9`zbjMx6n!hn2@rC>X#FpTaoL{PMM)W zT`9_62CgsIg4LJTz$#glgBm&M<_g_LF(XA$Va}qGoPUpr%|f!do5pD<#d+TL^s%`( zPJ{%X%H_-42DIs|i(0P)qC2vLEBhY8%1Fs>(=)c%c zz7i2Gqqu>Kd%3-hv{8ksY^}SfCYqTkXLB=(D=Q4+9bHUuSemY^K=FQmwx4(X8G45F zkRhd8t039i&*WtVH-evAETQe=)5b8aGd6ZK9*=i=7dH&QkY?Hq&-S2dt*cR~Osd@D z;xzr|wMUlxA<(IB8$FMPaj92&FM{5Pq|H^_I_7rIMnr%se3BsDT;?{ajb!m}kb9rt zQOT=efmGstr~gW1#XRUyQBP-LZ~~r6Yn_8L;Ys<(Ss(Nk?hhCz_AJ zp^<|yGJ3cyA>DqL-jtThyc&WDCJ0Gu$yvNj;s&28iUZoGBn|R9e$M6hP||R_JyFFt zzd4@_+khVC6lZ_aRXU7EQRt*T{9=KLU@0Gyqv)@|_QtfkV(yBABL-mmu#K2V?pjNm zobY&yQKTr{dR?_qjBW~xngNz}P_?LwTefzcT1N87yuo5Y)q?jIU1JhPgmX8*k(D>tE1&>jR3{y{_@aX$vqd zak7)8ttaI@O!1)i^oR*m6bc(h1}y>T#f0A0VZ&S(<}c{aReg^$Rp)WG>H_{#o#%KP zx_#ItazM>HzI;7I51BCwh$UmFP9H`;*9#d%@ldb}R`-9u8P<9R7SZA;(M3^I?`UE@ zq-)JNpMmnGpcE?2r_ysnzbWaI(OSL3{5>Px^pGibPRCod9T?u#;MHc?6dnS`>azH{7Fo5BXup+REiinCV-pX=_ih`)1qJjsD zsH~{pw<^fu4TyN5iyz;5`-zHtiU=xrg3A#I2?RnCa*}hd-d8=$Fg@Lq>6z(H5Z?FY z>#kR?-m7}kRrTt<*BvGipuNE9fK*fnY0oZ5g$3Tfnkt~79#Z`g`HJQyASoFvH4R8j z2TMuyUQg)?q5nWI`a`n4y+$C*Wo@lQY5O*KHhvAycV9!=z7>+&9g_kWV_@BT$jTH3 zodsdU#j?_4Vj5xNHc_IqV;kJ>uYza&T1b_LBkW>iXq>P@tfJ>(B#iDvmjnE7UFd`1AG}U35-`FO;68z@4&VE1xVGECUrY9 zwv5(Hanh|2Cr$z46C!J@gW6CfdcOG*?iZehr+BXp(QQw{I%dE!UCvH=pR0NVc5osd;d(`KWD1ZITpj7Fp*n1hR6XmJpp1%Sz$AYcf1Vd!iP6JT>Ho zymiqsumOXj>Xr~`D}K6g+&uP#Q6L|`R9ge*oj1bs?N^biL#B^NiPA4W!g=ciNEKyK z2|Jz}NzKi0&AtPk4^~CoP2JO3+WNEnYjI&GI#~FIL#B{k(Dfur#f5O*dmBy$1#-o? zUS0$b9aHr}_$RTlLS6%<(gS*Vo)C0Q6k%Dg1j4Wj!j32GljvHy7$=(oxz@OM$u;+G z+0ztGi(!>0UOO55S2-C$B44I+)-6DJX{*Bzt3;O93&PbCT4iz~S4vftaL%9I>JY;! zk+-%?n+fg-Ia$H8c@x~LUJp5ZT}nh+2Z*=a6_UxxP~m=Y0i?aVHHWI&og3XvSh8mY z?(Kc2vVqG9$An8D?JrW|O)kl?mE;sKt8uQYXuHh%^@nBtGpgp6V9fgmKE{6!e1uWi z7ovYkzhl+pf3wVd5YGFi9m5%T$80vR!9yYB4*<*S4c4;{SeIOYye-E&D4s-z$AK{$ zC!xwwjr^3pSU%)ARsWqc=#2T}Mio991WQYYaM2|Y&bAkw^}iV zm-oDiW{>i$%%_=f)p!M+-U7?$1naz~5ck14h!bu)Ar#2R?tc=0sremc&E*PxRJ2s$ z&7xJfEpM^{Z<#&|o-aO$$eS&Wz7m!P9tG?v3SPm5ZRIWac3&e(>YONVaHG1(jr0T& zosvX!wp%g0TOtN@I=-g8e@$Gt>v_Ca@^SE(U=!o;pR-mVJHC^m&i(dsxSoAdfzvAR z;JP?twj6EKs^_>P4i8@WsTv>cJc2{@u25utd{(jrSM;{y*1_pWwfQHLzrL++WF>mw z!Ic{(`q#tYPF&b&IG*VLuoBHpp7En0l@u%SK_%0icQ3{A?cVhFbx6=5+St!6)*8aa8QLo#nj6v{OYw{C(!w4u@)-hA`x8 z&9=hO^B_(QGT4t&^0jXK>isb(Fi_}sw1$pfU4qh}rGRD6AtPP63#4S49Qa%?MCnoSyHQK5DmZo!y8NbM1NaF?0kX;SAnn#e6=+|9PqVfJmAurez$_gN?}Fqgf^ftY-QX4% zXqY^d>dSiPt2*lRz%X-0#XJOJ1DQPzvIP9V$RC+L)?YO2##suX&Kcc8UvOj(xYtJy zY_DiRJss`Z5*q23LJ97@i8%RdYpK!U}>v7IwrPH@IOOCF0b9fVpJj*y5aC9Y_9$}r2I}ve&26M8Z#<1Uj1tTOuNV6LAk_>lZd~m?)8Vc@H7rO<$JGQM$KQBEFT~pORp5(3$ z?p|zVuEbLkJIBT(p!F+-Zy=QMeo}#t87o{&hR`L!I3?CP>#$<)TbiA` zrmr1VG1!N%Ng6X!q*%e2ejx&4_20+LU%^03j$xKM5ILi!@qX{*iXrg05 zviP15x+iu;iq+UBWK-pj_@Qcxs&5@Be*Da+EQ-vTGp#w_1*5W&sbL?2EC=cEtExW5 zjIfasIgp;;9Rl38fkp!kif z#NnCe#=j+`PAl7Wtjw0IFqh|gpS;D-XK?B9@DibGXL zk54{FZYwJ>H=zr9Cg(-ZEJVvA&U!qw^>H{QrzXX)u8H_^Qa3pr#AcDZqDiNPj3aYt z>Y#LdLGAex5fWM`{J}FJOaPWVT;}S}#d)phZE$1R4B+W`kK{i9io1nm&jb2vD1`78 zMe4R3Y=T=6Y4SGX(|>SIJVxdvV|34CImsy`!=n|_-ieUv)`cUBs$Sq35OLk$S7Iqe z@WySTH%BGy^KVpA0vcVCGZGK?Yh95(@<0%P&c7e=VLT~Z zQQTP8G?;@Khbq$&A|0F;sy1dk>p%&rM?tX=jnBQthd1TQ6Qge4JOeyoz;rmgj5d=( zQ^YWVoGEEn`*|yrI4JFO^s)E!SDJBC)UXdzx6HtbqLpZJo0Cq$vl67TMP_v0%QI~Z zARIfOD3r)4ruUd?p75ib`LteM_$IBvH_2}*H0lU;Mbas56H4yrLc!tWFeZX!%~X*2 zH7xYT*fmAxvr&#UaaUdSrp3$ zhQ@A;`fuptKx<6t8qa5B-ImidR)<~#1?o~_qL_eZ2R=y~O_#v7ZF)Z;cMQ})H8-RK zkC@UACMJQMx{_WM4j&EGr9|G#4sq#tZs1es6t7|6nlg-IOu6jI-LE@_@ZB9=LEq}x z=_?s_W#k}Xr@jRw4${R_w-Pxw{(j$!XDn=U(}$Z|d^RY+T?OgT0tL#50u$oAQ#eV# zw?85!@=o$8wRG@e^h@b&M4!X*;0}??a{i{GlS=~{mRkU6i2rMp_zU)bH=_GI5Bofw9DUl1{ zj@73I%*Wlmrokd;o*pCVhbAq5yHzU^DIJ(g4hG{q@XS7(6iE5!w&-S8)JpV?`r6#T zW67XJhOd+SJ?j}gZ}o{ecCGo4URF0IpN5g?B6R*IP2tt_`h4^oX3R?DqvIdlSb63$ z+|+#{xIJeCOw1ii8(Ef;mDEJ%C3z$G?C64O;?!Cwwh!-nTfyS z@#Pm08h0<^(`ebdb z{R7J>&2Dqm&pwpy>%9Egs;{8HSpsRtFgo5f>E;ti$S98x9dGh_r2}01fi%(Ho2Eox zhxohH{DVd7%D<&(U-=KiZxd<&$SkNsu6H_Vy^mO*Q4#$}zbR-46bqwH7QJ@~ra9P@Je?BRsqHMlt6uEL_Rv824J@_27Px(sYygZR7efAR%>jNRTzH0_FLC>Tf1Agm325#iEfLEA_EpNsHiwa(Mg7)Xown- z7!x8f@t-Cdj7s>S@dpYTyoB3al!=PSL?Xk;ra_o)%I3yKFS~Z@{o?zcZtd5u9a}S> zr0I9gd2i>uS1C-u9D;>?`?nj7f4b1_@IzJsBi;~J%-7=8m3ffnN})Fh>~3@7$8Ha9 zE7zj-8a*sI>gZJ(+FfY5=$)OyKnUm=4Pek60^cM@BcaSF;{+-Bux$(*Z^*{ISL>om z58#BMUohSSk|cq>^5C^uf|ZZeQlgZ|y3(XceZyX7 z5Zh0V;2**k!QHqQwVm3Q?e=sF}byyC1RD#O8tXEi{9i$S`))&tNDpR; zD)iIqt=Q9#e}?=*SaG%*@7ES0D?>v4K|4ie#L`lOjQc3$*;&7))!-la;@%wEvif_OW1i&L7XyXP*DoJd1pTOJQX;Vj&!=j zu?U*Z!2mi2{8&nnwf7+tJb^Gad|@Z0F^97uoao7rP5adp!PB9s(=Cog;-BvGVqrlB zJ|$&3vh=A&2QE@YQQ{Y(xs`mJ3jJd-;9o%AZ`O^>4^j#T33nzMBs16vakjNQGbfeXvebWBGP>U!{vE zJWVC7g=*h);I#RJif^SUV+tAf$MuJ77)dDhO2SnObV8vp`QzWmlxHcwpZ>}r0!v9? zr)u;Bjn6wco=m6qjYnV3(Vo~se}IFgY_ z7Pqde$ilm;3&ftx0}odgt|V`*%17;I)@Y%Q8hOEtUu z!W{BvpR&fJLhUu;K7MsW-U!_D`_U>;WriJMJ1V{HElaO zh}Un=gPA%#!$yU+x!a9>=f*{l@Br1k(JcJTHPJ`Sfqlc>Wj2u79lr4DPplZ{8G}%$ zSHnvU(>c)@t}oVL^I`*8ub++Fl(b^RXuaga8$S)xkmM6j#?e)6$;3L!pPS8^l+5WI Z{0A=W@cz4Jh}8f9002ovPDHLkV1mNyXyX6? literal 0 HcmV?d00001 diff --git a/src/main/webapp/ParallelRunner/icons/png/explorer@2x.png b/src/main/webapp/ParallelRunner/icons/png/explorer@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..38d82b40a1f23f5cb645c2dddc36ea2d1acd25ee GIT binary patch literal 2510 zcmV;<2{HDGP)Px;h)G02RA>d&TM2Yj)fxV0GFc}3GTGP^3d&+da5;djMHHb`IiOXHP^suS2-;nW zUF@-?J#Fn`tF1+9DV#z@k=Tlwg9ufYQW_B#mJ|^rfC*&ZCVSHFd&!%;H}l?`H#13` zeCJHwcHh1CfA_!t9!EDILkP#KJ7jNZi|jkoBB$#*YBp zC0X1qheDNOC=htQsZ(A!(j=SlJ5k*(4u?Z7$#lu6G?!#2#YhZjsq}Wq!LnAlfVR2G zF|y^$IdW-MtVA_|T&+L+w_XZMnk3fgkhx>sa_c3DGGj!%q$fBH`EKW_7Ww|JYH9Bh z*}f<*IteVT@06eKt(BKbymE26OO{Pdk%g0z6gD)Z%I{_cR`a^`WwQA4t-ZkDn9! z#}y-z9P5<)lo%NaLdImcv`PN-Yu7}IVUb# zt!*|s+t4Yme(04wr(5K3MZ1(Wbl7?`9ult=t4HDS?P;kp_cQK@h~uD1kg8d3XXGo` z(AF(~d%scs`9H6`Ti$AmAUlmH0Si8xEQ>Bnmelxgm{jEM!iw+-tZVI(wb(0b-)WF~ zoDUR|z{+<_Op+B>r^rQ63!z}eYgM5W*a@@XNr>)07S~I|021a;NF09!o1cWI(YkKx_^7$14T3m0VldySSI9I0rN&y7m3 zN8pZ=EwXUy1x18g_KJt2Gh$`kylmNeM~-Ye?v=u0O~GCX`8hda6;#TP->NlzH_P2) z!UZ+e-ap?a^Pj&UO|*S1;D#`GczUWlaAm3-#n)Q~Rz6wNZt+I{Jo@IeH2EI(r5P*< zq+a_X*pddU6|Nucmd9_*lu@ZMvgv~+S+x_kAf?eD;a9UW# zMlbRnS8esobomN8ryO|5jACcTK)Uu9S}^`{=sY7~ZKyfR;Y9xCKXs<#lO29KD^ucOQ__+t zfB-7~#Mp{SigU`HP}GZHm5hZCr#hnK;4^SoUxW}^|8ApHz+R06C6#T8MYUwIo>dK5 z^r50E*>W^c`q5B+3@l0ag{X!nP3cNOWQ5Cd;$-83Y{`cMY6X6zCI6^UymYH}!Jc`* z9mV$#)45dvEJ|OBewaUKGHsae@exN;?e;C^#EpTv*mhTLP~tdFN}NMB-<~7x$oslDL!Ys=h*p_y!fD|ly(y8`INjknVcKhD$d{5BXk$JKsW}u;i|`}i+k+m2*!;mDtX6IKKab{X zHKrO!Rqw2+EZ4xJ7^;YY-AtGg$dJHbI<5WvA(?R^d@R~?+4Hvuf`$3FaPg;`J#uA! zpPC7`pGe-zh5bwz68MCLFKA~_`h1}VY3=kIPMZK0-GwB`dnW#!-2s@Sj1~l}ASGv{ z*bQU%YuBWP)eX%o<~kw)qX@sep+}$V2;7U{u36|IlmQteE`y>C=E)oN`4rLuJ5E}A zD@N~W@7+16FKnS>Q9GW3wj;CiPDFoJ?=}z0n!UHDv^8Sl*!R*a3*;7QKj})Sm%t<(s5SdTfyg#1coZqM&TZ5r2k@HozNSx!W$?YxaGO? zN=b-SyI{{46#LQV({;^!QMGC7%H-4lh1%2LJQrYJOhDL!>VwWSU7F*NwuQ&Mwi7zK znHyXz#28P`)yH)d0_n^$M6bm%W6#|P+=m})ThWOd647mvf0nv_C$Sz%FVj4PGO~j<4 z3g#Tt#xz)&>$`be|0XfjvHIi4G{V;{j0)#YKczZ-CK;J$7?z?legfJK){SrBgZ~cE^I)Icc?1PJD!4)uz@lcj zadd+0TbeHqfhA&9hs&(-0NrOWdc*u|dBh^Cs~y@|iwu#9>_jK3`qV4qBTG0Qg)%*G z-!OUb>QteQ8!RjspCoTC$x|w!?2hRe@kD928t=@&*C|;s-0r(dI|inxthayUMWJe| zc!T8fL+ZS@@pafXt7fFjRm04=%dB6=)V1fj)xZ*2^z=7IDgjfo7p(5LAyT&)Cf^Ts z)z}UaoAsBM?2<2yb1S--#joMQ#ljkuKvp-uj+J21X{b1Z8qcTSt{0}SRF0rY#`H3O zR$vv=SmY#_bCz8_Ye+3@#I<%_wms@odI?UBPx@u1Q2eRCodHT?dd9RT}?^-MHDa;A_nA?U_d3PC+Z1uo>z!>dSWQ= z(DOXcGM1iN;$cKFU`9|-6hR4!5<~?R1w;jwWfN?U?0sKL&-V1Zndu2VJGWz{eBvbTP}CqjOJGol=mNAi1edv}u*{y8W`btP#LBNLg)* z8^jw=%9fi>&epc$3Q&I1i!d4=`Mgp#>~3%aau7z^xFgc!)PqxGNRMR6NOHK3`C3`L zwNCC`wNEycG-^#|j>(q`k4%%e0F*$!_DzjE{8^=JDR0sMNKbUi1pwf}qtaz4=EP8_ z2?P7O#bxq3uH7ZYDI2Et6jvx0>PY7-`LSN^T)tOhGVFJcOqX1FT&7GqIzzIO1CK<1 z&x&^#L-Be=A0zQ?5TTTdu&UOir-pN&4ovWcb0! z@)bm`m;n^eE?e=YImuJ@qxez*u3BE-qH$Qtdx_w{i3tu#OLRycI4?inL$Y1cFE3Gg zWhKbRKh?|i@0ZJt%4Tsm9CGQP47ughE|QP7b`u%ehT_Wh1N4{57Wrs+8wd~1W) z)QA!J^oA-;h_0w>Q_sTfupQ?gQMtU@OAPnU?u6J*YJKpUCx%AO7fCg1i#Sek}ETO@D7 zP!cL_E^U%yG2+7plrrO(mv+m{HI=eIOw;O71xYd%MvC?zid@qcmddn6Wt#XCOdlvN zb<0T5G_bG${idWz&U&d>(-4B`fVu6_c(cz>D3E27yGg&?MDyXOZodh}G7euFjmuVP zB{)1qGg8QND8+wxIhONK~1qEmYKpg%2ZuteqhhT|T@q0$*%ILl++Nm|L3SEU!`93V) zu}++tmR#1&k|p0Vpd3FJzfqzYG=c$uR-Y@6%a9qc`p|1gqG4pxyb`z3H<;_SS6fOS zPoA3}@b>;E2gB))!Vg31P%y+f=n+`7NA&)6RPx-*Q~7H_Q;3i88xsSPTAM<`$X@aKx;2MfmFnJp;&(?3zBJWtFYg2J+Nz%ESc0zR6f(T2~P2- z@4#qa1$`U9yyA~3whVZJ&m$t zn|ccL3+Sx1RRM4Mx1re@^GPzvz5m3>q>a!Dao&9fQ$-&HVueF=+&y((zA%WvZhGNs z^|SfBGo5GaFzNduC*;ffM&)X{xVg=Pt1IORi=R2qrJI+GClW;O=gqJW*i9d7t5X_K zd;!+C{0$=yFx_`N^uj7n1xKhG!eSxxBgZMS^;`&#)sEJnf5g-51K>H!TZnDhL#Wk3UizwD;@ z5cbWa1e6gFD#w~W*BRp>^$YTxYu+ml+Q=M9N15IiE>DMIVK;pXD?RNSMp6R091$31 z;+#1XY9ym}%~VpmUoM|t8d9Lb;O_Qt zwARUMg!%%LCopdP3qyX7evx=zCKymOtonzAbL+h;?UNb(-#xaECP0hS$ugky2i1fT z1Fzq(GcJQ3p=*#AIqy4fQ&ndKCzNLjdW7DJVA9{nHv&dk-HXecPh$|OG11g~Je+Oj z8O~zag2kvYltxrIk zA*(*{sePl9qml{&6Hhx6`2>_){pToTbJ#UMx7SPZIfu?%6WAvoiB2y+I1n4Q?n7NM-EP7_a5Y8s`_f~d!)D7m*tQ$XR*9)R%aoeB?+yGp@i= zWiky=mTpv$s*n^b8a|HCKVC*EL)KrupsO6DkTg`7IcfJ~i8C|tt@w&AW{UQ6;|pw$ zV>kCH+S{p+Ze9dK_9Y^z`s4fzbEhf;?Q|r(8l6w(lSe_1eIF^$tP|21i42$(9aP$o zzvp$DBXIS`oIe8*8Py^rYh8>IlAVd@JbW8P2SUl{b28aLMONPoGdLbTGgsb3CfyOJ zlGxFS$-2zw3-wu?EYfTya&g9}2ScYoR$YqJ=i5=tgmvaR8u6J~n0o%iLak&_sQq_U zq58F%xl{e&47ZEtTAiMX=j0R)jTEMwlav zWy-G`nk9cliZ(ScCeSj~G1iDV_%~xzvL16N14#8eN=B|q`cj=7Xdf?5xs^Yb5~A^! zKRbQ>f%?SbG;myw^u?)zGqs`yR?e~7#&Oa!yIRfll4$SSIlWiJ-kP~Hba$+Tn}x3G z6^fiFbNfhbvqn8@F|+WNawJ9IMlQ~mWo7)HGw1-0y?6i6Vn ztBywY-zfa7)?NyyPcDL{mnJt}i2m|O14?heQ(sielPJ`x@(dh?x_6vzRL6{cQ>{}) z><_W+2s{r(9x|Hadn83XF;{hO<37i-AM08tzOl!+Pg`e+pf!K)5s?mULN&5EaQ-n? zN@b`f6TE9gjwT)O<}5Q@j$*D%+u?t3uy9Kw49kpzqWwD=R@_XSqy13apG#H_j|FnT z0^Ztx<__h94nS=U7Jmv<`%U#AOsHiE-B;nF(El$()ox^;RJjj%q*jd&s%ym3KFtMk z^O6d!=(MV1%voYiJBtmlETyk;Kt~zX*i~RMEATfCo50omc^~Q0xC7;S$44QrUG-dc z?b86|Xd3$Tu7K4RSygcWj3Id_Zbd&6>&|n&+rGD1^Yi!vP=5fP$C^%mflpg6-KHPw z3`@6@j>%kiue4s;BG`u~$E6WvIs|@JgYB&329ys--}Va@E7@2DgbZiOu^DpJ;4J*v zQ^(Wstv;vT&h7Q&jt9UTSVs9pA0>43ldLRhwV5~|Lz^Qb9a(4P{_WMqV}$CR_z?d= z#OP&zWrp;&`jYiX7%zVs4AW#{{4>0GBqg9a5Fa5}cA`0tMt&4PZ8@(SLY59MonZtXH0cYm`0000Px(7)eAyR7ee_mS0R9RTRd5cXoGJ77B$1P!s4wV^KgGG*~T7Y!f2sgK20((jth7 z)!06$F*QDj){->FszejDR%wh6OFnu=0u0X@Ow5JIN!Pe3!@;@&oh`R| z*jVUBccf^fD3Q#}P>*o*!VIsSoy4mQuD9})@!k#D)ZdYbLnKy5%%p1A{U%gA!{C%b z;}@g+?hS;iGVn2rCvk@*v``ynC{#d6ei|Qc&7&}50UT~yjb>#7UqNpxeU~p&{qeA6 z^pM_8m8;8=B?}6~I31Z!uyVXBT;DS^38TF>dBm*u2!ssAJDO=Q+Ssk1V6*cV_NN`D zO#9PTlql&oN;v3m+V%#%n*r$wmu|4LXANQ0F@k3n$Fq zN$z_c}dz9H&pAAcv zjLR%WLpiEN^3%;Pb-Xf{9s1X*ag1)}8csRujeQ22pIOoxsNvQ5hnbX_HZD=}M`$%q z>c`?J>7POquJkw}8aN%inS%x$8U0;4`Xwr**NpSu5urYUcyb{)9$mktnVKcka?nJvWB@^Z`V0)@qn2@T2oipq7qc1#TIj!f}xY^-fB) z$TbpMCmrdC9p8W&kjPEle;hiSVztZ9H|~Sm>%x5^muGP;-1+G8n@4vjt+$L!IAUgI z>z{>nyUb|$tE>U;d*0S3@*1Pzfp%o)i-?8zZ!B7tD3;C)M5X#U)^3ZV6PuZ`dG&{- z=Y3?~M+jp+t}qsmnhQ~~6UujoCoh&a^WFaQ7m07*qoM6N<$g7%*m4*&oF literal 0 HcmV?d00001 diff --git a/src/main/webapp/ParallelRunner/icons/png/firefox@2x.png b/src/main/webapp/ParallelRunner/icons/png/firefox@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d97d58bc9ffc3287feb4ab22a59030499f042fa9 GIT binary patch literal 2424 zcmV-;35WKHP)Px;GD$>1RA>dwS`Bbi)fN8U+n=|a&5{5%7zjub7$iXuq!EJ_J5mHir4+0q{tT#8 z%@h@@=uibM(=r2vhUqx93WCfaV`H@y0|+>P{d?PU-^>0y z_PzaiyBRn$$-D2|bI!fryZ4@Z?zzkPiI76-aQU&b)`=sHF4SE1qV9?ZjCa*7O0A@u zdGrxD49zqlzpoMF2MU;+Yn6B@>;|}00Bh{@VOxz8+o~PdU+;p)m)N&588{T@2$(u7 z4O8>27-%;njWH=;4FqWUzIK$I?t+-2f#*36vkGi@V`2sdB>^xBF!t3s)i2lX67iQq z9avl0370pq(NQ(1!W4`go*8S$%XjuchQO;xL}zIOJF*%W^)z7Vr?9Z)oD&Pb{t@ln z@|sap_QFesg~zHX{V{#GH6iQjpTgYU|kw zsKWiG14u)+WP*J_)+TFPqONAZ>x^k$9oU&q08bZidK2L8fP<#nGh}?l{&uK2(dUIS zJZ9P!v$1#t&WO2~XZjZ^?T_PCVI$0(M{1L`&HCUFvVeyDfb++w<|2WK9(lBwn)@m| z$2VZc=4NcEa;O^0=YPN(!g>@M&a2iZ%5?ipc*^lEs>ECHy6`c!rfY`SYOcgsbaOD-H_2CtJAP@IQQIdr4}io50Q^u)DlPlG)!CS@Bx! z13(`A-Th8PQ_2zhVQ&N|rf~~*5&Z}hbN)73)Wc}{ydcY-*}59vi#Lbt)szR7_P*CXIT5LY+;`;ApWL7A>8ZBOn=Ad!0fdl`m_^tIc&TmG-}6?H=|PMwl4F zHz|2lpGogV>3{Qom6a)Yb5Urtu=^F1d48eWnuT+t+iwo)AM%X~mNg4agoRu`MMV@F zww~0K(^Jvmw_&DZWm2G6yYtQe#KXot!7fybgM($wf}f64goj7lX+r4Il+#mT=ekg2 zkRt>=`T?Dd?gvmxvFI$*PKnj#?;EI!{%ko;z*;J!3+bq39&3r^1NwVkhjvKivcC_u zdM9F~Wi|5ndN^s@V0&atYCXY#$x(Am;RFTP8uR*%QiPD8szQ7x1>06yYi|j1xJOnM z^{OvjEfhF+)T`Dd!`$jE#**&maiJ&1OUBlBzI;i2nrR)j902`%}Y zV0d?!y;d<3gZNhb%JfZmm3EnOHarZWFhyH3dd)vPld+b9(s)3zBu%2H?F^nG3Zl5C zp(JP~V5W3QDVcwpJyYURpKjcXv-X+TZJUoH=}%zrwNZnL6$5>)bc$ONBErPO66fBa zVVSw#qu!AkwMzCME$@LH78&L6Em$OMPztEL{i2cS=mP%J>mUTM;%N|e1&E!1e3Tr8b@^n1cpa)IgQoOe-qBf99 zi>T;fye<4)t4f>C(}5-Xrv%KHMg;@(Q&@-L{P#gi%&q^)@>hIdT}BNl zlc`Pq{@6wliWbeJJ*(JwLaSPvKY(VS$<~w1Irjyydy%$qf;DWzW^Ov#zEk3SUGrE| zz@Mi?=>jRGkYLlm&z1orX48jclzTs5PJTZNbb^IH(LlZDnym>chmQLj(w680Wwgqf zVd{tsj4^JT8|YWBJ-q~Xm3t1}am`n4qkt|p$|cEsv>x6ByWC)R0E;Z^r4)L2UEF1BKg!3^ft1!4BXS`<#71rW z%fOyD1DvFvEp+1D?!60T?#VdlyDh>V%V|7f+>PIuKTG}^>W<$AL9vEHBPKOVp6l~p z0&Qm^I-!T*q(n>wC16g8d1&-!!6^!`P>%6t{t`y>RTytPt$&2VJCsSYU>03}aiNpN zHNZ%^eAnU#P^_+u6)<~l9_dw&mHJRFztlnLELw=68U?XSE>ie^7CU;#_@-vSk@Xd|b*e{WL8P;z1~ z1q0hen$ia>(8Bq0;OH9QN^O9Xnx}05Fs_7-AF~wEL?XtM0~TnhsRF3}H&91GsNMvu z*-pQjo6)Qfhz&tg$D%&u*eMcDXU^P7( qpllLYoJU7_Y5hcT-{DQfQ~p15102F7jCuzE0000Px@Qb|NXRCod9TnTs-MHc?&OlC4Ul`~w1hzbD&4|Wwf6bbMNc&y;AE~0!QDyxY1 zE~ucZg80StTtRVFTvT)w1QkUDK@_<`Kp=qtf)F4HA;%Rn@E3d5DliI#}hx)}sw5E_a}~!ijwq4wT#7sBYlP1H03MRHF_yGhce- zr0Q{2wh8&!M&#$1(4&R*ztfuS0NoSJ*=#Xhd-wvs` zjIP4Y7NnVUO_mvtfP{eProO&%za0y9)Zp{tI@CJc@w726UaLuuq4^eE-!%>WJElUP z06aAXk+J$3gSk_d33p$dfl=MkK-g+Vnt;fI?Au$a@%-8<96r_b z*R`on-!|QdNqsUfrl$>BbWHgmx~V7WO);NmZ=)BWLJzI^0Y>a$5f^uhx&sEHhIch|4At zhy>&f%K<~^zgS%E#BGa@W5=-unbjtrt!oQ2=3I3qnMp=pW1O{s(W!8s$@T5bYJf?vMS_s(%&Z zPpqoMV=F3Tjep$@dvLe;J>=Eo9mMVP0H8j!Wv`=b1)|5jp4h(pNqt$&VI^ z45EvA%#JW)Sk(a>*}5>AOiA8-Df0-pQZcQYVXqiYRG_HgMttlTAXaygVF#9`O++_+ ziI~QLSJqe2MXz@6JAvX)fghfcz&=inx}tTiI!j#CvNz%*;sNQ435@%l&7)sDZ ze?TJPM^^!c*Az+85*6u8fBM&H6KGuan_|_lVsy>ZSWikwAPdbAzq@Q5a@W(?Xtn{@ zEdp%0LUzbK{Oer$m0|$7h7_Fx*P6Zw0g&^$CgFAFdYMYx?J>Q6yf4!DYomAOUF#I& z8~lHE9ck^cn|i>*Gqi?kVEO$~6-{^$y=q=kmueAibVogD`6SWYhLQN*)m>71mhKeh zTmFF-I{)yswZep5=3YKNo~><}Eh!Ti2?g=!2H)%?kW1xovc^T>F{aq>gga;{qJ#bj z-mp9&F@N5zyg(=dY4&m-&{0Wbz z_^Tz{1QpIwTY`6tO>HR0gqA`_wGU&DHf$y9>={g@jyE|!Iqf~r* z>UnEzH^V@EGML8IPQ_wpKkBO<>`uQ18M+!D3oTw?Bu#x=NQVO{h^rq3c1lf>;0m;g zANOPus6DZ|5!5~I4q8pySCJNN5H!xzp z5cA&sAhJz3e*n!;5;rZAv?M4}=E=qy0+g@S1TJex&*L7*1H0D53hc1w%!t)oZd?~+Q8u#f`baF}2l3c8F)>*IHmshlAA|9=Q(*U) z6V?nivErtarM`V9D(C}|7hfy)#Vtq80(Au1?REdatopyIDOQ%OZDf2aqC;!E#e5+0 zR4<7nD3FB#Ykq1shv&tkO<#r;yEB{y4$B#o$h)9KJ`j&255!V;8x+=PuRxA@a!_dc z9`9JEB8?V70_mtbCon2M%w{1`V^7>9zo5#TJnkdX6DW zS?%>FX~}ROfykZ>$CI}p!22#UQeX6LASrti`K8#f{@&RG7tsPpQR*zQV1+xwy8|R9 z#1kmnLLeUB0k|6CDW(Z8Zy?P~ecn6i*QA0*p}YggbPdghMi^Im!yc;jlqby_j{Ao? zpx)~q5_d^$3fOdY$kfqFvWE1T^HOmw@v+p|;`$-IlFDkWJ3%0x_*q$D6-#Y#cfnP( z?{a6|Bd82F%~G*0?s2@H$ka|>hEYb^3L&yU;lc}zi+WU*dW9t8=a?r8_ts5DVf9Po ztx%A#Ca`COK)0F~A)TgoyeF-Q2t*^;t0BSU@E9@2aW$SJ!0J+TuokC3s8^eOGY%n5?mf^;O>UWpe1xAKS)C&0tCi7|ow_Rs#7HzGpm#>% z2~KB+&jH5u!O6ql%sk}+WR~QOdZm;{?r@QaeQ4sPOAOomoAL1$4#!U}%6epX z4wt2BT1!3cX)B~)KkGm-^@x89p-@5Z4XiUH>;+M9uMNpnFQL0$nH`o(bK7Vj9&opg ztC41M`Mb)rDy}jynF&9=*Lg8ReeZ(6%5N|)#ThzUz>Je7m_7{aD6>Fy*1W!=Y_ z7NT{S;~26Ehhws}1=8CSh)lVE49B8cS{m$lft=q{13Xk?31<(4Tg;zEWMkX&ONab+ zXV4PcJ!+q$X~fM3V%x|Y*b$#1&Wu6EAMv5}0q`N6STu~b3*NLm9(84fZO>n$>=y^u zaSt5<$yT6cwGSGu#3t9dI6>ZEOx#nr z_x;861$e_e7Cl>kb1W7y|02UrxZV7b7*{30uE>lVkq<<3y3fn0WQi*BqY2?Xm65b8 z&leLfOqglj!G7Ly=__X+u-BFx;v;EutxrVl)pF#7@N^tN&gs4lF5m0S9OqmY!k37I zbX{#+0J6>bh<&20rm;4D)A~4hm?<~0B39JpS~1HHBER1@|6--c(ToB$bT(#e?KB*e zVcM_~d)+b}7Z^0y{;-noPW%2MGJX)*ZKubrVn%Zd@K(b0H8ZhR#x_E>uF9*#3Tcm7 z6DpwbSZ5GL2Y^Uv=Z>aBg3?uAku!;bZ=4rmVD)R*;5sj6E6%3FM~l-Yft8phluF}Z z*Bd3Gr63weL-)K*!jR0!&$QV-rfxbdc|8qw1BpgF{_zRY<+cgPr;}5fQNdW>vEG0R z{65=4A|H%gFpSjZFG5N}?=>C^zNRgNx9N1~Dj6C$1q~QZOJbABknT)Jfi)$5OGho0 z0V22Jmv4d36W=2lyeI3&VTUU(Di-XJbfIx41{v03lzADHtmZ_mAX4TPML-^PupkQU zi2}p&$#fV_d%IDnF7STRW24=`T(1_crk>eAtJfBtosNxFqK*C-&e89u`6^HR5=iYY z1BSdFw!+9D)*S~vqzBg`q{M?Lc{o~~F5gY3{!8fEOUGVI0s6=#8pwH*XGVNE>&V@o zKr)e&J5N1LHd@=u1v1a_U0HPJnTCvo0!h^>M*a_WKdm2FL|yX$0000 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/ParallelRunner/icons/svg/explorer.svg b/src/main/webapp/ParallelRunner/icons/svg/explorer.svg new file mode 100644 index 0000000000..ae9c6f8789 --- /dev/null +++ b/src/main/webapp/ParallelRunner/icons/svg/explorer.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/ParallelRunner/icons/svg/firefox.svg b/src/main/webapp/ParallelRunner/icons/svg/firefox.svg new file mode 100644 index 0000000000..1583e63467 --- /dev/null +++ b/src/main/webapp/ParallelRunner/icons/svg/firefox.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/css/PARALLEL_RUNNER_UI.css b/src/main/webapp/css/PARALLEL_RUNNER_UI.css new file mode 100644 index 0000000000..4feed4c2ff --- /dev/null +++ b/src/main/webapp/css/PARALLEL_RUNNER_UI.css @@ -0,0 +1,113 @@ +.modal { + display: none; + position: fixed; + z-index: 999999; + padding-top: 100px; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgb(0,0,0); + background-color: rgba(0,0,0,0.4); + transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s; +} + +.modal-content { + position: relative; + background-color: #fefefe; + margin: auto; + padding: 0; + border: 1px solid #888; + width: 420px; + height: 400px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); + transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s; +} + +.close { + padding-top: 17px; + padding-right: 13px; + color: grey; + float: right; + font-size: 20px; + font-weight: bold; +} +.close:hover, +.close:focus {color: #000;text-decoration: none;cursor: pointer;} + +.modal-header { + padding : 0; +} + +.modal-title { + padding-top: 25px; + padding-left: 25px; + font-size: 18px; + font-weight: 600; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + color: black; +} + +.modal-body { + padding: 2px 21px; +} + +.modal-footer { + margin-top: 25px; + border-top: 1px solid #e6e6e6; + padding: 2px 16px; + color: white; +} + +.save-text { + width: 34px; + height: 16px; + font-size: 14px; + font-weight: bold; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: 0.7px; + text-align: center; + color: #0073e7; + right: 20px; + bottom: 20px; + position: absolute; +} + +.save-text:hover, +.save-text:focus { + color: #000;text-decoration: none;cursor: pointer; +} + +.browser-item { + position: relative; + padding-top: 25px; + vertical-align: middle; +} + +.browser-item input { + display: inline-block; + vertical-align: middle; +} + +.browser-item img { + padding-left: 16px; +} + +.browser-item-child.browser-name { + padding-left: 16px; + vertical-align: middle; + display: inline-block; + font-size: 14px; + font-weight: normal; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + color: #000000; +} \ No newline at end of file diff --git a/src/main/webapp/icons/report/html_report.svg b/src/main/webapp/icons/report/html_report.svg new file mode 100644 index 0000000000..bbf920b0dd --- /dev/null +++ b/src/main/webapp/icons/report/html_report.svg @@ -0,0 +1 @@ +Artboard 8 \ No newline at end of file diff --git a/src/main/webapp/icons/report/parallel_html_report.svg b/src/main/webapp/icons/report/parallel_html_report.svg new file mode 100644 index 0000000000..aeb374b8f7 --- /dev/null +++ b/src/main/webapp/icons/report/parallel_html_report.svg @@ -0,0 +1 @@ +Artboard 7 \ No newline at end of file diff --git a/src/main/webapp/parallelRunnerEnvironment.js b/src/main/webapp/parallelRunnerEnvironment.js new file mode 100644 index 0000000000..4404802f68 --- /dev/null +++ b/src/main/webapp/parallelRunnerEnvironment.js @@ -0,0 +1,628 @@ +/** + * Prototype that represents the modal dialog. + * @constructor + */ +function ModalDialog() {} + +/** + * Add the style sheet to the provided modal node. + * @param modalCSS the modal style sheet link + */ +ModalDialog.addStyleSheet = function(modalCSS) { + var link = document.createElement("link"); + Utils.addStyleSheet(link,modalCSS); + document.head.appendChild(link); +}; + +/** + * Sets the environment wizard button. + * @param envWizardButton the environment wizard button + */ +ModalDialog.setEnvironmentWizardButton = function(envWizardButton){ + ModalDialog.envWizardButton = envWizardButton; +}; + +/** + * Generate the browser item for the browsers dialog. + * @param iconSrc the icons source + * @param browserId the id of the browser + * @param labelText the label text + * @param checked true if the radio should be checked, false otherwise + * @returns {*} + */ +ModalDialog.generateBrowserItem = function(iconSrc,browserId,labelText,checked) { + var browserRadio = document.createElement("input"); + browserRadio.setAttribute("class","browser-item-child customRadio"); + browserRadio.setAttribute("type","radio"); + browserRadio.setAttribute("name","browser-radio"); + + if(checked) { + browserRadio.setAttribute("checked", "true"); + } + + browserRadio.setAttribute("id",browserId); + + var browserImage = document.createElement("img"); + browserImage.setAttribute("class","browser-item-child"); + browserImage.setAttribute("src",iconSrc); + + var browserItem = document.createElement("div"); + browserItem.setAttribute("class","browser-item"); + + var browserLabel = document.createElement("div"); + browserLabel.setAttribute("class","browser-item-child browser-name"); + browserLabel.innerHTML = labelText; + + browserItem.appendChild(browserRadio); + browserItem.appendChild(browserImage); + browserItem.appendChild(browserLabel); + + return browserItem; +}; + +ModalDialog.saveBrowserSettings = function(modalNode) { + // retrieve the button that was used to open the env wizard + var button = ModalDialog.envWizardButton; + + var radioButtons = modalNode.querySelectorAll('input[type="radio"]'); + + for(var i =0; i < radioButtons.length;i++) { + if(radioButtons[i].checked) { + ParallelRunnerEnvironment.setUpBrowserEnvironment(button,radioButtons[i],modalNode); + } + } +}; + +ModalDialog.setSelectedBrowser = function(modal,browserId){ + if(ModalDialog.browsers == null) return false; + + // check if the provided browser id matches any of the available browsers + var selectedBrowser = null; + for(var i = 0; i < ModalDialog.browsers.length; i++) { + if(ModalDialog.browsers[i].toLowerCase() === browserId.toLowerCase()) { + selectedBrowser = ModalDialog.browsers[i]; + } + } + + // no match, select the default one + if(selectedBrowser == null) return false; + + var radioButton = modal.querySelector("input[id=" + selectedBrowser + "]"); + + if(radioButton == null) return false; + + // set the corresponding radio button to be checked + radioButton.checked = true; + + return true; +}; + +/** + * Hide the modal with the given modalId. + * @param modalId the modal id + * @returns {boolean} true if the modal was hidden, false otherwise + */ +ModalDialog.hide = function(modalId) { + var modal = document.getElementById(modalId); + + if(modal == null) return false; + + modal.style.display = "none"; +}; + +/** + * Generate the modal dialog + * @constructor + */ +ModalDialog.generate = function(path) { + var modalCSS = path + "plugin/hp-application-automation-tools-plugin/css/PARALLEL_RUNNER_UI.css"; + + // add the css style + ModalDialog.addStyleSheet(modalCSS); + + var browsersModal = document.createElement("div"); + browsersModal.setAttribute("id","browsersModal"); + browsersModal.setAttribute("class","modal"); + + var modalContent = document.createElement("div"); + modalContent.setAttribute("class","modal-content"); + + var modalHeader = document.createElement("div"); + modalHeader.setAttribute("class","modal-header"); + + var span = document.createElement("div"); + span.innerHTML = "x"; + span.setAttribute("class","close"); + span.setAttribute("onclick","ModalDialog.hide('browsersModal')"); + + var title = document.createElement("div"); + title.innerHTML = "Choose a browser"; + title.setAttribute("class","modal-title"); + + var modalBody = document.createElement("div"); + modalBody.setAttribute("class","modal-body"); + + var iconsSRC = path + "plugin/hp-application-automation-tools-plugin/ParallelRunner/icons/"; + + var chromeBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/chrome.svg','Chrome','Chrome',true); + var firefoxBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox','Firefox',false); + var firefox64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox64','Firefox 64',false); + var ieBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE','IE',false); + var ie64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE64','IE 64',false); + + // retain the available browsers + ModalDialog.browsers = ["Chrome","Firefox","Firefox64","IE","IE64"]; + + // add the browser items to the modal body + modalBody.appendChild(chromeBrowserItem); + modalBody.appendChild(firefoxBrowserItem); + modalBody.appendChild(firefox64BrowserItem); + modalBody.appendChild(ieBrowserItem); + modalBody.appendChild(ie64BrowserItem); + + var saveText = document.createElement('div'); + saveText.innerHTML = "SAVE"; + saveText.setAttribute("class","save-text"); + saveText.setAttribute("id","save-btn"); + saveText.setAttribute("onclick",'ModalDialog.saveBrowserSettings(browsersModal)'); + + var modalFooter = document.createElement("div"); + modalFooter.setAttribute("class","modal-footer"); + + modalFooter.appendChild(saveText); + modalHeader.appendChild(span); + modalHeader.appendChild(title); + modalContent.appendChild(modalHeader); + modalContent.appendChild(modalBody); + modalContent.appendChild(modalFooter); + browsersModal.appendChild(modalContent); + + return browsersModal; +}; + +/** + * Multi-purpose utils class. + * @constructor + */ +function Utils() {} + +/** + * Find the ancestor of a control by a given tag. + * @param start - the node from where to start. + * @param tag - the tag of the ancestor to find. + * @returns {HTMLElement} + */ +Utils.findAncestorByTag = function(start,tag) { + while((start = start.parentElement) && !(start.tagName.toLowerCase() === tag.toLowerCase())) {} + return start; +}; + +/** + * Check if a string is empty. + * @param str the string to check + * @returns {boolean} + */ +Utils.isEmptyString = function(str) { + return (!str || str.length === 0); +}; + +Utils.addStyleSheet = function(elem,sheetHref) { + elem.setAttribute("rel","stylesheet"); + elem.setAttribute("type","text/css"); + elem.setAttribute("href",sheetHref); +}; + +/** + * Parse the information received for MobileCenter. + * @param deviceId - the deviceId string + * @param os - the os string + * @param manufacturerAndModel - the manufacturer and model string + * @returns {string} the parsed information. + */ +Utils.parseMCInformation = function(deviceId, os, manufacturerAndModel) { + var mc_params = []; + var os_types = {android : 'Android', ios: 'ios', wp : 'Windows Phone'}; + + if(!Utils.isEmptyString(deviceId)) + mc_params.push({name: 'deviceId', value: deviceId}); + else { + if (!Utils.isEmptyString(os)) { + // regex for the os string + // example: ios<=10.2.2 => we need to extract ios,<=,10.2.2 + var regex = /([a-z]+)(>=|>|<|<=)*([0-9].*[0-9])+/gi; + var match = regex.exec(os); + + if (match == null) { // string does not contain a version + mc_params.push({name: 'osType', value: os_types[os]}); + mc_params.push({name: 'osVersion', value: 'any'}); + } + else { // version was given to us + mc_params.push({name: 'osType', value: os_types[match[1]]}); + mc_params.push({name: 'osVersion', value: match[2] == null ? match[3] : match[2] + match[3]}); + } + } + } + + if(!Utils.isEmptyString(manufacturerAndModel)) + mc_params.push({name: 'manufacturerAndModel', value: manufacturerAndModel}); + + var result_str = ""; + for(var i = 0; i < mc_params.length; i++) { + result_str = result_str.concat(mc_params[i].name, " : ", mc_params[i].value, (i===mc_params.length - 1) ? "" : ","); + } + return result_str; +}; + +/** + * Set the provided jenkins element visibility. + * @param element the jenkins element to be hidden + * @param visible the element visibility state + */ +Utils.setJenkinsElementVisibility = function(element,visible) { + var parent = Utils.findAncestorByTag(element,'tr'); + + if(visible === false) { + parent.style.display = "none"; + } + else{ + parent.style.display = ""; + } +}; + +/** + * Load the mobile center wizard. + * @param a descriptor + * @param path the url path + * @param button the environment wizard button + */ +Utils.loadMC = function(a,path,button){ + var buttonStatus = false; + if(buttonStatus) return; + buttonStatus = true; + var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; + var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; + var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; + var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; + var useProxy = document.getElementsByName("proxySettings")[0].checked; + var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; + var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; + var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; + var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; + var baseUrl = ""; + if(mcUserName == '' || mcPassword == ''|| (useProxy && proxyAddress == '') || (useAuthentication && (proxyUserName == '' || proxyPassword == ''))){ + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } + var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; + a.getMcServerUrl(mcUrl, function(r){ + baseUrl = r.responseObject(); + a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { + var jobResponse = response.responseObject(); + if(jobResponse == null){ + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } + var openedWindow = window.open('/','test parameters','height=820,width=1130'); + openedWindow.location.href = 'about:blank'; + openedWindow.location.href = baseUrl+path+jobResponse+'&displayUFTMode=true&deviceOnly=true'; + var messageCallBack = function (event) { + if (event && event.data && event.data=="mcCloseWizard") { + a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobResponse, function (app) { + var jobInfo = app.responseObject(); + var deviceId = ""; + var OS = ""; + var manufacturerAndModel = ""; + if(jobInfo['deviceJSON']){ + if(jobInfo['deviceJSON']['deviceId']){ + deviceId = jobInfo['deviceJSON']['deviceId']; + } + if(jobInfo['deviceJSON']['OS']){ + OS = jobInfo['deviceJSON']['OS']; + } + if(jobInfo['deviceJSON']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; + } + } + if(jobInfo['deviceCapability']){ + if(jobInfo['deviceCapability']['OS']){ + OS = jobInfo['deviceCapability']['OS']; + } + if(jobInfo['deviceCapability']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; + } + } + console.log(deviceId); + ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,Utils.parseMCInformation(deviceId,OS,manufacturerAndModel)); + + buttonStatus = false; + ParallelRunnerEnvironment.setEnvironmentError(button,false); + window.removeEventListener("message",messageCallBack, false); + openedWindow.close(); + }); + } + }; + window.addEventListener("message", messageCallBack ,false); + function checkChild() { + if (openedWindow && openedWindow.closed) { + clearInterval(timer); + buttonStatus = false; + } + } + var timer = setInterval(checkChild, 500); + }); + }); + +}; + +/** + * Prototype that represents the ParallelRunner environment. + * @constructor + */ +function ParallelRunnerEnvironment() {} + +/** + * + * @param button + * @returns {*} + */ +ParallelRunnerEnvironment.getEnvironmentSettingsInputNode = function (button) { + // jelly represents each item as a tr + // with data inside + var parent = Utils.findAncestorByTag(button._button, 'tr'); + + if (parent == null) return null; + + var settingInput = parent.getElementsByClassName("setting-input ")[0]; + + if(settingInput == null) return null; + + return settingInput; +}; + +/** + * Set the environment text box input to the given input value, + * the input corresponds to the clicked environment wizard button. + * @param button the clicked environment wizard button + * @param inputValue the input value to be set + * @returns {boolean} true if it succeeded, false otherwise. + */ +ParallelRunnerEnvironment.setEnvironmentSettingsInput = function(button,inputValue) { + var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); + + if(settingInput == null) return false; + + settingInput.value = inputValue; + + return true; +}; +/** + * + * @param button + * @returns {null} + */ +ParallelRunnerEnvironment.getEnvironmentSettingsInputValue = function(button) { + // jelly represents each item as a tr + // with data inside + var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); + + if(settingInput == null) return null; + + return settingInput.value; +}; + +/** + * Enable the error div that corresponds to the clicked + * environment wizard button. + * @param button the environment wizard button + * @param enable the div visibility state(true - visible, false - hidden) + * @returns {boolean} true if it succeeded, false otherwise. + */ +ParallelRunnerEnvironment.setEnvironmentError = function(button, enable) { + var parent = Utils.findAncestorByTag(button._button, 'tr'); + + if(parent == null) return false; + + var errorDiv = parent.querySelector('div[name="mcSettingsError"'); + + if(!enable) { + errorDiv.style.display = "none"; // hide error + } + else { + errorDiv.style.display = "block"; // display error + } +}; + +/** + * Set the browser selection modal visibility. + * @param button - the environment button + * @param modalId - the browser modal id + * @param visible - should the modal be visible?(true / false) + * @param path - the patch to the root of the plugin + */ +ParallelRunnerEnvironment.setBrowsersModalVisibility = function(button,modalId,visible,path) { + var modal = document.getElementById(modalId); + + // it wasn't generated, so we need to generate it + if(modal == null) { + // generate it + modal = ModalDialog.generate(path); + + // add it to the DOM + document.body.appendChild(modal); + } + + ModalDialog.setEnvironmentWizardButton(button); + + modal = document.getElementById(modalId); + + var environmentInputValue = ParallelRunnerEnvironment.getEnvironmentSettingsInputValue(button); + + // set the selected browser to match the one in the input + if(environmentInputValue != null) { + var browser = environmentInputValue.split(":"); + + // should be of the form browser: BrowserName + if(browser != null && browser.length === 2) + { + ModalDialog.setSelectedBrowser (modal,browser[1].trim()); + } + } + + if(visible) { + modal.style.display = "block"; + + // also allow the user to hide it by clicking anywhere on the window + window.onclick = function(event) { + if (event.target === modal) { + modal.style.display = "none"; + } + }; + } + else + modal.style.display = "none"; +}; + +/** + * Determine the currently selected environment type. + * @param button - the environment wizard button + * @returns {*} + */ +ParallelRunnerEnvironment.GetCurrentEnvironmentType = function(button) { + var parent = Utils.findAncestorByTag(button._button,"td"); + + if(parent == null) return null; + + var inputs = parent.querySelectorAll('input[type="radio"'); + + if(inputs == null) return null; + + // find the checked input and return it's value + for(var i = 0; i < inputs.length; i++) { + if(inputs[i].checked === true) { + return inputs[i].defaultValue; + } + } + + return null; +}; + +/** + * Set the environment text based on the browser selection. + * @param button - the environment button + * @param radio - the selected radio + * @param modal - the browser selection modal + */ +ParallelRunnerEnvironment.setUpBrowserEnvironment = function(button,radio,modal) { + // we can close the modal now + modal.style.display = "none"; + // based on the browser chosen we will prepare the environment + ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,"browser : " + radio['id']); +}; + +/** + * Sets the environment and test set visibility based on the parallel runner checkBox state. + * @param index - the current build index + */ +ParallelRunnerEnvironment.setEnvironmentsVisibility = function(index) { + var fsTests = document.getElementsByName("runfromfs.fsTests")[index]; + var parent = Utils.findAncestorByTag(fsTests,"tbody"); + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + var environment = parent.querySelectorAll("div[name='fileSystemTestSet'")[0]; + + if(environment == null) return; + + Utils.setJenkinsElementVisibility(environment,check.checked); +}; + +/** + * Click handler for the environment wizard button. + * @param button the environment wizard button + * @param a first mc argument + * @param modalId the browser modalId to be shown + * @param visibility of the modal + * @param pluginPath the ${root} path + * @returns {boolean} + */ +ParallelRunnerEnvironment.onEnvironmentWizardClick = function(button,a,modalId,visibility,pluginPath) { + // get the environment type for the current env + // could be: 'web' or 'mobile' + var type = ParallelRunnerEnvironment.GetCurrentEnvironmentType(button); + + if(type == null) return false; + + // if the type is web we need to show the browsers modal + if(type.toLowerCase() === 'web') { + ParallelRunnerEnvironment.setBrowsersModalVisibility(button,modalId,visibility,pluginPath); + return true; + } + + // open the mobile center wizard + if(type.toLowerCase() === 'mobile') { + Utils.loadMC(a,'/integration/#/login?jobId=',button); + return true; + } + + return false; +}; + +/** + * Utility class for the RunFromFileSystem model. + * @constructor + */ +function RunFromFileSystemEnvironment() {} + +/** + * Sets the fsTests visibility based on the parallel runner checkBox state. + * @param index - the current build index + */ +RunFromFileSystemEnvironment.setFsTestsVisibility = function(index) { + var fsTests = document.getElementsByName("runfromfs.fsTests")[index]; + var parentElement = fsTests.parentElement; + var parent = Utils.findAncestorByTag(fsTests,"tr"); + + // when the text box is not expanded + if(!parentElement.classList.contains("setting-main")) { + parent = Utils.findAncestorByTag(parent,'tr'); + } + + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + + if(check.checked) { + parent.style.display = "none"; + } + else { + parent.style.display = ""; + } +}; + +/** + * Sets the fsTimeout visibility based on the parallel runner checkbox state. + * @param index the current build index. + */ +RunFromFileSystemEnvironment.setTimeoutVisibility = function (index) { + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + var fsTimeout = document.getElementsByName("runfromfs.fsTimeout")[index]; + + Utils.setJenkinsElementVisibility(fsTimeout,!check.checked); +}; + +/** + * Hide/Show the corresponding controls based on the parallel runner checkBox state. + */ +function setViewVisibility() { + var parallelRuns = document.getElementsByName("runfromfs.isParallelRunnerEnabled"); + + // go over all the available builds and set their corresponding + // visibilities based on the parallel runner state + for(var i = 0; i < parallelRuns.length; i++) { + RunFromFileSystemEnvironment.setFsTestsVisibility(i); + RunFromFileSystemEnvironment.setTimeoutVisibility(i); + ParallelRunnerEnvironment.setEnvironmentsVisibility(i); + } +} + +document.addEventListener('DOMContentLoaded', function() { + setViewVisibility(); +}, false); From 9c2bf16167b8b9127eecbf7b2ff806d920fe21a8 Mon Sep 17 00:00:00 2001 From: Ionut Florin Tamas Date: Fri, 13 Jul 2018 11:09:35 +0300 Subject: [PATCH 0403/2502] Implemened requested changes --- HpToolsAborter/Program.cs | 8 +-- HpToolsLauncher/ElevatedProcess.cs | 3 +- HpToolsLauncher/NativeProcess.cs | 35 ------------ .../ParallelRunnerEnvironmentUtil.cs | 28 +++++++++- .../Runners/FileSystemTestsRunner.cs | 2 +- .../TestRunners/ParallelTestRunner.cs | 25 +++++++-- .../tools/model/FileSystemTestSetModel.java | 3 -- .../model/ParallelRunnerEnvironmentModel.java | 53 +++++++++---------- .../tools/model/RunFromFileSystemModel.java | 5 +- .../tools/results/RunResultRecorder.java | 9 ---- .../tools/run/RunFromFileBuilder.java | 2 +- 11 files changed, 81 insertions(+), 92 deletions(-) diff --git a/HpToolsAborter/Program.cs b/HpToolsAborter/Program.cs index f15c12dadd..38dbc86659 100644 --- a/HpToolsAborter/Program.cs +++ b/HpToolsAborter/Program.cs @@ -74,7 +74,7 @@ static void Main(string[] args) { KillQtpAutomationProcess(); KillLoadRunnerAutomationProcess(); - KillParallelRunnerAutomatonProcesses(); + KillParallelRunnerAutomationProcesses(); } if (runType=="Alm") @@ -119,7 +119,7 @@ private static void KillLoadRunnerAutomationProcess() } - private static void KillParllelRunnerAutomationProcess(Process parallelRunner) + private static void KillParallelRunnerAutomationProcess(Process parallelRunner) { if(parallelRunner != null) { @@ -140,7 +140,7 @@ private static void KillParllelRunnerAutomationProcess(Process parallelRunner) } } - private static void KillParallelRunnerAutomatonProcesses() + private static void KillParallelRunnerAutomationProcesses() { Process[] paralelRunnerProcesses = Process.GetProcessesByName("ParallelRunner"); @@ -157,7 +157,7 @@ private static void KillParallelRunnerAutomatonProcesses() // if ctr-c has failed, just kill the process... if (!closed || !proc.HasExited) { - KillParllelRunnerAutomationProcess(proc); + KillParallelRunnerAutomationProcess(proc); } } } diff --git a/HpToolsLauncher/ElevatedProcess.cs b/HpToolsLauncher/ElevatedProcess.cs index 93e15a2128..5fbb53673f 100644 --- a/HpToolsLauncher/ElevatedProcess.cs +++ b/HpToolsLauncher/ElevatedProcess.cs @@ -7,6 +7,7 @@ namespace HpToolsLauncher { + [Serializable] public class ElevatedProcessException : Exception { public ElevatedProcessException(string message) : base(message) { } @@ -80,7 +81,7 @@ public void StartElevated() process = Process.GetProcessesByName("explorer").FirstOrDefault(); }catch(InvalidOperationException e) { - throw new ElevatedProcessException("Unable to find explorer process: ", e); + throw new ElevatedProcessException("An error has occurred while trying to find the 'explorer' process: ", e); } if(process == null) diff --git a/HpToolsLauncher/NativeProcess.cs b/HpToolsLauncher/NativeProcess.cs index cbb3d5cda6..bf911c4abb 100644 --- a/HpToolsLauncher/NativeProcess.cs +++ b/HpToolsLauncher/NativeProcess.cs @@ -430,40 +430,9 @@ public struct LUID public int HighPart; } - [StructLayout(LayoutKind.Sequential)] - public struct LUID_AND_ATTRIBUTES - { - public LUID pLuid; - public UInt32 Attributes; - } - - public class TOKEN_PRIVILEGES - { - public UInt32 PrivilegeCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] - public LUID_AND_ATTRIBUTES[] Privileges = new LUID_AND_ATTRIBUTES[2]; - } - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct TokPriv1Luid - { - public int Count; - public LUID Luid; - public UInt32 Attr; - } - - [StructLayout(LayoutKind.Sequential)] - public struct SID_AND_ATTRIBUTES - { - public IntPtr Sid; - public uint Attributes; - } - [DllImport("kernel32.dll", SetLastError = true)] public static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds); - - [DllImport("kernel32.dll", SetLastError = true)] public static extern IntPtr OpenProcess(ProcessAccessFlags processAccess, bool bInheritHandle, int processId); @@ -501,10 +470,6 @@ public static extern bool CreateProcessAsUser(IntPtr hToken, string lpApplicatio [return: MarshalAs(UnmanagedType.Bool)] public static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, out LUID lpLuid); - [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] - public static extern bool AdjustTokenPrivileges(IntPtr htok, bool disableAllPrivileges, ref TokPriv1Luid newState, - int len, IntPtr prev, IntPtr relen); - [DllImport("kernel32.dll", SetLastError = true)] public static extern uint ResumeThread(IntPtr hThread); diff --git a/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs index 550a8aafb1..4e6fd98281 100644 --- a/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs +++ b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs @@ -16,6 +16,9 @@ public class ParallelRunnerConfigurationException : Exception public ParallelRunnerConfigurationException(string message) : base(message) { } + + public ParallelRunnerConfigurationException(string message, Exception innerException) : base(message, innerException) + { } }; public enum EnvironmentType @@ -108,6 +111,7 @@ public static Dictionary GetEnvironmentProperties(string environ return dictionary; } + /// /// Parse the mobile environment provided in jenkins. /// @@ -426,9 +430,29 @@ public static string GetConfigFilePath(TestInfo testInfo, McConnectionInfo mcCon JavaScriptSerializer serializer = new JavaScriptSerializer(); - var configJson = serializer.Serialize(config); + string configJson = null; - File.WriteAllText(configFilePath, configJson); + try + { + configJson = serializer.Serialize(config); + } + catch(InvalidOperationException e) + { + throw new ParallelRunnerConfigurationException("Invalid json confguration provided: ",e); + } + catch(ArgumentException e) + { + throw new ParallelRunnerConfigurationException("Configuration serialization recursion limit exceeded: ", e); + } + + try + { + File.WriteAllText(configFilePath, configJson); + } + catch (Exception e) + { + throw new ParallelRunnerConfigurationException("Could not write configuration file: ", e); + } return configFilePath; } diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index 8ebafe7480..f849443b70 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -321,7 +321,7 @@ private TestRunResults RunHPToolsTest(TestInfo testinf, ref string errorReason) var testPath = testinf.TestPath; var type = Helper.GetTestType(testPath); - // if we have at leas one environment for parallel runner, + // if we have at least one environment for parallel runner, // then it must be enabled var isParallelRunnerEnabled = _parallelRunnerEnvironments.Count > 0; diff --git a/HpToolsLauncher/TestRunners/ParallelTestRunner.cs b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs index 09d42328b5..192f7e0db8 100644 --- a/HpToolsLauncher/TestRunners/ParallelTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Runtime.InteropServices; using System.Threading; using System.Web.Script.Serialization; @@ -165,7 +166,7 @@ public TestRunResults RunTest(TestInfo testInfo, ref string errorReason, RunCanc { configFilePath = ParallelRunnerEnvironmentUtil.GetConfigFilePath(testInfo,_mcConnectionInfo,_environments); _configFiles.Add(configFilePath); - }catch(Exception ex) // invalid configuration + }catch(ParallelRunnerConfigurationException ex) // invalid configuration { errorReason = ex.Message; runResults.ErrorDesc = errorReason; @@ -229,7 +230,23 @@ private bool IsParentProcessRunningInUserSession() Process parentProcess = currentProcess.Parent(); // if they are not in the same session we will assume it is a service - Process explorer = Process.GetProcessesByName("explorer")[0]; + Process explorer = null; + try + { + explorer = Process.GetProcessesByName("explorer").FirstOrDefault(); + } + catch (InvalidOperationException) + { + return false; + } + + // could not retrieve the explorer process + if(explorer == null) + { + // try to start the process from the current session + return false; + } + return parentProcess.SessionId != explorer.SessionId; } @@ -239,7 +256,7 @@ private bool IsParentProcessRunningInUserSession() /// the filename to be ran /// the arguments for the process /// the corresponding process type, based on the jenkins instance - private object GetProcessTypForCurrentSession(string fileName,string arguments) + private object GetProcessTypeForCurrentSession(string fileName,string arguments) { try { @@ -273,7 +290,7 @@ private object GetProcessTypForCurrentSession(string fileName,string arguments) /// the exit code of the process private int ExecuteProcess(string fileName, string arguments, ref string failureReason) { - IProcessAdapter processAdapter = ProcessAdapterFactory.CreateAdapter(GetProcessTypForCurrentSession(fileName, arguments)); + IProcessAdapter processAdapter = ProcessAdapterFactory.CreateAdapter(GetProcessTypeForCurrentSession(fileName, arguments)); if (processAdapter == null) { diff --git a/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java b/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java index cb2ce0d855..e2543c1fca 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/FileSystemTestSetModel.java @@ -37,13 +37,10 @@ import hudson.Extension; import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; -import hudson.util.VariableResolver; -import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.List; import java.util.Properties; diff --git a/src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java b/src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java index 4cd8e214da..231175ae02 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/ParallelRunnerEnvironmentModel.java @@ -42,12 +42,19 @@ import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; +import javax.xml.bind.ValidationException; import java.util.*; /** * Represents the environment that Parallel Runner uses to execute a test. */ public class ParallelRunnerEnvironmentModel extends AbstractDescribableImpl { + private static class EnvironmentValidationException extends Exception { + public EnvironmentValidationException(String message) { + super(message); + } + } + private String environment; private String environmentType; // 'Web', 'Mobile' @@ -201,48 +208,36 @@ private boolean isKnownProperty(String property) { return false; } + private void checkKeyValueValidity(String key,Map pairs,String message) throws EnvironmentValidationException { + // if the key is present the value must be present too + if(pairs.containsKey(key) && pairs.get(key).trim().isEmpty()) { + throw new EnvironmentValidationException(message); + } + } + /** * Validate the environment string. * @param environment the environment string */ - private void validateEnvironmentString(String environment) throws Exception { + private void validateEnvironmentString(String environment) throws EnvironmentValidationException { Map pairs = this.getEnvironmentKeyValuePairs(environment); // check if any property was provided if(pairs.isEmpty()) { - throw new Exception("No property provided. Enter properties using the following syntax: :"); + throw new EnvironmentValidationException("No property provided. Enter properties using the following syntax: :"); } // check if there are any invalid property names for(String key : pairs.keySet()) { if(!isKnownProperty(key)) { - throw new Exception("Invalid property name: " + key); + throw new EnvironmentValidationException("Invalid property name: " + key); } } - // the environment must either be a mobile environment or a browser - // environment, and if no properties are present it is neither of those - //if(!pairs.containsKey(DeviceIdKey) && !pairs.containsKey(BrowserKey) && - //(!pairs.containsKey(OsTypeKey) && !pairs.containsKey(OsVersionKey) && !pairs.containsKey(ManufacturerAndModelKey))){ - //throw new Exception("Not enough parameters provided!"); - //} - - // if the key is present the value must be present too - if(pairs.containsKey(DeviceIdKey) && pairs.get(DeviceIdKey).trim().isEmpty()) { - throw new Exception("DeviceId value must not be empty!"); - } - - if(pairs.containsKey(OsVersionKey) && pairs.get(OsVersionKey).trim().isEmpty()) { - throw new Exception("OsVersion value must not be empty!"); - } - - if(pairs.containsKey(OsTypeKey) && pairs.get(OsTypeKey).trim().isEmpty()) { - throw new Exception("OsType value must not be empty!"); - } - - if(pairs.containsKey(ManufacturerAndModelKey) && pairs.get(ManufacturerAndModelKey).trim().isEmpty()) { - throw new Exception("ManufacturerAndModel value must not be empty!"); - } + checkKeyValueValidity(DeviceIdKey,pairs,"DeviceId value must not be empty!"); + checkKeyValueValidity(OsVersionKey,pairs,"OsVersion value must not be empty!"); + checkKeyValueValidity(OsTypeKey,pairs,"OsType value must not be empty!"); + checkKeyValueValidity(ManufacturerAndModelKey,pairs,"ManufacturerAndModel value must not be empty!"); // if it's a browser environment if(pairs.containsKey(BrowserKey)) { @@ -250,12 +245,12 @@ private void validateEnvironmentString(String environment) throws Exception { // check if the value is present if(browserName.isEmpty()) { - throw new Exception("Browser value must not be empty!"); + throw new EnvironmentValidationException("Browser value must not be empty!"); } // check if ParallelRunner supports the given browser if(!isSupportedBrowser(browserName)) { - throw new Exception(String.format("Invalid browser. %s is not supported!", browserName.toUpperCase())); + throw new EnvironmentValidationException(String.format("Invalid browser. %s is not supported!", browserName.toUpperCase())); } } } @@ -273,7 +268,7 @@ public FormValidation doCheckEnvironment(@QueryParameter String value) { try{ this.validateEnvironmentString(value); - }catch (Exception e) { + }catch (EnvironmentValidationException e) { return FormValidation.error(e.getMessage()); } diff --git a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java index 2f5685f208..83f7426d2b 100644 --- a/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/hpe/application/automation/tools/model/RunFromFileSystemModel.java @@ -33,7 +33,6 @@ package com.hpe.application.automation.tools.model; -import com.hpe.application.automation.tools.AlmToolsUtils; import com.hpe.application.automation.tools.EncryptionUtils; import com.hpe.application.automation.tools.mc.JobConfigurationProxy; import hudson.EnvVars; @@ -727,12 +726,12 @@ private Properties createProperties(EnvVars envVars) { if(isUseAuthentication()){ props.put(MOBILE_PROXY_SETTING_AUTHENTICATION,"1"); props.put(MOBILE_PROXY_SETTING_USER_NAME,proxySettings.getFsProxyUserName()); - String encryptedPassword = ""; + String encryptedPassword; try { encryptedPassword = EncryptionUtils.Encrypt(proxySettings.getFsProxyPassword(), EncryptionUtils.getSecretKey()); - }catch (Exception ex){ + }catch (Exception ex) { return null; // cannot continue without proper config } diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index 69e4054995..e9966f9a97 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -131,7 +131,6 @@ public class RunResultRecorder extends Recorder implements Serializable, MatrixA public static final String SLA_ULL_NAME = "FullName"; public static final String ARCHIVING_TEST_REPORTS_FAILED_DUE_TO_XML_PARSING_ERROR = "Archiving test reports failed due to xml parsing error: "; - private static final String PARALLEL_REPORT_FOLDER = "ParallelReport"; private static final String PARALLEL_RESULT_FILE = "parallelrun_results.html"; private final ResultsPublisherModel _resultsPublisherModel; @@ -452,11 +451,6 @@ private void archiveTestsReport( FilePath htmlReport = new FilePath(reportFolder, isParallelRunnerReport ? PARALLEL_RESULT_FILE : "run_results.html"); - // the report name is different for the parallel runner - /*if(isParallelRunnerReport) { - htmlReport = new FilePath(reportFolder,PARALLEL_RESULT_FILE); - }*/ - FilePath rrvReport = new FilePath(reportFolder, "Results.xml"); if (htmlReport.exists()) { reportIsHtml = true; @@ -659,9 +653,6 @@ private Boolean collectAndPrepareHtmlReports(Run build, TaskListener listener, L String htmlReportDir = htmlReportInfo.getFolderPath(); // C:\UFTTest\GuiTest1\Report - //boolean isParallelRunner = htmlReportDir.contains(PARALLEL_REPORT_FOLDER); - // htmlReportDir.endsWith(PARALLEL_REPORT_FOLDER + "\\Res1"); - listener.getLogger().println("collectAndPrepareHtmlReports, collecting:" + htmlReportDir); listener.getLogger().println("workspace: " + runWorkspace); diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index e56497e5d3..fef4c3e1d8 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -172,7 +172,7 @@ public RunFromFileBuilder(String fsTests, String fsTimeout, String fsUftRunMode, String perScenarioTimeOut, String ignoreErrorStrings, String displayController, String mcServerName, String fsUserName, String fsPassword, String mcTenantId, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, String fsExtraApps, String fsJobId, - ProxySettings proxySettings, boolean useSSL,boolean isParallelRunnerEnabled, List environments) { + ProxySettings proxySettings, boolean useSSL,boolean isParallelRunnerEnabled) { this.isParallelRunnerEnabled = isParallelRunnerEnabled; runFromFileModel = new RunFromFileSystemModel(fsTests, fsTimeout, fsUftRunMode, controllerPollingInterval, perScenarioTimeOut, ignoreErrorStrings, displayController, mcServerName, fsUserName, fsPassword, mcTenantId, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, fsAutActions, fsLaunchAppName, From b72687ace60428edf7cf1828a1231510e9244f83 Mon Sep 17 00:00:00 2001 From: Ionut Florin Tamas Date: Fri, 13 Jul 2018 11:22:21 +0300 Subject: [PATCH 0404/2502] Removed binaries --- .../Out/AgentRestart.dat | Bin 365 -> 0 bytes .../Out/AgentRestart.dat | Bin 365 -> 0 bytes .../Out/AgentRestart.dat | Bin 365 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_16_02/Out/AgentRestart.dat delete mode 100644 HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_19_32/Out/AgentRestart.dat delete mode 100644 HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-27 15_09_14/Out/AgentRestart.dat diff --git a/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_16_02/Out/AgentRestart.dat b/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_16_02/Out/AgentRestart.dat deleted file mode 100644 index b92f9ff313d6fe3fb73600d5b974b4e5c079fbca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 365 zcmZ`#y-veG3{KrbD-{F}z|aS%qC{2HsRQbO0z&+>>cU_pIj3Bk5vG6Cicrvt(PJZGE=AhUa-(3l|*@z&d>?vs!7Dvp!j%Su1#9V?1Jq0lB!V}4Du)+ z=3ywJAQ>ckZiC@J!c)?`qxz$LYssYMxXM-2&bCXeO%;pd64_StSe2`Sn8aa;^gx+m zyI?GuUZXo%Yo^jaGg5Tiy{#|%fnBz1Nx%d!1TY}f^7#4oezbXZE&DC!yWc@^a2Nmp diff --git a/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_19_32/Out/AgentRestart.dat b/HpToolsLauncher/TestResults/tamasio_AIBUISJW1Y 2018-06-26 17_19_32/Out/AgentRestart.dat deleted file mode 100644 index d48aa276c06e39218100e346018a9e2c64ea24da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 365 zcmZ`#%}N774Bn>I7HYvq=mV6crPQ8!kcv`7{AuYm&hBLEw7WAhlL7k>;tP25A-s6> z?h}d5ph7Qxfh2rM_>v^GBuTykVvIO|;M|4Et#PK{bg7&d<($1#CcO@+;_bqi(xt~M z(tMe%Dd%2yN!BT&CxcPikJjr>eaYU^M3ZML%3k-%XQj%|DU5GOPqO~77!~7UFp#6Z z7>d2P!T2BH1v%bP{n5S&q_8~Gg{g{Lh(lzR>f&SX8Q zwdY&MRHbKL$yU6#@fkj_%eDgvC;&6S98dxhU;(%SyaQB#YrswD`9rJOgkRjgo<4QN T`^n4E$D@9Gwy|Zu5qIR#w3W5a|PyrAt|Q>Op#tB2u-b*RZ>jsnhQ6$W8_u&TAPBx3eDpX3=gg(bYi+dTXrYWviy2#?bad@f#hba- zg^A9VRPi)hQO>>Yf@-65HHwp{@2%Gz+k$OPqlzroY0>Lm*{o3c1-bDxRimswkck}1 zI2K7i9i)4HgW*5Ib27Z6`lEg0$h783C3Vxywo9ySH4(=pva6V}F7FCr5=SM{J>{0& zf)mjU8sThXn9AtfD$()xwm#ekcG=L8fGJ=Gm;(wx0+fJDz*|5CxB^_eoB08><$3z__V6fQPZHm<-|{~E1~kiWP5=M^ From 261d71263cc981c8b489a35cd10a85da97570f6c Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Fri, 13 Jul 2018 13:49:35 +0300 Subject: [PATCH 0405/2502] JENKINS-52445: Add infrastructure for internal builds --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 954335c334..8c3db644b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1 +1,7 @@ -buildPlugin(platforms: ['windows']) +if (env.JENKINS_URL == 'https://ci.jenkins.io/') { + // Builds the plugin using https://github.com/jenkins-infra/pipeline-library + buildPlugin(platforms: ['windows']) +} +else { + // Do internal build +} From 9c4fd006bb3b43acbeb914c4c2a168026f065f39 Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 14:02:56 +0300 Subject: [PATCH 0406/2502] Code Refactoring --- HpToolsLauncher/Launcher.cs | 1 + LRAnalysisLauncher/Program.cs | 1 + .../tools/results/RunResultRecorder.java | 120 ++++++++---------- 3 files changed, 54 insertions(+), 68 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index b99388046e..e191171b31 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -395,6 +395,7 @@ IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciParams) return null; } + //If a file path was provided and it doesn't exist stop the analysis launcher if (!analysisTemplate.Equals("") && !Helper.FileExists(analysisTemplate)) { return null; } diff --git a/LRAnalysisLauncher/Program.cs b/LRAnalysisLauncher/Program.cs index 53d098f5d3..49ae0e7a91 100644 --- a/LRAnalysisLauncher/Program.cs +++ b/LRAnalysisLauncher/Program.cs @@ -75,6 +75,7 @@ static int Main(string[] args) Session session = analysis.Session; log("creating analysis session"); + //Apply a template and create LRA folder if (session.CreateWithTemplateFile(lralocation, lrrlocation, analysisTemplateLocation)) { log("analysis session created"); diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index dd911284da..ea63bce9d9 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -138,9 +138,10 @@ public class RunResultRecorder extends Recorder implements Serializable, MatrixA public static final String SLA_ULL_NAME = "FullName"; public static final String ARCHIVING_TEST_REPORTS_FAILED_DUE_TO_XML_PARSING_ERROR = "Archiving test reports failed due to xml parsing error: "; + private static final String NO_RICH_REPORTS_ERROR = "Template contains no rich reports."; + private static final String NO_TRANSACTION_SUMMARY_REPORT_ERROR = "Template contains no transaction summary report."; private final ResultsPublisherModel _resultsPublisherModel; private List runReportList; - /** * Instantiates a new Run result recorder. * @@ -808,7 +809,6 @@ private void createHtmlReport(FilePath reportFolder, _resultsPublisherModel.getArchiveTestResultsMode(); boolean createReport = archiveTestResultMode.equals(ResultsPublisherModel.CreateHtmlReportResults.getValue()); - if (createReport) { File testFolderPathFile = new File(testFolderPath); FilePath srcDirectoryFilePath = new FilePath(reportFolder, HTML_REPORT_FOLDER); @@ -832,12 +832,15 @@ private void createHtmlReport(FilePath reportFolder, FileUtils.moveDirectory(new File(reportDirectory, IE_REPORT_FOLDER), new File(reportDirectory, newFolderName)); tmpZipFile.delete(); - outputReportFiles(reportNames, reportDirectory, testResult, "Performance Report", "HTML.html"); + outputReportFiles(reportNames, reportDirectory, testResult, "Performance Report", HTML_REPORT_FOLDER); } } } } + /** + * Create a new directory RichReport/scenario_name on master and copy the .pdf files from slave LRA folder + */ private void createRichReports(FilePath reportFolder, String testFolderPath, File artifactsDir, @@ -859,8 +862,6 @@ private void createRichReports(FilePath reportFolder, FilePath dstReportPath = new FilePath(testDirectory); FileFilter reportFileFilter = new WildcardFileFilter("*.pdf"); List reporFiles = htmlReportPath.list(reportFileFilter); - - List richReportNames = new ArrayList(); for (FilePath fileToCopy : reporFiles) { FilePath dstFilePath = new FilePath(dstReportPath, fileToCopy.getName()); @@ -868,59 +869,45 @@ private void createRichReports(FilePath reportFolder, richReportNames.add(dstFilePath.getName()); } - outputReportFiles(reportNames, reportDirectory, testResult, "Rich Reports", "index.html"); - createRichReportsIndex(testDirectory, richReportNames, "Rich Reports"); + outputReportFiles(reportNames, reportDirectory, testResult, "Rich Reports", INDEX_HTML_NAME); + createRichReportHtml(testDirectory, richReportNames); } } - private void createRichReportsIndex(File reportDirectory, List richReportNames, String title) - throws IOException { + private void createErrorHtml(File htmlDirectory, String error) throws IOException { + String htmlFileContents = "" + + "" + + "" + + "Rich Report" + + "" + + "" + error + ""; + + writeToFile(htmlDirectory, htmlFileContents); + } + private void createRichReportHtml(File reportDirectory, List richReportNames) throws IOException { String htmlFileContents = "" + "" + "" + - "" + title + "<TITLE>" + + "<TITLE>Rich Report" + "" + ""; if (richReportNames.size() == 0) { - htmlFileContents += "Template contains no rich reports."; + htmlFileContents += NO_RICH_REPORTS_ERROR; } else { for (String richReportName : richReportNames) { htmlFileContents += ""; } } - htmlFileContents += ""; - - File htmlIndexFile = new File(reportDirectory, "HTML.html"); - BufferedWriter writer = new BufferedWriter(new FileWriter(htmlIndexFile)); - writer.write(htmlFileContents); - writer.flush(); - writer.close(); - /*writer.write(""); - writer.write(""); - writer.write(""); - writer.write(String.format("%s", title)); - writer.write(""); - writer.write(""); - - if (richReportNames.size() == 0) { - writer.write("Template contains no rich reports."); - } - for (String richReportName : richReportNames) { - writer.write( - String.format( - "", richReportName - ) - ); - } - - writer.write("");*/ + htmlFileContents += ""; + File richReportsHtml = new File(reportDirectory, HTML_REPORT_FOLDER +".html"); + writeToFile(richReportsHtml, htmlFileContents); } - private void writeToFile(File file, String contents) { + private void writeToFile(File file, String contents) throws IOException { BufferedWriter writer = new BufferedWriter(new FileWriter(file)); writer.write(contents); writer.flush(); @@ -941,8 +928,6 @@ private void outputReportFiles(List reportNames, File reportDirectory, T if (reportNames.isEmpty()) { return; } - //String title = (tranSummary) ? "Transaction Summary" : "Performance Report"; - //String htmlFileName = (tranSummary) ? (TRANSACTION_REPORT_NAME + ".html") : "HTML.html"; File htmlIndexFile = new File(reportDirectory, INDEX_HTML_NAME); BufferedWriter writer = new BufferedWriter(new FileWriter(htmlIndexFile)); writer.write("%n"); @@ -1070,35 +1055,13 @@ private void createTransactionSummary(FilePath reportFolder, } FilePath dstReportPath = new FilePath(testDirectory); - FileFilter reportFileFilter = new WildcardFileFilter("Report*.html"); - List reportFiles = htmlReportPath.list(reportFileFilter); - boolean doesTransactionSummaryFileExist = false; - for (FilePath fileToCopy : reportFiles) { - Scanner s = new Scanner(fileToCopy.read()).useDelimiter("\\A"); - - while (s.hasNextLine()) { - String myStr = s.nextLine(); - if (myStr.toLowerCase().contains("transaction summary")) { - FilePath dstFilePath = new FilePath(dstReportPath, TRANSACTION_REPORT_NAME + ".html"); - fileToCopy.copyTo(dstFilePath); - doesTransactionSummaryFileExist = true; - } - } - } - - if (!doesTransactionSummaryFileExist) { + FilePath fileToCopy1; + if ((fileToCopy1 = getTransactionSummaryReport(htmlReportPath)) != null) { + FilePath dstFilePath = new FilePath(dstReportPath, TRANSACTION_REPORT_NAME + ".html"); + fileToCopy1.copyTo(dstFilePath); + } else { File htmlIndexFile = new File(testDirectory, TRANSACTION_REPORT_NAME + ".html"); - BufferedWriter writer = new BufferedWriter(new FileWriter(htmlIndexFile)); - writer.write(""); - writer.write(""); - writer.write(""); - writer.write(String.format("%s", "Testing")); - writer.write(""); - writer.write(""); - writer.write("Template contains no transaction summary report."); - writer.write(""); - writer.flush(); - writer.close(); + createErrorHtml(htmlIndexFile, NO_TRANSACTION_SUMMARY_REPORT_ERROR); } FilePath cssFilePath = new FilePath(htmlReportPath, "Properties.css"); @@ -1124,6 +1087,27 @@ private void createTransactionSummary(FilePath reportFolder, } } + /** + * Scan the LRA folder from slave to find the report containting Transaction Summary + * as title (or variants based on language packs) + */ + private FilePath getTransactionSummaryReport(FilePath htmlReportPath) throws IOException, InterruptedException { + FileFilter reportFileFilter = new WildcardFileFilter("Report*.html"); + List reportFiles = htmlReportPath.list(reportFileFilter); + for (FilePath fileToCopy : reportFiles) { + Scanner s = new Scanner(fileToCopy.read()).useDelimiter("\\A"); + + while (s.hasNextLine()) { + String myStr = s.nextLine(); + if (myStr.toLowerCase().contains("transaction summary")) { + return fileToCopy; + } + } + } + + return null; + } + /* * if we have a directory with file name "file.zip" we will return "file_1.zip" */ From 1f810b1d376fb3da0e5cd0e514110c213c96394c Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 14:38:20 +0300 Subject: [PATCH 0407/2502] Added new line at the end of files. --- .../automation/tools/results/RichReportAction/index.jelly | 2 +- .../automation/tools/results/SrfSummaryReport/index.jelly | 4 ++-- .../automation/tools/results/SummaryReport/index.jelly | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly index fffa00506f..8767c1b5b7 100644 --- a/src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/results/RichReportAction/index.jelly @@ -66,4 +66,4 @@ - \ No newline at end of file + diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly index 716a17abf9..3eaa274e6c 100644 --- a/src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/results/SrfSummaryReport/index.jelly @@ -37,7 +37,7 @@

    Transaction Summary

    ${it.name}

    - +
    - \ No newline at end of file + diff --git a/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly b/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly index f8e6a89eed..eb9a0c13d9 100644 --- a/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/results/SummaryReport/index.jelly @@ -40,4 +40,4 @@ - \ No newline at end of file + From a03df916010cf14040adacdb3bd987cb69256d7f Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 14:58:45 +0300 Subject: [PATCH 0408/2502] Prepared for push. --- .../tools/results/RunResultRecorder.java | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index ea63bce9d9..f7f4be4573 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -861,9 +861,9 @@ private void createRichReports(FilePath reportFolder, FilePath dstReportPath = new FilePath(testDirectory); FileFilter reportFileFilter = new WildcardFileFilter("*.pdf"); - List reporFiles = htmlReportPath.list(reportFileFilter); + List reportFiles = htmlReportPath.list(reportFileFilter); List richReportNames = new ArrayList(); - for (FilePath fileToCopy : reporFiles) { + for (FilePath fileToCopy : reportFiles) { FilePath dstFilePath = new FilePath(dstReportPath, fileToCopy.getName()); fileToCopy.copyTo(dstFilePath); richReportNames.add(dstFilePath.getName()); @@ -879,8 +879,7 @@ private void createErrorHtml(File htmlDirectory, String error) throws IOExceptio "" + "" + "Rich Report" + - "" + - "" + error + ""; + "" + "" + error + ""; writeToFile(htmlDirectory, htmlFileContents); } @@ -889,9 +888,7 @@ private void createRichReportHtml(File reportDirectory, List richReportN String htmlFileContents = "" + "" + "" + - "Rich Report" + - "" + - ""; + "Rich Report" + "" + ""; if (richReportNames.size() == 0) { htmlFileContents += NO_RICH_REPORTS_ERROR; @@ -1055,10 +1052,10 @@ private void createTransactionSummary(FilePath reportFolder, } FilePath dstReportPath = new FilePath(testDirectory); - FilePath fileToCopy1; - if ((fileToCopy1 = getTransactionSummaryReport(htmlReportPath)) != null) { + FilePath transSummaryReport; + if ((transSummaryReport = getTransactionSummaryReport(htmlReportPath)) != null) { FilePath dstFilePath = new FilePath(dstReportPath, TRANSACTION_REPORT_NAME + ".html"); - fileToCopy1.copyTo(dstFilePath); + transSummaryReport.copyTo(dstFilePath); } else { File htmlIndexFile = new File(testDirectory, TRANSACTION_REPORT_NAME + ".html"); createErrorHtml(htmlIndexFile, NO_TRANSACTION_SUMMARY_REPORT_ERROR); @@ -1089,18 +1086,23 @@ private void createTransactionSummary(FilePath reportFolder, /** * Scan the LRA folder from slave to find the report containting Transaction Summary - * as title (or variants based on language packs) + * as title (or title variants based on language packs) */ private FilePath getTransactionSummaryReport(FilePath htmlReportPath) throws IOException, InterruptedException { + String[] transactionSummaryNames = {"transaction summary", "dummy", "dummy", "dummy", + "dummy", "dummy", "dummy", "dummy"}; + FileFilter reportFileFilter = new WildcardFileFilter("Report*.html"); List reportFiles = htmlReportPath.list(reportFileFilter); - for (FilePath fileToCopy : reportFiles) { - Scanner s = new Scanner(fileToCopy.read()).useDelimiter("\\A"); - - while (s.hasNextLine()) { - String myStr = s.nextLine(); - if (myStr.toLowerCase().contains("transaction summary")) { - return fileToCopy; + for (FilePath fileToCopy : reportFiles) { + Scanner scanner = new Scanner(fileToCopy.read()).useDelimiter("\\A"); + + while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + for (String transactionSummaryName: transactionSummaryNames) { + if (line.contains(transactionSummaryName)){ + return fileToCopy; + } } } } From 95df8992b44b582f5cbe0ce031860438b608af9f Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 16:48:02 +0300 Subject: [PATCH 0409/2502] Fixed pipeline syntax code generation for Sample Step: General Build Step - Execute Micro Focus tests from file system - Publish Micro Focus tests results --- .../tools/results/RunResultRecorder.java | 4 + .../tools/run/RunFromFileBuilder.java | 92 +++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index e9966f9a97..ed43b53156 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -1350,6 +1350,10 @@ public ResultsPublisherModel getResultsPublisherModel() { return _resultsPublisherModel; } + public String getArchiveTestResultsMode() { + return _resultsPublisherModel.getArchiveTestResultsMode(); + } + /** * The type Descriptor. */ diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index fef4c3e1d8..ba54f95fc7 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -188,6 +188,98 @@ public String getParamFileName() { return ParamFileName; } + public String getFsTimeout(){ + return runFromFileModel.getFsTimeout(); + } + + public String getFsTests(){ + return runFromFileModel.getFsTests(); + } + + public String getControllerPollingInterval(){ + return runFromFileModel.getControllerPollingInterval(); + } + + public String getPerScenarioTimeOut(){ + return runFromFileModel.getPerScenarioTimeOut(); + } + + public String getDisplayController() { + return runFromFileModel.getDisplayController(); + } + + public String getFsAutActions(){ + return runFromFileModel.getFsAutActions(); + } + + public String getFsDeviceId() { + return runFromFileModel.getFsDeviceId(); + } + + public String getFsDevicesMetrics() { + return runFromFileModel.getFsDevicesMetrics(); + } + + public String getFsExtraApps() { + return runFromFileModel.getFsExtraApps(); + } + + public String getFsOs() { + return runFromFileModel.getFsOs(); + } + + public String getFsInstrumented() { + return runFromFileModel.getFsInstrumented(); + } + + public String getFsJobId() { + return runFromFileModel.getFsJobId(); + } + + public String getFsUftRunMode(){ + return runFromFileModel.getFsUftRunMode(); + } + + public String getIgnoreErrorStrings(){ + return runFromFileModel.getIgnoreErrorStrings(); + } + + public String getMcServerName(){ + return runFromFileModel.getMcServerName(); + } + + public String getFsManufacturerAndModel(){ + return runFromFileModel.getFsManufacturerAndModel(); + } + + public String getFsLaunchAppName(){ + return runFromFileModel.getFsLaunchAppName(); + } + + public ProxySettings getProxySettings(){ + return runFromFileModel.getProxySettings(); + } + + public String getMcTenantId(){ + return runFromFileModel.getMcTenantId(); + } + + public String getFsPassword(){ + return runFromFileModel.getFsPassword(); + } + + public String getFsUserName(){ + return runFromFileModel.getFsUserName(); + } + + public String getFsTargetLab(){ + return runFromFileModel.getFsTargetLab(); + } + + public boolean getUseSSL() { + return runFromFileModel.isUseSSL(); + } + /** * Sets controller polling interval. * From 4ecdb0616769e34d069d9469e7937a6aeddaf463 Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 16:53:55 +0300 Subject: [PATCH 0410/2502] Added translations for Transaction Summary. --- .../automation/tools/results/RunResultRecorder.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index f7f4be4573..c8571235de 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -1089,8 +1089,17 @@ private void createTransactionSummary(FilePath reportFolder, * as title (or title variants based on language packs) */ private FilePath getTransactionSummaryReport(FilePath htmlReportPath) throws IOException, InterruptedException { - String[] transactionSummaryNames = {"transaction summary", "dummy", "dummy", "dummy", - "dummy", "dummy", "dummy", "dummy"}; + String[] transactionSummaryNames = { + "Transaction Summary", //eng + "トランザクション サマリ", //jpn + "트랜잭션 요약", //kor + "事务摘è¦", //chs + "Transaktionsübersicht", //deu + "Resumen de transacciones", //spn + "Riepilogo transazioni", //ita + "Récapitulatif des transactions", //fr + "Сводка транзакций", //rus + }; FileFilter reportFileFilter = new WildcardFileFilter("Report*.html"); List reportFiles = htmlReportPath.list(reportFileFilter); From 3bde035ddd9210cacb28a1affaadb7f508ca980a Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 17:42:26 +0300 Subject: [PATCH 0411/2502] Fixed general build step for analysis template. --- .../automation/tools/run/RunFromFileBuilder.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java index 0a31856e26..2ea3841f88 100644 --- a/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/hpe/application/automation/tools/run/RunFromFileBuilder.java @@ -157,13 +157,8 @@ public RunFromFileBuilder(String fsTests, String fsTimeout, String fsUftRunMode, fsDevicesMetrics, fsInstrumented, fsExtraApps, fsJobId, proxySettings, useSSL); } - /** - * Gets param file name. - * - * @return the param file name - */ - public String getParamFileName() { - return ParamFileName; + public String getAnalysisTemplate() { + return runFromFileModel.getAnalysisTemplate(); } /** From f7541e734fe3ed35d24322563a9ddf3e7b4a6ae4 Mon Sep 17 00:00:00 2001 From: noamdoron Date: Fri, 13 Jul 2018 17:56:56 +0300 Subject: [PATCH 0412/2502] - Fixed review rejects --- .../automation/tools/srf/utilities/SrfStepsHtmlUtil.java | 6 ++++-- .../automation/tools/srf/utilities/SrfTrustManager.java | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java index 62691d03c0..690e2a8e7e 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfStepsHtmlUtil.java @@ -68,6 +68,9 @@ interface SrfLeanFtConst { }}; } + /** + * Srf's Selenium test/suite steps business to web map + */ interface SrfSeleniumConsts { HashMap steps = new HashMap() {{ put("suite-begin", "Suite"); @@ -154,8 +157,7 @@ private static void handleStepRole(StringBuilder htmlSteps, JSONObject step, int JSONObject stepRole = step.getJSONObject("role"); String stepRoleType = stepRole.getString("type"); - assert excludedRoleSteps != null; - if (excludedRoleSteps.contains(stepRoleType)){ + if (excludedRoleSteps != null && excludedRoleSteps.contains(stepRoleType)){ return; } diff --git a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java index 4abfbd85a9..aca0b58fbb 100644 --- a/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java +++ b/src/main/java/com/hpe/application/automation/tools/srf/utilities/SrfTrustManager.java @@ -39,6 +39,10 @@ import java.security.cert.CertificateException; import java.security.cert.X509Certificate; +// To prevent man-in-the-middle attacks, hostname checks can be done to verify that the hostname in an end-entity certificate matches the targeted hostname. +// TLS does not require such checks, but some protocols over TLS (such as HTTPS) do. +// In earlier versions of the JDK, the certificate chain checks were done at the SSL/TLS layer, and the hostname verification checks were done at the layer over TLS. +// This class allows for the checking to be done during a single call to this class. public class SrfTrustManager extends X509ExtendedTrustManager implements X509TrustManager { @Override From 2be84bf8acab943a124803ac694830903fba9e45 Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 19:58:12 +0300 Subject: [PATCH 0413/2502] PR changes performed. --- LRAnalysisLauncher/Program.cs | 1 + .../tools/results/DetailReport.java | 5 ++ .../tools/results/RichReportAction.java | 30 +++++----- .../tools/results/RunResultRecorder.java | 55 ++++++++++--------- 4 files changed, 50 insertions(+), 41 deletions(-) diff --git a/LRAnalysisLauncher/Program.cs b/LRAnalysisLauncher/Program.cs index 49ae0e7a91..8982e3e8b3 100644 --- a/LRAnalysisLauncher/Program.cs +++ b/LRAnalysisLauncher/Program.cs @@ -59,6 +59,7 @@ static int Main(string[] args) int iPassed = (int)Launcher.ExitCodeEnum.Passed;//variable to keep track of whether all of the SLAs passed try { + //The app uses 3 default arguments, a 4th optional one can be used to specify the path to an analysis template if (args.Length != 3 && args.Length != 4) { ShowHelp(); diff --git a/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java b/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java index 82d0b15802..a93922b627 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java +++ b/src/main/java/com/hpe/application/automation/tools/results/DetailReport.java @@ -110,4 +110,9 @@ public void setFail(String value) { fail = value; } + public void updateReport(String duration, String pass, String fail) { + setDuration(duration); + setPass(pass); + setFail(fail); + } } diff --git a/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java index b6bf905fdd..3c34b2cb91 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java @@ -82,6 +82,10 @@ public RichReportAction(Run build) throws IOException { projectActionList = new ArrayList(); } + /** + * Reads data from report.index and displays a table with: + * scenario name, duration, transactions passed and failed + */ private void createRichIndexFile(Run build, File indexFile, DirectoryBrowserSupport dbs) throws IOException { BufferedReader br = new BufferedReader(new FileReader(indexFile)); String line; @@ -98,18 +102,16 @@ private void createRichIndexFile(Run build, File indexFile, DirectoryBrows report.setColor("#F1F1F1"); rolling = true; } - if (values.length >= 2) - report.setDuration(values[1]); - else - report.setDuration("##"); - if (values.length >= 3) - report.setPass(values[2]); - else - report.setPass("##"); - if (values.length >= 4) - report.setFail(values[3]); - else - report.setFail("##"); + //Set detailed report information + switch (values.length) { + case 4: + report.updateReport(values[1], values[2], values[3]); + case 3: + report.updateReport(values[1], values[2], "##"); + case 2: + report.updateReport(values[1], "##", "##"); + + } richReportMap.put(values[0], report); } br.close(); @@ -148,10 +150,6 @@ public Object getDynamic(String name, StaplerRequest req, StaplerResponse rsp) { @Override public Collection getProjectActions() { -// List projectActions = new ArrayList<>(); -// projectActions.add(new PerformanceProjectAction(build.getParent())); -// projectActions.add(new TestResultProjectAction(build.getParent())); -// return projectActions; return Collections.emptySet(); } diff --git a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java index 2a550bcff9..0643ab2feb 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RunResultRecorder.java @@ -407,7 +407,7 @@ private void archiveTestsReport( zipFileNames.add(zipFileName); } - createRichReports(reportFolder, testFolderPath, artifactsDir, reportNames, testResult); + createRichReports(reportFolder, testFolderPath, artifactsDir, reportNames, testResult, listener); createHtmlReport(reportFolder, testFolderPath, artifactsDir, reportNames, testResult); createTransactionSummary(reportFolder, testFolderPath, artifactsDir, reportNames, testResult); try { @@ -888,32 +888,37 @@ private void createRichReports(FilePath reportFolder, String testFolderPath, File artifactsDir, List reportNames, - TestResult testResult) throws IOException, InterruptedException { - File testFolderPathFile = new File(testFolderPath); - FilePath htmlReportPath = new FilePath(reportFolder, LRA_FOLDER); - if (htmlReportPath.exists()) { - File reportDirectory = new File(artifactsDir.getParent(), RICH_REPORT_FOLDER); - if (!reportDirectory.exists()) { - reportDirectory.mkdir(); - } - String newFolderName = org.apache.commons.io.FilenameUtils.getName(testFolderPathFile.getPath()); - File testDirectory = new File(reportDirectory, newFolderName); - if (!testDirectory.exists()) { - testDirectory.mkdir(); - } + TestResult testResult, + TaskListener listener) { + try { + File testFolderPathFile = new File(testFolderPath); + FilePath htmlReportPath = new FilePath(reportFolder, LRA_FOLDER); + if (htmlReportPath.exists()) { + File reportDirectory = new File(artifactsDir.getParent(), RICH_REPORT_FOLDER); + if (!reportDirectory.exists()) { + reportDirectory.mkdir(); + } + String newFolderName = org.apache.commons.io.FilenameUtils.getName(testFolderPathFile.getPath()); + File testDirectory = new File(reportDirectory, newFolderName); + if (!testDirectory.exists()) { + testDirectory.mkdir(); + } - FilePath dstReportPath = new FilePath(testDirectory); - FileFilter reportFileFilter = new WildcardFileFilter("*.pdf"); - List reportFiles = htmlReportPath.list(reportFileFilter); - List richReportNames = new ArrayList(); - for (FilePath fileToCopy : reportFiles) { - FilePath dstFilePath = new FilePath(dstReportPath, fileToCopy.getName()); - fileToCopy.copyTo(dstFilePath); - richReportNames.add(dstFilePath.getName()); - } + FilePath dstReportPath = new FilePath(testDirectory); + FileFilter reportFileFilter = new WildcardFileFilter("*.pdf"); + List reportFiles = htmlReportPath.list(reportFileFilter); + List richReportNames = new ArrayList(); + for (FilePath fileToCopy : reportFiles) { + FilePath dstFilePath = new FilePath(dstReportPath, fileToCopy.getName()); + fileToCopy.copyTo(dstFilePath); + richReportNames.add(dstFilePath.getName()); + } - outputReportFiles(reportNames, reportDirectory, testResult, "Rich Reports", INDEX_HTML_NAME); - createRichReportHtml(testDirectory, richReportNames); + outputReportFiles(reportNames, reportDirectory, testResult, "Rich Reports", INDEX_HTML_NAME); + createRichReportHtml(testDirectory, richReportNames); + } + } catch (IOException|InterruptedException ex) { + listener.getLogger().println("Exception caught while creating rich reports: " + ex); } } From e666467e619af7f1181a446badd7b090ed5a3d69 Mon Sep 17 00:00:00 2001 From: Vlad Rolando-Mihai Date: Fri, 13 Jul 2018 20:08:09 +0300 Subject: [PATCH 0414/2502] Fixed switch case. --- .../application/automation/tools/results/RichReportAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java b/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java index 3c34b2cb91..deea733bb1 100644 --- a/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java +++ b/src/main/java/com/hpe/application/automation/tools/results/RichReportAction.java @@ -106,11 +106,12 @@ private void createRichIndexFile(Run build, File indexFile, DirectoryBrows switch (values.length) { case 4: report.updateReport(values[1], values[2], values[3]); + break; case 3: report.updateReport(values[1], values[2], "##"); + break; case 2: report.updateReport(values[1], "##", "##"); - } richReportMap.put(values[0], report); } From 77d72d0731f83f96800edeaf210baf96528a88b1 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Sat, 14 Jul 2018 10:10:03 +0300 Subject: [PATCH 0415/2502] [JENKINS-52556] Rebrand missed files https://issues.jenkins-ci.org/browse/JENKINS-52556 --- .../tools/model/AutEnvironmentModel/config.properties | 2 +- .../octane/actions/UFTTestDetectionBuildAction/index.jelly | 4 ++-- .../pipelineSteps/SseBuildAndPublishStep/config.properties | 4 ++-- .../tools/pipelineSteps/UftScenarioLoadStep/config.properties | 2 +- .../tools/run/AutEnvironmentBuilder/config.properties | 2 +- .../automation/tools/run/PcBuilder/help-vudsMode.html | 2 +- .../settings/OctaneServerSettingsBuilder/help-identity.html | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties index 39e13aa8a6..6160d917da 100644 --- a/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties +++ b/src/main/resources/com/hpe/application/automation/tools/model/AutEnvironmentModel/config.properties @@ -31,6 +31,6 @@ # # -AlmServersAreNotDefined=HPE ALM servers are not defined. To use this build step, goto Manage Jenkins->Configure System->Application Lifecycle Management->Add ALM server +AlmServersAreNotDefined=Micro Focus ALM servers are not defined. To use this build step, goto Manage Jenkins->Configure System->Application Lifecycle Management->Add ALM server AutEnvironmentConfigurationDescription=Use this build step to assign values to AUT Environment Configuration in ALM. \ No newline at end of file diff --git a/src/main/resources/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly b/src/main/resources/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly index c055979f1c..0894694c3e 100644 --- a/src/main/resources/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly +++ b/src/main/resources/com/hpe/application/automation/tools/octane/actions/UFTTestDetectionBuildAction/index.jelly @@ -33,7 +33,7 @@ --> - + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 2cea55e32c..78cae4434c 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -22,7 +22,44 @@ - +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    FrameworkLinux shell
    Maven Surefiremvn clean -Dtest=$testsToRunConverted test
    Maven Failsafemvn clean -Dit.test=$testsToRunConverted verify
    Gradlegradle test $testsToRunConverted
    Protractorprotractor conf.js --grep="$testsToRunConverted"
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FrameworkWindows batch command
    Maven Surefiremvn clean -Dtest=%testsToRunConverted% test
    Maven Failsafemvn clean -Dit.test=%testsToRunConverted% verify
    Gradlegradle test %testsToRunConverted%
    Protractorprotractor conf.js --grep="%testsToRunConverted%"
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FrameworkPipeline script
    Maven Surefirebat 'mvn clean -Dtest=${params.testsToRunConverted} test'
    Maven Failsafebat 'mvn clean -Dit.test=${params.testsToRunConverted} verify'
    Gradlebat 'gradle test ${params.testsToRunConverted}'
    Protractorbat(/protractor conf.js --grep="${params.testsToRunConverted}"/)
    +
    +

  • + +
    -
    - * For UFT: In order to build a UFT MTBX file, this builder needs to know the test check-out directory. By default this is the job workspace directory. - If tests are checked out in another directory, define in the job a String parameter "testsToRunCheckoutDirectory" with the correct directory. + * For UFT: In order to build a UFT MTBX file, this builder needs to know the test check-out directory. By + default this is the job workspace directory. + If tests are checked out in another directory, define in the job a String parameter "testsToRunCheckoutDirectory" + with the correct directory.
    ** For JUnit/TestNG: supported for JUnit 4.7+, Surefire Plugin 2.19+, Failsafe Plugin 2.12.1+
    From 2c2209e4c062ca54c8b9cc7874165a87f729f433 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 30 Jun 2019 17:56:07 +0300 Subject: [PATCH 0929/2502] tech : fixing getProperties to be active only in custom test framework --- .../octane/testrunner/TestsToRunConverterBuilder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 88a96ebc58..54178813e7 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -140,9 +140,10 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu public Map getProperties() { Map properties = new HashMap(); - properties.put(TestsToRunConverter.CONVERTER_FORMAT, getFormat()); - properties.put(TestsToRunConverter.CONVERTER_DELIMITER, getDelimiter()); - + if(TestsToRunFramework.Custom.value().equals(getFramework())) { + properties.put(TestsToRunConverter.CONVERTER_FORMAT, getFormat()); + properties.put(TestsToRunConverter.CONVERTER_DELIMITER, getDelimiter()); + } return properties; } From 86ff0c8b6bee56750248d817c7acc9b5178d00ea Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 30 Jun 2019 19:47:15 +0300 Subject: [PATCH 0930/2502] tech : adding cucumber testing framework converter --- pom.xml | 2 +- .../TestsToRunConverterBuilder/help.html | 27 ++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 698d123684..1a5c244930 100644 --- a/pom.xml +++ b/pom.xml @@ -470,7 +470,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.0.55 + 2.0.56 diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html index 7482318ad0..e3b5537885 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html @@ -53,6 +53,10 @@ Maven Failsafe mvn clean -Dit.test=$testsToRunConverted verify + + Cucumber + mvn clean test -Dcucumber.options="--name $testsToRunConverted" + Gradle gradle test $testsToRunConverted @@ -76,6 +80,10 @@ Maven Surefire mvn clean -Dtest=%testsToRunConverted% test + + Cucumber + mvn clean test -Dcucumber.options="--name %testsToRunConverted%" + Maven Failsafe mvn clean -Dit.test=%testsToRunConverted% verify @@ -107,6 +115,10 @@ Maven Failsafe bat 'mvn clean -Dit.test=${params.testsToRunConverted} verify' + + Cucumber + bat(/mvn clean test -Dcucumber.options="--name ${params.testsToRunConverted}"/) + Gradle bat 'gradle test ${params.testsToRunConverted}' @@ -123,12 +135,13 @@
    - * For UFT: In order to build a UFT MTBX file, this builder needs to know the test check-out directory. By - default this is the job workspace directory. - If tests are checked out in another directory, define in the job a String parameter "testsToRunCheckoutDirectory" - with the correct directory. -
    - ** For JUnit/TestNG: supported for JUnit 4.7+, Surefire Plugin 2.19+, Failsafe Plugin 2.12.1+ + Notes/Limitations :
    - +
      +
    • UFT: In order to build a UFT MTBX file, this builder needs to know the test check-out directory. By + default this is the job workspace directory. If tests are checked out in another directory, define in the job a String parameter "testsToRunCheckoutDirectory" + with the correct directory.
    • +
    • JUnit/TestNG: supported for JUnit 4.7+, Surefire Plugin 2.19+, Failsafe Plugin 2.12.1+.
    • +
    • Cucumber: execution is done by scenario name only. If there are several scenarios with the same name in different features, they all will be executed.
    • +
    \ No newline at end of file From 07d6f766a80d78103d9299c24197f40e512f1964 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 1 Jul 2019 14:02:39 +0300 Subject: [PATCH 0931/2502] tech : adding cucumber testing framework converter - some doc fixes --- .../TestsToRunConverterBuilder/help.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html index e3b5537885..bd6a016b54 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html @@ -28,15 +28,15 @@
    • To use in parameter textboxes, use the following syntax: ${testsToRunConverted}

    • -
    • To use in the scripts , use the following syntax: +
    • To use in the scripts, use the following syntax:
        -
      • Linux shell : $testsToRunConverted
      • -
      • Windows batch command : %testsToRunConverted%
      • -
      • Pipeline script (workflow job) : "${params.testsToRunConverted}"
      • +
      • Linux shell: $testsToRunConverted
      • +
      • Windows batch command: %testsToRunConverted%
      • +
      • Pipeline script (workflow job): "${params.testsToRunConverted}"

      - See examples in the tables below : + See examples in the tables below: @@ -141,7 +141,7 @@
    • UFT: In order to build a UFT MTBX file, this builder needs to know the test check-out directory. By default this is the job workspace directory. If tests are checked out in another directory, define in the job a String parameter "testsToRunCheckoutDirectory" with the correct directory.
    • -
    • JUnit/TestNG: supported for JUnit 4.7+, Surefire Plugin 2.19+, Failsafe Plugin 2.12.1+.
    • -
    • Cucumber: execution is done by scenario name only. If there are several scenarios with the same name in different features, they all will be executed.
    • +
    • JUnit/TestNG: Supported for JUnit 4.7+, Surefire Plugin 2.19+, Failsafe Plugin 2.12.1+.
    • +
    • Cucumber: Execution is done by scenario name only. If there are several scenarios with the same name in different features, they all will be executed.
    • \ No newline at end of file From 58086ca163aea945807d8c27e8f325cfc78743e0 Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Tue, 9 Jul 2019 14:32:32 +0300 Subject: [PATCH 0932/2502] add SSO option, updated file system and alm runners --- .../HpToolsLauncherTests/UnitTest1.cs | 2 +- HpToolsLauncher/Launcher.cs | 25 ++++++++--- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 44 +++++++++++++++---- .../Runners/FileSystemTestsRunner.cs | 1 + HpToolsLauncher/TestRunners/GuiTestRunner.cs | 6 ++- .../tools/model/RunFromAlmModel.java | 11 ++++- .../automation/tools/model/SseModel.java | 2 +- .../tools/run/RunFromAlmBuilder.java | 8 +++- .../tools/run/RunFromAlmBuilder/config.jelly | 12 ++++- .../tools/run/RunFromFileBuilder/config.jelly | 2 +- .../uft/model/UftSettingsModel/config.jelly | 2 +- src/main/webapp/js/almUtils.js | 17 +++++++ .../js/{utils.js => fileSystemUtils.js} | 3 ++ .../tests/detection/UFTExtensionTest.java | 2 +- 14 files changed, 110 insertions(+), 27 deletions(-) create mode 100644 src/main/webapp/js/almUtils.js rename src/main/webapp/js/{utils.js => fileSystemUtils.js} (99%) diff --git a/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs b/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs index f2c774598c..789be7d3d2 100644 --- a/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs +++ b/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs @@ -131,7 +131,7 @@ public void TestQcTestRun() 100000, QcRunMode.RUN_LOCAL, null, - new List { "Aaron\\Amit" }, false, "", new List { "Failed", "Blocked" }, false, TestStorageType.Alm); + new List { "Aaron\\Amit" }, false, "", new List { "Failed", "Blocked" }, false, TestStorageType.Alm, false); if (runner.Connected) runner.Run(); diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 90c199edfe..119051bc73 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -328,7 +328,7 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara switch (runType) { case TestStorageType.AlmLabManagement: - List testSetsList = GetParamsWithPrefix("almEntityId"); + List testSetsList = GetParamsWithPrefix("TestSet"); string filterByName = (_ciParams.ContainsKey("FilterByName") ? _ciParams["FilterByName"] : ""); @@ -347,6 +347,9 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara filterByStatuses.Add(statuses); } } + + bool isSSOEnabled = _ciParams.ContainsKey("SSOEnabled") && Convert.ToBoolean(_ciParams["SSOEnabled"]); + //create an Alm runner runner = new AlmTestSetsRunner(_ciParams["almServerUrl"], _ciParams["almUserName"], @@ -361,11 +364,11 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara filterByName, filterByStatuses, initialTestRun, - TestStorageType.AlmLabManagement); + TestStorageType.AlmLabManagement, + isSSOEnabled); break; case TestStorageType.Alm: - Console.WriteLine("runType is alm"); //check that all required parameters exist foreach (string param1 in requiredParamsForQcRun) { @@ -404,14 +407,15 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara } //check if filterTests flag is selected; if yes apply filters on the list + bool isFilterSelected; - string filter = (_ciParams.ContainsKey("FilterTests") ? _ciParams["FilterTests"] : ""); + string filter = _ciParams.ContainsKey("FilterTests") ? _ciParams["FilterTests"] : ""; isFilterSelected = !string.IsNullOrEmpty(filter) && Convert.ToBoolean(filter.ToLower()); - filterByName = (_ciParams.ContainsKey("FilterByName") ? _ciParams["FilterByName"] : ""); + filterByName = _ciParams.ContainsKey("FilterByName") ? _ciParams["FilterByName"] : ""; - statuses = (_ciParams.ContainsKey("FilterByStatus") ? _ciParams["FilterByStatus"] : ""); + statuses = _ciParams.ContainsKey("FilterByStatus") ? _ciParams["FilterByStatus"] : ""; filterByStatuses = new List(); @@ -425,6 +429,8 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara filterByStatuses.Add(statuses); } } + + isSSOEnabled = _ciParams.ContainsKey("SSOEnabled") && Convert.ToBoolean(_ciParams["SSOEnabled"]); //create an Alm runner runner = new AlmTestSetsRunner(_ciParams["almServerUrl"], @@ -440,7 +446,8 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara filterByName, filterByStatuses, initialTestRun, - TestStorageType.Alm); + TestStorageType.Alm, + isSSOEnabled); break; case TestStorageType.FileSystem: bool displayController = false; @@ -833,6 +840,10 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul _xmlBuilder.CreateXmlFromRunResults(results); + if (results.TestRuns.Count == 0) + { + Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; + } //if there is an error if (results.TestRuns.Any(tr => tr.TestState == TestState.Failed || tr.TestState == TestState.Error)) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index b1b2c8d439..a21856020f 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -38,6 +38,7 @@ namespace HpToolsLauncher { public class AlmTestSetsRunner : RunnerBase, IDisposable { + private ITDConnection2 _tdConnection; public ITDConnection2 TdConnection @@ -79,6 +80,8 @@ public ITDConnection2 TdConnection public double Timeout { get; set; } + public bool SSOEnabled { get; set; } + /// /// constructor @@ -97,6 +100,7 @@ public ITDConnection2 TdConnection /// /// /// + /// public AlmTestSetsRunner(string qcServer, string qcUser, string qcPassword, @@ -110,8 +114,10 @@ public AlmTestSetsRunner(string qcServer, string filterByName, List filterByStatuses, bool initialTestRun, - TestStorageType testStorageType) + TestStorageType testStorageType, + bool isSSOEnabled) { + Timeout = intQcTimeout; RunMode = enmQcRunMode; RunHost = runHost; @@ -125,8 +131,9 @@ public AlmTestSetsRunner(string qcServer, FilterByName = filterByName; FilterByStatuses = filterByStatuses; InitialTestRun = initialTestRun; + SSOEnabled = isSSOEnabled; - Connected = ConnectToProject(MQcServer, MQcUser, qcPassword, MQcDomain, MQcProject); + Connected = ConnectToProject(MQcServer, MQcUser, qcPassword, MQcDomain, MQcProject, SSOEnabled); TestSets = qcTestSets; Storage = testStorageType; if (!Connected) @@ -216,11 +223,12 @@ private bool CheckIsOldQc() /// /// /// + /// /// - public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, string qcDomain, string qcProject) + public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, string qcDomain, string qcProject, bool SSOEnabled) { if (string.IsNullOrWhiteSpace(qcServerUrl) - || string.IsNullOrWhiteSpace(qcLogin) + || (string.IsNullOrWhiteSpace(qcLogin) && !SSOEnabled) || string.IsNullOrWhiteSpace(qcDomain) || string.IsNullOrWhiteSpace(qcProject)) { @@ -244,7 +252,14 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, } try { - TdConnection.Login(qcLogin, qcPass); + if (!SSOEnabled) + { + TdConnection.Login(qcLogin, qcPass); + } + else + { + //TODO - connect through SSO + } } catch (Exception ex) { @@ -512,12 +527,12 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet if (tsFolder != null) { - + if ((testStorageType.Equals(TestStorageType.AlmLabManagement) && !testSet.Equals("")) || testStorageType.Equals(TestStorageType.Alm)) { List testList = tsFolder.FindTestSets(testSuiteName); - + return testList; } @@ -1019,7 +1034,20 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } //get target test set - ITestSet targetTestSet = GetTargetTestSet(testSetList, testSuiteName); + if (testSetList == null) + { + Console.WriteLine("Null test set list"); + } + + ITestSet targetTestSet = null; + try + { + targetTestSet = GetTargetTestSet(testSetList, testSuiteName); + } + catch (Exception ex) + { + Console.WriteLine("Null test set list"); + } ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); ConsoleWriter.WriteLine(Resources.AlmRunnerStartingExecution); diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index bf5de52c39..267883d166 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -379,6 +379,7 @@ private bool CheckTimeout() private TestRunResults RunHpToolsTest(TestInfo testInfo, ref string errorReason) { var testPath = testInfo.TestPath; + var type = Helper.GetTestType(testPath); // if we have at least one environment for parallel runner, diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 45aa52f568..fb075d92fa 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -431,7 +431,11 @@ private GuiTestRunResult ExecuteQTPRun(TestRunResults testResults) Type runResultsOptionstype = Type.GetTypeFromProgID("QuickTest.RunResultsOptions"); var options = (RunResultsOptions)Activator.CreateInstance(runResultsOptionstype); options.ResultsLocation = testResults.ReportLocation; - _qtpApplication.Options.Run.RunMode = _uftRunMode; + // _qtpApplication.Options.Run.RunMode = _uftRunMode; + if (_uftRunMode != null) + { + _qtpApplication.Options.Run.RunMode = _uftRunMode; + } //Check for cancel before executing if (_runCancelled()) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java index 4f88054bcb..53984e4051 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java @@ -34,7 +34,6 @@ import java.util.Properties; -import jenkins.model.Jenkins; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; @@ -64,12 +63,13 @@ public class RunFromAlmModel extends AbstractDescribableImpl { private String almTimeout; private String almRunMode; private String almRunHost; + private Boolean isSSOEnabled; @DataBoundConstructor public RunFromAlmModel(String almServerName, String almUserName, String almPassword, String almDomain, String almProject, String almTestSets, String almRunResultsMode, String almTimeout, - String almRunMode, String almRunHost){ + String almRunMode, String almRunHost, Boolean isSSOEnabled){ this.almServerName = almServerName; this.almUserName = almUserName; @@ -86,6 +86,8 @@ public RunFromAlmModel(String almServerName, String almUserName, this.almTimeout = almTimeout; this.almRunMode = almRunMode; this.almRunHost = almRunHost; + + this.isSSOEnabled = isSSOEnabled; } public String getAlmUserName() { @@ -128,6 +130,10 @@ public String getAlmServerName() { return almServerName; } + public Boolean isSSOEnabled() { + return isSSOEnabled; + } + public Properties getProperties(EnvVars envVars, VariableResolver varResolver) { return CreateProperties(envVars, varResolver); @@ -140,6 +146,7 @@ public Properties getProperties() { private Properties CreateProperties(EnvVars envVars, VariableResolver varResolver) { Properties props = new Properties(); + props.put("SSOEnabled", Boolean.toString(isSSOEnabled)); if (envVars == null) { props.put("almUserName", almUserName); diff --git a/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java b/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java index 215178d1c2..856ad7d039 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java @@ -232,7 +232,7 @@ private Properties createProperties() { props.put("almProject", getAlmProject()); props.put("clientType", getClientType()); props.put("almRunType", getRunType()); - props.put("almEntityId1", getAlmEntityId()); + props.put("TestSet1", getAlmEntityId()); props.put("almTimeout", getTimeslotDuration()); props.put("description", getDescription()); props.put("environmentConfigurationId", getEnvironmentConfigurationId()); diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index e8b44fb9c0..872d05827c 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -84,6 +84,7 @@ public RunFromAlmBuilder( String almTimeout, String almRunMode, String almRunHost, + boolean isSSOEnabled, boolean isFilterTestsEnabled, FilterTestsModel filterTestsModel){ @@ -101,13 +102,16 @@ public RunFromAlmBuilder( almRunResultsMode, almTimeout, almRunMode, - almRunHost); + almRunHost, + isSSOEnabled); } public String getAlmServerName(){ return runFromAlmModel.getAlmServerName(); } + public boolean getIsSSOEnabled() { return runFromAlmModel.isSSOEnabled(); } + public String getAlmUserName(){ return runFromAlmModel.getAlmUserName(); } @@ -148,7 +152,7 @@ public boolean getIsFilterTestsEnabled() { return isFilterTestsEnabled; } - @DataBoundSetter + @DataBoundSetter public void setIsFilterTestsEnabled(boolean isFilterTestsEnabled) { this.isFilterTestsEnabled = isFilterTestsEnabled; } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 78cae4434c..66a2747cb3 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -22,6 +22,8 @@ + \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html deleted file mode 100644 index 12d69cd1c2..0000000000 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-delimiter.html +++ /dev/null @@ -1,24 +0,0 @@ - -
      - The delimiter used to separate different tests when converting the "testsToRun" parameter to the format of the selected testing framework.
      - For usage details refer to the help on the format field. - -
      \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html index 8fde204f01..74e02b4967 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help-format.html @@ -18,23 +18,91 @@ ~ ___________________________________________________________________ -->
      - The format used for converting the single test data that is received in the "testsToRun" parameter, to the format of the custom testing framework. This is then injected to the "testsToRunConverted" parameter.
      - The format syntax is: -
        -
      • $package - uses the test package name in the conversion
      • -
      • $class - uses the test class name in the conversion
      • -
      • $testName - uses the test name in the conversion
      • + Custom configuration is json that describes how to convert tests in raw format to the format of your testing framework. + After conversion, result is injected to the "testsToRunConverted" parameter. + +

        + Note : In "Advanced" section you can validate correctness of the inserted configuration. +

        + + + Here are properties of the custom configuration +
          +
        • testPattern - describes pattern for converting single test. It uses reserved words ($package,$class,$testName) that will be + replaced by real test data. All other characters in pattern will appear as is in final result
        • +
        • testDelimiter - the delimiter used to separate different tests
        • +
        • prefix - the prefix for whole conversion result
        • +
        • suffix - the suffix for whole conversion result
        • +
        • testsToRunConvertedParameter - the parameter name to set conversion result to. Default value is “testsToRunConvertedâ€
        • +
        • replacements - the array of replace methods
        • +
        + Minimal configuration is: +

        +
        +{
        +    "testPattern": "$package.$class#$testName",
        +    "testDelimiter": ","
        +}
        +    
        +
        For example:

        - The testsToRun parameter received 2 tests separated by a semicolon: v1:MF.simple.tests|AppTest|testA;MF.simple.tests|App2Test|testSendGet
        - The defined format is: $package.$class#$testName
        - The defined delimiter is: , + The testsToRun parameter received 2 tests separated by a semicolon: v1:myPackage1|myClass1|myTest1;myPackage2|myClass2|myTest2
        + The defined testPattern is: $package.$class#$testName
        + The defined testDelimiter is: ,
          -
        • $package variable will get a value: MF.simple.tests
        • -
        • $class variable will get a value: AppTest
        • -
        • $testName variable will get a value: testA
        • +
        • $package variable will get a value: myPackage1 for first test and myPackage2 for second one
        • +
        • $class variable will get a value: myClass1 for first test and myClass2 for second one
        • +
        • $testName variable will get a value: myTest1 for first test and myTest2 for second one
        -
        The testsToRunConverted will be equal: MF.simple.tests.AppTest#testA,MF.simple.tests.App2Test#testSendGet +
        The testsToRunConverted will be equal: myPackage1.myClass1#myTest1,myPackage2.myClass2#myTest2 + +
        +
        + There is possibility to alter values that received from ALM Octane, for example set lower case to the testName,replace spaces by '_', and so on. + +
        Here are examples of available replace methods. Each replace method contains "target" property that define what parts of the test pattern are affected by replace method, + available values are $package,$class,$testName. Its possible to put several values separated by '|'. The replacements are executed in the order they appear in configuration json. +
        +"replacements": [
        +{
        +    "type": "replaceRegex",
        +    "target": "$package|$class|$testName",
        +    "regex": "aaa",
        +    "replacement": "bbb",
        +    "description": "Replaces all the sequence of characters matching regex by replacement string."
        +},{
        +    "type": "replaceRegexFirst",
        +    "target": "$package|$class|$testName",
        +    "regex": "aaa",
        +    "replacement": "bbb",
        +    "description": "Replaces the first substring that matches the given regex with the given replacement."
        +},{
        +    "type": "replaceString",
        +    "target": "$package|$class|$testName",
        +    "string": "xxx",
        +    "replacement": "yyy",
        +    "description": "Replaces all occurrences of ‘string’ with ‘replacement’."
        +},{
        +    "type": "joinString",
        +    "target": "$package|$class|$testName",
        +    "prefix": "xxx",
        +    "suffix": "yyy",
        +    "description": "Add prefix and suffix to the test template."
        +},{
        +    "type": "toLowerCase",
        +    "target": "$package|$class|$testName",
        +    "description": "Convert test template to lower case."
        +},{
        +    "type": "toUpperCase",
        +    "target": "$package|$class|$testName",
        +    "description": "Convert test template to upper  case."
        +},{
        +    "type": "notLatinAndDigitToOctal",
        +    "target": "$package|$class|$testName",
        +    "description": "Replaces all non-latin characters and digits ^[a-zA-Z0-9] to their ASCII octal value."
        +}]
        +
      \ No newline at end of file From cf6a0bd8f78a25348dc23ca35dc1a0d08654892d Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Thu, 18 Jul 2019 09:59:14 +0300 Subject: [PATCH 0941/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-5.8.2-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8f7e7cba5f..299e651739 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ hp-application-automation-tools-plugin - 5.8.2-beta-SNAPSHOT + 5.8.2-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -71,7 +71,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-5.8.2-beta From 1dd34ac035b8a92a9a0f0e9a422ee10700931216 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Thu, 18 Jul 2019 09:59:28 +0300 Subject: [PATCH 0942/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 299e651739..c4fb7841cf 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ hp-application-automation-tools-plugin - 5.8.2-beta + 5.8.3-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -71,7 +71,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.8.2-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 1bf5913882db0e539258a83d3bc56c33d80216a3 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 18 Jul 2019 23:50:30 +0300 Subject: [PATCH 0943/2502] tech : improving custom framework --- .../TestsToRunConverterBuilder.java | 4 +- .../TestsToRunConverterBuilder/config.jelly | 109 +++++++++++------- 2 files changed, 69 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 8975c669ff..a6d3808f1b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -161,8 +161,8 @@ public String getFormat() { return framework.getFramework().getFormat(); } - public boolean getIsCustom(){ - return TestsToRunFramework.Custom.value().equals(framework.getFramework().getName()); + public boolean getIsCustom() { + return framework != null && TestsToRunFramework.Custom.value().equals(framework.getFramework().getName()); } private void printToConsole(TaskListener listener, String msg) { diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly index b0ba8754df..7b89b4cce1 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly @@ -23,7 +23,7 @@ - ${myFramework.description} @@ -31,19 +31,27 @@ - - - - - + + + + + + + + @@ -55,21 +63,29 @@ method="testConvert" with="teststorunconverter.framework,teststorunconverter.format,testsToRun"/> - \ No newline at end of file From 63bd7ca3f42f1cecd42171657c84495edb649361 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 21 Jul 2019 13:23:04 +0300 Subject: [PATCH 0944/2502] tecj : remove console.log --- .../octane/testrunner/TestsToRunConverterBuilder/config.jelly | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly index 7b89b4cce1..69fb22c0e3 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly @@ -160,7 +160,6 @@ break; } } - console.log("getTableParent",myElement); return myElement; } From 54613ae4d3d58d4460c96060b30f40dfd6b835b7 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Sun, 21 Jul 2019 14:43:08 +0300 Subject: [PATCH 0945/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-5.8.3-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c4fb7841cf..f43e1577ad 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ hp-application-automation-tools-plugin - 5.8.3-beta-SNAPSHOT + 5.8.3-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -71,7 +71,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-5.8.3-beta From 9a5d764a4217b93e0d9f0700b93cd508f6f319f6 Mon Sep 17 00:00:00 2001 From: Daniel Gront Date: Sun, 21 Jul 2019 14:43:22 +0300 Subject: [PATCH 0946/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f43e1577ad..a9fd3942c2 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ hp-application-automation-tools-plugin - 5.8.3-beta + 5.8.4-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -71,7 +71,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-5.8.3-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 9c5043395529f292c1bb04bfe16d1d7e9178596d Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 28 Jul 2019 12:39:39 +0300 Subject: [PATCH 0947/2502] defect #875099 : two jobs with the same name in folder - are not treated correctly --- .../tools/octane/CIJenkinsServicesImpl.java | 35 ++++++++++++++++++- .../octane/tests/build/BuildHandlerUtils.java | 5 +++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index 542b2a2ea5..00383791fb 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -59,6 +59,7 @@ import com.microfocus.application.automation.tools.octane.model.processors.projects.AbstractProjectProcessor; import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; import com.microfocus.application.automation.tools.octane.tests.TestListener; +import com.microfocus.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.microfocus.application.automation.tools.octane.tests.junit.JUnitExtension; import hudson.ProxyConfiguration; import hudson.console.PlainTextConsoleOutputStream; @@ -71,6 +72,7 @@ import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; import javax.xml.bind.DatatypeConverter; @@ -692,13 +694,44 @@ private Job getJobByRefId(String jobRefId) { String parentJobRefId = jobRefId.substring(0, jobRefId.indexOf('/')); item = getTopLevelItem(parentJobRefId); if (item != null) { + String jobName = BuildHandlerUtils.revertTranslateFolderJobName(jobRefId); Collection allJobs = item.getAllJobs(); for (Job job : allJobs) { - if (jobRefId.endsWith(job.getName())) { + if (jobName.equals(job.getFullName())) { result = job; break; } } + + //PATCH UNTIL OCTANE SEND jobRefId correctly (fix in octane : pipeline-management-add-dialog-controller.js) + //bug in octane : duplicating parent prefix, for example job f1/f2/jobA , appear as f1/f2/f1/f2/jobA + //try to reduce duplication and find job + if (result == null) { + int jobNameIndex = jobName.lastIndexOf('/'); + String parentPrefix = jobName.substring(0, jobNameIndex); + String notDuplicatedParentPrefix1 = jobName.substring(0, parentPrefix.length() / 2); + String notDuplicatedParentPrefix2 = jobName.substring((parentPrefix.length() / 2) + 1, jobNameIndex); + if (StringUtils.equals(notDuplicatedParentPrefix1, notDuplicatedParentPrefix2)) { + String alternativeJobName = notDuplicatedParentPrefix1 + jobName.substring(jobNameIndex); + for (Job job : allJobs) { + if (alternativeJobName.equals(job.getFullName())) { + result = job; + break; + } + } + } + } + + //if not found - try to find by last name only. it work wrong if there are several jobs with the same name but in different subfolders + //for example : f1/f2/jobA and f1/f3/jobA + if (result == null) { + for (Job job : allJobs) { + if (jobRefId.endsWith(job.getName())) { + result = job; + break; + } + } + } } } } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/build/BuildHandlerUtils.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/build/BuildHandlerUtils.java index 46cc48e8a7..79cb9dcc9f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/build/BuildHandlerUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/build/BuildHandlerUtils.java @@ -141,6 +141,11 @@ public static String translateFolderJobName(String jobPlainName) { return jobPlainName.replaceAll("/", newSplitterCharacters); } + public static String revertTranslateFolderJobName(String translatedJobName) { + String newSplitterCharacters = "/"; + return translatedJobName.replaceAll("/job/", newSplitterCharacters); + } + public static CIBuildResult translateRunResult(Run run) { CIBuildResult result; if (run.getResult() == Result.SUCCESS) { From 58ccc1723dc701e88c8aef1c312192bdcbd2d9d1 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 29 Jul 2019 10:40:19 +0300 Subject: [PATCH 0948/2502] defect #875099 : two jobs with the same name in folder - are not treated correctly --- .../tools/octane/CIJenkinsServicesImpl.java | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index 00383791fb..fe4fe800c1 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -703,35 +703,32 @@ private Job getJobByRefId(String jobRefId) { } } - //PATCH UNTIL OCTANE SEND jobRefId correctly (fix in octane : pipeline-management-add-dialog-controller.js) - //bug in octane : duplicating parent prefix, for example job f1/f2/jobA , appear as f1/f2/f1/f2/jobA - //try to reduce duplication and find job - if (result == null) { - int jobNameIndex = jobName.lastIndexOf('/'); - String parentPrefix = jobName.substring(0, jobNameIndex); - String notDuplicatedParentPrefix1 = jobName.substring(0, parentPrefix.length() / 2); - String notDuplicatedParentPrefix2 = jobName.substring((parentPrefix.length() / 2) + 1, jobNameIndex); - if (StringUtils.equals(notDuplicatedParentPrefix1, notDuplicatedParentPrefix2)) { - String alternativeJobName = notDuplicatedParentPrefix1 + jobName.substring(jobNameIndex); - for (Job job : allJobs) { - if (alternativeJobName.equals(job.getFullName())) { - result = job; - break; - } - } - } - } - - //if not found - try to find by last name only. it work wrong if there are several jobs with the same name but in different subfolders - //for example : f1/f2/jobA and f1/f3/jobA - if (result == null) { - for (Job job : allJobs) { - if (jobRefId.endsWith(job.getName())) { - result = job; - break; - } - } - } + // defect #875099 : two jobs with the same name in folder - are not treated correctly + // PATCH UNTIL OCTANE SEND jobRefId correctly (fix in octane : pipeline-management-add-dialog-controller.js) + //bug in octane : duplicating parent prefix, for example job f1/f2/jobA , appear as f1/f2/f1/f2/jobA + //try to reduce duplication and find job + if (result == null) { + int jobNameIndex = jobName.lastIndexOf('/'); + String parentPrefix = jobName.substring(0, jobNameIndex); + String notDuplicatedParentPrefix1 = jobName.substring(0, parentPrefix.length() / 2); + String notDuplicatedParentPrefix2 = jobName.substring((parentPrefix.length() / 2) + 1, jobNameIndex); + if (StringUtils.equals(notDuplicatedParentPrefix1, notDuplicatedParentPrefix2)) { + String alternativeJobName = notDuplicatedParentPrefix1 + jobName.substring(jobNameIndex); + result = allJobs.stream().filter(job -> alternativeJobName.equals(job.getFullName())).findFirst().orElse(null); + } + } + + //if not found - try to find by last name only. it work wrong if there are several jobs with the same name but in different subfolders + //for example : f1/f2/jobA and f1/f3/jobA + if (result == null) { + for (Job job : allJobs) { + if (jobRefId.endsWith(job.getName())) { + result = job; + logger.info(String.format("getJobByRefId %s found job only by jobName : %s", jobRefId, job.getName())); + break; + } + } + } } } } From 6acf415c8b246fc826d0243daebddb38485aa391 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 31 Jul 2019 09:47:10 +0300 Subject: [PATCH 0949/2502] improving custom framework --- pom.xml | 2 +- .../TestsToRunConverterBuilder/config.jelly | 69 +++++++++++-------- .../help-format.html | 38 +++++----- 3 files changed, 61 insertions(+), 48 deletions(-) diff --git a/pom.xml b/pom.xml index a9fd3942c2..346a57378b 100644 --- a/pom.xml +++ b/pom.xml @@ -470,7 +470,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.0.63 + 2.0.64 diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly index 69fb22c0e3..ced95be946 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/config.jelly @@ -32,31 +32,33 @@ - - - - - - - - +
      + + + + + + + + +
      - - - + + + @@ -109,7 +111,6 @@ - diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index e5c0ae5fc4..66aeb606b9 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -21,4 +21,5 @@ function enableSSO(element){ clientID.disabled = true; apiKey.disabled = true; } -} \ No newline at end of file +} + From fb1f84519f45c27a914109bc0ca784c989f36fd5 Mon Sep 17 00:00:00 2001 From: Roy Lu Date: Wed, 4 Sep 2019 15:01:04 +0800 Subject: [PATCH 0994/2502] JENKINS-59138 Revert Anda's change. --- .../automation/tools/model/SseModel.java | 53 ------ .../automation/tools/run/AlmRunTypes.java | 2 +- .../automation/tools/run/SseBuilder.java | 112 ++--------- .../run/AutEnvironmentBuilder/config.jelly | 34 ---- .../tools/run/SseBuilder/config.jelly | 179 +++++------------- 5 files changed, 65 insertions(+), 315 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java b/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java index 51daa50a04..b28a296125 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/SseModel.java @@ -22,13 +22,7 @@ import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Properties; -import com.microfocus.application.automation.tools.EncryptionUtils; -import hudson.EnvVars; -import hudson.util.Secret; -import hudson.util.VariableResolver; import org.kohsuke.stapler.DataBoundConstructor; /** @@ -42,7 +36,6 @@ public class SseModel { public static final String TEST_SET = "TEST_SET"; public static final String BVS = "BVS"; public static final String PC = "PC"; - public static final String RUN_MODE = "Run locally"; public static final String COLLATE = "Collate"; public static final String COLLATE_ANALYZE = "CollateAndAnalyze"; @@ -208,50 +201,4 @@ public String getPostRunAction() { return _postRunAction; } - - private Properties createProperties() { - Properties props = new Properties(); - - props.put("almRunHost", getAlmServerName()); - props.put("almServerUrl", getAlmServerUrl()); - props.put("almUserName", getAlmUserName()); - - String encAlmPass = ""; - try { - - encAlmPass = - EncryptionUtils.Encrypt( - getAlmPassword(), - EncryptionUtils.getSecretKey()); - }catch (Exception e){ - e.printStackTrace(); - - } - - props.put("almPassword", encAlmPass); - props.put("almDomain", getAlmDomain()); - props.put("almProject", getAlmProject()); - props.put("clientType", getClientType()); - props.put("almRunType", getRunType()); - props.put("TestSet1", getAlmEntityId()); - props.put("almTimeout", getTimeslotDuration()); - props.put("description", getDescription()); - props.put("environmentConfigurationId", getEnvironmentConfigurationId()); - if(getCdaDetails() != null){ - props.put("deploymentAction", getCdaDetails().getDeploymentAction()); - props.put("deployedEnvironmentName", getCdaDetails().getDeployedEnvironmentName()); - props.put("deprovisioningAction", getCdaDetails().getDeprovisioningAction()); - } - - props.put("almRunMode", RUN_MODE); - - return props; - - } - - public Properties getProperties() { - return createProperties(); - } - - } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java b/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java index 925a297739..001a7b6f4d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java @@ -22,7 +22,7 @@ public class AlmRunTypes { public enum RunType { - Alm, AlmLabManagement, FileSystem, LoadRunner + Alm, FileSystem, LoadRunner } } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java index 82c63c3962..2ba29da388 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java @@ -20,18 +20,17 @@ package com.microfocus.application.automation.tools.run; -import java.io.*; -import java.net.URL; +import java.io.IOException; +import java.io.PrintStream; +import java.io.StringWriter; import java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; -import java.util.Properties; import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; -import com.microfocus.application.automation.tools.AlmToolsUtils; import com.microfocus.application.automation.tools.model.AlmServerSettingsModel; import com.microfocus.application.automation.tools.model.CdaDetails; import com.microfocus.application.automation.tools.model.EnumDescription; @@ -42,9 +41,6 @@ import com.microfocus.application.automation.tools.sse.result.model.junit.Testsuites; import com.microfocus.application.automation.tools.sse.sdk.Logger; import com.microfocus.application.automation.tools.uft.utils.UftToolUtils; -import hudson.*; -import hudson.util.IOUtils; -import jenkins.model.Jenkins; import org.apache.commons.lang.StringUtils; import org.jenkinsci.Symbol; import org.kohsuke.stapler.AncestorInPath; @@ -60,6 +56,10 @@ import com.cloudbees.plugins.credentials.matchers.IdMatcher; import com.microfocus.application.automation.tools.sse.SSEBuilderPerformer; +import hudson.Extension; +import hudson.FilePath; +import hudson.Launcher; +import hudson.Util; import hudson.model.*; import hudson.model.queue.Tasks; import hudson.security.ACL; @@ -87,10 +87,6 @@ public class SseBuilder extends Builder implements SimpleBuildStep { private SseModel _sseModel; private String _fileName; - private static final String HP_TOOLS_LAUNCHER_EXE = "HpToolsLauncher.exe"; - private String ResultFilename = "ApiResults.xml"; - private String ParamFileName = "ApiRun.txt"; - private String almServerName; private String credentialsId; @@ -185,83 +181,12 @@ public void perform(Run build, FilePath workspace, Launcher launcher, _sseModel.setAlmServerUrl(getServerUrl(_sseModel.getAlmServerName())); - // now merge them into one list - Properties mergedProperties = new Properties(); - - mergedProperties.putAll(_sseModel.getProperties()); - - mergedProperties.put("runType", AlmRunTypes.RunType.AlmLabManagement.toString()); - - Date now = new Date(); - Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); - String time = formatter.format(now); - - // get a unique filename for the params file - ParamFileName = "props" + time + ".txt"; - ResultFilename = "Results" + time + ".xml"; - mergedProperties.put("resultsFilename", ResultFilename); - - // get properties serialized into a stream - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - try { - mergedProperties.store(stream, ""); - } catch (IOException e) { - listener.error("Storing run variable failed: " + e); - build.setResult(Result.FAILURE); - } - String propsSerialization = stream.toString(); - InputStream propsStream = IOUtils.toInputStream(propsSerialization); - - // get the remote workspace filesys - FilePath projectWS = workspace; - - // Get the URL to the Script used to run the test, which is bundled - // in the plugin - URL cmdExeUrl = - Jenkins.getInstanceOrNull().pluginManager.uberClassLoader.getResource(HP_TOOLS_LAUNCHER_EXE); - if (cmdExeUrl == null) { - listener.fatalError(HP_TOOLS_LAUNCHER_EXE + " not found in resources"); - return; - } - - FilePath propsFileName = projectWS.child(ParamFileName); - FilePath CmdLineExe = projectWS.child(HP_TOOLS_LAUNCHER_EXE); - - try { - // create a file for the properties file, and save the properties - propsFileName.copyFrom(propsStream); - - // Copy the script to the project workspace - CmdLineExe.copyFrom(cmdExeUrl); - } catch (IOException e1) { - build.setResult(Result.FAILURE); - // TODO Auto-generated catch block - e1.printStackTrace(); - } + VariableResolver varResolver = new VariableResolver.ByMap(build.getEnvironment(listener)); + Testsuites testsuites = execute(build, logger, varResolver); - try { - // Run the HpToolsLauncher.exe - AlmToolsUtils.runOnBuildEnv(build, launcher, listener, CmdLineExe, ParamFileName); - } catch (IOException ioe) { - Util.displayIOException(ioe, listener); - build.setResult(Result.FAILURE); - return; - } catch (InterruptedException e) { - build.setResult(Result.ABORTED); - PrintStream out = listener.getLogger(); - try { - AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); - } catch (IOException e1) { - Util.displayIOException(e1, listener); - build.setResult(Result.FAILURE); - return; - } catch (InterruptedException e1) { - logger.println("Exception: " + e1.getMessage()); - } - - out.println("Operation was aborted by user."); - } - return; + FilePath resultsFilePath = workspace.child(getFileName()); + Result resultStatus = createRunResults(resultsFilePath, testsuites, logger); + provideStepResultStatus(resultStatus, build, logger); } /** @@ -369,6 +294,14 @@ private boolean containsErrors(List testsuites) { return ret; } + private String getFileName() { + + Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); + String time = formatter.format(new Date()); + _fileName = String.format("Results%s.xml", time); + return _fileName; + } + private void stop(SSEBuilderPerformer performer, PrintStream logger) { try { @@ -589,10 +522,5 @@ public FormValidation doCheckCredentialsId(@AncestorInPath Item project, // no credentials available, can't check return FormValidation.warning("Cannot find any credentials with id " + value); } - - public FormValidation doCheckEnvironmentConfigurationId(@QueryParameter String value) { - return UftToolUtils.doCheckNumberOfReruns(value); - } - } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly index 3eb9c61e04..8188ad1f24 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly @@ -23,40 +23,6 @@ - diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly index 3f70288c7f..8f66e98857 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly @@ -22,50 +22,7 @@ - - - +
      - - - - - - + + - - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - + - - - - - - - + + - - - - - - + + - - - - - - + + - - - - - - + + - - - - - - + + - - - - - - + + - - - - - - + + From 93c9b97cb49d3c810d411a93d2483cea175bb566 Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Wed, 4 Sep 2019 15:02:12 +0300 Subject: [PATCH 0995/2502] removed runner for lab management --- HpToolsLauncher/Launcher.cs | 44 +------------------------------------ 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 167d4526e2..eb19d2de73 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -317,49 +317,7 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara switch (runType) { - /*case TestStorageType.AlmLabManagement: - List testSetsList = GetParamsWithPrefix("TestSet"); - - string filterByName = (_ciParams.ContainsKey("FilterByName") ? _ciParams["FilterByName"] : ""); - - string statuses = (_ciParams.ContainsKey("FilterByStatus") ? _ciParams["FilterByStatus"] : ""); - - List filterByStatuses = new List(); - - if (statuses != "" && statuses.Contains(",")) - { - - filterByStatuses = statuses.Split(',').ToList(); - } - else - { - filterByStatuses.Add(statuses); - } - - - bool isSSOEnabled = _ciParams.ContainsKey("SSOEnabled") && Convert.ToBoolean(_ciParams["SSOEnabled"]); - string almClientID = _ciParams.ContainsKey("almClientID") ? _ciParams["almClientID"] : ""; - string almAPIKey = _ciParams.ContainsKey("almApiKey") ? _ciParams["almApiKey"] : ""; - - //create an Alm runner - runner = new AlmTestSetsRunner(_ciParams["almServerUrl"], - _ciParams["almUserName"], - Decrypt(_ciParams["almPassword"], _secretKey), - _ciParams["almDomain"], - _ciParams["almProject"], - Convert.ToDouble(_ciParams["almTimeout"]), - QcRunMode.RUN_LOCAL, - "", - testSetsList, - false, - filterByName, - filterByStatuses, - initialTestRun, - TestStorageType.AlmLabManagement, - isSSOEnabled, almClientID, almAPIKey); - break;*/ - - case TestStorageType.Alm: + case TestStorageType.Alm: //check that all required parameters exist foreach (string param1 in requiredParamsForQcRun) { From 51b49f652d53350cd281f90bc224a2c2572dff54 Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Wed, 4 Sep 2019 15:12:29 +0300 Subject: [PATCH 0996/2502] renamed constant, removed Alm Lab Management run type --- .../application/automation/tools/model/RunFromAlmModel.java | 2 +- .../application/automation/tools/run/AlmRunTypes.java | 2 +- .../application/automation/tools/run/RunFromAlmBuilder.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java index 06bc33cd36..d51748e3af 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java @@ -52,7 +52,7 @@ public class RunFromAlmModel extends AbstractDescribableImpl { public final static int DEFAULT_TIMEOUT = 36000; // 10 hrs public final static String ALM_PASSWORD_KEY = "almPassword"; - public final static String ALM_API_KEY = "almApiKey"; + public final static String ALM_API_KEY_SECRET = "almApiKey"; private String almServerName; private String almUserName; diff --git a/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java b/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java index 925a297739..001a7b6f4d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/AlmRunTypes.java @@ -22,7 +22,7 @@ public class AlmRunTypes { public enum RunType { - Alm, AlmLabManagement, FileSystem, LoadRunner + Alm, FileSystem, LoadRunner } } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index 4c2b5a0520..27dc274b46 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -232,8 +232,8 @@ public void perform(Run build, FilePath workspace, Launcher launcher, EncryptionUtils.Encrypt( runFromAlmModel.getAlmApiKey(), EncryptionUtils.getSecretKey()); - mergedProperties.remove(RunFromAlmModel.ALM_API_KEY); - mergedProperties.put(RunFromAlmModel.ALM_API_KEY, encAlmApiKey); + mergedProperties.remove(RunFromAlmModel.ALM_API_KEY_SECRET); + mergedProperties.put(RunFromAlmModel.ALM_API_KEY_SECRET, encAlmApiKey); }catch (Exception e) { build.setResult(Result.FAILURE); listener.fatalError("problem with apiKey encryption"); From a5a62956037b214aed929c52413cd591505ff6a1 Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Thu, 5 Sep 2019 12:23:12 +0300 Subject: [PATCH 0997/2502] removed background for help texts --- .../tools/run/AutEnvironmentBuilder/config.jelly | 4 ++-- .../automation/tools/run/RunFromAlmBuilder/config.jelly | 2 +- .../automation/tools/run/RunFromFileBuilder/config.jelly | 8 ++++---- .../automation/tools/run/SseBuilder/config.jelly | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly index 3eb9c61e04..4ee29a75ed 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/AutEnvironmentBuilder/config.jelly @@ -37,7 +37,7 @@ .help { border: none; - background: none; + background: none !important; background-color: transparent; } @@ -46,7 +46,7 @@ } table tr[nameref^="rowSetStart"] { - background: none; + background: none !important; } table tr[nameref^="cb31"] { diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 64d04a95e2..603c234936 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -42,7 +42,7 @@ .help { border: none; - background: none; + background: none !important; background-color: transparent; } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 3c78faa49f..92222a9c93 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -79,8 +79,8 @@ table tr td div.help { margin-left: 12px; - background: none !important; - border: none !important; + background: none; + border: none; } .help { @@ -88,11 +88,11 @@ } table td.help { - background: none !important; + background: none; } table tr[nameref^="rowSetStart"] { - background: none !important; + background: none; } textarea.setting-input{ diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly index c94b91da35..92db8310f8 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly @@ -42,7 +42,7 @@ .help { border: none; - background: none; + background: none !important; background-color: transparent; } From 79449a73287e77951c0f44daf9340160aad65edf Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Thu, 5 Sep 2019 15:08:58 +0300 Subject: [PATCH 0998/2502] fixed checkbox alignment --- .../tools/run/RunFromAlmBuilder/config.jelly | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 603c234936..6f6f7d26d4 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -61,6 +61,16 @@ textarea.setting-input{ resize: vertical; } + + [name="runfromalm.isSSOEnabled"] { + position: relative; + top: 1px !important; + } + + [name="runfromAlm.isFilterTestsEnabled"] { + position: relative; + top: 2px; + } From 0aaf783d4cc346310c8ce6462e77ed3530b84c78 Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Fri, 6 Sep 2019 13:02:22 +0300 Subject: [PATCH 0999/2502] removed unnecessary login for ALM SSO --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 5bdd0f716e..6bc24091c0 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -282,7 +282,8 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, || (string.IsNullOrWhiteSpace(qcLogin) && !SSOEnabled) || string.IsNullOrWhiteSpace(qcDomain) || string.IsNullOrWhiteSpace(qcProject) - || (SSOEnabled && (string.IsNullOrWhiteSpace(qcClientID) || string.IsNullOrWhiteSpace(qcApiKey)))) + || (SSOEnabled && (string.IsNullOrWhiteSpace(qcClientID) + || string.IsNullOrWhiteSpace(qcApiKey)))) { ConsoleWriter.WriteLine(Resources.AlmRunnerConnParamEmpty); return false; @@ -313,10 +314,6 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, { TdConnection.Login(qcLogin, qcPass); } - else - { - TdConnection.Login(qcClientID, qcApiKey); - } } catch (Exception ex) { @@ -365,7 +362,6 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, { try { - TdConnectionOld.Login(qcLogin, qcPass); } catch (Exception ex) From 05e8cce7ff47199c8d7b06137fb46007fa6cf56b Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Mon, 9 Sep 2019 20:31:13 +0300 Subject: [PATCH 1000/2502] bug fixing - validate client id, api key and username fields --- .../tools/model/RunFromAlmModel.java | 26 +++++++++++++++ .../tools/run/RunFromAlmBuilder.java | 18 ++++------- .../tools/run/RunFromAlmBuilder/config.jelly | 23 +++++++++++-- src/main/webapp/js/almUtils.js | 32 +++++++++++++++++++ 4 files changed, 84 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java index d51748e3af..af2579f9ca 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java @@ -25,6 +25,7 @@ import hudson.Util; import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; +import hudson.util.FormValidation; import hudson.util.VariableResolver; import java.util.Arrays; @@ -36,6 +37,7 @@ import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; @@ -226,5 +228,29 @@ public String getDisplayName() { public List getAlmRunModes() { return runModes; } + + /*public FormValidation doCheckAlmClientID(@QueryParameter String value){ + if (StringUtils.isBlank(value)) { + return FormValidation.error("Client ID must be set"); + } + + return FormValidation.ok(); + } + + public FormValidation doCheckAlmApiKey(@QueryParameter String value){ + if (StringUtils.isBlank(value) && isSSOEnabled) { + return FormValidation.error("Api key secret must be set"); + } + + return FormValidation.ok(); + } + + public FormValidation doCheckAlmUserName(@QueryParameter String value) { + if (StringUtils.isBlank(value) && !isSSOEnabled) { + return FormValidation.error("User name must be set"); + } + + return FormValidation.ok(); + }*/ } } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index 27dc274b46..fc1e92a757 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -65,7 +65,7 @@ public class RunFromAlmBuilder extends Builder implements SimpleBuildStep { - private final RunFromAlmModel runFromAlmModel; + public RunFromAlmModel runFromAlmModel; private boolean isFilterTestsEnabled; private FilterTestsModel filterTestsModel; private final static String HpToolsLauncher_SCRIPT_NAME = "HpToolsLauncher.exe"; @@ -378,7 +378,8 @@ public boolean isApplicable( public String getDisplayName() { return RunFromAlmBuilderStepName(CompanyName()); } - + + public boolean hasAlmServers() { return Hudson.getInstance().getDescriptorByType( AlmServerSettingsBuilder.DescriptorImpl.class).hasAlmServers(); @@ -388,17 +389,10 @@ public AlmServerSettingsModel[] getAlmServers() { return Hudson.getInstance().getDescriptorByType( AlmServerSettingsBuilder.DescriptorImpl.class).getInstallations(); } - - public FormValidation doCheckAlmUserName(@QueryParameter String value) { - if (StringUtils.isBlank(value)) { - return FormValidation.error("User name must be set"); - } - - return FormValidation.ok(); - } - + + public FormValidation doCheckAlmTimeout(@QueryParameter String value) { - + if (StringUtils.isEmpty(value)) { return FormValidation.ok(); } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 6f6f7d26d4..dfed3a87a9 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -71,6 +71,17 @@ position: relative; top: 2px; } + + [name="runfromalm.almClientID"] { + margin-bottom: 10px; + } + [name="runfromalm.almApiKey"] { + margin-bottom: 10px; + } + [name="runfromalm.almUserName"] { + margin-bottom: 10px; + } + @@ -115,21 +126,27 @@ - + + - + + - + + diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index 66aeb606b9..5629205fc0 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -1,6 +1,7 @@ document.addEventListener('DOMContentLoaded', function() { var ssoCheckbox = document.getElementById('ssoCheckbox'); enableSSO(ssoCheckbox); + validateParameters(ssoCheckbox); }) function enableSSO(element){ @@ -21,5 +22,36 @@ function enableSSO(element){ clientID.disabled = true; apiKey.disabled = true; } + validateParameters(element); } +function validateParameters(element){ + var almClientID = document.getElementsByName('runfromalm.almClientID')[0]; + var almApiKey = document.getElementsByName('runfromalm.almApiKey')[0]; + var almUsername = document.getElementsByName('runfromalm.almUserName')[0]; + + var errClientIDLabel = document.getElementById('errClientID'); + var errApiKeyLabel = document.getElementById('errApiKey'); + var errUsernameLabel = document.getElementById('errUsername'); + + if(almClientID.value == "" && element.checked){ + errClientIDLabel.style.visibility = 'visible'; + } else { + errClientIDLabel.style.visibility = 'hidden'; + } + if(almApiKey.value == "" && element.checked){ + errApiKeyLabel.style.visibility = 'visible'; + } else { + errApiKeyLabel.style.visibility = 'hidden'; + } + if(almUsername.value == "" && !element.checked){ + errUsernameLabel.style.visibility = 'visible'; + } else { + errUsernameLabel.style.visibility = 'hidden'; + } +} + +function validateField(){ + var ssoCheckbox = document.getElementById('ssoCheckbox'); + validateParameters(ssoCheckbox); +} From 7eaca48f49813a2fa64c411a52648b7780cd43a0 Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Mon, 9 Sep 2019 20:32:11 +0300 Subject: [PATCH 1001/2502] removed commented code --- .../tools/model/RunFromAlmModel.java | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java index af2579f9ca..c04266f320 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java @@ -228,29 +228,5 @@ public String getDisplayName() { public List getAlmRunModes() { return runModes; } - - /*public FormValidation doCheckAlmClientID(@QueryParameter String value){ - if (StringUtils.isBlank(value)) { - return FormValidation.error("Client ID must be set"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckAlmApiKey(@QueryParameter String value){ - if (StringUtils.isBlank(value) && isSSOEnabled) { - return FormValidation.error("Api key secret must be set"); - } - - return FormValidation.ok(); - } - - public FormValidation doCheckAlmUserName(@QueryParameter String value) { - if (StringUtils.isBlank(value) && !isSSOEnabled) { - return FormValidation.error("User name must be set"); - } - - return FormValidation.ok(); - }*/ } } From 7bc33a322324054d143a0e92e2bbe1c607c730df Mon Sep 17 00:00:00 2001 From: Anda Laakso Date: Tue, 10 Sep 2019 15:09:19 +0300 Subject: [PATCH 1002/2502] removed background from uft specifc settings fields --- .../tools/uft/model/UftSettingsModel/config.jelly | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly index 151040bf65..2f67c5ccd2 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly @@ -26,6 +26,12 @@ - -
      +
      Environment
      - + title="Mobile" inline="true" style="margin-right: 15px;" class="customRadio"/> + title="Web" inline="true" style="margin-left: 15px;" class="customRadio"/>
      diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 70fc8a7869..a712d35d03 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -89,38 +89,45 @@ margin-bottom: 10px; } + .info { + margin-left: -15px; + } -
      - - + + + - - -
      - The credentials for "Run from ALM" tasks have been moved to Jenkins Configure System page. In order to update them please create a new project, add as a - "Post build action" in the configuration page the action called "Migrate ALM Credentials" and run the job. - In case migration process was accomplised, please add/edit credentials in global configuration page. +
      + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 3a91abcc1b..94399bf375 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -102,58 +102,43 @@ - - - - - - - - - - - - + + - - - - - - + + + + + - - - - + + + - + - - - - - - + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly index eceb1b3048..6b735be3cb 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly @@ -29,26 +29,28 @@ + + - - - - - + + + + - - - - - + + + - - - - - + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly index 883c6e45e1..12db1083d4 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly @@ -41,36 +41,40 @@ background-size: 65px; width: 65px; margin-left: 20px; - height:40px; + height:35px; } #copyPasteBtn { background-image: url("${rootURL}/plugin/hp-application-automation-tools-plugin/icons/uft_icons/copy_paste.png"); background-size: 65px; width: 65px; - height: 40px; + height: 35px; + margin-left: 10px; + } + + LABEL.attach-previous { + margin-left: 0 !important; + } + + #checkBox1 { margin-left: 10px; } - - - - - - + + + + - - - + - - - - - + - - - + + - + - - - + + + - - - - - + + diff --git a/src/main/webapp/js/fileSystemUtils.js b/src/main/webapp/js/fileSystemUtils.js index d283aa819d..00703db4ce 100644 --- a/src/main/webapp/js/fileSystemUtils.js +++ b/src/main/webapp/js/fileSystemUtils.js @@ -26,22 +26,21 @@ * ___________________________________________________________________ */ document.addEventListener('DOMContentLoaded', function() { + var checkbox1 = document.getElementById('checkBox1'); - if(checkbox1.checked){ - document.getElementsByName("fsTestType")[0].disabled = false; - document.getElementsByName("selectedNode")[0].disabled = false; + if (checkbox1.checked) { + document.getElementsByName("fsTestType")[0].disabled = false; + document.getElementsByName("selectedNode")[0].disabled = false; - }else{ + } else { document.getElementsByName("fsTestType")[0].disabled = true; document.getElementsByName("selectedNode")[0].disabled = true; } - - var selectIndex = document.getElementsByName("fsTestType")[0].selectedIndex; var selectValue = document.getElementsByName("fsTestType")[0].options[selectIndex].text; - if(selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { + if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { selectCleanupTest("none"); } else { selectCleanupTest("block"); @@ -49,62 +48,63 @@ document.addEventListener('DOMContentLoaded', function() { }, false); -function useAuthentication(obj){ - if(obj.checked){ - document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled=null; - document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled=null; - }else{ - document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled="true"; - document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled="true"; + function useAuthentication(obj) { + if (obj.checked) { + document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled = null; + document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled = null; + } else { + document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled = "true"; + document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled = "true"; + } } -} -function enableCombobox(object){ - if (object.checked){ - document.getElementsByName("fsTestType")[0].disabled = false; - document.getElementsByName("selectedNode")[0].disabled = false; - document.getElementById("checkBox2").disabled=false; - } else { - document.getElementsByName("fsTestType")[0].disabled = true; - document.getElementsByName("selectedNode")[0].disabled = true; - document.getElementById("checkBox2").disabled=true; + function enableCombobox(object) { + if (object.checked) { + document.getElementsByName("fsTestType")[0].disabled = false; + document.getElementsByName("selectedNode")[0].disabled = false; + //document.getElementById("checkBox2").disabled=false; + } else { + document.getElementsByName("fsTestType")[0].disabled = true; + document.getElementsByName("selectedNode")[0].disabled = true; + //document.getElementById("checkBox2").disabled=true; + } } -} -function fileSelected(input){ - var selectIndex = document.getElementById('testTypeSelect').selectedIndex; - var selectValue = document.getElementById('testTypeSelect').options[selectIndex].text; - if(selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { - document.getElementsByName("uftSettingsModel.cleanupTest")[0].value = input.files[0].name; - } else { - addCleanupTest(input.files[0].name); + function fileSelected(input) { + var selectIndex = document.getElementById('testTypeSelect').selectedIndex; + var selectValue = document.getElementById('testTypeSelect').options[selectIndex].text; + if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { + document.getElementsByName("uftSettingsModel.cleanupTest")[0].value = input.files[0].name; + } else { + addCleanupTest(input.files[0].name); + } } -} - -function selectCleanupTest(displayStyle) { - document.getElementById('clearBtn').style.display = displayStyle; - document.getElementById('clear').style.display = displayStyle; - document.getElementById('copyPasteBtn').style.display = displayStyle; - document.getElementById('infoMessage').style.display = displayStyle; - document.getElementById('testsTable').style.display = displayStyle; -} -function selectValueCombo(selectObj) { + function selectCleanupTest(displayStyle) { + document.getElementById('clearBtn').style.display = displayStyle; + document.getElementById('clear').style.display = displayStyle; + document.getElementById('copyPasteBtn').style.display = displayStyle; + document.getElementById('infoMessage').style.display = displayStyle; + document.getElementById('testsTable').style.display = displayStyle; + } - var selectIndex = selectObj.selectedIndex; - var selectValue = selectObj.options[selectIndex].text; + function selectValueCombo(selectObj) { - if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { - selectCleanupTest("none"); - } else { - selectCleanupTest("block"); + var selectIndex = selectObj.selectedIndex; + var selectValue = selectObj.options[selectIndex].text; - if (selectValue === "Of any of the build's tests") { - selectCleanupTest("hidden"); - document.getElementById("checkBox2").disabled = false; + if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { + selectCleanupTest("none"); } else { - selectCleanupTest("visible"); - document.getElementById("checkBox2").disabled = true; + selectCleanupTest("block"); + + if (selectValue === "Of any of the build's tests") { + selectCleanupTest("hidden"); + //document.getElementById("checkBox2").disabled = false; + } else { + selectCleanupTest("visible"); + // document.getElementById("checkBox2").disabled = true; + } } } @@ -146,7 +146,6 @@ function selectValueCombo(selectObj) { } function clearRerunSettings() { - alert("clear"); var checkBoxes = document.getElementsByName("rerunSettingsModels.checked"); checkBoxes.forEach(function (element) { element.checked = false; @@ -162,7 +161,8 @@ function selectValueCombo(selectObj) { element.value = ""; }); } -} + + From 0fb8caadf8928aa0794db07491502602de6b9855 Mon Sep 17 00:00:00 2001 From: "CORPDOM\\llu2" Date: Wed, 6 Jan 2021 10:52:32 +0800 Subject: [PATCH 1573/2502] Enhancement: When updating run's status, retry 3 times if failed. --- .../uploader/RunUploader.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/RunUploader.java b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/RunUploader.java index 0979e25924..99f860be6f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/RunUploader.java +++ b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/RunUploader.java @@ -102,7 +102,24 @@ public void upload(Map testset, Map test, Map updateRun = new HashMap<>(); updateRun.put(AlmCommonProperties.ID, createdRun.get(AlmCommonProperties.ID)); updateRun.put(AlmRun.RUN_STATUS, runstatus); - restService.update(RUN_PREFIX, updateRun); + + // Retry update run status 3 times. For some ALM server may has limited DB connections then the update may fail. + // Added here because only here uses RestService.update. + // Otherwise the retry could be in RestService.update or UpdateAlmEntityEntityRequest.perform + // depends on whether the result would be changed if update multiple times. + // But this should be fixed at ALM server side to larger the connection number I think. + + Map updateResult = restService.update(RUN_PREFIX, updateRun); + if (updateResult == null) { + for (int i = 0; i < 3; i++) { + if (updateResult == null) { + updateResult = restService.update(RUN_PREFIX, updateRun); + } else { + break; + } + } + } + } else { restService.create(RUN_PREFIX, run); } From fea6ee6ef5a1872cccb3b211a4b06e394f4af2cf Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Mon, 18 Jan 2021 12:12:42 +0200 Subject: [PATCH 1574/2502] Create UFT_Mobile_Integration.md UFT Mobile docs moved to Jenkins from Online Help --- doc/UFT_Mobile_Integration.md | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 doc/UFT_Mobile_Integration.md diff --git a/doc/UFT_Mobile_Integration.md b/doc/UFT_Mobile_Integration.md new file mode 100644 index 0000000000..9d2bf3ffd0 --- /dev/null +++ b/doc/UFT_Mobile_Integration.md @@ -0,0 +1,71 @@ +# UFT Mobile integration + +The Application Automation Tools plugin for the Jenkins continuous integration server provides a mechanism for uploading apps to the UFT Mobile lab console. + +First you define the UFT Mobile server within Jenkins, and then you add build steps to upload your mobile apps with .apk (Android) or .ipa (iOS) file extensions. + +For additional information, see the [UFT Mobile Help Center](https://admhelp.microfocus.com/uftmobile/en/). + +### Table of Contents + +[Prerequisites](#prerequisites) + +[Define the UFT Mobile server](#define-the-uft-mobile-server) + +[Upload apps to UFT Mobile](#upload-apps-to-uft-mobile) + + + +## Prerequisites + +1. Install one of the five latest LTS versions of Jenkins, [(Click here for a list.)](https://jenkins.io/changelog-stable/) + +2. Install the Jenkins [Micro Focus Application Automation Tools plugin](https://plugins.jenkins.io/hp-application-automation-tools-plugin). + + + +## Define the UFT Mobile server + +Before using Jenkins with UFT Mobile, you need to configure Jenkins to recognize the UFT Mobile server. + +To configure Jenkins to integrate with UFT Mobile: + +1. On the Jenkins Server home page, click **Manage Jenkins > Configure System**. + +2. Go to the **UFT Mobile** section, and click **Add UFT Mobile server**. + +3. Enter a name for the UFT Mobile server that you will be using, and its URL. + +4. Repeat the last two steps for each of the UFT Mobile servers that you will be accessing. + +5. For running functional tests where UFT and Jenkins are hosted on separate machines, you need to create an execution node for the functional test: + + a. Select **Manage Jenkins > Manage Nodes and Clouds > New Node**. + + b. Give the node a name, and select the **Permanent Agent** option. + + c. Enter the details for the UFT machine. + + d. Save your changes. + + + +## Upload apps to UFT Mobile + +The **Application Automation Tools** Jenkins plugin provides a standalone builder for uploading apps to UFT Mobile. If you want to create a job that runs a UFT One functional test with Mobile devices, see the [UFT One Help Center](https://admhelp.microfocus.com/uft/en/latest/UFT_Help/Content/MC/mobile_on_UFT_Jenkins_integ.htm). + +1. Make sure you have added your UFT Mobile server to the Jenkins configuration as described in [Define the UFT Mobile server](#define-the-uft-mobile-server). +2. Copy your application package file, with **.apk** or **.ipa** extensions, to the Jenkins machine. +3. On the Jenkins Server home page, click **New Item**. +4. Enter an item name for the project. +5. Select **Free style project** and click **OK** in the bottom left corner. +6. In the **General** tab, scroll down to the **Build** section. +7. Expand the **Add build step** drop-down and select **Upload app to UFT Mobile**. +8. Select your UFT Mobile server from the drop-down list of servers. +9. Provide your login credentials. If your server has the multiple share spaces enabled, you must also include the nine-digit project ID in the **Tenant ID** field. If the feature is not enabled, you must leave this field empty. +10. If you are connecting to a UFT Mobile server through a proxy, select **Use proxy settings** and provide the relevant information. +11. Click **Add Application** and enter the full path of the **.apk** or **.ipa** package file of the app you want to upload to the UFT Mobile server. Repeat this step for each app you want to upload. +12. Click **Apply** to save your changes and continue with more build steps. +13. Click **Save** when you are finished adding build steps. +14. Run or trigger the job as you would with any standard Jenkins job. +15. To troubleshoot, check the log file on the UFT Mobile server for issues such as connectivity and security. From 5cc3fb9d672932500665027f267921fd2b4faca4 Mon Sep 17 00:00:00 2001 From: Anda Sorina Laakso Date: Thu, 21 Jan 2021 15:06:14 +0200 Subject: [PATCH 1575/2502] fixed layout for the new Jenkins version --- .../model/FileSystemTestSetModel/config.jelly | 6 +- .../config.jelly | 13 +-- .../tools/run/RunFromAlmBuilder/config.jelly | 41 ++++--- .../tools/run/RunFromFileBuilder/config.jelly | 59 ++++------ .../uft/model/RerunSettingsModel/config.jelly | 32 ++--- .../uft/model/UftSettingsModel/config.jelly | 64 +++++----- src/main/webapp/js/fileSystemUtils.js | 110 +++++++++--------- 7 files changed, 154 insertions(+), 171 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly index 6c3aeb39dd..4b6b763bb4 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly @@ -29,7 +29,7 @@ - - - + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly index 997a6fffe0..536b85b6e6 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly @@ -36,26 +36,19 @@ div[name="parallelRunnerEnvironments"] { background-color: inherit !important; } - - input[type=radio] { top : 0 !important; } - - -
      +
      Environment
      - + title="Mobile" inline="true" style="margin-right: 15px;" class="customRadio"/> + title="Web" inline="true" style="margin-left: 15px;" class="customRadio"/>
      diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 70fc8a7869..a712d35d03 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -89,38 +89,45 @@ margin-bottom: 10px; } + .info { + margin-left: -15px; + } -
      - - + + + - - -
      - The credentials for "Run from ALM" tasks have been moved to Jenkins Configure System page. In order to update them please create a new project, add as a - "Post build action" in the configuration page the action called "Migrate ALM Credentials" and run the job. - In case migration process was accomplised, please add/edit credentials in global configuration page. +
      + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 3a91abcc1b..94399bf375 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -102,58 +102,43 @@ - - - - - - - - - - - - + + - - - - - - + + + + + - - - - + + + - + - - - - - - + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly index eceb1b3048..6b735be3cb 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/RerunSettingsModel/config.jelly @@ -29,26 +29,28 @@ + + - - - - - + + + + - - - - - + + + - - - - - + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly index 883c6e45e1..12db1083d4 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/UftSettingsModel/config.jelly @@ -41,36 +41,40 @@ background-size: 65px; width: 65px; margin-left: 20px; - height:40px; + height:35px; } #copyPasteBtn { background-image: url("${rootURL}/plugin/hp-application-automation-tools-plugin/icons/uft_icons/copy_paste.png"); background-size: 65px; width: 65px; - height: 40px; + height: 35px; + margin-left: 10px; + } + + LABEL.attach-previous { + margin-left: 0 !important; + } + + #checkBox1 { margin-left: 10px; } - - - - - - + + + + - - - + - - - - - + - - - + + - + - - - + + + - - - - - + + diff --git a/src/main/webapp/js/fileSystemUtils.js b/src/main/webapp/js/fileSystemUtils.js index d283aa819d..00703db4ce 100644 --- a/src/main/webapp/js/fileSystemUtils.js +++ b/src/main/webapp/js/fileSystemUtils.js @@ -26,22 +26,21 @@ * ___________________________________________________________________ */ document.addEventListener('DOMContentLoaded', function() { + var checkbox1 = document.getElementById('checkBox1'); - if(checkbox1.checked){ - document.getElementsByName("fsTestType")[0].disabled = false; - document.getElementsByName("selectedNode")[0].disabled = false; + if (checkbox1.checked) { + document.getElementsByName("fsTestType")[0].disabled = false; + document.getElementsByName("selectedNode")[0].disabled = false; - }else{ + } else { document.getElementsByName("fsTestType")[0].disabled = true; document.getElementsByName("selectedNode")[0].disabled = true; } - - var selectIndex = document.getElementsByName("fsTestType")[0].selectedIndex; var selectValue = document.getElementsByName("fsTestType")[0].options[selectIndex].text; - if(selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { + if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { selectCleanupTest("none"); } else { selectCleanupTest("block"); @@ -49,62 +48,63 @@ document.addEventListener('DOMContentLoaded', function() { }, false); -function useAuthentication(obj){ - if(obj.checked){ - document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled=null; - document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled=null; - }else{ - document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled="true"; - document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled="true"; + function useAuthentication(obj) { + if (obj.checked) { + document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled = null; + document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled = null; + } else { + document.getElementsByName("runfromfs.fsProxyUserName")[0].disabled = "true"; + document.getElementsByName("runfromfs.fsProxyPassword")[0].disabled = "true"; + } } -} -function enableCombobox(object){ - if (object.checked){ - document.getElementsByName("fsTestType")[0].disabled = false; - document.getElementsByName("selectedNode")[0].disabled = false; - document.getElementById("checkBox2").disabled=false; - } else { - document.getElementsByName("fsTestType")[0].disabled = true; - document.getElementsByName("selectedNode")[0].disabled = true; - document.getElementById("checkBox2").disabled=true; + function enableCombobox(object) { + if (object.checked) { + document.getElementsByName("fsTestType")[0].disabled = false; + document.getElementsByName("selectedNode")[0].disabled = false; + //document.getElementById("checkBox2").disabled=false; + } else { + document.getElementsByName("fsTestType")[0].disabled = true; + document.getElementsByName("selectedNode")[0].disabled = true; + //document.getElementById("checkBox2").disabled=true; + } } -} -function fileSelected(input){ - var selectIndex = document.getElementById('testTypeSelect').selectedIndex; - var selectValue = document.getElementById('testTypeSelect').options[selectIndex].text; - if(selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { - document.getElementsByName("uftSettingsModel.cleanupTest")[0].value = input.files[0].name; - } else { - addCleanupTest(input.files[0].name); + function fileSelected(input) { + var selectIndex = document.getElementById('testTypeSelect').selectedIndex; + var selectValue = document.getElementById('testTypeSelect').options[selectIndex].text; + if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { + document.getElementsByName("uftSettingsModel.cleanupTest")[0].value = input.files[0].name; + } else { + addCleanupTest(input.files[0].name); + } } -} - -function selectCleanupTest(displayStyle) { - document.getElementById('clearBtn').style.display = displayStyle; - document.getElementById('clear').style.display = displayStyle; - document.getElementById('copyPasteBtn').style.display = displayStyle; - document.getElementById('infoMessage').style.display = displayStyle; - document.getElementById('testsTable').style.display = displayStyle; -} -function selectValueCombo(selectObj) { + function selectCleanupTest(displayStyle) { + document.getElementById('clearBtn').style.display = displayStyle; + document.getElementById('clear').style.display = displayStyle; + document.getElementById('copyPasteBtn').style.display = displayStyle; + document.getElementById('infoMessage').style.display = displayStyle; + document.getElementById('testsTable').style.display = displayStyle; + } - var selectIndex = selectObj.selectedIndex; - var selectValue = selectObj.options[selectIndex].text; + function selectValueCombo(selectObj) { - if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { - selectCleanupTest("none"); - } else { - selectCleanupTest("block"); + var selectIndex = selectObj.selectedIndex; + var selectValue = selectObj.options[selectIndex].text; - if (selectValue === "Of any of the build's tests") { - selectCleanupTest("hidden"); - document.getElementById("checkBox2").disabled = false; + if (selectValue === "Rerun the entire set of tests" || selectValue === "Rerun only failed tests") { + selectCleanupTest("none"); } else { - selectCleanupTest("visible"); - document.getElementById("checkBox2").disabled = true; + selectCleanupTest("block"); + + if (selectValue === "Of any of the build's tests") { + selectCleanupTest("hidden"); + //document.getElementById("checkBox2").disabled = false; + } else { + selectCleanupTest("visible"); + // document.getElementById("checkBox2").disabled = true; + } } } @@ -146,7 +146,6 @@ function selectValueCombo(selectObj) { } function clearRerunSettings() { - alert("clear"); var checkBoxes = document.getElementsByName("rerunSettingsModels.checked"); checkBoxes.forEach(function (element) { element.checked = false; @@ -162,7 +161,8 @@ function selectValueCombo(selectObj) { element.value = ""; }); } -} + + From d9f7210d2553e88b6096b17d551c0a4d33c7e2ef Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 24 Jan 2021 07:25:39 +0200 Subject: [PATCH 1576/2502] us #1123230 : allow sync branches to octane --- pom.xml | 2 +- .../automation/tools/octane/GeneralUtils.java | 26 ++ .../automation/tools/octane/JellyUtils.java | 27 ++ .../actions/UFTTestDetectionPublisher.java | 10 +- .../octane/branches/BranchesBuildAction.java | 94 +++++ .../octane/branches/BranchesPublisher.java | 323 ++++++++++++++++++ .../pullrequests/PullRequestPublisher.java | 88 ++--- .../UftScenarioLoadStepExecution.java | 1 + .../META-INF/hudson.remoting.ClassFilter | 2 + .../tools/octane/Messages.properties | 1 + .../branches/BranchesBuildAction/index.jelly | 136 ++++++++ .../branches/BranchesPublisher/config.jelly | 58 ++++ .../branches/BranchesPublisher/help.html | 71 ++++ .../PullRequestBuildAction/index.jelly | 2 +- .../PullRequestPublisher/config.jelly | 4 +- 15 files changed, 779 insertions(+), 66 deletions(-) create mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/GeneralUtils.java create mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction.java create mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java create mode 100644 src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction/index.jelly create mode 100644 src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly create mode 100644 src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html diff --git a/pom.xml b/pom.xml index b35697d747..e28dcbfcde 100644 --- a/pom.xml +++ b/pom.xml @@ -507,7 +507,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.6.0 + 2.6.7.0 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/GeneralUtils.java b/src/main/java/com/microfocus/application/automation/tools/octane/GeneralUtils.java new file mode 100644 index 0000000000..0bffd85a4a --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/octane/GeneralUtils.java @@ -0,0 +1,26 @@ +package com.microfocus.application.automation.tools.octane; + +import com.hp.octane.integrations.services.pullrequestsandbranches.factory.CommitUserIdPicker; +import hudson.model.User; + +import java.util.Collections; + +public class GeneralUtils { + + public static CommitUserIdPicker getUserIdForCommit; + + public static String getUserIdForCommit(String email, String login) { + if (login != null) { + User user = User.get(login, false, Collections.emptyMap()); + if (user != null) { + return user.getId(); + } + } + if (email != null && email.contains("@")) { + String[] emailParts = email.split("@"); + return emailParts[0]; + + } + return login; + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/JellyUtils.java b/src/main/java/com/microfocus/application/automation/tools/octane/JellyUtils.java index 8b916ce0bd..9f67732950 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/JellyUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/JellyUtils.java @@ -28,12 +28,21 @@ package com.microfocus.application.automation.tools.octane; +import com.cloudbees.plugins.credentials.CredentialsMatcher; +import com.cloudbees.plugins.credentials.common.StandardCredentials; +import com.cloudbees.plugins.credentials.common.StandardListBoxModel; +import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel; +import com.cloudbees.plugins.credentials.domains.URIRequirementBuilder; import com.hp.octane.integrations.OctaneClient; import com.hp.octane.integrations.OctaneSDK; import com.hp.octane.integrations.dto.entities.Entity; import com.hp.octane.integrations.services.entities.EntitiesService; import com.microfocus.application.automation.tools.model.OctaneServerSettingsModel; import com.microfocus.application.automation.tools.octane.configuration.ConfigurationService; +import hudson.model.Item; +import hudson.model.Queue; +import hudson.model.queue.Tasks; +import hudson.security.ACL; import hudson.util.ListBoxModel; import org.apache.commons.lang.StringUtils; @@ -82,4 +91,22 @@ public static ListBoxModel fillConfigurationIdModel() { return m; } + + public static ListBoxModel fillCredentialsIdItems(Item project, String credentialsId, CredentialsMatcher credentialsMatcher) { + + if (project == null || !project.hasPermission(Item.CONFIGURE)) { + return new StandardUsernameListBoxModel().includeCurrentValue(credentialsId); + } + + return new StandardListBoxModel() + .includeEmptyValue() + .includeMatchingAs( + project instanceof Queue.Task ? Tasks.getAuthenticationOf((Queue.Task) project) : ACL.SYSTEM, + project, + StandardCredentials.class, + URIRequirementBuilder.create().build(), + credentialsMatcher) + .includeCurrentValue(credentialsId); + } + } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java index 9a5c87f0b4..463fc7ed0c 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTTestDetectionPublisher.java @@ -214,11 +214,11 @@ private static String getScmRepositoriesWithRoots(BuildListener listener, ScmPlu //find branch String name = scmPluginHandler.tryExtractUrlShortName(url) + (isGit ? ":master" : ""); - String branchCondition = QueryHelper.orConditions(QueryHelper.condition(EntityConstants.ScmRepository.BRANCH, "master"), - QueryHelper.conditionEmpty(EntityConstants.ScmRepository.BRANCH)); + String branchCondition = QueryHelper.orConditions(QueryHelper.condition(EntityConstants.ScmRepository.BRANCH_FIELD, "master"), + QueryHelper.conditionEmpty(EntityConstants.ScmRepository.BRANCH_FIELD)); conditions = Collections.singletonList(branchCondition); foundEntities = entitiesService.getEntities(workspaceId, branchCollectionName, conditions, - Arrays.asList(EntityConstants.ScmRepository.ID_FIELD, EntityConstants.ScmRepository.BRANCH)); + Arrays.asList(EntityConstants.ScmRepository.ID_FIELD, EntityConstants.ScmRepository.BRANCH_FIELD)); if (!foundEntities.isEmpty()) { scmBranchId = foundEntities.get(0).getId(); UFTTestDetectionService.printToConsole(listener, String.format("SCM branch %s is already exist in ALM Octane with id=%s", name, scmBranchId)); @@ -228,12 +228,12 @@ private static String getScmRepositoriesWithRoots(BuildListener listener, ScmPlu newBranch.setName(name); if (isGit) { - newBranch.setField(EntityConstants.ScmRepository.BRANCH, "master"); + newBranch.setField(EntityConstants.ScmRepository.BRANCH_FIELD, "master"); } Entity scmRoot = new EntityImpl().setType(EntityConstants.ScmRepositoryRoot.ENTITY_NAME).setId(scmRootId); - newBranch.setField(EntityConstants.ScmRepository.PARENT, scmRoot); + newBranch.setField(EntityConstants.ScmRepository.PARENT_FIELD, scmRoot); List createEntities = entitiesService.postEntities(workspaceId, branchCollectionName, Collections.singletonList(newBranch)); scmBranchId = createEntities.get(0).getId(); UFTTestDetectionService.printToConsole(listener, String.format("SCM branch %s is created in ALM Octane with id=%s", name, scmBranchId)); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction.java b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction.java new file mode 100644 index 0000000000..9d56ae7195 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction.java @@ -0,0 +1,94 @@ +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2019 Micro Focus or one of its affiliates. + * + * The only warranties for products and services of Micro Focus and its affiliates + * and licensors ("Micro Focus") are set forth in the express warranty statements + * accompanying such products and services. Nothing herein should be construed as + * constituting an additional warranty. Micro Focus shall not be liable for technical + * or editorial errors or omissions contained herein. + * The information contained herein is subject to change without notice. + * ___________________________________________________________________ + */ + +package com.microfocus.application.automation.tools.octane.branches; + +import com.hp.octane.integrations.services.pullrequestsandbranches.BranchSyncResult; +import com.microfocus.application.automation.tools.octane.Messages; +import hudson.model.Action; +import hudson.model.Run; + +import javax.annotation.CheckForNull; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.TimeZone; + +public class BranchesBuildAction implements Action { + + private final Run build; + + private final BranchSyncResult branchSyncResult; + private final String filter; + private final String repositoryUrl; + + private static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm"; + private SimpleDateFormat updatedDateFormat = null; + + @CheckForNull + @Override + public String getIconFileName() { + return "notepad.png"; + } + + public BranchesBuildAction(final Run build, BranchSyncResult branchSyncResult, String repositoryUrl, String filter) { + this.build = build; + this.branchSyncResult = branchSyncResult; + this.filter = filter; + this.repositoryUrl = repositoryUrl; + } + + @CheckForNull + @Override + public String getDisplayName() { + return Messages.BranchActionConfigurationLabel(); + } + + @CheckForNull + @Override + public String getUrlName() { + return "branch-report"; + } + + public BranchSyncResult getBranchSyncResult () { + return branchSyncResult; + } + + @SuppressWarnings("squid:S1452") + public final Run getBuild() { + return build; + } + + public String getFormattedDate(long longTime) { + if (updatedDateFormat == null) { + updatedDateFormat = new SimpleDateFormat(DATE_TIME_FORMAT); + TimeZone utc = TimeZone.getTimeZone("UTC"); + updatedDateFormat.setTimeZone(utc); + } + return updatedDateFormat.format(new Date(longTime)); + } + + public String getFilter() { + return filter; + } + + public String getRepositoryUrl() { + return repositoryUrl; + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java new file mode 100644 index 0000000000..43f106038e --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java @@ -0,0 +1,323 @@ +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2019 Micro Focus or one of its affiliates. + * + * The only warranties for products and services of Micro Focus and its affiliates + * and licensors ("Micro Focus") are set forth in the express warranty statements + * accompanying such products and services. Nothing herein should be construed as + * constituting an additional warranty. Micro Focus shall not be liable for technical + * or editorial errors or omissions contained herein. + * The information contained herein is subject to change without notice. + * ___________________________________________________________________ + */ + +package com.microfocus.application.automation.tools.octane.branches; + +import com.cloudbees.plugins.credentials.CredentialsMatcher; +import com.cloudbees.plugins.credentials.CredentialsMatchers; +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.common.StandardCredentials; +import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; +import com.cloudbees.plugins.credentials.domains.URIRequirementBuilder; +import com.hp.octane.integrations.OctaneClient; +import com.hp.octane.integrations.OctaneSDK; +import com.hp.octane.integrations.exceptions.OctaneValidationException; +import com.hp.octane.integrations.services.pullrequestsandbranches.BranchSyncResult; +import com.hp.octane.integrations.services.pullrequestsandbranches.PullRequestAndBranchService; +import com.hp.octane.integrations.services.pullrequestsandbranches.factory.BranchFetchParameters; +import com.hp.octane.integrations.services.pullrequestsandbranches.factory.FetchFactory; +import com.hp.octane.integrations.services.pullrequestsandbranches.factory.FetchHandler; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.ScmTool; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.AuthenticationStrategy; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.BasicAuthenticationStrategy; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.NoCredentialsStrategy; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.PATStrategy; +import com.microfocus.application.automation.tools.octane.GeneralUtils; +import com.microfocus.application.automation.tools.octane.JellyUtils; +import hudson.EnvVars; +import hudson.Extension; +import hudson.FilePath; +import hudson.Launcher; +import hudson.model.*; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.BuildStepMonitor; +import hudson.tasks.Publisher; +import hudson.tasks.Recorder; +import hudson.util.ListBoxModel; +import hudson.util.Secret; +import jenkins.tasks.SimpleBuildStep; +import org.apache.commons.lang.StringUtils; +import org.jenkinsci.Symbol; +import org.jenkinsci.plugins.plaincredentials.StringCredentials; +import org.kohsuke.stapler.AncestorInPath; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; + +import javax.annotation.Nonnull; +import java.io.IOException; +import java.io.PrintStream; +import java.util.function.Consumer; + +/** + * Post-build action of Uft test detection + */ + +public class BranchesPublisher extends Recorder implements SimpleBuildStep { + private String configurationId; + private String workspaceId; + private String repositoryUrl; + private String credentialsId; + private String filter; + private String scmTool; + + // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" + @DataBoundConstructor + public BranchesPublisher(String configurationId, String workspaceId, String scmTool, String repositoryUrl, String credentialsId, String filter) { + this.configurationId = JellyUtils.NONE.equalsIgnoreCase(configurationId) ? null : configurationId; + this.workspaceId = JellyUtils.NONE.equalsIgnoreCase(workspaceId) ? null : workspaceId; + this.repositoryUrl = repositoryUrl; + this.credentialsId = credentialsId; + this.filter = filter; + this.scmTool = JellyUtils.NONE.equalsIgnoreCase(scmTool) ? null : scmTool; + } + + @Override + public void perform(@Nonnull Run run, @Nonnull FilePath filePath, @Nonnull Launcher launcher, @Nonnull TaskListener taskListener) throws InterruptedException, IOException { + performInternal(run, taskListener); + } + + @Override + public boolean perform(AbstractBuild build, @Nonnull Launcher launcher, BuildListener listener) { + performInternal(build, listener); + return build.getResult() == Result.SUCCESS; + } + + public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskListener) { + LogConsumer logConsumer = new LogConsumer(taskListener.getLogger()); + logConsumer.printLog("BranchPublisher is started."); + if (configurationId == null) { + throw new IllegalArgumentException("ALM Octane configuration is not defined."); + } + if (workspaceId == null) { + throw new IllegalArgumentException("ALM Octane workspace is not defined."); + } + if (scmTool == null) { + throw new IllegalArgumentException("SCM Tool is not defined."); + } + + String myCredentialsId = credentialsId; + String myConfigurationId = configurationId; + String myWorkspaceId = workspaceId; + String myScmTool = scmTool; + try { + EnvVars env = run.getEnvironment(taskListener); + myCredentialsId = env.expand(credentialsId); + myConfigurationId = env.expand(configurationId); + myWorkspaceId = env.expand(workspaceId); + myScmTool = env.expand(scmTool); + } catch (IOException | InterruptedException e) { + taskListener.error("Failed loading build environment " + e); + } + + BranchFetchParameters fp = createFetchParameters(run, taskListener, logConsumer::printLog); + + StandardCredentials credentials = getCredentialsById(myCredentialsId, run, taskListener.getLogger()); + AuthenticationStrategy authenticationStrategy = getAuthenticationStrategy(credentials); + + try { + //GET BRANCHES FROM CI SERVER + FetchHandler fetchHandler = FetchFactory.getHandler(ScmTool.fromValue(myScmTool), authenticationStrategy); + + OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(myConfigurationId); + logConsumer.printLog("ALM Octane " + octaneClient.getConfigurationService().getConfiguration().geLocationForLog()); + octaneClient.validateOctaneIsActiveAndSupportVersion(PullRequestAndBranchService.BRANCH_COLLECTION_SUPPORTED_VERSION); + BranchSyncResult result = OctaneSDK.getClientByInstanceId(myConfigurationId).getPullRequestAndBranchService() + .syncBranchesToOctane(fetchHandler, fp, Long.parseLong(myWorkspaceId), GeneralUtils::getUserIdForCommit, logConsumer::printLog); + + BranchesBuildAction buildAction = new BranchesBuildAction(run, result, fp.getRepoUrl(), fp.getFilter()); + run.addAction(buildAction); + + + } catch (Exception e) { + logConsumer.printLog("ALM Octane branch collector failed : " + e.getMessage()); + if(!(e instanceof OctaneValidationException)){ + e.printStackTrace(taskListener.getLogger()); + } + + run.setResult(Result.FAILURE); + } + } + + private BranchFetchParameters createFetchParameters(@Nonnull Run run, @Nonnull TaskListener taskListener, Consumer logConsumer) { + + BranchFetchParameters fp; + try { + EnvVars env = run.getEnvironment(taskListener); + fp = new BranchFetchParameters() + .setRepoUrl(env.expand(repositoryUrl)) + .setFilter(env.expand(filter)); + } catch (IOException | InterruptedException e) { + taskListener.error("Failed loading build environment " + e); + fp = new BranchFetchParameters() + .setRepoUrl(repositoryUrl) + .setFilter(filter); + } + + ParametersAction parameterAction = run.getAction(ParametersAction.class); + if (parameterAction != null) { + fp.setPageSize(getIntegerValueParameter(parameterAction, "branches_page_size")); + fp.setActiveBranchDays(getIntegerValueParameter(parameterAction, "branches_active_branch_days")); + fp.setMaxBranchesToFill(getIntegerValueParameter(parameterAction, "branches_max_branches_to_fill")); + } + + logConsumer.accept("Repository URL : " + fp.getRepoUrl()); + logConsumer.accept("Filter : " + fp.getFilter()); + logConsumer.accept("Page size : " + fp.getPageSize()); + logConsumer.accept("Max branches to fill : " + fp.getMaxBranchesToFill()); + logConsumer.accept("Branch active days : " + fp.getActiveBranchDays()); + + return fp; + } + + private Integer getIntegerValueParameter(ParametersAction parameterAction, String paramValue) { + ParameterValue pv = parameterAction.getParameter(paramValue); + if (pv != null && pv.getValue() instanceof String) { + try { + return Integer.valueOf((String) pv.getValue()); + } catch (Exception e) { + return null; + } + } + return null; + } + + public String getConfigurationId() { + return configurationId; + } + + public String getWorkspaceId() { + return workspaceId; + } + + private static class LogConsumer { + + private final PrintStream ps; + + public LogConsumer(PrintStream ps) { + this.ps = ps; + } + + public void printLog(String msg) { + ps.println("BranchPublisher : " + msg); + } + } + + private AuthenticationStrategy getAuthenticationStrategy(StandardCredentials credentials) { + AuthenticationStrategy authenticationStrategy; + if (credentials == null) { + authenticationStrategy = new NoCredentialsStrategy(); + } else if (credentials instanceof StringCredentials) { + Secret secret = ((StringCredentials) credentials).getSecret(); + authenticationStrategy = new PATStrategy(secret.getPlainText()); + } else if (credentials instanceof StandardUsernamePasswordCredentials) { + StandardUsernamePasswordCredentials cr = (StandardUsernamePasswordCredentials) credentials; + authenticationStrategy = new BasicAuthenticationStrategy(cr.getUsername(), cr.getPassword().getPlainText()); + } else { + throw new IllegalArgumentException("Credentials type is not supported : " + credentials.getClass().getCanonicalName()); + } + + return authenticationStrategy; + } + + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl) super.getDescriptor(); + } + + @Override + public BuildStepMonitor getRequiredMonitorService() { + return BuildStepMonitor.NONE; + } + + public String getRepositoryUrl() { + return repositoryUrl; + } + + public String getCredentialsId() { + return credentialsId; + } + + public String getFilter() { + return filter; + } + + public String getScmTool() { + return scmTool; + } + + /** + * Get user name password credentials by id. + */ + private StandardCredentials getCredentialsById(String credentialsId, Run run, PrintStream logger) { + + StandardCredentials credentials = null; + if (!StringUtils.isEmpty(credentialsId)) { + credentials = CredentialsProvider.findCredentialById(credentialsId, + StandardCredentials.class, + run, + URIRequirementBuilder.create().build()); + if (credentials == null) { + logger.println("Can not find credentials with the credentialsId:" + credentialsId); + } + } + + return credentials; + } + + @Symbol("collectBranchesToAlmOctane") + @Extension // This indicates to Jenkins that this is an implementation of an extension point. + public static final class DescriptorImpl extends BuildStepDescriptor { + + static final CredentialsMatcher CREDENTIALS_MATCHER = CredentialsMatchers.anyOf(new CredentialsMatcher[]{ + CredentialsMatchers.instanceOf(StandardUsernamePasswordCredentials.class), + CredentialsMatchers.instanceOf(StringCredentials.class)}); + + public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item project, + @QueryParameter String credentialsId) { + + return JellyUtils.fillCredentialsIdItems(project, credentialsId, CREDENTIALS_MATCHER); + } + + public ListBoxModel doFillScmToolItems() { + ListBoxModel m = JellyUtils.createComboModelWithNoneValue(); + for (ScmTool tool : ScmTool.values()) { + m.add(tool.getDesc(), tool.getValue()); + } + + return m; + } + + public boolean isApplicable(Class aClass) { + return true; + } + + public ListBoxModel doFillConfigurationIdItems() { + return JellyUtils.fillConfigurationIdModel(); + } + + public ListBoxModel doFillWorkspaceIdItems(@QueryParameter String configurationId, @QueryParameter(value = "workspaceId") String workspaceId) { + return JellyUtils.fillWorkspaceModel(configurationId, workspaceId); + } + + public String getDisplayName() { + return "ALM Octane branch collector"; + } + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java index c8d445bc98..6bea0f1759 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java @@ -32,29 +32,28 @@ import com.cloudbees.plugins.credentials.CredentialsMatchers; import com.cloudbees.plugins.credentials.CredentialsProvider; import com.cloudbees.plugins.credentials.common.StandardCredentials; -import com.cloudbees.plugins.credentials.common.StandardListBoxModel; -import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel; import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; import com.cloudbees.plugins.credentials.domains.URIRequirementBuilder; +import com.hp.octane.integrations.OctaneClient; import com.hp.octane.integrations.OctaneSDK; import com.hp.octane.integrations.dto.scm.PullRequest; -import com.hp.octane.integrations.services.pullrequests.factory.CommitUserIdPicker; -import com.hp.octane.integrations.services.pullrequests.factory.FetchParameters; -import com.hp.octane.integrations.services.pullrequests.factory.PullRequestFetchFactory; -import com.hp.octane.integrations.services.pullrequests.factory.PullRequestFetchHandler; -import com.hp.octane.integrations.services.pullrequests.rest.ScmTool; -import com.hp.octane.integrations.services.pullrequests.rest.authentication.AuthenticationStrategy; -import com.hp.octane.integrations.services.pullrequests.rest.authentication.BasicAuthenticationStrategy; -import com.hp.octane.integrations.services.pullrequests.rest.authentication.NoCredentialsStrategy; -import com.hp.octane.integrations.services.pullrequests.rest.authentication.PATStrategy; +import com.hp.octane.integrations.exceptions.OctaneValidationException; +import com.hp.octane.integrations.services.pullrequestsandbranches.PullRequestAndBranchService; +import com.hp.octane.integrations.services.pullrequestsandbranches.factory.FetchFactory; +import com.hp.octane.integrations.services.pullrequestsandbranches.factory.FetchHandler; +import com.hp.octane.integrations.services.pullrequestsandbranches.factory.PullRequestFetchParameters; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.ScmTool; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.AuthenticationStrategy; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.BasicAuthenticationStrategy; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.NoCredentialsStrategy; +import com.hp.octane.integrations.services.pullrequestsandbranches.rest.authentication.PATStrategy; +import com.microfocus.application.automation.tools.octane.GeneralUtils; import com.microfocus.application.automation.tools.octane.JellyUtils; import hudson.EnvVars; import hudson.Extension; import hudson.FilePath; import hudson.Launcher; import hudson.model.*; -import hudson.model.queue.Tasks; -import hudson.security.ACL; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.BuildStepMonitor; import hudson.tasks.Publisher; @@ -72,7 +71,6 @@ import javax.annotation.Nonnull; import java.io.IOException; import java.io.PrintStream; -import java.util.Collections; import java.util.List; import java.util.function.Consumer; @@ -80,7 +78,7 @@ * Post-build action of Uft test detection */ -public class PullRequestPublisher extends Recorder implements SimpleBuildStep, CommitUserIdPicker { +public class PullRequestPublisher extends Recorder implements SimpleBuildStep { private String configurationId; private String workspaceId; private String repositoryUrl; @@ -139,40 +137,45 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi taskListener.error("Failed loading build environment " + e); } - FetchParameters fp = createFetchParameters(run, taskListener, myConfigurationId, myWorkspaceId, logConsumer::printLog); + PullRequestFetchParameters fp = createFetchParameters(run, taskListener, myConfigurationId, myWorkspaceId, logConsumer::printLog); StandardCredentials credentials = getCredentialsById(myCredentialsId, run, taskListener.getLogger()); AuthenticationStrategy authenticationStrategy = getAuthenticationStrategy(credentials); - PullRequestFetchHandler fetchHandler = PullRequestFetchFactory.getHandler(ScmTool.fromValue(myScmTool), authenticationStrategy); + FetchHandler fetchHandler = FetchFactory.getHandler(ScmTool.fromValue(myScmTool), authenticationStrategy); try { - List pullRequests = fetchHandler.fetchPullRequests(fp, this, logConsumer::printLog); + OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(myConfigurationId); + logConsumer.printLog("ALM Octane " + octaneClient.getConfigurationService().getConfiguration().geLocationForLog()); + octaneClient.validateOctaneIsActiveAndSupportVersion(PullRequestAndBranchService.PULL_REQUEST_COLLECTION_SUPPORTED_VERSION); + List pullRequests = fetchHandler.fetchPullRequests(fp, GeneralUtils.getUserIdForCommit, logConsumer::printLog); PullRequestBuildAction buildAction = new PullRequestBuildAction(run, pullRequests, fp.getRepoUrl(), fp.getMinUpdateTime(), fp.getSourceBranchFilter(), fp.getTargetBranchFilter()); run.addAction(buildAction); if (!pullRequests.isEmpty()) { - OctaneSDK.getClientByInstanceId(myConfigurationId).getPullRequestService().sendPullRequests(pullRequests, myWorkspaceId, fp, logConsumer::printLog); + octaneClient.getPullRequestAndBranchService().sendPullRequests(pullRequests, myWorkspaceId, fp, logConsumer::printLog); } } catch (Exception e) { - logConsumer.printLog("Failed to fetch pull requests : " + e.getMessage()); - e.printStackTrace(taskListener.getLogger()); + logConsumer.printLog("ALM Octane pull request collector failed : " + e.getMessage()); + if (!(e instanceof OctaneValidationException)) { + e.printStackTrace(taskListener.getLogger()); + } run.setResult(Result.FAILURE); } } - private FetchParameters createFetchParameters(@Nonnull Run run, @Nonnull TaskListener taskListener, String myConfigurationId, String myWorkspaceId, Consumer logConsumer) { + private PullRequestFetchParameters createFetchParameters(@Nonnull Run run, @Nonnull TaskListener taskListener, String myConfigurationId, String myWorkspaceId, Consumer logConsumer) { - FetchParameters fp; + PullRequestFetchParameters fp; try { EnvVars env = run.getEnvironment(taskListener); - fp = new FetchParameters() + fp = new PullRequestFetchParameters() .setRepoUrl(env.expand(repositoryUrl)) .setSourceBranchFilter(env.expand(sourceBranchFilter)) .setTargetBranchFilter(env.expand(targetBranchFilter)); } catch (IOException | InterruptedException e) { taskListener.error("Failed loading build environment " + e); - fp = new FetchParameters() + fp = new PullRequestFetchParameters() .setRepoUrl(repositoryUrl) .setSourceBranchFilter(sourceBranchFilter) .setTargetBranchFilter(targetBranchFilter); @@ -185,8 +188,8 @@ private FetchParameters createFetchParameters(@Nonnull Run run, @Nonnull T fp.setMaxCommitsToFetch(getIntegerValueParameter(parameterAction, "pullrequests_max_commits_to_collect")); fp.setMinUpdateTime(getLongValueParameter(parameterAction, "pullrequests_min_update_time")); } - if (fp.getMinUpdateTime() == FetchParameters.DEFAULT_MIN_UPDATE_DATE) { - long lastUpdateTime = OctaneSDK.getClientByInstanceId(myConfigurationId).getPullRequestService().getLastUpdateTime(myWorkspaceId, fp.getRepoUrl()); + if (fp.getMinUpdateTime() == PullRequestFetchParameters.DEFAULT_MIN_UPDATE_DATE) { + long lastUpdateTime = OctaneSDK.getClientByInstanceId(myConfigurationId).getPullRequestAndBranchService().getPullRequestLastUpdateTime(myWorkspaceId, fp.getRepoUrl()); fp.setMinUpdateTime(lastUpdateTime); } @@ -231,22 +234,6 @@ public String getWorkspaceId() { return workspaceId; } - @Override - public String getUserIdForCommit(String email, String login) { - if (login != null) { - User user = User.get(login, false, Collections.emptyMap()); - if (user != null) { - return user.getId(); - } - } - if (email != null && email.contains("@")) { - String[] emailParts = email.split("@"); - return emailParts[0]; - - } - return login; - } - private static class LogConsumer { private final PrintStream ps; @@ -336,20 +323,7 @@ public static final class DescriptorImpl extends BuildStepDescriptor public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item project, @QueryParameter String credentialsId) { - - if (project == null || !project.hasPermission(Item.CONFIGURE)) { - return new StandardUsernameListBoxModel().includeCurrentValue(credentialsId); - } - - return new StandardListBoxModel() - .includeEmptyValue() - .includeMatchingAs( - project instanceof Queue.Task ? Tasks.getAuthenticationOf((Queue.Task) project) : ACL.SYSTEM, - project, - StandardCredentials.class, - URIRequirementBuilder.create().build(), - CREDENTIALS_MATCHER) - .includeCurrentValue(credentialsId); + return JellyUtils.fillCredentialsIdItems(project, credentialsId, CREDENTIALS_MATCHER); } public ListBoxModel doFillScmToolItems() { diff --git a/src/main/java/com/microfocus/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java b/src/main/java/com/microfocus/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java index d11ec12bf3..605cda4df2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java +++ b/src/main/java/com/microfocus/application/automation/tools/pipelineSteps/UftScenarioLoadStepExecution.java @@ -84,6 +84,7 @@ protected Void run() throws Exception { } private void setRunnerTypeAsParameter() { + listener.getLogger().println("Set HPRunnerType = HPRunnerType.UFT"); ParametersAction parameterAction = build.getAction(ParametersAction.class); List newParams = (parameterAction != null) ? new ArrayList<>(parameterAction.getAllParameters()) : new ArrayList<>(); newParams.add(new StringParameterValue(HPRunnerType.class.getSimpleName(), HPRunnerType.UFT.name())); diff --git a/src/main/resources/META-INF/hudson.remoting.ClassFilter b/src/main/resources/META-INF/hudson.remoting.ClassFilter index 3e1fe1bb15..9fc118f068 100644 --- a/src/main/resources/META-INF/hudson.remoting.ClassFilter +++ b/src/main/resources/META-INF/hudson.remoting.ClassFilter @@ -18,4 +18,6 @@ com.hp.octane.integrations.dto.scm.impl.SCMDataImpl com.hp.octane.integrations.dto.scm.impl.SCMFileBlameImpl com.hp.octane.integrations.dto.scm.impl.SCMRepositoryImpl com.hp.octane.integrations.dto.scm.impl.PullRequestImpl +com.hp.octane.integrations.dto.scm.impl.BranchImpl +com.hp.octane.integrations.services.pullrequestsandbranches.BranchSyncResult diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/Messages.properties b/src/main/resources/com/microfocus/application/automation/tools/octane/Messages.properties index 48dc4ab703..60f518965a 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/Messages.properties +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/Messages.properties @@ -74,3 +74,4 @@ UFTTestDetectionPublisherConfigurationLabel=ALM Octane UFT tests discovery #pull request PullRequestActionConfigurationLabel=ALM Octane pull-request report +BranchActionConfigurationLabel=ALM Octane branch report \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction/index.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction/index.jelly new file mode 100644 index 0000000000..1deb547008 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesBuildAction/index.jelly @@ -0,0 +1,136 @@ + + + + + + + + + +

      +

      ALM Octane Branch Report

      +

      +
      +
      +
      +
      repositoryUrl : ${it.repositoryUrl}
      +
      filter : ${it.filter}
      +
      + + Update : ${it.branchSyncResult.getUpdated().size()}; + Created : ${it.branchSyncResult.getCreated().size()}; + Deleted : ${it.branchSyncResult.getDeleted().size()}; + +
      @@ -95,52 +52,33 @@
      - -
      - ${%AlmServersAreNotDefined} -
      -
      -
      + +
      + ${%AlmServersAreNotDefined} +
      +
      +
      -
      +
      ${%DontForgetThePublisher}
      + +
      + The credentials for "Run from ALM" tasks have been moved to Jenkins Configure System page. In order to update them please create a new project, add as a + "Post build action" in the configuration page the action called "Migrate ALM Credentials" and run the job. + In case migration process was accomplished, please add/edit credentials in global configuration page.
      - +
      +
      -
      +
      ${%DontForgetThePublisher}
      - -
      - ${%AlmServersAreNotDefined} -
      -
      -
      + +
      + ${%AlmServersAreNotDefined} +
      +
      +
      -
      +
      ${%DontForgetThePublisher}
      + +
      + The credentials for "Run from ALM" tasks have been moved to Jenkins Configure System page. In order to update them please create a new project, add as a + "Post build action" in the configuration page the action called "Migrate ALM Credentials" and run the job. + In case migration process was accomplished, please add/edit credentials in global configuration page.
      - +
      +
      -
      +
      ${%DontForgetThePublisher}
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Branches
      Octane IdBranchLast Commit RevisionLast updatedLast updaterMergedStatus
      ${s.octaneId}${s.name}${s.lastCommitSHA}${it.getFormattedDate(s.lastCommitTime)}${s.lastCommiterName}(${s.lastCommiterEmail})${s.isMerged}Updated
      ${s.name}${s.lastCommitSHA}${it.getFormattedDate(s.lastCommitTime)}${s.lastCommiterName}(${s.lastCommiterEmail})${s.isMerged}Created
      ${s.octaneId}${s.name}Deleted
      + + + + + \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly new file mode 100644 index 0000000000..122300f80d --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html new file mode 100644 index 0000000000..ba92426c18 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html @@ -0,0 +1,71 @@ + + +
      + This step is responsible for collecting branches from the SCM tool and injecting them to ALM Octane. +
      +
      +
      + Supported version of ALM Octane: 15.1.61 and later. + + +
      +
      + You can change the behaviour of this step by adding the following parameters to the job: +
        +
      • branches_active_branch_days: Only active branches can be added/update to ALM Octane. Default is 90 days.

      • +
      • branches_max_branches_to_fill: Relevant for GitHub repository only. Max branches to fetch info. Branch for which info is not fetched, cannot be added to ALM Octane. Default is 1000.

      • +
      + +
      +
      + + Supported SCM Tools: +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      SCM ToolSupported types of authenticationHow to create PAT (Personal access token)
      Bitbucket ServerUser/password and PATClick on your profile icon -> Manage account -> Personal access tokens -> Create a token (Assign Read permissions for both Projects and Repositories)
      Github CloudPAT onlyClick on your profile icon -> Settings -> Developer settings -> Personal access tokens -> Generate new token (Uncheck all scopes to grants read-only access)
      Github ServerUser/password and PAT
      +
      + Note : To create PAT credentials in Jenkins , use "Secret text" kind of credentials in "Add Credentials" dialog + +
      \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestBuildAction/index.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestBuildAction/index.jelly index fbe79291a2..2126eaab4b 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestBuildAction/index.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestBuildAction/index.jelly @@ -28,7 +28,7 @@ --> - + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 94399bf375..ed9fa28c65 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -99,6 +99,9 @@ + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly index 3d02b7923e..cbbd6cf5ae 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/SseBuilder/config.jelly @@ -73,6 +73,9 @@ } + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/SvChangeModeBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/SvChangeModeBuilder/config.jelly index 658de9b09d..939751831b 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/SvChangeModeBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/SvChangeModeBuilder/config.jelly @@ -28,6 +28,9 @@ + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/SvDeployBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/SvDeployBuilder/config.jelly index 632339440b..c7439ac1d3 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/SvDeployBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/SvDeployBuilder/config.jelly @@ -28,6 +28,9 @@ + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/SvExportBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/SvExportBuilder/config.jelly index 38a8348513..7df876d1a5 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/SvExportBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/SvExportBuilder/config.jelly @@ -28,6 +28,9 @@ + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/SvUndeployBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/SvUndeployBuilder/config.jelly index 422d302665..8fb143724f 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/SvUndeployBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/SvUndeployBuilder/config.jelly @@ -28,6 +28,9 @@ + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index bd4766fe97..0876a0946a 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -27,7 +27,9 @@ --> - + diff --git a/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly index c3b16a1634..8d7e1efb41 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly @@ -27,7 +27,7 @@ ~ ___________________________________________________________________ --> - + + xmlns:f="/lib/form" + xmlns:hp="/lib/hp-application-automation-tools"> + + +
      + +
      +
      + + + +
      +
      +
      +
      \ No newline at end of file diff --git a/src/main/resources/lib/hp-application-automation-tools/blockWrapperTableWidthId.jelly b/src/main/resources/lib/hp-application-automation-tools/blockWrapperTableWidthId.jelly new file mode 100644 index 0000000000..46c2981cdc --- /dev/null +++ b/src/main/resources/lib/hp-application-automation-tools/blockWrapperTableWidthId.jelly @@ -0,0 +1,16 @@ + + + + + +
      + +
      +
      + + + +
      +
      +
      +
      \ No newline at end of file diff --git a/src/main/resources/lib/hp-application-automation-tools/taglib b/src/main/resources/lib/hp-application-automation-tools/taglib new file mode 100644 index 0000000000..e69de29bb2 From 658b7e33e0c778173b10d7bc8a0e9d7fd4a98fd3 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 28 Feb 2021 06:57:44 +0200 Subject: [PATCH 1649/2502] tech : add log print of workspace to branch/pull request collectors --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ca62b6d1f..c0d17b534a 100644 --- a/pom.xml +++ b/pom.xml @@ -507,7 +507,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.7.13 + 2.6.7.14 From f62cac6c7c7a995cf3461b87edc20ebd7239e01a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 3 Mar 2021 14:03:24 +0200 Subject: [PATCH 1650/2502] tech : small fixes --- pom.xml | 5 ----- .../tools/octane/branches/BranchesPublisher/help.html | 2 +- .../tools/octane/pullrequests/PullRequestPublisher/help.html | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index c0d17b534a..f37e84d05a 100644 --- a/pom.xml +++ b/pom.xml @@ -357,11 +357,6 @@ central https://repo1.maven.org/maven2 - - bintray-adm-maven - bintray - http://dl.bintray.com/adm/maven - diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html index 7cd2ea630d..acf0e7997d 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html @@ -20,7 +20,7 @@
      This step is responsible for collecting branches from the SCM tool and injecting them to ALM Octane. -
      +

      In addition, this step is used to define the scm repositories templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions.

      diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html index e42c751045..b455002ac1 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html @@ -29,7 +29,7 @@
      This step is responsible for collecting pull requests from the SCM tool and injecting them to ALM Octane. See help information in ALM Octane Help Center. -
      +

      In addition, this step is used to define the scm repositories templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions.

      From 948be46adec65ee9d25d33faa6755b7301c33524 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 3 Mar 2021 14:06:21 +0200 Subject: [PATCH 1651/2502] Revert "tech : small fixes" This reverts commit f62cac6c --- .../tools/octane/branches/BranchesPublisher/help.html | 2 +- .../tools/octane/pullrequests/PullRequestPublisher/help.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html index acf0e7997d..7cd2ea630d 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html @@ -20,7 +20,7 @@
      This step is responsible for collecting branches from the SCM tool and injecting them to ALM Octane. -

      +
      In addition, this step is used to define the scm repositories templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions.

      diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html index b455002ac1..e42c751045 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html @@ -29,7 +29,7 @@
      This step is responsible for collecting pull requests from the SCM tool and injecting them to ALM Octane. See help information in ALM Octane Help Center. -

      +
      In addition, this step is used to define the scm repositories templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions.

      From 9529ffacaf5c161a987290935654be759f4e6d94 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 3 Mar 2021 14:06:36 +0200 Subject: [PATCH 1652/2502] tech : small fixes --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index f37e84d05a..c0d17b534a 100644 --- a/pom.xml +++ b/pom.xml @@ -357,6 +357,11 @@ central https://repo1.maven.org/maven2 + + bintray-adm-maven + bintray + http://dl.bintray.com/adm/maven + From 4cd4622f31a697c608ee0b9265e399f04a8eaed1 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 3 Mar 2021 14:10:37 +0200 Subject: [PATCH 1653/2502] tech : small fixes --- .../automation/tools/octane/branches/BranchesPublisher/help.html | 1 + .../tools/octane/pullrequests/PullRequestPublisher/help.html | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html index 7cd2ea630d..04c08cee05 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html @@ -21,6 +21,7 @@
      This step is responsible for collecting branches from the SCM tool and injecting them to ALM Octane.
      +
      In addition, this step is used to define the scm repositories templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions.

      diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html index e42c751045..dadb4b0ffb 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help.html @@ -30,6 +30,7 @@ This step is responsible for collecting pull requests from the SCM tool and injecting them to ALM Octane. See help information in ALM Octane Help Center.
      +
      In addition, this step is used to define the scm repositories templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions.

      From f56f59a0b98918d0346fcb1cdb7bb8bb968ab742 Mon Sep 17 00:00:00 2001 From: Daniel Danan Date: Sun, 7 Mar 2021 16:49:07 +0200 Subject: [PATCH 1654/2502] - JENKINS-65044: Add possibility to authenticate with access token. Added new checkbox indicating whether the credentials as access token. --- pom.xml | 2 +- .../automation/tools/pc/PcClient.java | 6 ++-- .../automation/tools/pc/PcModel.java | 11 ++++--- .../automation/tools/run/PcBuilder.java | 11 +++++-- .../tools/run/PcBuilder/config.jelly | 5 ++++ .../PcBuilder/help-authenticateWithToken.html | 29 +++++++++++++++++++ .../run/PcBuilder/help-credentialsId.html | 25 ++++++++++++++++ .../automation/tools/pc/MockPcModel.java | 4 +-- .../automation/tools/pc/MockPcRestProxy.java | 4 +-- .../tools/pc/MockPcRestProxyBadResponses.java | 4 +-- .../automation/tools/pc/PcTestBase.java | 3 +- .../automation/tools/pc/TestPcClient.java | 2 +- .../pc/TestPcClientNegativeScenrios.java | 2 +- 13 files changed, 89 insertions(+), 19 deletions(-) create mode 100644 src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-authenticateWithToken.html create mode 100644 src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-credentialsId.html diff --git a/pom.xml b/pom.xml index 83c245bec8..df28e6a22e 100644 --- a/pom.xml +++ b/pom.xml @@ -606,7 +606,7 @@ com.microfocus.adm.performancecenter plugins-common - 1.1.4 + 1.0.2-TENANT com.thoughtworks.xstream diff --git a/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java b/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java index 55a6f48350..9bc2f69e81 100644 --- a/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java @@ -78,7 +78,7 @@ public PcClient(PcModel pcModel, PrintStream logger) { logger.println(String.format("%s - %s %s.", dateFormatter.getDate(), Messages.UsingProxyCredentialsConfiguration(), proxyOutUser)); } } - restProxy = new PcRestProxy(model.isHTTPSProtocol(),model.getPcServerName(true), model.getAlmDomain(true), model.getAlmProject(true), model.getProxyOutURL(true),proxyOutUser,proxyOutPassword); + restProxy = new PcRestProxy(model.isHTTPSProtocol(), model.getPcServerName(true), model.isAuthenticateWithToken(), model.getAlmDomain(true), model.getAlmProject(true), model.getProxyOutURL(true),proxyOutUser,proxyOutPassword); this.logger = logger; }catch (PcException e){ logger.println(String.format("%s - %s", dateFormatter.getDate(), e.getMessage())); @@ -101,11 +101,11 @@ public boolean login() { logger.println(String.format("%s - %s", dateFormatter.getDate(), Messages.UsingPCCredentialsBuildParameters())); else logger.println(String.format("%s - %s", dateFormatter.getDate(), Messages.UsingPCCredentialsConfiguration())); - logger.println(String.format("%s - %s\n[PCServer='%s://%s/loadtest/%s', User='%s']", dateFormatter.getDate(), Messages.TryingToLogin(), model.isHTTPSProtocol(), restProxy.GetPcServer(), restProxy.GetTenant(), usernamePCPasswordCredentials.getUsername())); + logger.println(String.format("%s - %s\n[LRE Server='%s://%s/loadtest/%s', %s='%s']", dateFormatter.getDate(), Messages.TryingToLogin(), model.isHTTPSProtocol(), restProxy.GetPcServer(), restProxy.GetTenant(), model.isAuthenticateWithToken() ? "ClientIdKey" : "User", usernamePCPasswordCredentials.getUsername())); loggedIn = restProxy.authenticate(usernamePCPasswordCredentials.getUsername(), usernamePCPasswordCredentials.getPassword().getPlainText()); } else { - logger.println(String.format("%s - %s\n[PCServer='%s://%s/loadtest/%s', User='%s']", dateFormatter.getDate(), Messages.TryingToLogin(), model.isHTTPSProtocol(), restProxy.GetPcServer(), restProxy.GetTenant(), PcBuilder.usernamePCPasswordCredentials.getUsername())); + logger.println(String.format("%s - %s\n[LRE Server='%s://%s/loadtest/%s', %s='%s']", dateFormatter.getDate(), Messages.TryingToLogin(), model.isHTTPSProtocol(), restProxy.GetPcServer(), restProxy.GetTenant(), model.isAuthenticateWithToken() ? "ClientIdKey" : "User", PcBuilder.usernamePCPasswordCredentials.getUsername())); loggedIn = restProxy.authenticate(PcBuilder.usernamePCPasswordCredentials.getUsername(), PcBuilder.usernamePCPasswordCredentials.getPassword().getPlainText()); } } catch (PcException e) { diff --git a/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java b/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java index 08fc897512..a196741086 100644 --- a/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java @@ -67,13 +67,14 @@ public class PcModel { private String retry; private String retryDelay; private String retryOccurrences; + private final boolean authenticateWithToken; @DataBoundConstructor public PcModel(String serverAndPort, String pcServerName, String credentialsId, String almDomain, String almProject, String testId,String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, String addRunToTrendReport, String trendReportId, boolean HTTPSProtocol, - String proxyOutURL, String credentialsProxyId, String retry, String retryDelay, String retryOccurrences ) { + String proxyOutURL, String credentialsProxyId, String retry, String retryDelay, String retryOccurrences, boolean authenticateWithToken) { this.serverAndPort = serverAndPort; this.pcServerName = pcServerName; @@ -96,7 +97,7 @@ public PcModel(String serverAndPort, String pcServerName, String credentialsId, this.retry = retry; this.retryDelay = verifyStringValueIsIntAndPositive(retryDelay, 5); this.retryOccurrences = verifyStringValueIsIntAndPositive(retryOccurrences, 3); - + this.authenticateWithToken = authenticateWithToken; } private String verifyStringValueIsIntAndPositive (String supplied, int defaultValue) @@ -279,11 +280,11 @@ public String runParamsToString() { return String.format("[PCServer='%s', CredentialsId='%s', Domain='%s', Project='%s', TestID='%s', " + "TestInstanceID='%s', TimeslotDuration='%s', PostRunAction='%s', " + - "VUDsMode='%s'%s, HTTPSProtocol='%s']", + "VUDsMode='%s, trending='%s', HTTPSProtocol='%s', authenticateWithToken='%s']", pcServerName, credentialsId, almDomain, almProject, testId, testInstanceId, timeslotDuration, postRunAction.getValue(), - vudsModeString, trendString, HTTPSProtocol); + vudsModeString, trendString, HTTPSProtocol, authenticateWithToken); } @@ -309,6 +310,8 @@ public String isHTTPSProtocol(){ return "https"; } + public boolean isAuthenticateWithToken() { return this.authenticateWithToken; } + public void setBuildParameters(String buildParameters){ this.buildParameters = buildParameters; } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java index 78c198fa5b..4cd0951d6d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java @@ -129,6 +129,7 @@ public class PcBuilder extends Builder implements SimpleBuildStep{ private String retry; private String retryDelay; private String retryOccurrences; + private boolean authenticateWithToken; private int runId; private String testName; @@ -162,7 +163,8 @@ public PcBuilder( String credentialsProxyId, String retry, String retryDelay, - String retryOccurrences) { + String retryOccurrences, + boolean authenticateWithToken) { this.serverAndPort = serverAndPort; this.pcServerName = pcServerName; @@ -186,6 +188,7 @@ public PcBuilder( this.retry = (retry == null || retry.isEmpty())? "NO_RETRY" : retry; this.retryDelay = ("NO_RETRY".equals(this.retry)) ? "0" : (retryDelay == null || retryDelay.isEmpty()) ? "5" : retryDelay; this.retryOccurrences = ("NO_RETRY".equals(this.retry)) ? "0" : (retryOccurrences == null || retryOccurrences.isEmpty()) ? "3" : retryOccurrences; + this.authenticateWithToken = authenticateWithToken; } @Override @@ -314,7 +317,8 @@ public PcModel getPcModel() { credentialsProxyId, retry, retryDelay, - retryOccurrences); + retryOccurrences, + authenticateWithToken); } return pcModel; } @@ -1061,6 +1065,9 @@ public boolean isVudsMode() return getPcModel().isVudsMode(); } + public boolean isAuthenticateWithToken() { return getPcModel().isAuthenticateWithToken(); } + + public String getRetry () { return getPcModel().getRetry(); } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly index 855e11cc37..ea3b8d51a8 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly @@ -179,6 +179,11 @@ + + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-authenticateWithToken.html b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-authenticateWithToken.html new file mode 100644 index 0000000000..ea9a4e522c --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-authenticateWithToken.html @@ -0,0 +1,29 @@ + + +
      +
      From LRE 2021 R1, you can use a token associated with your user for authentication.
      +
      If LRE is defined to use SSO, this will be the only way for this plugin to authenticate to LRE.
      +
      To use it, have a token issued to your user in LRE.
      +
      In Jenkins, create new Jenkins credentials based on the LRE token you received: use the ClientIdKey in the Username and the ClientSecretKey key in the password.
      +
      Then use the new Jenkins credentials with this checkbox switched on.
      +
      \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-credentialsId.html b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-credentialsId.html new file mode 100644 index 0000000000..205f33568e --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/help-credentialsId.html @@ -0,0 +1,25 @@ + + +
      + LoadRunner Enterprise User / Token's Credentials or parameter pointing to such credentials. +
      diff --git a/src/test/java/com/microfocus/application/automation/tools/pc/MockPcModel.java b/src/test/java/com/microfocus/application/automation/tools/pc/MockPcModel.java index 0901c41932..6d3fd604b9 100644 --- a/src/test/java/com/microfocus/application/automation/tools/pc/MockPcModel.java +++ b/src/test/java/com/microfocus/application/automation/tools/pc/MockPcModel.java @@ -37,9 +37,9 @@ public class MockPcModel extends PcModel { public MockPcModel(String serverAndPort, String pcServerName, String credential, String almDomain, String almProject, String testId, String autoTestInstanceID, String testInstanceId, String timeslotDurationHours, - String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, boolean webProtocol, String retry, String retryDelay, String retryOccurrences) { + String timeslotDurationMinutes, PostRunAction postRunAction, boolean vudsMode, String description, boolean webProtocol, String retry, String retryDelay, String retryOccurrences, boolean authenticateWithToken) { super(serverAndPort, pcServerName, credential, almDomain, almProject, testId, autoTestInstanceID, testInstanceId, timeslotDurationHours, - timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null,null, retry, retryDelay, retryOccurrences + timeslotDurationMinutes, postRunAction, vudsMode, description, "NO_TREND", null,false,null,null, retry, retryDelay, retryOccurrences, authenticateWithToken ); } diff --git a/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxy.java b/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxy.java index ea0c67f1da..289bed5554 100644 --- a/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxy.java +++ b/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxy.java @@ -54,8 +54,8 @@ public class MockPcRestProxy extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); - public MockPcRestProxy(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) throws PcException { - super(webProtocol, pcServerName, almDomain, almProject,null,null,null); + public MockPcRestProxy(String webProtocol, String pcServerName, boolean authenticateWithToken, String almDomain, String almProject,PrintStream logger) throws PcException { + super(webProtocol, pcServerName, authenticateWithToken, almDomain, almProject,null,null,null); } @Override diff --git a/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxyBadResponses.java b/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxyBadResponses.java index 92b75ecb5c..80987be18e 100644 --- a/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxyBadResponses.java +++ b/src/test/java/com/microfocus/application/automation/tools/pc/MockPcRestProxyBadResponses.java @@ -51,8 +51,8 @@ public class MockPcRestProxyBadResponses extends PcRestProxy { private static Iterator runState = initializeRunStateIterator(); - public MockPcRestProxyBadResponses(String webProtocol, String pcServerName, String almDomain, String almProject,PrintStream logger) throws PcException { - super(webProtocol, pcServerName, almDomain, almProject,null,null,null); + public MockPcRestProxyBadResponses(String webProtocol, String pcServerName, boolean authenticateWithToken, String almDomain, String almProject,PrintStream logger) throws PcException { + super(webProtocol, pcServerName, authenticateWithToken, almDomain, almProject,null,null, null); } @Override diff --git a/src/test/java/com/microfocus/application/automation/tools/pc/PcTestBase.java b/src/test/java/com/microfocus/application/automation/tools/pc/PcTestBase.java index 5d7acf6a21..44966fd56f 100644 --- a/src/test/java/com/microfocus/application/automation/tools/pc/PcTestBase.java +++ b/src/test/java/com/microfocus/application/automation/tools/pc/PcTestBase.java @@ -58,12 +58,13 @@ public interface PcTestBase { public static final String RETRY = "NO_RETRY"; public static final String RETRYDELAY = "5"; public static final String RETRYOCCURRENCES = "3"; + public static final boolean AUTHENTICATE_WITH_TOKEN = false; public static final MockPcModel pcModel = new MockPcModel(SERVER_AND_PORT,PC_SERVER_NAME, CREDENTIALSID, ALM_DOMAIN, ALM_PROJECT, TEST_ID,TESTINSTANCEID, TEST_INSTANCE_ID, TIMESLOT_DURATION_HOURS, TIMESLOT_DURATION_MINUTES, POST_RUN_ACTION, - VUDS_MODE, DESCRIPTION,IS_HTTPS, RETRY, RETRYDELAY, RETRYOCCURRENCES); + VUDS_MODE, DESCRIPTION,IS_HTTPS, RETRY, RETRYDELAY, RETRYOCCURRENCES, AUTHENTICATE_WITH_TOKEN); public static final String runResponseEntity = "" + "" + TEST_ID + "" + diff --git a/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClient.java b/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClient.java index 8851accd9a..67cc6bb141 100644 --- a/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClient.java +++ b/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClient.java @@ -48,7 +48,7 @@ public class TestPcClient { @BeforeClass public static void setUp() { try { - PcRestProxy resetProxy = new MockPcRestProxy(PcTestBase.WEB_PROTOCOL, PcTestBase.PC_SERVER_NAME, PcTestBase.ALM_DOMAIN, + PcRestProxy resetProxy = new MockPcRestProxy(PcTestBase.WEB_PROTOCOL, PcTestBase.PC_SERVER_NAME, PcTestBase.AUTHENTICATE_WITH_TOKEN, PcTestBase.ALM_DOMAIN, PcTestBase.ALM_PROJECT,PcTestBase.LOGGER); pcClient = new PcClient(PcTestBase.pcModel, System.out, resetProxy); } catch (Exception e) { diff --git a/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClientNegativeScenrios.java b/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClientNegativeScenrios.java index cb58c73867..441ca0c08a 100644 --- a/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClientNegativeScenrios.java +++ b/src/test/java/com/microfocus/application/automation/tools/pc/TestPcClientNegativeScenrios.java @@ -58,7 +58,7 @@ public class TestPcClientNegativeScenrios { public static void setUp() { System.out.println("Starting Performance Center client negative testing scenarios:"); try { - PcRestProxy resetProxy = new MockPcRestProxyBadResponses(PcTestBase.WEB_PROTOCOL,PcTestBase.PC_SERVER_NAME, PcTestBase.ALM_DOMAIN, + PcRestProxy resetProxy = new MockPcRestProxyBadResponses(PcTestBase.WEB_PROTOCOL,PcTestBase.PC_SERVER_NAME, PcTestBase.AUTHENTICATE_WITH_TOKEN, PcTestBase.ALM_DOMAIN, PcTestBase.ALM_PROJECT,PcTestBase.LOGGER); pcClient = new PcClient(PcTestBase.pcModel, new PrintStream(new OutputStream() { From 7d646033ff2cf284fa0fc1dc9c5ae3f406b17698 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 8 Mar 2021 14:59:22 +0200 Subject: [PATCH 1655/2502] tech : add message on trial to launch uft tests while job folder in under windows\system32 --- .../automation/tools/AlmToolsUtils.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java index d49e8a4937..ceb586c860 100644 --- a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java @@ -30,17 +30,14 @@ import hudson.FilePath; import hudson.Launcher; -import hudson.model.BuildListener; -import hudson.model.Result; -import hudson.model.AbstractBuild; -import hudson.model.Run; -import hudson.model.TaskListener; +import hudson.model.*; import hudson.util.ArgumentListBuilder; import jenkins.model.Jenkins; import java.io.IOException; import java.io.PrintStream; import java.net.URL; +import java.util.Locale; @SuppressWarnings("squid:S1160") public class AlmToolsUtils { @@ -75,9 +72,14 @@ public static void runOnBuildEnv( build.setResult(Result.UNSTABLE); } else if (returnCode == -3) { build.setResult(Result.ABORTED); + } else { + listener.getLogger().println("Launch return code " + returnCode); + build.setResult(Result.FAILURE); + if(returnCode == -2146232576 && file.getRemote().toLowerCase(Locale.ROOT).contains("\\system32\\config")) { + listener.getLogger().println("!!! Move 'JENKINS_HOME' out of the 'windows\\\\system32' folder because the plugin may not have permissions to launch tests under this folder."); + } } } - } public static void runHpToolsAborterOnBuildEnv( From e5e3d20cbcf59599f17f956a8985299f6499f43b Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 10 Mar 2021 09:33:38 +0200 Subject: [PATCH 1656/2502] defect #1178005 : [Jenkins] Trial to rebuild job that has pipeline - pipeline build never ends in octane --- .../automation/tools/octane/model/CIEventCausesFactory.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java index f20098ab07..d2747cd4e5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java @@ -88,6 +88,9 @@ public static List processCauses(Run run) { tmpResultCause.setUser(tmpUserCause.getUserId()); result.put(tmpResultCause.generateKey(), tmpResultCause); } else if (cause instanceof Cause.UpstreamCause) { + if("RebuildCause".equals(cause.getClass().getSimpleName())){ + continue;//rebuild reason have upstream of previous build - its confusing octane.(Part of rebuild plugin) + } tmpUpstreamCause = (Cause.UpstreamCause) cause; boolean succeededToBuildFlowCauses = false; From c51a3f96b668d2358213f87f27892b669c592620 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 12 Mar 2021 06:03:54 +0200 Subject: [PATCH 1657/2502] tech : handling possible null pointer --- .../automation/tools/octane/model/CIEventCausesFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java index d2747cd4e5..3c50096dd9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java @@ -109,8 +109,7 @@ public static List processCauses(Run run) { } } - if (!succeededToBuildFlowCauses) { - + if (upstreamRun != null && !succeededToBuildFlowCauses) { // proceed with regular UPSTREAM calculation logic as usual tmpResultCause.setType(CIEventCauseType.UPSTREAM); tmpResultCause.setProject(resolveJobCiId(tmpUpstreamCause.getUpstreamProject())); From d878a1d16ab22a8107a9ce951cbbda44eb98fc31 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 12 Mar 2021 10:31:16 +0200 Subject: [PATCH 1658/2502] us #1178033 : [Jenkins] need possibility to inject branches and pull requests with SSH format of repository --- pom.xml | 2 +- .../tools/octane/GitFetchUtils.java | 6 ++-- .../octane/branches/BranchesPublisher.java | 29 ++++++++++++---- .../pullrequests/PullRequestPublisher.java | 29 +++++++++++++--- .../branches/BranchesPublisher/config.jelly | 5 +++ .../BranchesPublisher/help-useSSHFormat.html | 34 +++++++++++++++++++ .../PullRequestPublisher/config.jelly | 4 +++ .../help-useSSHFormat.html | 34 +++++++++++++++++++ 8 files changed, 128 insertions(+), 15 deletions(-) create mode 100644 src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help-useSSHFormat.html create mode 100644 src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help-useSSHFormat.html diff --git a/pom.xml b/pom.xml index c0d17b534a..cac5d7a78b 100644 --- a/pom.xml +++ b/pom.xml @@ -507,7 +507,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.7.14 + 2.6.7.15 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/GitFetchUtils.java b/src/main/java/com/microfocus/application/automation/tools/octane/GitFetchUtils.java index e073fd2b22..992fc7393d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/GitFetchUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/GitFetchUtils.java @@ -101,11 +101,11 @@ public static AuthenticationStrategy getAuthenticationStrategy(StandardCredentia return authenticationStrategy; } - public static void updateRepoTemplates(PullRequestAndBranchService pullRequestAndBranchService, FetchHandler fetcherHandler, String repoUrl, Long workspaceId, Consumer logConsumer) { + public static void updateRepoTemplates(PullRequestAndBranchService pullRequestAndBranchService, FetchHandler fetcherHandler, String repoHttpUrlForTemplates, String repoUrlForOctane, Long workspaceId, Consumer logConsumer) { //update repo templates try { - RepoTemplates repoTemplates = fetcherHandler.buildRepoTemplates(repoUrl); - if (pullRequestAndBranchService.updateRepoTemplates(repoUrl, workspaceId, repoTemplates)) { + RepoTemplates repoTemplates = fetcherHandler.buildRepoTemplates(repoHttpUrlForTemplates); + if (pullRequestAndBranchService.updateRepoTemplates(repoUrlForOctane, workspaceId, repoTemplates)) { logConsumer.accept("Repo template are updated successfully in ALM Octane"); } } catch (Exception e) { diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java index 740fa4a75c..0f12126198 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java @@ -52,6 +52,7 @@ import org.jenkinsci.plugins.plaincredentials.StringCredentials; import org.kohsuke.stapler.AncestorInPath; import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; @@ -72,6 +73,7 @@ public class BranchesPublisher extends Recorder implements SimpleBuildStep { private String credentialsId; private String filter; private String scmTool; + private String useSSHFormat; // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" @DataBoundConstructor @@ -112,17 +114,19 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi String myConfigurationId = configurationId; String myWorkspaceId = workspaceId; String myScmTool = scmTool; + String myUseSshFormat = useSSHFormat; try { EnvVars env = run.getEnvironment(taskListener); myCredentialsId = env.expand(credentialsId); myConfigurationId = env.expand(configurationId); myWorkspaceId = env.expand(workspaceId); myScmTool = env.expand(scmTool); + myUseSshFormat = env.expand(useSSHFormat); } catch (IOException | InterruptedException e) { taskListener.error("Failed loading build environment " + e); } - BranchFetchParameters fp = createFetchParameters(run, taskListener, logConsumer::printLog); + BranchFetchParameters fp = createFetchParameters(run, taskListener, myUseSshFormat, logConsumer::printLog); StandardCredentials credentials = GitFetchUtils.getCredentialsById(myCredentialsId, run, taskListener.getLogger()); AuthenticationStrategy authenticationStrategy = GitFetchUtils.getAuthenticationStrategy(credentials); @@ -137,7 +141,8 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi PullRequestAndBranchService service = OctaneSDK.getClientByInstanceId(myConfigurationId).getPullRequestAndBranchService(); BranchSyncResult result = service.syncBranchesToOctane(fetchHandler, fp, Long.parseLong(myWorkspaceId), GitFetchUtils::getUserIdForCommit, logConsumer::printLog); - GitFetchUtils.updateRepoTemplates(service, fetchHandler, getRepositoryUrl(), Long.parseLong(myWorkspaceId), logConsumer::printLog); + String repoUrlForOctane = fp.isUseSSHFormat() ? fp.getRepoUrlSsh() : fp.getRepoUrl(); + GitFetchUtils.updateRepoTemplates(service, fetchHandler, fp.getRepoUrl(), repoUrlForOctane, Long.parseLong(myWorkspaceId), logConsumer::printLog); synchronized (BranchesBuildAction.class) { long index = run.getActions(BranchesBuildAction.class).size(); @@ -145,7 +150,6 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi run.addAction(buildAction); } - } catch (OctaneValidationException e) { logConsumer.printLog("ALM Octane branch collector failed on validation : " + e.getMessage()); run.setResult(Result.FAILURE); @@ -163,19 +167,31 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi } } - private BranchFetchParameters createFetchParameters(@Nonnull Run run, @Nonnull TaskListener taskListener, Consumer logConsumer) { + @DataBoundSetter + public void setUseSSHFormat(boolean useSSHFormat) { + this.useSSHFormat = Boolean.toString(useSSHFormat); + } + + + public boolean getUseSSHFormat() { + return Boolean.parseBoolean(useSSHFormat); + } + + private BranchFetchParameters createFetchParameters(@Nonnull Run run, @Nonnull TaskListener taskListener, String myUseSshFormat, Consumer logConsumer) { BranchFetchParameters fp; try { EnvVars env = run.getEnvironment(taskListener); fp = new BranchFetchParameters() .setRepoUrl(env.expand(repositoryUrl)) - .setFilter(env.expand(filter)); + .setFilter(env.expand(filter)) + .setUseSSHFormat(Boolean.parseBoolean(env.expand(myUseSshFormat))); } catch (IOException | InterruptedException e) { taskListener.error("Failed loading build environment " + e); fp = new BranchFetchParameters() .setRepoUrl(repositoryUrl) - .setFilter(filter); + .setFilter(filter) + .setUseSSHFormat(Boolean.parseBoolean(myUseSshFormat)); } ParametersAction parameterAction = run.getAction(ParametersAction.class); @@ -190,6 +206,7 @@ private BranchFetchParameters createFetchParameters(@Nonnull Run run, @Non logConsumer.accept("Page size : " + fp.getPageSize()); logConsumer.accept("Max branches to fill : " + fp.getMaxBranchesToFill()); logConsumer.accept("Branch active days : " + fp.getActiveBranchDays()); + logConsumer.accept("Use ssh format : " + fp.isUseSSHFormat()); return fp; } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java index 59a14e73b7..f2e1985684 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java @@ -60,6 +60,7 @@ import org.jenkinsci.plugins.plaincredentials.StringCredentials; import org.kohsuke.stapler.AncestorInPath; import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; @@ -80,6 +81,7 @@ public class PullRequestPublisher extends Recorder implements SimpleBuildStep { private String sourceBranchFilter; private String targetBranchFilter; private String scmTool; + private String useSSHFormat; // Fields in config.jelly must match the parameter names in the "DataBoundConstructor" @DataBoundConstructor @@ -121,17 +123,20 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi String myConfigurationId = configurationId; String myWorkspaceId = workspaceId; String myScmTool = scmTool; + String myUseSshFormat = useSSHFormat; try { EnvVars env = run.getEnvironment(taskListener); myCredentialsId = env.expand(credentialsId); myConfigurationId = env.expand(configurationId); myWorkspaceId = env.expand(workspaceId); myScmTool = env.expand(scmTool); + myUseSshFormat = env.expand(useSSHFormat); } catch (IOException | InterruptedException e) { taskListener.error("Failed loading build environment " + e); } - PullRequestFetchParameters fp = createFetchParameters(run, taskListener, myConfigurationId, myWorkspaceId, logConsumer::printLog); + PullRequestFetchParameters fp = createFetchParameters(run, taskListener, myConfigurationId, myWorkspaceId, myUseSshFormat, logConsumer::printLog); + //fp.set StandardCredentials credentials = GitFetchUtils.getCredentialsById(myCredentialsId, run, taskListener.getLogger()); AuthenticationStrategy authenticationStrategy = GitFetchUtils.getAuthenticationStrategy(credentials); @@ -154,7 +159,8 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi octaneClient.getPullRequestAndBranchService().sendPullRequests(pullRequests, myWorkspaceId, fp, logConsumer::printLog); } //update templates - GitFetchUtils.updateRepoTemplates(octaneClient.getPullRequestAndBranchService(), fetchHandler, getRepositoryUrl(), + String repoUrlForOctane = fp.isUseSSHFormat() ? fp.getRepoUrlSsh() : fp.getRepoUrl(); + GitFetchUtils.updateRepoTemplates(octaneClient.getPullRequestAndBranchService(), fetchHandler, fp.getRepoUrl(), repoUrlForOctane, Long.parseLong(myWorkspaceId), logConsumer::printLog); } catch (OctaneValidationException e) { logConsumer.printLog("ALM Octane pull request collector failed on validation : " + e.getMessage()); @@ -169,7 +175,7 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi } } - private PullRequestFetchParameters createFetchParameters(@Nonnull Run run, @Nonnull TaskListener taskListener, String myConfigurationId, String myWorkspaceId, Consumer logConsumer) { + private PullRequestFetchParameters createFetchParameters(@Nonnull Run run, @Nonnull TaskListener taskListener, String myConfigurationId, String myWorkspaceId, String myUseSshFormat, Consumer logConsumer) { PullRequestFetchParameters fp; try { @@ -177,13 +183,16 @@ private PullRequestFetchParameters createFetchParameters(@Nonnull Run run, fp = new PullRequestFetchParameters() .setRepoUrl(env.expand(repositoryUrl)) .setSourceBranchFilter(env.expand(sourceBranchFilter)) - .setTargetBranchFilter(env.expand(targetBranchFilter)); + .setTargetBranchFilter(env.expand(targetBranchFilter)) + .setUseSSHFormat(Boolean.parseBoolean(env.expand(myUseSshFormat))); + } catch (IOException | InterruptedException e) { taskListener.error("Failed loading build environment " + e); fp = new PullRequestFetchParameters() .setRepoUrl(repositoryUrl) .setSourceBranchFilter(sourceBranchFilter) - .setTargetBranchFilter(targetBranchFilter); + .setTargetBranchFilter(targetBranchFilter) + .setUseSSHFormat(Boolean.parseBoolean(myUseSshFormat)); } ParametersAction parameterAction = run.getAction(ParametersAction.class); @@ -204,6 +213,7 @@ private PullRequestFetchParameters createFetchParameters(@Nonnull Run run, logConsumer.accept("Target branch filter : " + fp.getTargetBranchFilter()); logConsumer.accept("Max PRs to collect : " + fp.getMaxPRsToFetch()); logConsumer.accept("Max commits to collect: " + fp.getMaxCommitsToFetch()); + logConsumer.accept("Use ssh format : " + fp.isUseSSHFormat()); return fp; } @@ -239,6 +249,15 @@ public String getWorkspaceId() { return workspaceId; } + @DataBoundSetter + public void setUseSSHFormat(boolean useSSHFormat) { + this.useSSHFormat = Boolean.toString(useSSHFormat); + } + + public boolean getUseSSHFormat() { + return Boolean.parseBoolean(useSSHFormat); + } + private static class LogConsumer { private final PrintStream ps; diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly index 122300f80d..ddc4794122 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/config.jelly @@ -45,6 +45,11 @@ + + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help-useSSHFormat.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help-useSSHFormat.html new file mode 100644 index 0000000000..70f75ad288 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help-useSSHFormat.html @@ -0,0 +1,34 @@ + + +
      + Select this if all other jobs that use this repository and are connected to ALM Octane pipelines use SSH format. + It is important to be consistent with other jobs that use this repository. +
      + This will ensure that ALM Octane correctly identifies the SCM repository associated with commits, branches and pull requests. +
      \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/config.jelly index 0f40ffcf99..6a2aca9dce 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/config.jelly @@ -50,6 +50,10 @@ description="Repository clone URL in HTTP format.">
      + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help-useSSHFormat.html b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help-useSSHFormat.html new file mode 100644 index 0000000000..70f75ad288 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher/help-useSSHFormat.html @@ -0,0 +1,34 @@ + + +
      + Select this if all other jobs that use this repository and are connected to ALM Octane pipelines use SSH format. + It is important to be consistent with other jobs that use this repository. +
      + This will ensure that ALM Octane correctly identifies the SCM repository associated with commits, branches and pull requests. +
      \ No newline at end of file From 2c716e71efddd8ed469bdce927bc2b13754c7c53 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 12 Mar 2021 10:32:01 +0200 Subject: [PATCH 1659/2502] tech : disabling branch publisher for 6.7 release --- .../automation/tools/octane/branches/BranchesPublisher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java index 0f12126198..c9ab75cff9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java @@ -294,7 +294,7 @@ public ListBoxModel doFillScmToolItems() { } public boolean isApplicable(Class aClass) { - return true; + return false; } public ListBoxModel doFillConfigurationIdItems() { From 10bfae85628afdb00e1b870206770801adbabf51 Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Fri, 12 Mar 2021 15:17:21 +0200 Subject: [PATCH 1660/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.6.4-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d4e1b25c23..99746e9c03 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.6.4-beta-SNAPSHOT + 6.6.4-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.6.4-beta From 42dcb9c3d9fbaffa586c7f74c56b4e66eac6a50c Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Fri, 12 Mar 2021 15:17:32 +0200 Subject: [PATCH 1661/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 99746e9c03..02613716a8 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.6.4-beta + 6.6.5-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.6.4-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 635b012143b0e6e0163570dbad161b912c15d808 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 14 Mar 2021 17:24:30 +0200 Subject: [PATCH 1662/2502] tech : revert commit that done by mistake --- .../events/WorkflowListenerOctaneImpl.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java index c0631079f5..127f82bb23 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java @@ -202,27 +202,6 @@ private CIEvent prepareStageEvent(StepStartNode stepStartNode) { } private CIBuildResult extractFlowNodeResult(FlowNode node) { - CIBuildResult result = node.getError() != null ? CIBuildResult.FAILURE : CIBuildResult.SUCCESS; - if (CIBuildResult.SUCCESS.equals(result) && isChildNodeFailed(node, 0)) { - result = CIBuildResult.FAILURE; - } - return result; - } - - private boolean isChildNodeFailed(FlowNode node, int iteration) { - if (iteration >= 2) { - return false; - } - try { - for (FlowNode temp : node.getParents()) { - boolean isFailed = temp.getError() != null; - if (isFailed || isChildNodeFailed(node, iteration + 1)) - return true; - } - return false; - } catch (Exception e) { - return false; - } - + return node.getAction(ErrorAction.class) != null ? CIBuildResult.FAILURE : CIBuildResult.SUCCESS; } } \ No newline at end of file From 5e0b12e2a24f7d0275a01894aa608dc2ebbf842f Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 15 Mar 2021 07:22:59 +0200 Subject: [PATCH 1663/2502] tech : show in octane stage as failed (mapfre) --- .../events/WorkflowListenerOctaneImpl.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java index 127f82bb23..8719ff34e4 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java @@ -202,6 +202,29 @@ private CIEvent prepareStageEvent(StepStartNode stepStartNode) { } private CIBuildResult extractFlowNodeResult(FlowNode node) { - return node.getAction(ErrorAction.class) != null ? CIBuildResult.FAILURE : CIBuildResult.SUCCESS; + CIBuildResult result = node.getError() != null ? CIBuildResult.FAILURE : CIBuildResult.SUCCESS; + if (CIBuildResult.SUCCESS.equals(result) && isChildNodeFailed(node, 0)) { + result = CIBuildResult.FAILURE; + } + return result; + } + + private boolean isChildNodeFailed(FlowNode node, int iteration) { + if (iteration >= 2) { + return false; + } + try { + for (FlowNode temp : node.getParents()) { + if(temp instanceof StepEndNode) { + boolean isFailed = temp.getError() != null; + if (isFailed || isChildNodeFailed(temp, iteration + 1)) + return true; + } + } + return false; + } catch (Exception e) { + return false; + } + } } \ No newline at end of file From 36b61c17ecff3c6162861ed22f83675ca28ac803 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 15 Mar 2021 07:23:40 +0200 Subject: [PATCH 1664/2502] tech : show in octane stage as failed (mapfre) --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 02613716a8..e371977122 100644 --- a/pom.xml +++ b/pom.xml @@ -415,6 +415,12 @@ workflow-basic-steps 2.11 + + org.jenkins-ci.plugins.workflow workflow-multibranch From 0d3bf40eb21b4039cfb9af7b607a753b79480427 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 15 Mar 2021 09:41:53 +0200 Subject: [PATCH 1665/2502] tech : show in octane stage as failed (mapfre) --- .../tools/octane/events/WorkflowListenerOctaneImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java index 8719ff34e4..af026420e2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java @@ -225,6 +225,15 @@ private boolean isChildNodeFailed(FlowNode node, int iteration) { } catch (Exception e) { return false; } + //example of script : in this case second stage is failing but in octane its successful + /*node { + stage('Build') {} + stage('Results') { + uftScenarioLoad archiveTestResultsMode: 'ALWAYS_ARCHIVE_TEST_REPORT',testPaths: '''c:\\dev\\plugins\\_uft\\UftTests\\GeneratedResult\\GUITestWithFail''' + catchError(stageResult: 'FAILURE') {error 'error message 123'} + } + stage('Post Results') { } + }*/ } } \ No newline at end of file From 777913a50acffcda6c24ca834a7773264d0c513c Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 15 Mar 2021 10:06:12 +0200 Subject: [PATCH 1666/2502] tech : show in octane stage as failed (mapfre) --- .../events/WorkflowListenerOctaneImpl.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java index af026420e2..9f9bf067d5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java @@ -209,6 +209,20 @@ private CIBuildResult extractFlowNodeResult(FlowNode node) { return result; } + /** + * example of script : in this case second stage is failing but in octane its successful + * node { + * stage('Build') {} + * stage('Results') { + * uftScenarioLoad archiveTestResultsMode: 'ALWAYS_ARCHIVE_TEST_REPORT',testPaths: '''c:\\dev\\plugins\\_uft\\UftTests\\GeneratedResult\\GUITestWithFail''' + * catchError(stageResult: 'FAILURE') {error 'error message 123'} + * } + * stage('Post Results') { } + * } + * @param node + * @param iteration + * @return + */ private boolean isChildNodeFailed(FlowNode node, int iteration) { if (iteration >= 2) { return false; @@ -225,15 +239,5 @@ private boolean isChildNodeFailed(FlowNode node, int iteration) { } catch (Exception e) { return false; } - //example of script : in this case second stage is failing but in octane its successful - /*node { - stage('Build') {} - stage('Results') { - uftScenarioLoad archiveTestResultsMode: 'ALWAYS_ARCHIVE_TEST_REPORT',testPaths: '''c:\\dev\\plugins\\_uft\\UftTests\\GeneratedResult\\GUITestWithFail''' - catchError(stageResult: 'FAILURE') {error 'error message 123'} - } - stage('Post Results') { } - }*/ - } } \ No newline at end of file From 3f007b2f51bb86988032a6a610f159f26a71dce7 Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Mon, 15 Mar 2021 12:23:12 +0200 Subject: [PATCH 1667/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.6.5-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e371977122..ee10240aaf 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.6.5-beta-SNAPSHOT + 6.6.5-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.6.5-beta From 0a4d2a00257d7030fd0eaa6fde3ce883a2476772 Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Mon, 15 Mar 2021 12:23:21 +0200 Subject: [PATCH 1668/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ee10240aaf..a8d07cc84d 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.6.5-beta + 6.6.6-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.6.5-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From db30219717a5a0d0094ef11bdb8d6bacfcd13db5 Mon Sep 17 00:00:00 2001 From: Daniel Danan Date: Tue, 16 Mar 2021 16:37:06 +0200 Subject: [PATCH 1669/2502] JENKINS-65137: JAXBContext failing - dependency problem change: use XStream instead of JAXBContext and Marshaller. --- .../automation/tools/run/PcBuilder.java | 10 ++++------ .../tools/sse/result/model/junit/Error.java | 9 +++++++++ .../tools/sse/result/model/junit/Failure.java | 9 +++++++++ .../sse/result/model/junit/Testcase.java | 16 +++++++++++++++ .../sse/result/model/junit/Testsuite.java | 20 +++++++++++++++++++ .../sse/result/model/junit/Testsuites.java | 6 +++++- 6 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java index 4cd0951d6d..e99dd264d0 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java @@ -63,8 +63,6 @@ import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; import java.beans.IntrospectionException; import java.io.*; import java.lang.reflect.Method; @@ -72,7 +70,7 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.logging.Level; -import java.util.logging.Logger; +import com.thoughtworks.xstream.XStream; import hudson.model.Run; @@ -922,9 +920,9 @@ private Result createRunResults(FilePath filePath, Testsuites testsuites) { try { if (testsuites != null) { StringWriter writer = new StringWriter(); - JAXBContext context = JAXBContext.newInstance(Testsuites.class); - Marshaller marshaller = context.createMarshaller(); - marshaller.marshal(testsuites, writer); + XStream xstream = new XStream(); + xstream.autodetectAnnotations(true); + xstream.toXML(testsuites, writer); filePath.write(writer.toString(), null); if (containsErrorsOrFailures(testsuites.getTestsuite())) { ret = Result.FAILURE; diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Error.java b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Error.java index 6e6043433f..02d330c84a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Error.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Error.java @@ -27,6 +27,11 @@ package com.microfocus.application.automation.tools.sse.result.model.junit; +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; +import com.thoughtworks.xstream.annotations.XStreamConverter; +import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -57,13 +62,17 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "content" }) @XmlRootElement(name = "error") +@XStreamAlias("error") +@XStreamConverter(value= ToAttributedValueConverter.class, strings={"content"}) public class Error { @XmlValue protected String content; @XmlAttribute + @XStreamAsAttribute protected String type; @XmlAttribute + @XStreamAsAttribute protected String message; /** diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Failure.java b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Failure.java index 576600d73a..ebd428fc93 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Failure.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Failure.java @@ -27,6 +27,11 @@ package com.microfocus.application.automation.tools.sse.result.model.junit; +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; +import com.thoughtworks.xstream.annotations.XStreamConverter; +import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -57,13 +62,17 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "content" }) @XmlRootElement(name = "failure") +@XStreamAlias("failure") +@XStreamConverter(value= ToAttributedValueConverter.class, strings={"content"}) public class Failure { @XmlValue protected String content; @XmlAttribute + @XStreamAsAttribute protected String type; @XmlAttribute + @XStreamAsAttribute protected String message; /** diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testcase.java b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testcase.java index d01aa516e8..92f6a54bf8 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testcase.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testcase.java @@ -27,6 +27,10 @@ package com.microfocus.application.automation.tools.sse.result.model.junit; +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + import java.util.ArrayList; import java.util.List; @@ -72,28 +76,40 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "skipped", "error", "failure", "systemOut", "systemErr" }) @XmlRootElement(name = "testcase") +@XStreamAlias("testcase") public class Testcase { protected String skipped; + @XStreamImplicit protected List error; + @XStreamImplicit protected List failure; @XmlElement(name = "system-out") + @XStreamImplicit(itemFieldName="system-out") protected List systemOut; @XmlElement(name = "system-err") + @XStreamImplicit(itemFieldName="system-err") protected List systemErr; @XmlAttribute(required = true) + @XStreamAsAttribute protected String name; @XmlAttribute + @XStreamAsAttribute protected String assertions; @XmlAttribute + @XStreamAsAttribute protected String time; @XmlAttribute + @XStreamAsAttribute protected String classname; @XmlAttribute + @XStreamAsAttribute protected String status; @XmlAttribute + @XStreamAsAttribute protected String type; @XmlAttribute + @XStreamAsAttribute protected String report; /** diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuite.java b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuite.java index 848d8c3804..ba2b79042f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuite.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuite.java @@ -27,6 +27,10 @@ package com.microfocus.application.automation.tools.sse.result.model.junit; +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + import java.util.ArrayList; import java.util.List; @@ -75,35 +79,51 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "properties", "testcase", "systemOut", "systemErr" }) @XmlRootElement(name = "testsuite") +@XStreamAlias("testsuite") public class Testsuite { protected Properties properties; + @XStreamImplicit protected List testcase; @XmlElement(name = "system-out") + @XStreamAlias("system-out") protected String systemOut; @XmlElement(name = "system-err") + @XStreamAlias("system-err") protected String systemErr; @XmlAttribute(required = true) + @XStreamAsAttribute protected String name; @XmlAttribute(required = true) + @XStreamAsAttribute protected String tests; @XmlAttribute + @XStreamAsAttribute protected String failures; @XmlAttribute + @XStreamAsAttribute protected String errors; @XmlAttribute + @XStreamAsAttribute protected String time; @XmlAttribute + @XStreamAsAttribute protected String disabled; @XmlAttribute + @XStreamAsAttribute protected String skipped; @XmlAttribute + @XStreamAsAttribute protected String timestamp; @XmlAttribute + @XStreamAsAttribute protected String hostname; @XmlAttribute + @XStreamAsAttribute protected String id; @XmlAttribute(name = "package") + @XStreamAlias("package") + @XStreamAsAttribute protected String _package; /** diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuites.java b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuites.java index c82faa22e3..cd7fcfde82 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuites.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/result/model/junit/Testsuites.java @@ -27,6 +27,9 @@ package com.microfocus.application.automation.tools.sse.result.model.junit; +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + import java.util.ArrayList; import java.util.List; @@ -66,8 +69,9 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "testsuite" }) @XmlRootElement(name = "testsuites") +@XStreamAlias("testsuites") public class Testsuites { - + @XStreamImplicit protected List testsuite; @XmlAttribute protected String name; From 041783a2507d7283a060ab5aa10a23dd785ff122 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 18 Mar 2021 15:49:49 +0200 Subject: [PATCH 1670/2502] defect #1181062 : fix taking only latest uft test result --- .../tools/results/RunResultRecorder.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java index 369bf65c05..71e53ad22d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java @@ -49,12 +49,13 @@ import hudson.tasks.*; import hudson.tasks.junit.*; import hudson.tasks.test.TestResultAggregator; -import hudson.util.RunList; import jenkins.model.Jenkins; import jenkins.tasks.SimpleBuildStep; import org.apache.commons.io.FileUtils; +import org.apache.commons.io.filefilter.AgeFileFilter; +import org.apache.commons.io.filefilter.FileFilterUtils; +import org.apache.commons.io.filefilter.IOFileFilter; import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.boon.primitive.Int; import org.kohsuke.stapler.DataBoundConstructor; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -73,12 +74,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import java.io.*; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static com.microfocus.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNode; import static com.microfocus.application.automation.tools.results.projectparser.performance.XmlParserUtil.getNodeAttr; @@ -1451,8 +1447,11 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } } - FileFilter fileSystemResultFileFilter = new WildcardFileFilter(String.format("*_%d.xml", build.getNumber())); - List fileSystemResultsPath = workspace.list(fileSystemResultFileFilter); + IOFileFilter byBuildNumberFileFilter = new WildcardFileFilter(String.format("*_%d.xml", build.getNumber())); + IOFileFilter byBuildStartedFileFilter = new AgeFileFilter(build.getStartTimeInMillis(), false); + IOFileFilter fileFilter = FileFilterUtils.and(byBuildNumberFileFilter, byBuildStartedFileFilter); + + List fileSystemResultsPath = workspace.list(fileFilter); for (FilePath fileSystemResultPath: fileSystemResultsPath) { fileSystemResultNames.add(fileSystemResultPath.getName()); From 006730cb39c0785f4fbb49e4a35235de4e5bfdcb Mon Sep 17 00:00:00 2001 From: "CORPDOM\\llu2" Date: Thu, 25 Mar 2021 13:13:49 +0800 Subject: [PATCH 1671/2502] Report url update since ALM UI's angular version update. --- .../automation/tools/sse/sdk/ALMRunReportUrlBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java index 8f1f4063e2..aaace55bec 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java @@ -43,7 +43,7 @@ public String build(Client client, String serverUrl, String domain, String proje String ret = "NA"; try { if (isNewReport(client)) { - ret = String.format("%sui/?redirected&p=%s/%s&execution-report#/test-set-report/%s", + ret = String.format("%sui/?redirected&p=%s/%s&execution-report#!/test-set-report/%s", serverUrl, domain, project, From 1a6521ca0dac833d3093e9f8c6c2cb481574f0ea Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 25 Mar 2021 13:21:41 +0200 Subject: [PATCH 1672/2502] =?UTF-8?q?defect=20#1138101=20:=20=20=E2=80=9CS?= =?UTF-8?q?tage=E2=80=9D=20in=20Jenkins=20is=20failed,=20and=20in=20octane?= =?UTF-8?q?=20it=20appears=20as=20successful.=20handle=20error=20converted?= =?UTF-8?q?=20to=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../events/WorkflowListenerOctaneImpl.java | 55 +++++++++++-------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index a8d07cc84d..97e3ad9775 100644 --- a/pom.xml +++ b/pom.xml @@ -393,7 +393,7 @@ org.jenkins-ci.plugins.workflow workflow-api - 2.31 + 2.34 org.jenkins-ci.plugins.workflow diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java index 9f9bf067d5..3ac008716a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java @@ -46,9 +46,10 @@ import com.microfocus.application.automation.tools.octane.tests.TestListener; import com.microfocus.application.automation.tools.octane.tests.build.BuildHandlerUtils; import hudson.Extension; +import hudson.model.Result; import org.apache.logging.log4j.Logger; -import org.jenkinsci.plugins.workflow.actions.ErrorAction; import org.jenkinsci.plugins.workflow.actions.TimingAction; +import org.jenkinsci.plugins.workflow.actions.WarningAction; import org.jenkinsci.plugins.workflow.cps.nodes.StepEndNode; import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode; import org.jenkinsci.plugins.workflow.flow.GraphListener; @@ -210,34 +211,44 @@ private CIBuildResult extractFlowNodeResult(FlowNode node) { } /** - * example of script : in this case second stage is failing but in octane its successful + * example of script : in this case second stage is failing but in octane its successful;in third case - error converted to warning * node { * stage('Build') {} * stage('Results') { * uftScenarioLoad archiveTestResultsMode: 'ALWAYS_ARCHIVE_TEST_REPORT',testPaths: '''c:\\dev\\plugins\\_uft\\UftTests\\GeneratedResult\\GUITestWithFail''' * catchError(stageResult: 'FAILURE') {error 'error message 123'} - * } - * stage('Post Results') { } - * } + * } + * stage('Post Results') { + * warnError('Script failed!') {//convert error to warning + * error 'err 1' + * } + * } * @param node * @param iteration * @return */ - private boolean isChildNodeFailed(FlowNode node, int iteration) { - if (iteration >= 2) { - return false; - } - try { - for (FlowNode temp : node.getParents()) { - if(temp instanceof StepEndNode) { - boolean isFailed = temp.getError() != null; - if (isFailed || isChildNodeFailed(temp, iteration + 1)) - return true; - } - } - return false; - } catch (Exception e) { - return false; - } - } + private boolean isChildNodeFailed(FlowNode node, int iteration) { + if (iteration >= 2) { // drill down upto 2 levels + return false; + } + try { + for (FlowNode temp : node.getParents()) { + if (temp instanceof StepEndNode) { + boolean isFailed = temp.getError() != null; + if (isFailed) {//if failed - validate that maybe error converted to warning of unstable + WarningAction warning = temp.getAction(WarningAction.class); + if (warning != null) { + return warning.getResult().isWorseThan(Result.UNSTABLE); + } + return true; + } else if (isChildNodeFailed(temp, iteration + 1)) { + return true; + } + } + } + return false; + } catch (Exception e) { + return false; + } + } } \ No newline at end of file From 77ec40b786487d50f35de283510cadf6e3be6d1b Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 25 Mar 2021 13:28:47 +0200 Subject: [PATCH 1673/2502] defect #1138101 : code climate fixes --- .../tools/octane/events/WorkflowListenerOctaneImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java index 3ac008716a..f1afdff950 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/events/WorkflowListenerOctaneImpl.java @@ -246,9 +246,9 @@ private boolean isChildNodeFailed(FlowNode node, int iteration) { } } } - return false; } catch (Exception e) { - return false; + logger.error("failed in isChildNodeFailed " + e.getMessage()); } + return false; } } \ No newline at end of file From 2327b081925e0ce1131e1a3e9f5fe9d24b996356 Mon Sep 17 00:00:00 2001 From: "CORPDOM\\llu2" Date: Mon, 29 Mar 2021 14:38:34 +0800 Subject: [PATCH 1674/2502] Url change due to angular js upgrade from ALM16 --- .../tools/sse/sdk/ALMRunReportUrlBuilder.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java index aaace55bec..625dcf730e 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java @@ -41,15 +41,23 @@ public class ALMRunReportUrlBuilder { public String build(Client client, String serverUrl, String domain, String project, String runId) { String ret = "NA"; + ALMVersion version = getALMVersion(client); try { - if (isNewReport(client)) { + if (toInt(version.getMajorVersion()) < 12 || toInt(version.getMajorVersion()) == 12 && toInt(version.getMinorVersion()) < 2) { + ret = client.buildWebUIRequest(String.format("lab/index.jsp?processRunId=%s", runId)); + } else if (toInt(version.getMajorVersion()) >= 16) { + // Url change due to angular js upgrade from ALM16 ret = String.format("%sui/?redirected&p=%s/%s&execution-report#!/test-set-report/%s", serverUrl, domain, project, runId); } else { - ret = client.buildWebUIRequest(String.format("lab/index.jsp?processRunId=%s", runId)); + ret = String.format("%sui/?redirected&p=%s/%s&execution-report#/test-set-report/%s", + serverUrl, + domain, + project, + runId); } } catch (Exception e) { // result url will be NA (in case of failure like getting ALM version, convert ALM version to number) @@ -58,15 +66,6 @@ public String build(Client client, String serverUrl, String domain, String proje return ret; } - public boolean isNewReport(Client client) { - - ALMVersion version = getALMVersion(client); - - // Newer than 12.2x, including 12.5x, 15.x and later - return (toInt(version.getMajorVersion()) == 12 && toInt(version.getMinorVersion()) >= 2) - || toInt(version.getMajorVersion()) > 12; - } - private int toInt(String str) { return Integer.parseInt(str); From d25d51a584ed8a7d6cd49292f4f842864a99c902 Mon Sep 17 00:00:00 2001 From: "CORPDOM\\llu2" Date: Mon, 29 Mar 2021 14:48:23 +0800 Subject: [PATCH 1675/2502] no message --- .../automation/tools/sse/sdk/ALMRunReportUrlBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java index 625dcf730e..501f0e82f5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java @@ -43,7 +43,7 @@ public String build(Client client, String serverUrl, String domain, String proje String ret = "NA"; ALMVersion version = getALMVersion(client); try { - if (toInt(version.getMajorVersion()) < 12 || toInt(version.getMajorVersion()) == 12 && toInt(version.getMinorVersion()) < 2) { + if (toInt(version.getMajorVersion()) < 12 || (toInt(version.getMajorVersion()) == 12 && toInt(version.getMinorVersion()) < 2)) { ret = client.buildWebUIRequest(String.format("lab/index.jsp?processRunId=%s", runId)); } else if (toInt(version.getMajorVersion()) >= 16) { // Url change due to angular js upgrade from ALM16 From 585e6fb89fb30a8923026534177c955f90f86399 Mon Sep 17 00:00:00 2001 From: "CORPDOM\\llu2" Date: Tue, 30 Mar 2021 10:21:22 +0800 Subject: [PATCH 1676/2502] Fix junit test --- .../tools/sse/sdk/ALMRunReportUrlBuilder.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java index 501f0e82f5..8ae3211d13 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java @@ -39,13 +39,14 @@ public class ALMRunReportUrlBuilder { public String build(Client client, String serverUrl, String domain, String project, String runId) { - String ret = "NA"; ALMVersion version = getALMVersion(client); + int majorVersion = toInt(version.getMajorVersion()); + int minorVersion = toInt(version.getMinorVersion()); try { - if (toInt(version.getMajorVersion()) < 12 || (toInt(version.getMajorVersion()) == 12 && toInt(version.getMinorVersion()) < 2)) { + if (majorVersion < 12 || (majorVersion == 12 && minorVersion < 2)) { ret = client.buildWebUIRequest(String.format("lab/index.jsp?processRunId=%s", runId)); - } else if (toInt(version.getMajorVersion()) >= 16) { + } else if (majorVersion >= 16) { // Url change due to angular js upgrade from ALM16 ret = String.format("%sui/?redirected&p=%s/%s&execution-report#!/test-set-report/%s", serverUrl, @@ -62,10 +63,16 @@ public String build(Client client, String serverUrl, String domain, String proje } catch (Exception e) { // result url will be NA (in case of failure like getting ALM version, convert ALM version to number) } - return ret; } + public boolean isNewReport(Client client) { + ALMVersion version = getALMVersion(client); + // Newer than 12.2x, including 12.5x, 15.x and later + return (toInt(version.getMajorVersion()) == 12 && toInt(version.getMinorVersion()) >= 2) + || toInt(version.getMajorVersion()) > 12; + } + private int toInt(String str) { return Integer.parseInt(str); From 11ad86819f3c8ca21a36383429e05b86a09eb3d4 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 30 Mar 2021 17:33:47 +0800 Subject: [PATCH 1677/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.7 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a8d07cc84d..b9ce2a359d 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.6.6-beta-SNAPSHOT + 6.7 hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.7 From 80737318080a6fb5554889916227e26a0f212b84 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 30 Mar 2021 17:33:59 +0800 Subject: [PATCH 1678/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b9ce2a359d..56abfdd96c 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.7 + 6.7.1-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.7 + micro-focus-application-automation-tools-plugin-5.5.4-beta From 4245c0b2d08fafa4e0f30272d7e72f2ca0b89ff7 Mon Sep 17 00:00:00 2001 From: "CORPDOM\\llu2" Date: Tue, 30 Mar 2021 17:50:37 +0800 Subject: [PATCH 1679/2502] Fix junit test --- .../automation/tools/sse/sdk/ALMRunReportUrlBuilder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java index 8ae3211d13..4de7337288 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/ALMRunReportUrlBuilder.java @@ -40,10 +40,10 @@ public class ALMRunReportUrlBuilder { public String build(Client client, String serverUrl, String domain, String project, String runId) { String ret = "NA"; - ALMVersion version = getALMVersion(client); - int majorVersion = toInt(version.getMajorVersion()); - int minorVersion = toInt(version.getMinorVersion()); try { + ALMVersion version = getALMVersion(client); + int majorVersion = toInt(version.getMajorVersion()); + int minorVersion = toInt(version.getMinorVersion()); if (majorVersion < 12 || (majorVersion == 12 && minorVersion < 2)) { ret = client.buildWebUIRequest(String.format("lab/index.jsp?processRunId=%s", runId)); } else if (majorVersion >= 16) { From aefee22a4bd3c74601ed4daf615afc0a70a4a31b Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 30 Mar 2021 18:14:40 +0800 Subject: [PATCH 1680/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.7.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a61f5acb11..33e1352370 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.7.1-beta-SNAPSHOT + 6.7.1-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.7.1-beta From 9f7337272ad641ed213cccd93b8bf68491acb698 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 30 Mar 2021 18:14:51 +0800 Subject: [PATCH 1681/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 33e1352370..64dadf9b39 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.7.1-beta + 6.7.2-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.7.1-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 497a143d9a95e9c937501ca329fe0dae22a0d9cd Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Tue, 30 Mar 2021 17:33:03 +0300 Subject: [PATCH 1682/2502] [SECURITY-2132] --- .../automation/tools/octane/actions/PluginActions.java | 5 +++++ .../tools/settings/AlmServerSettingsGlobalConfiguration.java | 4 ++++ .../settings/OctaneServerSettingsGlobalConfiguration.java | 4 ++++ .../tools/settings/SvServerSettingsGlobalConfiguration.java | 4 ++++ .../AlmServerSettingsGlobalConfiguration/config.jelly | 2 +- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java index 7c1864550e..5b1c301d0d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java @@ -35,6 +35,7 @@ import com.microfocus.application.automation.tools.octane.configuration.ConfigurationService; import hudson.Extension; import hudson.model.RootAction; +import jenkins.model.Jenkins; import net.sf.json.JSONObject; import org.apache.http.entity.ContentType; import org.kohsuke.stapler.StaplerRequest; @@ -84,6 +85,7 @@ public String getUrlName() { public void doDynamic(StaplerRequest req, StaplerResponse res) throws IOException { + Jenkins.get().checkPermission(Jenkins.READ); res.setHeader(CONTENT_TYPE, ContentType.TEXT_PLAIN.getMimeType()); res.setStatus(200); if (req.getRequestURI().toLowerCase().contains(STATUS_REQUEST)) { @@ -91,12 +93,15 @@ public void doDynamic(StaplerRequest req, StaplerResponse res) throws IOExceptio res.setHeader(CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType()); res.getWriter().write(result.toString()); } else if (req.getRequestURI().toLowerCase().contains(REENQUEUE_EVENT_REQUEST)) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); reEnqueueEvent(req.getParameterMap()); res.getWriter().write("resent"); } else if (req.getRequestURI().toLowerCase().contains(CLEAR_JOB_LIST_CACHE)) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); resetJobListCache(); res.getWriter().write("done"); } else if (req.getRequestURI().toLowerCase().contains(CLEAR_OCTANE_ROOTS_CACHE)) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); resetOctaneRootsCache(); res.getWriter().write("done"); } else if (req.getRequestURI().toLowerCase().contains(OCTANE_ROOTS_CACHE)) { diff --git a/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java b/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java index c771190872..e29ae2edc4 100644 --- a/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java +++ b/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java @@ -37,12 +37,14 @@ import hudson.XmlFile; import hudson.util.FormValidation; import jenkins.model.GlobalConfiguration; +import jenkins.model.Jenkins; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.Logger; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.IOException; import java.io.Serializable; @@ -125,7 +127,9 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc return super.configure(req, formData); } + @RequirePOST public FormValidation doCheckAlmServerUrl(@QueryParameter String value) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); return checkQcServerURL(value, false); } diff --git a/src/main/java/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration.java b/src/main/java/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration.java index 14a093c13d..b6a0db75ea 100644 --- a/src/main/java/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration.java +++ b/src/main/java/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration.java @@ -48,6 +48,7 @@ import hudson.util.FormValidation; import hudson.util.Secret; import jenkins.model.GlobalConfiguration; +import jenkins.model.Jenkins; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.commons.lang.StringEscapeUtils; @@ -55,6 +56,7 @@ import org.apache.logging.log4j.Logger; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.Serializable; import java.util.*; @@ -347,6 +349,7 @@ private void fireOnChanged(OctaneServerSettingsModel newConf, OctaneServerSettin } } + @RequirePOST @SuppressWarnings("unused") public FormValidation doTestConnection(StaplerRequest req, @QueryParameter("uiLocation") String uiLocation, @@ -357,6 +360,7 @@ public FormValidation doTestConnection(StaplerRequest req, @QueryParameter("workspace2ImpersonatedUserConf") String workspace2ImpersonatedUserConf, @QueryParameter("parameters") String parameters ) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); String myImpersonatedUser = StringUtils.trim(impersonatedUser); String myUsername = StringUtils.trim(username); OctaneUrlParser octaneUrlParser; diff --git a/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java b/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java index 4594e22245..6d6e7d1b7d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java +++ b/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java @@ -38,10 +38,12 @@ import hudson.XmlFile; import hudson.util.FormValidation; import jenkins.model.GlobalConfiguration; +import jenkins.model.Jenkins; import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.Serializable; import java.net.MalformedURLException; @@ -135,10 +137,12 @@ public FormValidation doCheckPassword(@QueryParameter String value, @QueryParame return FormValidation.ok(); } + @RequirePOST @SuppressWarnings("unused") public FormValidation doTestConnection(@QueryParameter("url") final String url, @QueryParameter("username") final String username, @QueryParameter("password") final String password) { try { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); Credentials credentials = (!StringUtils.isBlank(username)) ? new Credentials(username, password) : null; ICommandExecutor commandExecutor = new CommandExecutorFactory().createCommandExecutor(new URL(url), credentials); ServerInfo serverInfo = commandExecutor.getClient().getServerInfo(); diff --git a/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly index 8d7e1efb41..d88351c89a 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration/config.jelly @@ -50,7 +50,7 @@
      - + From 9fbd698401048644c325751e290f6d901128c1c7 Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Tue, 30 Mar 2021 17:33:37 +0300 Subject: [PATCH 1683/2502] [SECURITY-2175] --- .../tools/octane/testrunner/TestsToRunConverterBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index d78473c354..7fb7fae932 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -39,6 +39,7 @@ import hudson.Extension; import hudson.FilePath; import hudson.Launcher; +import hudson.Util; import hudson.model.*; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; @@ -219,7 +220,8 @@ public FormValidation doTestConvert( TestsToRunConverterResult convertResult = TestsToRunConvertersFactory.createConverter(testsToRunFramework) .setFormat(format) .convert(rawTests, TestsToRunConverterBuilder.DEFAULT_EXECUTING_DIRECTORY); - return ConfigurationValidator.wrapWithFormValidation(true, "Conversion is successful :
      " + convertResult.getConvertedTestsString() + "
      "); + String result = Util.escape(convertResult.getConvertedTestsString()); + return ConfigurationValidator.wrapWithFormValidation(true, "Conversion is successful :
      " + result + "
      "); } catch (Exception e) { return ConfigurationValidator.wrapWithFormValidation(false, "Failed to convert : " + e.getMessage()); } From b286378aa22bc48ed77d259200cb6863a532c2df Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Tue, 30 Mar 2021 17:34:09 +0300 Subject: [PATCH 1684/2502] [SECURITY-2176] --- pom.xml | 2 +- .../automation/tools/model/SvServerSettingsModel.java | 8 +++++++- .../settings/SvServerSettingsGlobalConfiguration.java | 6 ++++-- .../tools/sv/runner/AbstractSvRemoteRunner.java | 3 ++- .../automation/tools/sv/runner/AbstractSvRunBuilder.java | 4 ++-- .../SvServerSettingsGlobalConfiguration/config.jelly | 6 +++++- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 64dadf9b39..36c6fe04b5 100644 --- a/pom.xml +++ b/pom.xml @@ -489,7 +489,7 @@ com.microfocus.sv SVConfigurator - 5.3 + 5.4.1 commons-io diff --git a/src/main/java/com/microfocus/application/automation/tools/model/SvServerSettingsModel.java b/src/main/java/com/microfocus/application/automation/tools/model/SvServerSettingsModel.java index 475ae73e6f..03104edbfa 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/SvServerSettingsModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/SvServerSettingsModel.java @@ -41,13 +41,15 @@ public class SvServerSettingsModel implements Serializable{ private final String name; private final String url; + private final boolean trustEveryone; private final String username; private final Secret password; @DataBoundConstructor - public SvServerSettingsModel(String name, String url, String username, Secret password) { + public SvServerSettingsModel(String name, String url, boolean trustEveryone, String username, Secret password) { this.name = StringUtils.trim(name); this.url = StringUtils.trim(url); + this.trustEveryone = trustEveryone; this.username = username; this.password = password; } @@ -64,6 +66,10 @@ public URL getUrlObject() throws MalformedURLException { return new URL(url); } + public boolean isTrustEveryone() { + return trustEveryone; + } + public String getUsername() { return username; } diff --git a/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java b/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java index 6d6e7d1b7d..0ae8fda3c6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java +++ b/src/main/java/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration.java @@ -139,12 +139,14 @@ public FormValidation doCheckPassword(@QueryParameter String value, @QueryParame @RequirePOST @SuppressWarnings("unused") - public FormValidation doTestConnection(@QueryParameter("url") final String url, @QueryParameter("username") final String username, + public FormValidation doTestConnection(@QueryParameter("url") final String url, + @QueryParameter("trustEveryone") final boolean trustEveryone, + @QueryParameter("username") final String username, @QueryParameter("password") final String password) { try { Jenkins.get().checkPermission(Jenkins.ADMINISTER); Credentials credentials = (!StringUtils.isBlank(username)) ? new Credentials(username, password) : null; - ICommandExecutor commandExecutor = new CommandExecutorFactory().createCommandExecutor(new URL(url), credentials); + ICommandExecutor commandExecutor = new CommandExecutorFactory().createCommandExecutor(new URL(url), trustEveryone, credentials); ServerInfo serverInfo = commandExecutor.getClient().getServerInfo(); return FormValidation.ok("Validation passed. Connected to %s server of version: %s", serverInfo.getServerType(), serverInfo.getProductVersion()); } catch (Exception e) { diff --git a/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRemoteRunner.java b/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRemoteRunner.java index 41241e9983..02fab8ec34 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRemoteRunner.java +++ b/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRemoteRunner.java @@ -115,6 +115,7 @@ private void addServiceIfDeployed(String service, ArrayList results } protected ICommandExecutor createCommandExecutor() throws Exception { - return new CommandExecutorFactory().createCommandExecutor(server.getUrlObject(), server.getCredentials()); + return new CommandExecutorFactory() + .createCommandExecutor(server.getUrlObject(), server.isTrustEveryone(), server.getCredentials()); } } diff --git a/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRunBuilder.java b/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRunBuilder.java index b8c89cf12b..31db97d9f2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRunBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/sv/runner/AbstractSvRunBuilder.java @@ -91,8 +91,8 @@ public void perform(@Nonnull Run run, @Nonnull FilePath workspace, @Nonnul try { SvServerSettingsModel serverModel = getSelectedServerSettings(); - logger.printf("%nStarting %s for SV Server '%s' (%s as %s) on %s%n", getDescriptor().getDisplayName(), - serverModel.getName(), serverModel.getUrlObject(), serverModel.getUsername(), startDate); + logger.printf("%nStarting %s for SV Server '%s' (%s as %s, ignoreSslErrors=%s) on %s%n", getDescriptor().getDisplayName(), + serverModel.getName(), serverModel.getUrlObject(), serverModel.getUsername(), serverModel.isTrustEveryone(), startDate); logConfig(logger, " "); validateServiceSelection(); diff --git a/src/main/resources/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration/config.jelly index ddbcc21b8e..381e6df6bd 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/settings/SvServerSettingsGlobalConfiguration/config.jelly @@ -54,6 +54,10 @@
      + + + + @@ -64,7 +68,7 @@ + method="testConnection" with="url,trustEveryone,username,password"/>
      From ffee15a3a7b7d4dd549e5ad8e182d134116790d5 Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Wed, 31 Mar 2021 11:43:39 +0300 Subject: [PATCH 1685/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.8 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 36c6fe04b5..ea36cc535c 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.7.2-beta-SNAPSHOT + 6.8 hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.8 From 2d68b96f1741c5f93259f178663e81dc888d1df7 Mon Sep 17 00:00:00 2001 From: Paul-Adrian-Tofan Date: Wed, 31 Mar 2021 11:43:41 +0300 Subject: [PATCH 1686/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ea36cc535c..bc44e24c4c 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.8 + 6.8.1-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.8 + micro-focus-application-automation-tools-plugin-5.5.4-beta From ae1a8f93764103a2650d8a5d0a03769d4bd9e676 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Sun, 4 Apr 2021 18:30:36 +0300 Subject: [PATCH 1687/2502] Update README.md --- doc/README.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/README.md b/doc/README.md index a0c1d5337e..335427d518 100644 --- a/doc/README.md +++ b/doc/README.md @@ -26,10 +26,8 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j [User Guide](#user-guide) -- [Rebranding Script](#rebranding-script) - [Create an execution node](#create-an-execution-node) - [Connect an execution node to the Jenkins server](#connect-an-execution-node-to-the-jenkins-server) - - [Support for pipelines](#support-for-pipelines) [Enable non-English languages](#enable-non-english-languages) @@ -51,14 +49,31 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j Starting with version 1.641 (or 1.625.3), Jenkins introduced the **Content-Security-Policy** header. This causes some of the integration links, such as links to reports, to become inoperable. For details, see [Configuring Content Security Policy](https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy) and [Jenkins Security Advisory ](https://jenkins.io/security/advisory/2015-12-09/). For suggested workarounds until the issue is resolved, see [Content Security Policy Header](#content-security-policy-header). -## New Features and Enhancements in version 6.6 +## New Features and Enhancements in version 6.7 -Version 6.6 introduced the following enhancements: +Version 6.7 introduced the following enhancements: **General** -- Compliance with the new Jenkins version 2.264 form layout -- Certified for Jenkins version 2.264.1 +- Added support for the FOD plugin version 6.1.0. +- SonarQube integration: A new option was added to the Sonar pre-build step to skip automatic webhook configuration. (This allows you to run the integration without admin permissions) + - Added XSRF protection for running with Lab, Upload result, and Common result upload for compatibility with new versions of ALM. + +**ALM Octane – UFT Integration** + +- Reduce the length of the folder name for checkout of auto-generated execution jobs. +- Ability to execute UFT tests that are not located in job workspace. To show the test name correctly in ALM Octane, define the "UFT_CHECKOUT_FOLDER" parameter. +- For the Spanish Windows slave: The duration of a UFT test in Jenkins is shown in years instead of seconds. + +**ALM Octane** + +- Added the option to inject pull requests to ALM Octane with repository in SSH format. +- Auto-fill: After injection of pull-requests, templates related to SCM repositories are auto-filled in ALM Octane (Settings > Spaces-> DevOps > SCM Repositories). + +**LRE (LoadRunner Enterprise)** + +- The build step “Execute performance test using LoadRunner Enterprise†can authenticate to LoadRunner Enterprise using an access key (available from LoadRunner Enterprise 2021 R1). + For information about enhancements introduced in previous versions, see [What's new in earlier versions](WhatsNewEarlier.md). @@ -91,7 +106,7 @@ This plugin supports the following Micro Focus product versions: | ALM Octane | 12.53.20 and higher (12.55.4 or later required for direct UFT One integration and for LoadRunner Enterprise integration using pipelines) | [ALM Octane Help](https://admhelp.microfocus.com/octane/en/latest/Online/Content/AdminGuide/jenkins-integration.htm) | | LoadRunner Professional | 12.xx, 2020 and higher | [LoadRunner Professional Integration page](LR_Integration.md) | | UFT Mobile (formerly Mobile Center) | 2.0 and higher | [UFT Mobile Integration page](UFT_Mobile_Integration.md) | -| LoadRunner Enterprise (formerly Performance Center) | 12.xx (12.53 or higher required for trend reports), 2020 | [LoadRunner Enterprise Help Center](https://admhelp.microfocus.com/pc/en/latest/online_help/Content/PC/Continuous-Integration-Jenkins.htm) | +| LoadRunner Enterprise (formerly Performance Center) | 12.xx (12.53 or higher required for trend reports), 2020 and higher | [LoadRunner Enterprise Help Center](https://admhelp.microfocus.com/pc/en/latest/online_help/Content/PC/Continuous-Integration-Jenkins.htm) | | Service Virtualization | 3.80 and higher | [Service Virtualization Help Center](https://admhelp.microfocus.com/sv/en/latest/Help/Content/UG/c_continuous_integration.htm) | | UFT One (formerly UFT) | 12.xx and 14.03 and higher | [UFT One Help Center](https://admhelp.microfocus.com/uft/en/latest/UFT_Help/Content/User_Guide/Jenkins.htm) | | UFT Developer (formerly LeanFT) | 14.03 and higher | [UFT Developer Help Center](https://admhelp.microfocus.com/leanft/en/latest/HelpCenter/Content/HowTo/CI_Tools.htm)
      Blog: [Integrating LeanFT with Jenkins in just a few simple steps](https://community.softwaregrp.com/t5/Quality-and-Testing-Blog/Integrating-LeanFT-with-Jenkins-in-just-a-few-simple-steps/ba-p/247321#.WpzwYOhubcte%20steps) | @@ -126,24 +141,9 @@ This plugin supports the following Micro Focus product versions: You can run client side-or server-side (Default or Functional) test sets and build verification suites from Application Lifecycle Management (ALM) or functional tests from the file system. You can create and configure ALM Octane pipelines from the ALM Octane user interface, or on Jenkins. -## Rebranding script - -Due to rebranding in this version of the plugin to the "Micro Focus" name, certain job history and configurations from previous jobs may be not be recognized by Jenkins. Before you use this version of the plugin, back up all projects and jobs, and all job configurations related to the plugin that are included in the General Jenkins configuration. Run the following job to convert your earlier configurations: - -- Create a new **Free-Style** project. - -- Click **Add build step** and select **Fix old Micro Focus Jenkins builds**. - -- Run the job. - -- Restart the server after the build status is successful. You can restart the server by entering the following URL: **Jenkins\_URL/safeRestart** - - ## Create an execution node - - 1. Creating an execution node is only required when running scenarios from LoadRunner Professional or UFT One, that are stored on the file system. You only need to set an execution node if the Jenkins master machine is **not** the executing machine. If you are running LoadRunner Professional or UFT One on the master machine, you do not need to set and select a node. 2. Go to the Jenkins Server home page. From f79ef7e7fade67cac4de76c245983454a002bd05 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Sun, 4 Apr 2021 18:34:25 +0300 Subject: [PATCH 1688/2502] Update WhatsNewEarlier.md --- doc/WhatsNewEarlier.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/WhatsNewEarlier.md b/doc/WhatsNewEarlier.md index 56386a72b5..f8f9341c49 100644 --- a/doc/WhatsNewEarlier.md +++ b/doc/WhatsNewEarlier.md @@ -5,6 +5,8 @@ This page shows a history of the enhancements made to the Micro Focus Applicatio See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for information about beta versions and recent patches. +[What's New in version 6.6](#what's-new-in-version-6.6) + [What's New in version 6.5](#what's-new-in-version-6.5) [What's New in version 6.4](#what's-new-in-version-6.4) @@ -15,6 +17,15 @@ See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for infor [What's New in version 5.9](#what's-new-in-version-5.9) +## What's New in version 6.6 + +Version 6.6 introduced the following enhancements: + +**General** + +- Compliance with the new Jenkins version 2.264 form layout +- Certified for Jenkins version 2.264.1 + ## What's New in version 6.5 Version 6.5 introduced the following enhancements: From a7e4c04006bb2dbe4d158722231333fde478c70c Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 5 Apr 2021 17:10:43 +0300 Subject: [PATCH 1689/2502] defect #1193364 : SCM repository templates are not being set when you inject pull requests from Bitbucket, + activate branch publisher. --- pom.xml | 2 +- .../automation/tools/octane/branches/BranchesPublisher.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 64dadf9b39..880ec1bffa 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.7.15 + 2.6.9.1 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java index c9ab75cff9..0f12126198 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java @@ -294,7 +294,7 @@ public ListBoxModel doFillScmToolItems() { } public boolean isApplicable(Class aClass) { - return false; + return true; } public ListBoxModel doFillConfigurationIdItems() { From 63be7f7380a3affc3b6171e7f69866f3f4392947 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 8 Apr 2021 12:10:01 +0300 Subject: [PATCH 1690/2502] tech : fail to inject test results for UFT job without parameters at all --- .../automation/tools/octane/tests/junit/JUnitExtension.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java index 4e3370f142..c378c09959 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java @@ -170,7 +170,7 @@ public GetJUnitTestResults(Run build, List reports, boolean stri this.sharedCheckOutDirectory = CheckOutSubDirEnvContributor.getSharedCheckOutDirectory(build.getParent()); if (sharedCheckOutDirectory == null && HPRunnerType.UFT.equals(hpRunnerType)) { ParametersAction parameterAction = build.getAction(ParametersAction.class); - ParameterValue pv = parameterAction.getParameter(UftConstants.UFT_CHECKOUT_FOLDER); + ParameterValue pv = parameterAction != null ? parameterAction.getParameter(UftConstants.UFT_CHECKOUT_FOLDER) : null; sharedCheckOutDirectory = pv != null && pv instanceof StringParameterValue ? StringUtils.strip((String) pv.getValue(), "\\/") : ""; } From 22ff4f54a8342759253f58e83763254b1543f308 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sat, 10 Apr 2021 20:13:54 +0300 Subject: [PATCH 1691/2502] defect #1199229 : [CI SDK] Replace JAXB usage by Jackson XML (jaxb is missing in openJAVA11) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 32c78bfa57..c175e5cf38 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.1 + 2.6.9.2 @@ -666,14 +666,14 @@ javax.activation activation - 1.1 + 1.1.1 org.glassfish.jaxb jaxb-runtime - 3.0.0-M3 + 3.0.0 From e12f8bad6dea48ac1c6d8f73004a13f2d48101b3 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 12 Apr 2021 18:30:31 +0300 Subject: [PATCH 1692/2502] us #1204058 : [Jenkins] Use Gherkin login from CI SDK in Jenkins --- pom.xml | 2 +- .../octane/tests/TestResultContainer.java | 2 +- .../tests/gherkin/GherkinTestExtension.java | 25 +- .../tests/gherkin/GherkinTestResult.java | 96 ------- .../gherkin/GherkinTestResultsCollector.java | 246 ------------------ .../octane/tests/junit/JUnitTestResult.java | 2 +- .../octane/tests/testResult/TestResult.java | 40 --- .../octane/tests/xml/TestResultXmlWriter.java | 2 +- .../tests/xml/TestResultXmlWriterTest.java | 2 +- 9 files changed, 26 insertions(+), 391 deletions(-) delete mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java delete mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java delete mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/tests/testResult/TestResult.java diff --git a/pom.xml b/pom.xml index c175e5cf38..45bf3f870f 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.2 + 2.6.9.4 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java index 3a20ef4291..9ed50d80bf 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java @@ -28,8 +28,8 @@ package com.microfocus.application.automation.tools.octane.tests; +import com.hp.octane.integrations.testresults.TestResult; import com.microfocus.application.automation.tools.octane.tests.detection.ResultFields; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; import java.util.Iterator; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java index bfea7ca4b8..fd36d05d67 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java @@ -28,17 +28,21 @@ package com.microfocus.application.automation.tools.octane.tests.gherkin; +import com.hp.octane.integrations.testresults.GherkinUtils; +import com.hp.octane.integrations.testresults.TestResult; +import com.microfocus.application.automation.tools.octane.actions.cucumber.CucumberResultsService; import com.microfocus.application.automation.tools.octane.actions.cucumber.CucumberTestResultsAction; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; import com.microfocus.application.automation.tools.octane.tests.OctaneTestsExtension; import com.microfocus.application.automation.tools.octane.tests.TestProcessingException; import com.microfocus.application.automation.tools.octane.tests.TestResultContainer; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; import hudson.Extension; import hudson.model.Run; import org.apache.logging.log4j.Logger; +import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.List; @Extension @@ -60,14 +64,27 @@ public boolean supports(Run build) { public TestResultContainer getTestResults(Run build, String jenkinsRootUrl) throws TestProcessingException, IOException, InterruptedException { try { - List testResults = GherkinTestResultsCollector.collectGherkinTestsResults(build.getRootDir()); + List gherkinFiles = findGherkinFiles(build.getRootDir()); + List testResults = GherkinUtils.parseFiles(gherkinFiles); return new TestResultContainer(testResults.iterator(), null); } catch (IOException e) { throw e; - } catch (InterruptedException e) { - throw e; } catch (Exception e) { throw new TestProcessingException("Error while processing gherkin test results", e); } } + + private List findGherkinFiles(File buildDir){ + List result = new ArrayList<>(); + int i = 0; + File gherkinTestResultsFile = new File(buildDir, CucumberResultsService.getGherkinResultFileName(i)); + + while (gherkinTestResultsFile.exists()) { + result.add(gherkinTestResultsFile); + i++; + gherkinTestResultsFile = new File(buildDir, CucumberResultsService.getGherkinResultFileName(i)); + } + + return result; + } } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java deleted file mode 100644 index e5f2e4c608..0000000000 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResult.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Certain versions of software and/or documents ("Material") accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ___________________________________________________________________ - */ - -package com.microfocus.application.automation.tools.octane.tests.gherkin; - -import com.microfocus.application.automation.tools.octane.tests.junit.TestResultStatus; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by franksha on 20/03/2016. - */ -public class GherkinTestResult implements TestResult { - private Map attributes; - private Element contentElement; - - public GherkinTestResult(String name, Element xmlElement, long duration, TestResultStatus status) { - this.attributes = new HashMap<>(); - this.attributes.put("name", name); - this.attributes.put("duration", String.valueOf(duration)); - this.attributes.put("status", status.toPrettyName()); - this.contentElement = xmlElement; - } - - public Map getAttributes() { - return attributes; - } - - public Element getXmlElement() { - return contentElement; - } - - @Override - public void writeXmlElement(XMLStreamWriter writer) throws XMLStreamException { - writer.writeStartElement("gherkin_test_run"); - if (attributes != null) { - for (String attrName : attributes.keySet()) { - writer.writeAttribute(attrName, attributes.get(attrName)); - } - } - writeXmlElement(writer, contentElement); - writer.writeEndElement(); - } - - private void writeXmlElement(XMLStreamWriter writer, Element rootElement) throws XMLStreamException { - if (rootElement != null) { - writer.writeStartElement(rootElement.getTagName()); - for (int a = 0; a < rootElement.getAttributes().getLength(); a++) { - String attrName = rootElement.getAttributes().item(a).getNodeName(); - writer.writeAttribute(attrName, rootElement.getAttribute(attrName)); - } - NodeList childNodes = rootElement.getChildNodes(); - for (int c = 0; c < childNodes.getLength(); c++) { - Node child = childNodes.item(c); - if (child instanceof Element) { - writeXmlElement(writer, (Element) child); - } else if (child.getNodeType() == Node.CDATA_SECTION_NODE) { - writer.writeCharacters(child.getNodeValue()); - } - } - writer.writeEndElement(); - } - } -} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java deleted file mode 100644 index db95792e82..0000000000 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollector.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Certain versions of software and/or documents ("Material") accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ___________________________________________________________________ - */ - -package com.microfocus.application.automation.tools.octane.tests.gherkin; - -import com.microfocus.application.automation.tools.octane.actions.cucumber.CucumberResultsService; -import com.microfocus.application.automation.tools.octane.tests.junit.TestResultStatus; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by franksha on 20/03/2016. - */ -public class GherkinTestResultsCollector { - - public static List collectGherkinTestsResults(File buildDir) throws ParserConfigurationException, IOException, InterruptedException, SAXException, TransformerException { - List result = new ArrayList<>(); - - //Retrieve the cucumber results xml - int i = 0; - File gherkinTestResultsFile = new File(buildDir, CucumberResultsService.getGherkinResultFileName(i)); - - while (gherkinTestResultsFile.exists()) { - String gherkinTestResultsPath = buildDir.getAbsolutePath() + File.separator + CucumberResultsService.getGherkinResultFileName(i); - - //parse the xml - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(gherkinTestResultsPath); - doc.getDocumentElement().normalize(); - - validateXMLVersion(doc); - - //Go over the features - NodeList featureNodes = doc.getElementsByTagName("feature"); - for (int f = 0; f < featureNodes.getLength(); f++) { - Element featureElement = (Element) featureNodes.item(f); - FeatureInfo featureInfo = new FeatureInfo(featureElement); - result.add(new GherkinTestResult(featureInfo.getName(), featureElement, featureInfo.getDuration(), featureInfo.getStatus())); - } - - i++; - gherkinTestResultsFile = new File(buildDir, CucumberResultsService.getGherkinResultFileName(i)); - } //end while - - return result; - } - - private static class FeatureInfo { - private String name; - private List scenarioNames = new ArrayList<>(); - private TestResultStatus status = TestResultStatus.PASSED; - private boolean statusDetermined = false; - private long duration = 0; - - public FeatureInfo(Element featureElement) { - name = featureElement.getAttribute("name"); - NodeList backgroundNodes = featureElement.getElementsByTagName("background"); - Element backgroundElement = backgroundNodes.getLength() > 0 ? (Element)backgroundNodes.item(0) : null; - NodeList backgroundSteps = backgroundElement != null ? backgroundElement.getElementsByTagName("step") : null; - - //Go over the scenarios - NodeList scenarioNodes = featureElement.getElementsByTagName("scenario"); - for (int s = 0; s < scenarioNodes.getLength(); s++) { - Element scenarioElement = (Element) scenarioNodes.item(s); - ScenarioInfo scenarioInfo = new ScenarioInfo(scenarioElement, backgroundSteps); - String scenarioName = scenarioInfo.getName(); - scenarioNames.add(scenarioName); - - duration += scenarioInfo.getDuration(); - if (!statusDetermined && TestResultStatus.SKIPPED.equals(scenarioInfo.getStatus())) { - status = TestResultStatus.SKIPPED; - statusDetermined = true; - } else if (!statusDetermined && TestResultStatus.FAILED.equals(scenarioInfo.getStatus())) { - status = TestResultStatus.FAILED; - statusDetermined = true; - } - } - } - - public String getName() { - return name; - } - - public List getScenarioNames() { - return scenarioNames; - } - - public TestResultStatus getStatus() { - return status; - } - - public long getDuration() { - return duration; - } - - private class ScenarioInfo { - private List stepNames = new ArrayList<>(); - private long duration = 0; - private TestResultStatus status = TestResultStatus.PASSED; - private boolean statusDetermined = false; - private String name; - - public ScenarioInfo(Element scenarioElement, NodeList backgroundSteps) { - name = getScenarioName(scenarioElement); - - List stepElements = getStepElements(backgroundSteps, scenarioElement); - for (Element stepElement : stepElements) { - addStep(stepElement); - } - - scenarioElement.setAttribute("status", status.toPrettyName()); - - //for surefire report - stepNames.add(name); - stepNames.add("Scenario: " + name); - } - - public List getStepNames() { - return stepNames; - } - - public long getDuration() { - return duration; - } - - public TestResultStatus getStatus() { - return status; - } - - public String getName() { - return name; - } - - private void addStep(Element stepElement) { - String stepName = stepElement.getAttribute("name"); - stepNames.add(stepName); - - String durationStr = stepElement.getAttribute("duration"); - long stepDuration = durationStr != "" ? Long.parseLong(durationStr) : 0; - duration += stepDuration; - - String stepStatus = stepElement.getAttribute("status"); - if (!statusDetermined && ("pending".equals(stepStatus) || "skipped".equals(stepStatus))) { - status = TestResultStatus.SKIPPED; - statusDetermined = true; - } else if (!statusDetermined && "failed".equals(stepStatus)) { - status = TestResultStatus.FAILED; - statusDetermined = true; - } - } - - private List getStepElements(NodeList backgroundSteps, Element scenarioElement) { - List stepElements = new ArrayList<>(); - if(backgroundSteps != null) { - for (int bs = 0; bs < backgroundSteps.getLength(); bs++) { - Element stepElement = (Element) backgroundSteps.item(bs); - stepElements.add(stepElement); - } - } - NodeList stepNodes = scenarioElement.getElementsByTagName("step"); - for (int sn = 0; sn < stepNodes.getLength(); sn++) { - Element stepElement = (Element) stepNodes.item(sn); - stepElements.add(stepElement); - } - - return stepElements; - } - - private String getScenarioName(Element scenarioElement) { - String scenarioName = scenarioElement.getAttribute("name"); - if (scenarioElement.hasAttribute("outlineIndex")) { - String outlineIndexStr = scenarioElement.getAttribute("outlineIndex"); - if (outlineIndexStr != null && !outlineIndexStr.isEmpty()) { - Integer outlineIndex = Integer.valueOf(scenarioElement.getAttribute("outlineIndex")); - if (outlineIndex > 1) { - //we add the index only from 2 and upwards seeing as that is the naming convention in junit xml. - String delimiter = " "; - if (!scenarioName.contains(" ")) { - //we need to use the same logic as used in the junit report - delimiter = "_"; - } - scenarioName = scenarioName + delimiter + scenarioElement.getAttribute("outlineIndex"); - } - } - - } - return scenarioName; - } - } - } - - private static void validateXMLVersion(Document doc) { - String XML_VERSION = "1"; - NodeList featuresNodes = doc.getElementsByTagName("features"); - if(featuresNodes.getLength() > 0) { - String versionAttr = ((Element) featuresNodes.item(0)).getAttribute("version"); - if (versionAttr == null || versionAttr.isEmpty() || versionAttr.compareTo(XML_VERSION) != 0) { - throw new IllegalArgumentException("\n********************************************************\n" + - "Incompatible xml version received from the Octane formatter.\n" + - "expected version = " + XML_VERSION + " actual version = " + versionAttr + ".\n" + - "You may need to update the octane formatter version to the correct version in order to work with this jenkins plugin\n" + - "********************************************************"); - } - } else { - throw new IllegalArgumentException("The file does not contain Octane Gherkin results. Configuration error?"); - } - } -} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java index e4346f302b..666c0eb428 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java @@ -29,7 +29,7 @@ package com.microfocus.application.automation.tools.octane.tests.junit; import com.hp.octane.integrations.utils.SdkStringUtils; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; +import com.hp.octane.integrations.testresults.TestResult; import org.apache.commons.lang.StringUtils; import javax.xml.stream.XMLStreamException; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/testResult/TestResult.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/testResult/TestResult.java deleted file mode 100644 index 8d4299caab..0000000000 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/testResult/TestResult.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Certain versions of software and/or documents ("Material") accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ___________________________________________________________________ - */ - -package com.microfocus.application.automation.tools.octane.tests.testResult; - -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -public interface TestResult { - - /** - * Writes an XML element from the test result - */ - void writeXmlElement(XMLStreamWriter writer) throws XMLStreamException; -} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java index 6d507c9fea..094743d430 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java @@ -28,11 +28,11 @@ package com.microfocus.application.automation.tools.octane.tests.xml; +import com.hp.octane.integrations.testresults.TestResult; import com.microfocus.application.automation.tools.octane.tests.TestResultContainer; import com.microfocus.application.automation.tools.octane.tests.build.BuildDescriptor; import com.microfocus.application.automation.tools.octane.tests.build.BuildHandlerUtils; import com.microfocus.application.automation.tools.octane.tests.detection.ResultFields; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; import hudson.FilePath; import hudson.model.Run; import org.apache.commons.io.IOUtils; diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java index 4001bb8fce..3b0b847d46 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java @@ -28,6 +28,7 @@ package com.microfocus.application.automation.tools.octane.tests.xml; +import com.hp.octane.integrations.utils.TestResult; import com.microfocus.application.automation.tools.model.OctaneServerSettingsModel; import com.microfocus.application.automation.tools.octane.OctaneServerMock; import com.microfocus.application.automation.tools.octane.OctanePluginTestBase; @@ -39,7 +40,6 @@ import com.microfocus.application.automation.tools.octane.tests.detection.ResultFields; import com.microfocus.application.automation.tools.octane.tests.junit.JUnitTestResult; import com.microfocus.application.automation.tools.octane.tests.junit.TestResultStatus; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; import hudson.FilePath; import hudson.matrix.Axis; import hudson.matrix.AxisList; From c1443c073ed133f520b6a9525ee39debdf6732ee Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 12 Apr 2021 21:58:41 +0300 Subject: [PATCH 1693/2502] us #1204058 : [Jenkins] Use Gherkin login from CI SDK in Jenkins --- pom.xml | 2 +- .../octane/tests/TestResultContainer.java | 8 +- .../tests/gherkin/GherkinTestExtension.java | 4 +- .../octane/tests/junit/JUnitTestResult.java | 4 +- .../octane/tests/xml/TestResultXmlWriter.java | 6 +- .../GherkinTestResultsCollectorTest.java | 100 ------------------ .../tests/xml/TestResultXmlWriterTest.java | 4 +- .../gherkin/f1/OctaneGherkinResults0.xml | 50 --------- .../gherkin/f1/OctaneGherkinResults1.xml | 40 ------- .../gherkin/f2/OctaneGherkinResults0.xml | 40 ------- .../gherkin/f2/OctaneGherkinResults1.xml | 40 ------- .../gherkin/f3/OctaneGherkinResults0.xml | 40 ------- .../gherkin/f3/OctaneGherkinResults1.xml | 40 ------- 13 files changed, 14 insertions(+), 364 deletions(-) delete mode 100644 src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollectorTest.java delete mode 100644 src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults0.xml delete mode 100644 src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults1.xml delete mode 100644 src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults0.xml delete mode 100644 src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults1.xml delete mode 100644 src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults0.xml delete mode 100644 src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults1.xml diff --git a/pom.xml b/pom.xml index 45bf3f870f..d61d51b4f1 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.4 + 2.6.9.7 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java index 9ed50d80bf..6ccd326e46 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/TestResultContainer.java @@ -28,22 +28,22 @@ package com.microfocus.application.automation.tools.octane.tests; -import com.hp.octane.integrations.testresults.TestResult; +import com.hp.octane.integrations.testresults.XmlWritableTestResult; import com.microfocus.application.automation.tools.octane.tests.detection.ResultFields; import java.util.Iterator; public class TestResultContainer { - private Iterator iterator; + private Iterator iterator; private ResultFields resultFields; - public TestResultContainer(Iterator iterator, ResultFields resultFields) { + public TestResultContainer(Iterator iterator, ResultFields resultFields) { this.iterator = iterator; this.resultFields = resultFields; } - public Iterator getIterator() { + public Iterator getIterator() { return iterator; } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java index fd36d05d67..0ad71a794d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java @@ -29,7 +29,7 @@ package com.microfocus.application.automation.tools.octane.tests.gherkin; import com.hp.octane.integrations.testresults.GherkinUtils; -import com.hp.octane.integrations.testresults.TestResult; +import com.hp.octane.integrations.testresults.XmlWritableTestResult; import com.microfocus.application.automation.tools.octane.actions.cucumber.CucumberResultsService; import com.microfocus.application.automation.tools.octane.actions.cucumber.CucumberTestResultsAction; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; @@ -65,7 +65,7 @@ public TestResultContainer getTestResults(Run build, String jenkinsRootUrl TestProcessingException, IOException, InterruptedException { try { List gherkinFiles = findGherkinFiles(build.getRootDir()); - List testResults = GherkinUtils.parseFiles(gherkinFiles); + List testResults = GherkinUtils.parseFiles(gherkinFiles); return new TestResultContainer(testResults.iterator(), null); } catch (IOException e) { throw e; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java index 666c0eb428..dc18bf7a6a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java @@ -28,8 +28,8 @@ package com.microfocus.application.automation.tools.octane.tests.junit; +import com.hp.octane.integrations.testresults.XmlWritableTestResult; import com.hp.octane.integrations.utils.SdkStringUtils; -import com.hp.octane.integrations.testresults.TestResult; import org.apache.commons.lang.StringUtils; import javax.xml.stream.XMLStreamException; @@ -39,7 +39,7 @@ /** * Test Run XML writer to mqmTests.xml */ -final public class JUnitTestResult implements Serializable, TestResult { +final public class JUnitTestResult implements Serializable, XmlWritableTestResult { private final static int DEFAULT_STRING_SIZE = 255; private final String moduleName; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java index 094743d430..3946ac28d9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriter.java @@ -28,7 +28,7 @@ package com.microfocus.application.automation.tools.octane.tests.xml; -import com.hp.octane.integrations.testresults.TestResult; +import com.hp.octane.integrations.testresults.XmlWritableTestResult; import com.microfocus.application.automation.tools.octane.tests.TestResultContainer; import com.microfocus.application.automation.tools.octane.tests.build.BuildDescriptor; import com.microfocus.application.automation.tools.octane.tests.build.BuildHandlerUtils; @@ -72,9 +72,9 @@ public void writeResults(TestResultContainer testResultContainer) throws Interru ResultFields resultFields = testResultContainer.getResultFields(); initialize(resultFields); - Iterator testResults = testResultContainer.getIterator(); + Iterator testResults = testResultContainer.getIterator(); while (testResults.hasNext()) { - TestResult testResult = testResults.next(); + XmlWritableTestResult testResult = testResults.next(); testResult.writeXmlElement(writer); } } diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollectorTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollectorTest.java deleted file mode 100644 index bdb22a42ca..0000000000 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestResultsCollectorTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Certain versions of software and/or documents ("Material") accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ___________________________________________________________________ - */ - -package com.microfocus.application.automation.tools.octane.tests.gherkin; - -import com.microfocus.application.automation.tools.octane.tests.junit.TestResultStatus; -import com.microfocus.application.automation.tools.octane.tests.testResult.TestResult; -import org.junit.Assert; -import org.junit.Test; -import org.xml.sax.SAXException; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.List; -import java.util.Map; - -public class GherkinTestResultsCollectorTest { - String defaultResourceRelativePath = "f1"; - String defaultResourceName = "OctaneGherkinResults0.xml"; - - private String getDefaultRootResourceFolder(){ - return getRootResourceFolder(defaultResourceRelativePath,defaultResourceName); - } - - private String getRootResourceFolder(String resourceRelativePath,String resourceName){ - String resource; - if(resourceRelativePath.isEmpty()){ - resource = resourceName; - } else { - resource = resourceRelativePath + "/" + resourceName; - } - URL url = getClass().getResource(resource); - String path = url.getPath(); - return path.substring(0,path.lastIndexOf(resourceName)-1); - } - - @Test - public void testConstruct() throws InterruptedException, ParserConfigurationException, IOException, SAXException, TransformerException { - GherkinTestResultsCollector.collectGherkinTestsResults(new File(getDefaultRootResourceFolder())); - } - - @Test - public void testGetResults() throws InterruptedException, ParserConfigurationException, IOException, SAXException, TransformerException { - List gherkinTestsResults = GherkinTestResultsCollector.collectGherkinTestsResults(new File(getDefaultRootResourceFolder())); - Assert.assertEquals(3,gherkinTestsResults.size()); - validateGherkinTestResult((GherkinTestResult)gherkinTestsResults.get(0),"test Feature1",21, TestResultStatus.FAILED); - validateGherkinTestResult((GherkinTestResult)gherkinTestsResults.get(1),"test Feature10",21,TestResultStatus.FAILED); - validateGherkinTestResult((GherkinTestResult)gherkinTestsResults.get(2),"test Feature2",21,TestResultStatus.PASSED); - } - - @Test (expected=IllegalArgumentException.class) - public void testXmlHasNoVersion() throws InterruptedException, ParserConfigurationException, IOException, SAXException, TransformerException { - GherkinTestResultsCollector.collectGherkinTestsResults(new File(getRootResourceFolder("f2",defaultResourceName))); - } - - @Test (expected=IllegalArgumentException.class) - public void testXmlHasHigherVersion() throws InterruptedException, ParserConfigurationException, IOException, SAXException, TransformerException { - GherkinTestResultsCollector.collectGherkinTestsResults(new File(getRootResourceFolder("f3",defaultResourceName))); - } - - private void validateGherkinTestResult(GherkinTestResult gherkinTestResult, String name, long duration, TestResultStatus status){ - validateAttributes(gherkinTestResult, name, duration, status); - Assert.assertNotNull(gherkinTestResult.getXmlElement()); - } - - private void validateAttributes(GherkinTestResult gherkinTestResult, String name, long duration, TestResultStatus status){ - Map attributes = gherkinTestResult.getAttributes(); - Assert.assertEquals(name,attributes.get("name")); - Assert.assertEquals(String.valueOf(duration),attributes.get("duration")); - Assert.assertEquals(status.toPrettyName(),attributes.get("status")); - } -} diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java index 3b0b847d46..0a634a2987 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java @@ -28,7 +28,7 @@ package com.microfocus.application.automation.tools.octane.tests.xml; -import com.hp.octane.integrations.utils.TestResult; +import com.hp.octane.integrations.testresults.XmlWritableTestResult; import com.microfocus.application.automation.tools.model.OctaneServerSettingsModel; import com.microfocus.application.automation.tools.octane.OctaneServerMock; import com.microfocus.application.automation.tools.octane.OctanePluginTestBase; @@ -68,7 +68,7 @@ public class TestResultXmlWriterTest extends OctanePluginTestBase { @BeforeClass public static void initialize() { - List testResults = new ArrayList<>(); + List testResults = new ArrayList<>(); testResults.add(new JUnitTestResult("module", "package", "class", "testName", TestResultStatus.PASSED, 1, 2, null, null, null)); container = new TestResultContainer(testResults.iterator(), new ResultFields()); OctaneServerMock serverMock = OctaneServerMock.getInstance(); diff --git a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults0.xml b/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults0.xml deleted file mode 100644 index 5cfbe9b7f7..0000000000 --- a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults0.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults1.xml b/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults1.xml deleted file mode 100644 index d59819eb35..0000000000 --- a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f1/OctaneGherkinResults1.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults0.xml b/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults0.xml deleted file mode 100644 index 93bc56f13f..0000000000 --- a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults0.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults1.xml b/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults1.xml deleted file mode 100644 index d59819eb35..0000000000 --- a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f2/OctaneGherkinResults1.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults0.xml b/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults0.xml deleted file mode 100644 index 2c91d633f0..0000000000 --- a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults0.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults1.xml b/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults1.xml deleted file mode 100644 index 80ba03ac6b..0000000000 --- a/src/test/resources/com/microfocus/application/automation/tools/octane/tests/gherkin/f3/OctaneGherkinResults1.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - \ No newline at end of file From c684dcbbd51c585b23ad25073297267cf24368ef Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Tue, 13 Apr 2021 10:56:43 +0300 Subject: [PATCH 1694/2502] Update README.md --- doc/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/README.md b/doc/README.md index 335427d518..1b56cf57d0 100644 --- a/doc/README.md +++ b/doc/README.md @@ -56,14 +56,14 @@ Version 6.7 introduced the following enhancements: **General** - Added support for the FOD plugin version 6.1.0. -- SonarQube integration: A new option was added to the Sonar pre-build step to skip automatic webhook configuration. (This allows you to run the integration without admin permissions) +- SonarQube integration: A new option was added to the Sonar pre-build step to skip automatic webhook configuration. (This allows you to run the integration without admin permissions.) - Added XSRF protection for running with Lab, Upload result, and Common result upload for compatibility with new versions of ALM. **ALM Octane – UFT Integration** -- Reduce the length of the folder name for checkout of auto-generated execution jobs. -- Ability to execute UFT tests that are not located in job workspace. To show the test name correctly in ALM Octane, define the "UFT_CHECKOUT_FOLDER" parameter. -- For the Spanish Windows slave: The duration of a UFT test in Jenkins is shown in years instead of seconds. +- Reduced the length of the folder name for checkout of auto-generated execution jobs. +- [Bug fix] Ability to execute UFT tests not located in job workspace. To show the test name correctly in ALM Octane, define the "UFT_CHECKOUT_FOLDER" parameter. +- [Bug fix] For the Spanish Windows slave: The duration of a UFT test in Jenkins now displays correctly, in seconds. **ALM Octane** From 7c75afa6c615b3ceb3a739cbb40cf964653a1165 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 13 Apr 2021 18:47:59 +0300 Subject: [PATCH 1695/2502] us #1204058 : [Jenkins] Use Gherkin login from CI SDK in Jenkins --- pom.xml | 2 +- .../tools/octane/tests/gherkin/GherkinTestExtension.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d61d51b4f1..71b4e712f9 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.7 + 2.6.9.9 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java index 0ad71a794d..db8efcd934 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinTestExtension.java @@ -64,7 +64,8 @@ public boolean supports(Run build) { public TestResultContainer getTestResults(Run build, String jenkinsRootUrl) throws TestProcessingException, IOException, InterruptedException { try { - List gherkinFiles = findGherkinFiles(build.getRootDir()); + List gherkinFiles = GherkinUtils.findGherkinFilesByTemplateWithCounter(build.getRootDir().getAbsolutePath(), + CucumberResultsService.GHERKIN_NGA_RESULTS + "%s.xml", 0); List testResults = GherkinUtils.parseFiles(gherkinFiles); return new TestResultContainer(testResults.iterator(), null); } catch (IOException e) { From c88257a54657c6cd5311adcb86f8dc27bfe6ca5a Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Wed, 14 Apr 2021 14:47:46 +0800 Subject: [PATCH 1696/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.8.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 71b4e712f9..010b26a7f7 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.8.1-beta-SNAPSHOT + 6.8.1-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.8.1-beta From 8bb73de81d81a7597bf1b1824927c657a7e78b7f Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Wed, 14 Apr 2021 14:47:59 +0800 Subject: [PATCH 1697/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 010b26a7f7..1cfac51f0a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.8.1-beta + 6.8.2-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.8.1-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From b07d7bef40bcc069f0b0a49a3ad9d1df478ba88e Mon Sep 17 00:00:00 2001 From: redoxate <30434345+redoxate@users.noreply.github.com> Date: Fri, 16 Apr 2021 17:40:49 +0200 Subject: [PATCH 1698/2502] Triming trailing spaces at the end of the testcase names It is necessary to trim the trailing spaces at the end of the testcases names, otherwise in the second run of a report it would be considred a new testcase. Making the ALM server dening it for duplicate testcase. N.B : The spaces are correctly removed in the POST request sent to the server. --- .../tools/results/service/almentities/AlmTestImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/results/service/almentities/AlmTestImpl.java b/src/main/java/com/microfocus/application/automation/tools/results/service/almentities/AlmTestImpl.java index af67250316..59714145cc 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/service/almentities/AlmTestImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/service/almentities/AlmTestImpl.java @@ -29,7 +29,10 @@ package com.microfocus.application.automation.tools.results.service.almentities; public class AlmTestImpl extends AlmEntityImpl implements AlmTest { - private static String restPrefix = "tests"; + private static String restPrefix = "tests"; + private String trimTrailingSpace(String s){ + return s.replaceFirst("\\s++$", ""); + } public String getRestPrefix() { return restPrefix; } @@ -37,7 +40,7 @@ public String getRestPrefix() { public String getKey(){ String className = (String)getFieldValue(TS_UT_CLASS_NAME); - String methodName = (String)getFieldValue(TS_UT_METHOD_NAME); + String methodName = trimTrailingSpace((String)getFieldValue(TS_UT_METHOD_NAME)); String packageName = (String)getFieldValue(TS_UT_PACKAGE_NAME); if(packageName == null) { packageName = ""; From 1453c7eb922e7ec90cd81f560c7742b64202968c Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 16 Apr 2021 22:47:54 +0300 Subject: [PATCH 1699/2502] us #1204058 : [Jenkins] Use Gherkin login from CI SDK in Jenkins --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 71b4e712f9..b5051fab45 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.9 + 2.6.9.10 From 45d2d818523d89f243183b1f8d5cf29f00d2d845 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 19 Apr 2021 00:33:06 +0300 Subject: [PATCH 1700/2502] us #1204058 : [Jenkins] Use Gherkin login from CI SDK in Jenkins --- pom.xml | 2 +- .../tools/octane/configuration/SDKBasedLoggerProvider.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b5051fab45..cda8552848 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.10 + 2.6.9.11 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java index f9605aae54..dacea8401d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java @@ -28,6 +28,7 @@ package com.microfocus.application.automation.tools.octane.configuration; +import com.hp.octane.integrations.services.logging.CommonLoggerContextUtil; import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; @@ -56,7 +57,8 @@ private SDKBasedLoggerProvider() { public static Logger getLogger(Class type) { try { if (!sysParamConfigured) { - System.setProperty("octaneAllowedStorage", CIJenkinsServicesImpl.getAllowedStorageFile().getAbsolutePath() + File.separator); + CommonLoggerContextUtil.configureLogger(CIJenkinsServicesImpl.getAllowedStorageFile()); + //System.setProperty("octaneAllowedStorage", CIJenkinsServicesImpl.getAllowedStorageFile().getAbsolutePath() + File.separator); sysParamConfigured = true; } return LogManager.getLogger(type); From 0e9ea072ac50ff5db3000c42eac84b39bcea2158 Mon Sep 17 00:00:00 2001 From: redoxate <30434345+redoxate@users.noreply.github.com> Date: Mon, 19 Apr 2021 15:43:31 +0200 Subject: [PATCH 1701/2502] Update Response.java Setting UTF8 encoding --- .../application/automation/tools/sse/sdk/Response.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java index 5725d6e216..3fca84408a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java @@ -122,6 +122,6 @@ public boolean isOk() { @Override public String toString() { - return new String(_data); + return new String(_data, StandardCharsets.UTF_8); } } From ee163b6b8acc6471e505b42a9e8281fa55328e6d Mon Sep 17 00:00:00 2001 From: redoxate <30434345+redoxate@users.noreply.github.com> Date: Mon, 19 Apr 2021 15:48:09 +0200 Subject: [PATCH 1702/2502] Update GeneralPostRequest.java Setting UTF8 encoding --- .../automation/tools/sse/sdk/request/GeneralPostRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java index 78c809dd06..719a813d32 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java @@ -76,7 +76,7 @@ private byte[] getDataBytes() { builder.append(RestXmlUtils.fieldXml(currPair.getFirst(), currPair.getSecond())); } - return builder.append("").toString().getBytes(); + return builder.append("").toString().getBytes(StandardCharsets.UTF_8); } protected List> getDataFields() { From 2ffa82b458f35e40f3dc65e48e6910820998400b Mon Sep 17 00:00:00 2001 From: redoxate <30434345+redoxate@users.noreply.github.com> Date: Mon, 19 Apr 2021 16:17:38 +0200 Subject: [PATCH 1703/2502] Update GeneralPostRequest.java --- .../automation/tools/sse/sdk/request/GeneralPostRequest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java index 719a813d32..256d03ba57 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/request/GeneralPostRequest.java @@ -39,6 +39,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.nio.charset.StandardCharsets; /** * Created by barush on 29/10/2014. From cdef333f0988c29c78461de51b8af4b3baff9d78 Mon Sep 17 00:00:00 2001 From: redoxate <30434345+redoxate@users.noreply.github.com> Date: Mon, 19 Apr 2021 16:19:14 +0200 Subject: [PATCH 1704/2502] Update Response.java --- .../application/automation/tools/sse/sdk/Response.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java index 3fca84408a..c9a47aa8d9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/Response.java @@ -31,6 +31,7 @@ import java.net.HttpURLConnection; import java.util.List; import java.util.Map; +import java.nio.charset.StandardCharsets; /** * This is a naive implementation of an HTTP response. We use it to simplify matters in the From bc67b716a37e173e33abfdee31c4abfcbfcfbc64 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 20 Apr 2021 06:11:24 +0300 Subject: [PATCH 1705/2502] tech : update sdk and fix errata --- pom.xml | 2 +- .../automation/tools/octane/actions/PluginActions.java | 4 ++-- .../automation/tools/octane/branches/BranchesPublisher.java | 2 +- .../tools/octane/pullrequests/PullRequestPublisher.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 91879380cd..829d921b69 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.11 + 2.6.9.13 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java index 5b1c301d0d..43655eb3ba 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/PluginActions.java @@ -150,7 +150,7 @@ private JSONObject getStatusResult(Map parameterMap) { addMetrics(client.getRestService().obtainOctaneRestClient().getMetrics(), "restClient", confJson); - allMetricsJson.put(client.getConfigurationService().getConfiguration().geLocationForLog(), confJson); + allMetricsJson.put(client.getConfigurationService().getConfiguration().getLocationForLog(), confJson); } ); result.put("metrics", allMetricsJson); @@ -185,7 +185,7 @@ private JSONObject readOctaneRootsCache() { OctaneSDK.getClients().forEach( client -> { com.hp.octane.integrations.services.configuration.ConfigurationService cs = client.getConfigurationService(); - result.put(cs.getConfiguration().geLocationForLog(), cs.getOctaneRootsCacheCollection()); + result.put(cs.getConfiguration().getLocationForLog(), cs.getOctaneRootsCacheCollection()); } ); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java index 0f12126198..55c95f2a43 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher.java @@ -136,7 +136,7 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi FetchHandler fetchHandler = FetchFactory.getHandler(ScmTool.fromValue(myScmTool), authenticationStrategy); OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(myConfigurationId); - logConsumer.printLog("ALM Octane " + octaneClient.getConfigurationService().getConfiguration().geLocationForLog() + ", workspace - " + myWorkspaceId); + logConsumer.printLog("ALM Octane " + octaneClient.getConfigurationService().getConfiguration().getLocationForLog() + ", workspace - " + myWorkspaceId); octaneClient.validateOctaneIsActiveAndSupportVersion(PullRequestAndBranchService.BRANCH_COLLECTION_SUPPORTED_VERSION); PullRequestAndBranchService service = OctaneSDK.getClientByInstanceId(myConfigurationId).getPullRequestAndBranchService(); BranchSyncResult result = service.syncBranchesToOctane(fetchHandler, fp, Long.parseLong(myWorkspaceId), GitFetchUtils::getUserIdForCommit, logConsumer::printLog); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java index f2e1985684..93d3ef91fe 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/pullrequests/PullRequestPublisher.java @@ -144,7 +144,7 @@ public void performInternal(@Nonnull Run run, @Nonnull TaskListener taskLi FetchHandler fetchHandler = FetchFactory.getHandler(ScmTool.fromValue(myScmTool), authenticationStrategy); try { OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(myConfigurationId); - logConsumer.printLog("ALM Octane " + octaneClient.getConfigurationService().getConfiguration().geLocationForLog() + ", workspace - " + myWorkspaceId); + logConsumer.printLog("ALM Octane " + octaneClient.getConfigurationService().getConfiguration().getLocationForLog() + ", workspace - " + myWorkspaceId); octaneClient.validateOctaneIsActiveAndSupportVersion(PullRequestAndBranchService.PULL_REQUEST_COLLECTION_SUPPORTED_VERSION); List pullRequests = fetchHandler.fetchPullRequests(fp, GitFetchUtils::getUserIdForCommit, logConsumer::printLog); From cfbff94034561d58ade6842c5c4a31142c7c6a73 Mon Sep 17 00:00:00 2001 From: Xiao-Jing Zhang Date: Wed, 21 Apr 2021 13:49:42 +0800 Subject: [PATCH 1706/2502] Defect#598158: add remote node support for uftm file upload --- .../tools/run/UploadAppBuilder.java | 54 ++++++++++++++++--- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java index 53774ab899..aa2a4af990 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java @@ -36,19 +36,23 @@ import com.microfocus.application.automation.tools.settings.MCServerSettingsGlobalConfiguration; import com.microfocus.application.automation.tools.sse.common.StringUtils; import hudson.Extension; +import hudson.FilePath; import hudson.Launcher; import hudson.Util; -import hudson.model.*; +import hudson.model.AbstractBuild; +import hudson.model.AbstractProject; +import hudson.model.BuildListener; +import hudson.model.Result; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; import net.minidev.json.JSONObject; +import org.apache.commons.io.FilenameUtils; import org.kohsuke.stapler.DataBoundConstructor; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintStream; +import java.io.*; +import java.nio.file.NoSuchFileException; import java.util.List; +import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -94,17 +98,47 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen }else{ mcServerUrl = mcServerSettingsModel.getProperties().getProperty("MobileHostAddress"); out.println(String.format("There are %d apps to be uploaded.", paths.size())); - String workspace = new File(build.getWorkspace().toURI()).getCanonicalPath(); + String workspace = build.getWorkspace() == null ? "" : build.getWorkspace().toURI().getPath(); + for(int i=1; i<=paths.size(); i++){ String path = paths.get(i-1).getMcAppPath(); + String originPath = path; if(StringUtils.isNullOrEmpty(path)){ out.println(String.format("ignore the empty app %d upload", i)); continue; } //case insensitive replace of workspace to its real path - path = path.replaceAll("(?i)"+ Pattern.quote("${WORKSPACE}"), Matcher.quoteReplacement(workspace)); + if (path.toUpperCase(Locale.ENGLISH).startsWith("${WORKSPACE}")){ + path = path.replaceAll("(?i)"+ Pattern.quote("${WORKSPACE}"), Matcher.quoteReplacement(workspace)); + if (!FilenameUtils.normalize(path).startsWith(FilenameUtils.normalize(workspace))){ + out.println(String.format("Failed to upload app, Cause invalid application file: %s", path)); + build.setResult(Result.FAILURE); + allSuccess = false; + continue; + } + } + FilePath filePath = new FilePath(build.getWorkspace().getChannel(), path); + File tempFile = null; + if (filePath.isRemote()){ + tempFile = File.createTempFile("uftm", "." + FilenameUtils.getExtension(path)); + try (OutputStream outputStream = new FileOutputStream(tempFile)) { + filePath.copyTo(outputStream); + path = tempFile.getCanonicalPath(); + } catch (NoSuchFileException noSuchFileException){ + out.println(String.format("Failed to upload app, Cause cannot find application file: %s", path)); + build.setResult(Result.FAILURE); + allSuccess = false; + continue; + } catch (Exception e){ + out.println(String.format("Failed to upload app, Cause failed to copy application file: %s", path)); + build.setResult(Result.FAILURE); + allSuccess = false; + continue; + } + } + try{ - out.println(String.format("starting to upload app %d %s", i, path)); + out.println(String.format("starting to upload app %d %s", i, originPath)); if(uploadAppModel.getProxySettings() == null){ app = job.upload(mcServerUrl, uploadAppModel.getMcUserName(),uploadAppModel.getMcPassword(), uploadAppModel.getMcTenantId(), null, null, null, path); }else{ @@ -156,6 +190,10 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen } build.setResult(Result.FAILURE); return false; + } finally { + if (tempFile != null) { + tempFile.delete(); + } } } } From 6551fd47e79d4331eeacbc1bdea70ec926f58e97 Mon Sep 17 00:00:00 2001 From: Xiao-Jing Zhang Date: Wed, 21 Apr 2021 13:56:22 +0800 Subject: [PATCH 1707/2502] Defect#598158: add remote node support for uftm file upload --- .../application/automation/tools/run/UploadAppBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java index aa2a4af990..c44fe95d9a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java @@ -50,6 +50,7 @@ import org.kohsuke.stapler.DataBoundConstructor; import java.io.*; +import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.util.List; import java.util.Locale; @@ -192,7 +193,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen return false; } finally { if (tempFile != null) { - tempFile.delete(); + Files.delete(tempFile.toPath()); } } } From cc372e3edfd2d06cb9d829282f1fe3ba0faf878a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 25 Apr 2021 15:08:49 +0300 Subject: [PATCH 1708/2502] defect #1210119 : Pull Request is not injected as a result of too long description field --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 829d921b69..a7e12633f5 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.13 + 2.6.9.14 From 5eace855ef32e219dd8261fc28f09d90d7dad602 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 26 Apr 2021 14:52:02 +0300 Subject: [PATCH 1709/2502] tech : print passed parameters to UFT test in console --- HpToolsLauncher/MtbxManager.cs | 2 ++ HpToolsLauncher/TestRunners/GuiTestRunner.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/HpToolsLauncher/MtbxManager.cs b/HpToolsLauncher/MtbxManager.cs index 77fdfb48f5..ed4ec113af 100644 --- a/HpToolsLauncher/MtbxManager.cs +++ b/HpToolsLauncher/MtbxManager.cs @@ -49,6 +49,7 @@ public class MtbxManager + @@ -56,6 +57,7 @@ public class MtbxManager + */ diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 076860991e..e52e1b364f 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -670,6 +670,7 @@ private bool HandleInputParameters(string fileName, ref string errorReason, Dict } else { + ConsoleWriter.WriteLine(string.Format("Using parameter {0}:{1} ",paramName, paramValue)); _qtpParameters[paramName].Value = paramValue; } } From a6e48f2e473d0a382771d9016c8e1d57adf78992 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 26 Apr 2021 14:55:20 +0300 Subject: [PATCH 1710/2502] tech : print passed parameters to UFT test in console --- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index e52e1b364f..57196a6b6c 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -670,7 +670,7 @@ private bool HandleInputParameters(string fileName, ref string errorReason, Dict } else { - ConsoleWriter.WriteLine(string.Format("Using parameter {0}:{1} ",paramName, paramValue)); + ConsoleWriter.WriteLine(string.Format("Using parameter {0}={1} ",paramName, paramValue)); _qtpParameters[paramName].Value = paramValue; } } From e98b48bbd5ccc0f86b0493f7c6135a9a49ea22ef Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Mon, 3 May 2021 11:47:19 +0300 Subject: [PATCH 1711/2502] Update README.md --- doc/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/README.md b/doc/README.md index 1b56cf57d0..eb689788cd 100644 --- a/doc/README.md +++ b/doc/README.md @@ -49,12 +49,13 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j Starting with version 1.641 (or 1.625.3), Jenkins introduced the **Content-Security-Policy** header. This causes some of the integration links, such as links to reports, to become inoperable. For details, see [Configuring Content Security Policy](https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy) and [Jenkins Security Advisory ](https://jenkins.io/security/advisory/2015-12-09/). For suggested workarounds until the issue is resolved, see [Content Security Policy Header](#content-security-policy-header). -## New Features and Enhancements in version 6.7 +## New Features and Enhancements in Versions 6.7, 6.8 -Version 6.7 introduced the following enhancements: +Versions 6.7 and 6.8 introduced the following enhancements: **General** +- Security fixes: Security issues noted in the *Jenkins Security Advisory 2021-04-07* were addressed. For details, search for SECURITY-2132, SECURITY-2175, and SECURITY-2176 in the [Jenkins Security Advisory 2021-04-07 page](https://www.jenkins.io/security/advisory/2021-04-07/). (Version 6.8) - Added support for the FOD plugin version 6.1.0. - SonarQube integration: A new option was added to the Sonar pre-build step to skip automatic webhook configuration. (This allows you to run the integration without admin permissions.) - Added XSRF protection for running with Lab, Upload result, and Common result upload for compatibility with new versions of ALM. From a9426d64693376ae47b7b8ceba32774c2dec77c3 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 5 May 2021 12:11:09 +0300 Subject: [PATCH 1712/2502] branch injection supported from 15.1.90 - fix help --- .../tools/octane/branches/BranchesPublisher/help.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html index 04c08cee05..13cb90efef 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html @@ -26,7 +26,7 @@


      - Supported version of ALM Octane: 15.1.74 and later. + Supported version of ALM Octane: 15.1.90 and later.
      From 3cfc99a410c3a39b61fbbd1f12d8188cb07a9561 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 6 May 2021 10:47:41 +0300 Subject: [PATCH 1713/2502] branch injection supported from 15.1.90 - fix help --- .../tools/octane/branches/BranchesPublisher/help.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html index 13cb90efef..6dbf4c97df 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html @@ -33,7 +33,7 @@
      You can change the behaviour of this step by adding the following parameters to the job:
        -
      • branches_active_branch_days: Only active branches can be added/update to ALM Octane. Default is 90 days.

      • +
      • branches_active_branch_days: Only active branches can be added/update to ALM Octane. Default is 60 days.

      • branches_max_branches_to_fill: Relevant for GitHub repository only. Max branches to fetch info. Branch for which info is not fetched, cannot be added to ALM Octane. Default is 1000.

      From 8412ad538be7318a023b972e54c157d576b34419 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 6 May 2021 15:06:26 +0300 Subject: [PATCH 1714/2502] fix help --- .../tools/octane/branches/BranchesPublisher/help.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html index 6dbf4c97df..408906dc41 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/branches/BranchesPublisher/help.html @@ -19,10 +19,10 @@ -->
      - This step is responsible for collecting branches from the SCM tool and injecting them to ALM Octane. + This step is responsible for collecting branches from the SCM tool and injecting them into ALM Octane.

      - In addition, this step is used to define the scm repositories templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions. + In addition, this step is used to define the SCM repository templates that are used by ALM Octane to link to your repository viewer. To configure templates in ALM Octane, access Settings > Spaces. Select a workspace and click DevOps > SCM Repositories. Follow the on-screen instructions.


      @@ -33,8 +33,8 @@
      You can change the behaviour of this step by adding the following parameters to the job:
        -
      • branches_active_branch_days: Only active branches can be added/update to ALM Octane. Default is 60 days.

      • -
      • branches_max_branches_to_fill: Relevant for GitHub repository only. Max branches to fetch info. Branch for which info is not fetched, cannot be added to ALM Octane. Default is 1000.

      • +
      • branches_active_branch_days: Only active branches can be added/updated to ALM Octane. Default is 60 days.

      • +
      • branches_max_branches_to_fill: Relevant for GitHub repository only. Max branches to collect data. If data is not collected from a branch, it cannot be added to ALM Octane. Default is 1000.


      From 5e7be00decb1bab3050348587bcee60b3810dd41 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 11 May 2021 10:36:05 +0300 Subject: [PATCH 1715/2502] add logs to uft test runner test connection --- .../executor/ExecutorConnectivityService.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java index 753868fae0..efbabd01f5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -72,6 +72,7 @@ public class ExecutorConnectivityService { */ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { logger.info("checkRepositoryConnectivity started to " + testConnectivityInfo.getScmRepository().getUrl()); + long start = System.currentTimeMillis(); OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); if (testConnectivityInfo.getScmRepository() != null && StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl())) { @@ -84,8 +85,10 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te credentials = getCredentialsById(testConnectivityInfo.getCredentialsId()); } + long permValidationStarted = System.currentTimeMillis(); List permissionResult = checkCIPermissions(Jenkins.getInstanceOrNull(), needCredentialsPermission); - + long permValidationEnded = System.currentTimeMillis(); + logger.info(String.format("checkRepositoryConnectivity : permission check is done in %s ms ", (permValidationEnded - permValidationStarted))); if (!permissionResult.isEmpty()) { String user = User.current() != null ? User.current().getId() : Jenkins.ANONYMOUS.getPrincipal().toString(); String error = String.format("Failed : User \'%s\' is missing permissions \'%s\' on CI server", user, permissionResult); @@ -95,22 +98,32 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te return result; } - if (!ScmPluginFactory.isPluginInstalled(testConnectivityInfo.getScmRepository().getType())) { + long scmValidationStarted = System.currentTimeMillis(); + boolean requiredPluginInstalled = ScmPluginFactory.isPluginInstalled(testConnectivityInfo.getScmRepository().getType()); + if (!requiredPluginInstalled) { result.setStatus(HttpStatus.SC_BAD_REQUEST); result.setBody(String.format("%s plugin is not installed.", testConnectivityInfo.getScmRepository().getType().value().toUpperCase())); } else { + + long pluginInstalledValidationStarted = System.currentTimeMillis(); ScmPluginHandler handler = ScmPluginFactory.getScmHandler(testConnectivityInfo.getScmRepository().getType()); + long pluginInstalledValidationEnded = System.currentTimeMillis(); + logger.info(String.format("checkRepositoryConnectivity : plugin installed check is done in %s ms ", (pluginInstalledValidationEnded - pluginInstalledValidationStarted))); + handler.checkRepositoryConnectivity(testConnectivityInfo, credentials, result); + long scmValidationEnded = System.currentTimeMillis(); + logger.info(String.format("checkRepositoryConnectivity : scm check is done in %s ms ", (scmValidationEnded - scmValidationStarted))); } } else { result.setStatus(HttpStatus.SC_BAD_REQUEST); result.setBody("Missing input for testing"); } + long end = System.currentTimeMillis(); if (result.getStatus() != HttpStatus.SC_OK) { logger.info("checkRepositoryConnectivity failed: " + result.getBody()); - }else{ - logger.info("checkRepositoryConnectivity ok" ); + } else { + logger.info(String.format("checkRepositoryConnectivity ok, done in %s ms ", (end - start))); } return result; } From 9634648d8b8c8662f207d8b4becb34fa4a78c2c3 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 11 May 2021 14:12:20 +0300 Subject: [PATCH 1716/2502] Revert "add logs to uft test runner test connection" This reverts commit 5e7be00d --- .../executor/ExecutorConnectivityService.java | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java index efbabd01f5..753868fae0 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -72,7 +72,6 @@ public class ExecutorConnectivityService { */ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { logger.info("checkRepositoryConnectivity started to " + testConnectivityInfo.getScmRepository().getUrl()); - long start = System.currentTimeMillis(); OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); if (testConnectivityInfo.getScmRepository() != null && StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl())) { @@ -85,10 +84,8 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te credentials = getCredentialsById(testConnectivityInfo.getCredentialsId()); } - long permValidationStarted = System.currentTimeMillis(); List permissionResult = checkCIPermissions(Jenkins.getInstanceOrNull(), needCredentialsPermission); - long permValidationEnded = System.currentTimeMillis(); - logger.info(String.format("checkRepositoryConnectivity : permission check is done in %s ms ", (permValidationEnded - permValidationStarted))); + if (!permissionResult.isEmpty()) { String user = User.current() != null ? User.current().getId() : Jenkins.ANONYMOUS.getPrincipal().toString(); String error = String.format("Failed : User \'%s\' is missing permissions \'%s\' on CI server", user, permissionResult); @@ -98,32 +95,22 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te return result; } - long scmValidationStarted = System.currentTimeMillis(); - boolean requiredPluginInstalled = ScmPluginFactory.isPluginInstalled(testConnectivityInfo.getScmRepository().getType()); - if (!requiredPluginInstalled) { + if (!ScmPluginFactory.isPluginInstalled(testConnectivityInfo.getScmRepository().getType())) { result.setStatus(HttpStatus.SC_BAD_REQUEST); result.setBody(String.format("%s plugin is not installed.", testConnectivityInfo.getScmRepository().getType().value().toUpperCase())); } else { - - long pluginInstalledValidationStarted = System.currentTimeMillis(); ScmPluginHandler handler = ScmPluginFactory.getScmHandler(testConnectivityInfo.getScmRepository().getType()); - long pluginInstalledValidationEnded = System.currentTimeMillis(); - logger.info(String.format("checkRepositoryConnectivity : plugin installed check is done in %s ms ", (pluginInstalledValidationEnded - pluginInstalledValidationStarted))); - handler.checkRepositoryConnectivity(testConnectivityInfo, credentials, result); - long scmValidationEnded = System.currentTimeMillis(); - logger.info(String.format("checkRepositoryConnectivity : scm check is done in %s ms ", (scmValidationEnded - scmValidationStarted))); } } else { result.setStatus(HttpStatus.SC_BAD_REQUEST); result.setBody("Missing input for testing"); } - long end = System.currentTimeMillis(); if (result.getStatus() != HttpStatus.SC_OK) { logger.info("checkRepositoryConnectivity failed: " + result.getBody()); - } else { - logger.info(String.format("checkRepositoryConnectivity ok, done in %s ms ", (end - start))); + }else{ + logger.info("checkRepositoryConnectivity ok" ); } return result; } From ee310a5e1209862cb3b655f29a5c0a373b41e682 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 12 May 2021 10:43:06 +0300 Subject: [PATCH 1717/2502] tech : add possibility to disable UFT_TEST_CONNECTION validation --- pom.xml | 2 +- .../tools/octane/CIJenkinsServicesImpl.java | 5 +++-- .../executor/ExecutorConnectivityService.java | 16 +++++++++++++--- .../help-parameters.html | 7 ++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index a7e12633f5..e5e603d916 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.14 + 2.6.9.19 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index 5f256c70fe..b62eb1b235 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -507,11 +507,12 @@ public PipelineNode createExecutor(DiscoveryInfo discoveryInfo) { public OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { ACLContext securityContext = startImpersonation(); try { - OctaneResponse response = ExecutorConnectivityService.checkRepositoryConnectivity(testConnectivityInfo); + OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(getInstanceId()); + OctaneResponse response = ExecutorConnectivityService.checkRepositoryConnectivity(testConnectivityInfo, + octaneClient.getConfigurationService().getConfiguration()); //validate UftTestRunnerFolderParameter if (response.getStatus() == HttpStatus.SC_OK) { - OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(getInstanceId()); UftTestRunnerFolderParameter uftFolderParameter = (UftTestRunnerFolderParameter) octaneClient.getConfigurationService() .getConfiguration().getParameter(UftTestRunnerFolderParameter.KEY); if (uftFolderParameter != null) { diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java index 753868fae0..38f498fe0c 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -36,10 +36,12 @@ import com.cloudbees.plugins.credentials.domains.DomainRequirement; import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; +import com.hp.octane.integrations.OctaneConfiguration; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.CredentialsInfo; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; +import com.hp.octane.integrations.services.configurationparameters.factory.ConfigurationParameterFactory; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; import com.microfocus.application.automation.tools.octane.executor.scmmanager.ScmPluginFactory; import com.microfocus.application.automation.tools.octane.executor.scmmanager.ScmPluginHandler; @@ -68,11 +70,19 @@ public class ExecutorConnectivityService { * Validate that scm repository is valid * * @param testConnectivityInfo contains values to check + * @param configuration * @return OctaneResponse return status code and error to show for client */ - public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { + public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo, OctaneConfiguration configuration) { logger.info("checkRepositoryConnectivity started to " + testConnectivityInfo.getScmRepository().getUrl()); OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); + + if (ConfigurationParameterFactory.isUftTestConnectionDisabled(configuration)) { + logger.info("checkRepositoryConnectivity : validation disabled"); + result.setStatus(HttpStatus.SC_OK); + return result; + } + if (testConnectivityInfo.getScmRepository() != null && StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl())) { boolean needCredentialsPermission = false; @@ -109,8 +119,8 @@ public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo te } if (result.getStatus() != HttpStatus.SC_OK) { logger.info("checkRepositoryConnectivity failed: " + result.getBody()); - }else{ - logger.info("checkRepositoryConnectivity ok" ); + } else { + logger.info("checkRepositoryConnectivity ok"); } return result; } diff --git a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html index 6eba43452e..872f1c78cb 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html +++ b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html @@ -39,7 +39,7 @@ - Param name + Param name Value Description @@ -99,6 +99,11 @@ ALM Octane allows generation of discovery and execution jobs for UFT test runner. By default, those jobs are created in Jenkins root. This parameter allow to define the folder in which those jobs will be created.
      For example : my_team_folder/uft + + UFT_TEST_CONNECTION_DISABLED + true/false + Allow to disable "Test Connection" validation that is done during creation of UFT test runner. Default is false. + From 883ff58cc805b5451166d7fa2953e91944b8a39c Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 12 May 2021 11:41:27 +0300 Subject: [PATCH 1718/2502] tech : add possibility to disable UFT_TEST_CONNECTION validation --- .../tools/octane/CIJenkinsServicesImpl.java | 21 +++++++++++++------ .../executor/ExecutorConnectivityService.java | 12 +---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index b62eb1b235..e112ebbd2f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -57,6 +57,7 @@ import com.hp.octane.integrations.exceptions.PermissionException; import com.hp.octane.integrations.services.configurationparameters.FortifySSCTokenParameter; import com.hp.octane.integrations.services.configurationparameters.UftTestRunnerFolderParameter; +import com.hp.octane.integrations.services.configurationparameters.factory.ConfigurationParameterFactory; import com.microfocus.application.automation.tools.model.OctaneServerSettingsModel; import com.microfocus.application.automation.tools.octane.configuration.*; import com.microfocus.application.automation.tools.octane.executor.ExecutorConnectivityService; @@ -102,12 +103,14 @@ */ public class CIJenkinsServicesImpl extends CIPluginServices { - private static final Logger logger = SDKBasedLoggerProvider.getLogger(CIJenkinsServicesImpl.class); - private static final java.util.logging.Logger systemLogger = java.util.logging.Logger.getLogger(CIJenkinsServicesImpl.class.getName()); - private static final DTOFactory dtoFactory = DTOFactory.getInstance(); //we going to print octaneAllowedStorage to system log, this flag help to avoid multiple prints private static boolean skipOctaneAllowedStoragePrint = false; + private static Object skipOctaneAllowedStoragePrintLock = new Object();//this must be before SDKBasedLoggerProvider.getLogger + + private static final DTOFactory dtoFactory = DTOFactory.getInstance(); + private static final Logger logger = SDKBasedLoggerProvider.getLogger(CIJenkinsServicesImpl.class); + private static final java.util.logging.Logger systemLogger = java.util.logging.Logger.getLogger(CIJenkinsServicesImpl.class.getName()); @Override public CIServerInfo getServerInfo() { @@ -507,9 +510,14 @@ public PipelineNode createExecutor(DiscoveryInfo discoveryInfo) { public OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { ACLContext securityContext = startImpersonation(); try { + OctaneResponse response; OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(getInstanceId()); - OctaneResponse response = ExecutorConnectivityService.checkRepositoryConnectivity(testConnectivityInfo, - octaneClient.getConfigurationService().getConfiguration()); + if (ConfigurationParameterFactory.isUftTestConnectionDisabled(octaneClient.getConfigurationService().getConfiguration())) { + logger.info("checkRepositoryConnectivity : validation disabled"); + response = DTOFactory.getInstance().newDTO(OctaneResponse.class).setStatus(HttpStatus.SC_OK); + } else { + response = ExecutorConnectivityService.checkRepositoryConnectivity(testConnectivityInfo); + } //validate UftTestRunnerFolderParameter if (response.getStatus() == HttpStatus.SC_OK) { @@ -754,7 +762,8 @@ public static File getAllowedStorageFile() { private static File getAllowedStorageFileForMasterJenkins(Jenkins jenkins) { boolean allowPrint; - synchronized (dtoFactory) { + synchronized (skipOctaneAllowedStoragePrintLock) { + //do allowPrint only once allowPrint = !skipOctaneAllowedStoragePrint; skipOctaneAllowedStoragePrint = true; } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java index 38f498fe0c..e37c4634a2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/ExecutorConnectivityService.java @@ -36,12 +36,10 @@ import com.cloudbees.plugins.credentials.domains.DomainRequirement; import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; -import com.hp.octane.integrations.OctaneConfiguration; import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.connectivity.OctaneResponse; import com.hp.octane.integrations.dto.executor.CredentialsInfo; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; -import com.hp.octane.integrations.services.configurationparameters.factory.ConfigurationParameterFactory; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; import com.microfocus.application.automation.tools.octane.executor.scmmanager.ScmPluginFactory; import com.microfocus.application.automation.tools.octane.executor.scmmanager.ScmPluginHandler; @@ -70,19 +68,11 @@ public class ExecutorConnectivityService { * Validate that scm repository is valid * * @param testConnectivityInfo contains values to check - * @param configuration * @return OctaneResponse return status code and error to show for client */ - public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo, OctaneConfiguration configuration) { + public static OctaneResponse checkRepositoryConnectivity(TestConnectivityInfo testConnectivityInfo) { logger.info("checkRepositoryConnectivity started to " + testConnectivityInfo.getScmRepository().getUrl()); OctaneResponse result = DTOFactory.getInstance().newDTO(OctaneResponse.class); - - if (ConfigurationParameterFactory.isUftTestConnectionDisabled(configuration)) { - logger.info("checkRepositoryConnectivity : validation disabled"); - result.setStatus(HttpStatus.SC_OK); - return result; - } - if (testConnectivityInfo.getScmRepository() != null && StringUtils.isNotEmpty(testConnectivityInfo.getScmRepository().getUrl())) { boolean needCredentialsPermission = false; From b5b85e2b6dd7d020d3ca44a2584f992e369e077e Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 13 May 2021 13:48:34 +0300 Subject: [PATCH 1719/2502] JENKINS-65350 / DEF-613052 Plugins run a different TestSet --- HpToolsLauncher/HpToolsLauncher.csproj | 2 +- HpToolsLauncher/Launcher.cs | 2 +- .../ParallelRunnerEnvironmentUtil.cs | 7 ++--- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 30 ++++++++++++------- .../TestRunners/ParallelTestRunner.cs | 4 --- pom.xml | 2 +- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/HpToolsLauncher/HpToolsLauncher.csproj b/HpToolsLauncher/HpToolsLauncher.csproj index 3d890035d6..1451a8eadc 100644 --- a/HpToolsLauncher/HpToolsLauncher.csproj +++ b/HpToolsLauncher/HpToolsLauncher.csproj @@ -43,7 +43,7 @@ x86 pdbonly - false + true ..\src\main\resources\ TRACE prompt diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index f2fe1e3591..b4f382519e 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -805,7 +805,7 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara { reportPath = jenkinsEnvVariables[fsReportPath]; } - catch (KeyNotFoundException ex) + catch (KeyNotFoundException) { Console.WriteLine("============================================================================"); Console.WriteLine("The provided results folder path {0} does not exist.", fsReportPath); diff --git a/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs index 41c42b3f66..7a6a6d99f2 100644 --- a/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs +++ b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs @@ -29,13 +29,10 @@ using HpToolsLauncher.ParallelTestRunConfiguraion; using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.IO; using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Web.Script.Serialization; - +using System.Web.Script.Serialization; + namespace HpToolsLauncher.ParallelRunner { [Serializable] diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 633ea60992..b08930f9e2 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -38,8 +38,6 @@ using HpToolsLauncher.Properties; using Mercury.TD.Client.Ota.QC9; - - namespace HpToolsLauncher { public class AlmTestSetsRunner : RunnerBase, IDisposable @@ -101,7 +99,7 @@ public ITDConnection2 TdConnectionOld public string ApiKey { get; set; } - + private const string TEST_DETAILS = "ID = {0}, TestSet = {1}, TestSetFolder = {2}"; /// /// constructor @@ -401,7 +399,8 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, ConsoleWriter.WriteErrLine(Resources.AlmRunnerErrorAuthorization); } } - else { + else + { ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerServerUnreachable, qcServerUrl)); } @@ -567,8 +566,9 @@ private List GetAllTestSetsFromDirTree(ITestSetFolder tsFolder) /// /// /// + /// /// the target test set - public ITestSet GetTargetTestSet(List testSetList, string testSuiteName) + public ITestSet GetTargetTestSet(List testSetList, string testSuiteName, ITestSetFolder tsFolder) { ITestSet targetTestSet = null; @@ -577,10 +577,18 @@ public ITestSet GetTargetTestSet(List testSetList, string testSuiteName) foreach (ITestSet testSet in testSetList) { string tempName = testSet.Name; - if (tempName.Equals(testSuiteName, StringComparison.InvariantCultureIgnoreCase)) + var testSetFolder = testSet.TestSetFolder as ITestSetFolder; + try { - targetTestSet = testSet; - break; + if (tempName.Equals(testSuiteName, StringComparison.OrdinalIgnoreCase) && testSetFolder.NodeID == tsFolder.NodeID) + { + targetTestSet = testSet; + break; + } + } + catch(Exception ex) + { + ConsoleWriter.WriteLine(ex.Message); } } } @@ -672,7 +680,9 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet if (tsFolder != null) { List testList = tsFolder.FindTestSets(testSuiteName); - + foreach(ITestSet t in testList) + Console.WriteLine(string.Format(TEST_DETAILS, t.ID, t.Name, t.TestSetFolder.Name)); + return testList; } @@ -1176,7 +1186,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string ITestSet targetTestSet = null; try { - targetTestSet = GetTargetTestSet(testSetList, testSuiteName); + targetTestSet = GetTargetTestSet(testSetList, testSuiteName, tsFolder); } catch (Exception) { diff --git a/HpToolsLauncher/TestRunners/ParallelTestRunner.cs b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs index f4e8f65403..3cb5b9f160 100644 --- a/HpToolsLauncher/TestRunners/ParallelTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs @@ -27,15 +27,11 @@ */ using HpToolsLauncher.ParallelRunner; -using Microsoft.Win32; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.InteropServices; -using System.Threading; -using System.Web.Script.Serialization; using Environment = System.Environment; using Resources = HpToolsLauncher.Properties.Resources; namespace HpToolsLauncher.TestRunners diff --git a/pom.xml b/pom.xml index 91879380cd..f0e4fc7718 100644 --- a/pom.xml +++ b/pom.xml @@ -360,7 +360,7 @@ bintray-adm-maven bintray - http://dl.bintray.com/adm/maven + https://dl.bintray.com/adm/maven From 1e57e77c4b2b240c905168bb45b21a7c53683feb Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Fri, 14 May 2021 14:46:14 +0800 Subject: [PATCH 1720/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.8.2-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e5e603d916..233267cac0 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.8.2-beta-SNAPSHOT + 6.8.2-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.8.2-beta From 7b8083b8dac337836013fd479d1656b272905f94 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Fri, 14 May 2021 14:46:26 +0800 Subject: [PATCH 1721/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 233267cac0..7e923206eb 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.8.2-beta + 6.8.3-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.8.2-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 4f3da54cb029065b2a6d1e849258ccda96ea3a98 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 20 May 2021 20:21:24 +0300 Subject: [PATCH 1722/2502] tech: support stop build --- .../tools/octane/executor/UftConstants.java | 1 + .../projects/AbstractProjectProcessor.java | 65 ++++++++++++------- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java index a60bc39691..21d1f52559 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java @@ -35,6 +35,7 @@ public class UftConstants { public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; + public static final String BUILD_ID_PARAMETER_NAME = "buildId"; public static final String EXECUTION_ID_PARAMETER_NAME = "executionId"; public static final String FULL_SCAN_PARAMETER_NAME = "Full sync"; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 4bad4d5317..8ed6b3c7fc 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -91,39 +91,58 @@ public void scheduleBuild(Cause cause, ParametersAction parametersAction) { public void cancelBuild(Cause cause, ParametersAction parametersAction) { String suiteId = (String) parametersAction.getParameter(UftConstants.SUITE_ID_PARAMETER_NAME).getValue(); String suiteRunId = (String) parametersAction.getParameter(UftConstants.SUITE_RUN_ID_PARAMETER_NAME).getValue(); + String buildId = (String) parametersAction.getParameter(UftConstants.BUILD_ID_PARAMETER_NAME).getValue(); logger.info("cancelBuild for suiteId=" + suiteId +", suiteRunId=" + suiteRunId); + + if (job instanceof AbstractProject) { AbstractProject project = (AbstractProject) job; - Queue queue = Jenkins.get().getQueue(); - queue.getItems(project).forEach(item -> { - item.getActions(ParametersAction.class).forEach(action -> { - if (checkSuiteIdParamsExistAndEqual(action, suiteId, suiteRunId)) { - try { - logger.info("canceling item in queue : " + item.toString()); - queue.cancel(item); - logger.info("Item in queue is cancelled item : " + item.toString()); - } catch (Exception e) { - logger.warn("Failed to cancel '" + item.toString() + "' in queue : " + e.getMessage(), e); - } - } - }); - }); - project.getBuilds().forEach(build -> { - if (build instanceof AbstractBuild) { - AbstractBuild aBuild = (AbstractBuild) build; - aBuild.getActions(ParametersAction.class).forEach(action -> { + if (buildId != null) { + AbstractBuild aBuild = ((AbstractProject) job).getBuild(buildId); + if (aBuild == null) { + logger.warn(String.format("Cannot stop : build %s is not found"), buildId); + return; + } + try { + aBuild.doStop(); + logger.info("Build is stopped : " + aBuild.getProject().getDisplayName() + aBuild.getDisplayName()); + } catch (Exception e) { + logger.warn("Failed to stop build '" + aBuild.getDisplayName() + "' :" + e.getMessage(), e); + } + } else { + + Queue queue = Jenkins.get().getQueue(); + queue.getItems(project).forEach(item -> { + item.getActions(ParametersAction.class).forEach(action -> { if (checkSuiteIdParamsExistAndEqual(action, suiteId, suiteRunId)) { try { - aBuild.doStop(); - logger.info("Build is stopped : " + aBuild.getProject().getDisplayName() + aBuild.getDisplayName()); + logger.info("canceling item in queue : " + item.toString()); + queue.cancel(item); + logger.info("Item in queue is cancelled item : " + item.toString()); } catch (Exception e) { - logger.warn("Failed to stop build '" + aBuild.getDisplayName() + "' :" + e.getMessage(), e); + logger.warn("Failed to cancel '" + item.toString() + "' in queue : " + e.getMessage(), e); } } }); - } - }); + }); + + project.getBuilds().forEach(build -> { + if (build instanceof AbstractBuild) { + AbstractBuild aBuild = (AbstractBuild) build; + aBuild.getActions(ParametersAction.class).forEach(action -> { + if (checkSuiteIdParamsExistAndEqual(action, suiteId, suiteRunId)) { + try { + aBuild.doStop(); + logger.info("Build is stopped : " + aBuild.getProject().getDisplayName() + aBuild.getDisplayName()); + } catch (Exception e) { + logger.warn("Failed to stop build '" + aBuild.getDisplayName() + "' :" + e.getMessage(), e); + } + } + }); + } + }); + } } else { throw new IllegalStateException("unsupported job CAN NOT be stopped"); } From 755a69adac91ee51cc6245950e7987e59740e60b Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 20 May 2021 20:33:08 +0300 Subject: [PATCH 1723/2502] tech: support stop build --- .../projects/AbstractProjectProcessor.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 8ed6b3c7fc..6bbf20c884 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -101,15 +101,10 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { if (buildId != null) { AbstractBuild aBuild = ((AbstractProject) job).getBuild(buildId); if (aBuild == null) { - logger.warn(String.format("Cannot stop : build %s is not found"), buildId); + logger.warn(String.format("Cannot stop : build %s is not found", buildId)); return; } - try { - aBuild.doStop(); - logger.info("Build is stopped : " + aBuild.getProject().getDisplayName() + aBuild.getDisplayName()); - } catch (Exception e) { - logger.warn("Failed to stop build '" + aBuild.getDisplayName() + "' :" + e.getMessage(), e); - } + stopBuild(aBuild); } else { Queue queue = Jenkins.get().getQueue(); @@ -132,12 +127,7 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { AbstractBuild aBuild = (AbstractBuild) build; aBuild.getActions(ParametersAction.class).forEach(action -> { if (checkSuiteIdParamsExistAndEqual(action, suiteId, suiteRunId)) { - try { - aBuild.doStop(); - logger.info("Build is stopped : " + aBuild.getProject().getDisplayName() + aBuild.getDisplayName()); - } catch (Exception e) { - logger.warn("Failed to stop build '" + aBuild.getDisplayName() + "' :" + e.getMessage(), e); - } + stopBuild(aBuild); } }); } @@ -148,6 +138,15 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { } } + private void stopBuild(AbstractBuild aBuild) { + try { + aBuild.doStop(); + logger.info("Build is stopped : " + aBuild.getProject().getDisplayName() + aBuild.getDisplayName()); + } catch (Exception e) { + logger.warn("Failed to stop build '" + aBuild.getDisplayName() + "' :" + e.getMessage(), e); + } + } + private boolean checkSuiteIdParamsExistAndEqual(ParametersAction parametersAction, String suiteId, String suiteRunId) { ParameterValue suiteIdPV = parametersAction.getParameter(UftConstants.SUITE_ID_PARAMETER_NAME); ParameterValue suiteRunIdPV = parametersAction.getParameter(UftConstants.SUITE_RUN_ID_PARAMETER_NAME); From 9806358e0529382e9dfcddb0067a4d4b60644fe4 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 21 May 2021 14:09:24 +0300 Subject: [PATCH 1724/2502] tech: support stop build --- .../projects/AbstractProjectProcessor.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 6bbf20c884..8326dccbfb 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -89,24 +89,24 @@ public void scheduleBuild(Cause cause, ParametersAction parametersAction) { } public void cancelBuild(Cause cause, ParametersAction parametersAction) { - String suiteId = (String) parametersAction.getParameter(UftConstants.SUITE_ID_PARAMETER_NAME).getValue(); - String suiteRunId = (String) parametersAction.getParameter(UftConstants.SUITE_RUN_ID_PARAMETER_NAME).getValue(); - String buildId = (String) parametersAction.getParameter(UftConstants.BUILD_ID_PARAMETER_NAME).getValue(); - logger.info("cancelBuild for suiteId=" + suiteId +", suiteRunId=" + suiteRunId); - + String suiteId = getParameterValueIfExist(parametersAction, UftConstants.SUITE_ID_PARAMETER_NAME); + String suiteRunId = getParameterValueIfExist(parametersAction, UftConstants.SUITE_RUN_ID_PARAMETER_NAME); + String buildId = getParameterValueIfExist(parametersAction, UftConstants.BUILD_ID_PARAMETER_NAME); if (job instanceof AbstractProject) { AbstractProject project = (AbstractProject) job; if (buildId != null) { + logger.info(String.format("cancelBuild for %s, buildId=%s", buildId)); AbstractBuild aBuild = ((AbstractProject) job).getBuild(buildId); + logger.info(String.format("cancelBuild for %s, buildId=%s - is done", buildId)); if (aBuild == null) { logger.warn(String.format("Cannot stop : build %s is not found", buildId)); return; } stopBuild(aBuild); } else { - + logger.info(String.format("cancelBuild for %s, suiteId=%s, suiteRunId=%s", job.getFullName(), suiteId, suiteRunId)); Queue queue = Jenkins.get().getQueue(); queue.getItems(project).forEach(item -> { item.getActions(ParametersAction.class).forEach(action -> { @@ -138,6 +138,15 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { } } + private String getParameterValueIfExist(ParametersAction parametersAction, String paramName){ + ParameterValue pv= parametersAction.getParameter(paramName); + if(pv!=null){ + return (String)pv.getValue(); + }else{ + return null; + } + } + private void stopBuild(AbstractBuild aBuild) { try { aBuild.doStop(); From 2ba14a31f5fd2d827fa9dbb0e38413965972c476 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 21 May 2021 15:05:23 +0300 Subject: [PATCH 1725/2502] tech: support stop build --- .../model/processors/projects/AbstractProjectProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 8326dccbfb..d7cda67d11 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -97,9 +97,9 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { AbstractProject project = (AbstractProject) job; if (buildId != null) { - logger.info(String.format("cancelBuild for %s, buildId=%s", buildId)); + logger.info(String.format("cancelBuild for %s, buildId=%s", job.getFullName(), buildId)); AbstractBuild aBuild = ((AbstractProject) job).getBuild(buildId); - logger.info(String.format("cancelBuild for %s, buildId=%s - is done", buildId)); + logger.info(String.format("cancelBuild for %s, buildId=%s - is done", job.getFullName(), buildId)); if (aBuild == null) { logger.warn(String.format("Cannot stop : build %s is not found", buildId)); return; From 345579a286bff3fb2db74f44105379b75fcfea7a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 21 May 2021 19:14:35 +0300 Subject: [PATCH 1726/2502] tech: support stop build --- .../processors/projects/AbstractProjectProcessor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index d7cda67d11..3396a0bc75 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -138,11 +138,11 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { } } - private String getParameterValueIfExist(ParametersAction parametersAction, String paramName){ - ParameterValue pv= parametersAction.getParameter(paramName); - if(pv!=null){ - return (String)pv.getValue(); - }else{ + private String getParameterValueIfExist(ParametersAction parametersAction, String paramName) { + ParameterValue pv = parametersAction.getParameter(paramName); + if (pv != null) { + return (String) pv.getValue(); + } else { return null; } } From 4ed3b623f8c7dd1d66d5dcfdd928933ce2b51022 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 24 May 2021 13:58:21 +0300 Subject: [PATCH 1727/2502] tech: support stop build --- .../tools/octane/CIJenkinsServicesImpl.java | 89 ++++++++++--------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index e112ebbd2f..e33514c158 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -668,54 +668,57 @@ private List createParameters(Job project, CIParameters ciParame boolean parameterHandled; ParameterValue tmpValue; ParametersDefinitionProperty paramsDefProperty = (ParametersDefinitionProperty) project.getProperty(ParametersDefinitionProperty.class); - if (paramsDefProperty != null) { - Map ciParametersMap = ciParameters.getParameters().stream().collect(Collectors.toMap(CIParameter::getName, Function.identity())); - for (ParameterDefinition paramDef : paramsDefProperty.getParameterDefinitions()) { - parameterHandled = false; - CIParameter ciParameter = ciParametersMap.remove(paramDef.getName()); - if (ciParameter != null) { - tmpValue = null; - switch (ciParameter.getType()) { - case NUMBER: - case STRING: - tmpValue = new StringParameterValue(ciParameter.getName(), ciParameter.getValue().toString()); - break; - case BOOLEAN: - tmpValue = new BooleanParameterValue(ciParameter.getName(), Boolean.parseBoolean(ciParameter.getValue().toString())); - break; - case PASSWORD: - tmpValue = new PasswordParameterValue(ciParameter.getName(), ciParameter.getValue().toString()); - break; - default: - break; - } - if (tmpValue != null) { - result.add(tmpValue); - parameterHandled = true; - } + + if (paramsDefProperty == null) { + paramsDefProperty = new ParametersDefinitionProperty(); + } + + Map ciParametersMap = ciParameters.getParameters().stream().collect(Collectors.toMap(CIParameter::getName, Function.identity())); + for (ParameterDefinition paramDef : paramsDefProperty.getParameterDefinitions()) { + parameterHandled = false; + CIParameter ciParameter = ciParametersMap.remove(paramDef.getName()); + if (ciParameter != null) { + tmpValue = null; + switch (ciParameter.getType()) { + case NUMBER: + case STRING: + tmpValue = new StringParameterValue(ciParameter.getName(), ciParameter.getValue().toString()); + break; + case BOOLEAN: + tmpValue = new BooleanParameterValue(ciParameter.getName(), Boolean.parseBoolean(ciParameter.getValue().toString())); + break; + case PASSWORD: + tmpValue = new PasswordParameterValue(ciParameter.getName(), ciParameter.getValue().toString()); + break; + default: + break; } - if (!parameterHandled) { - if (paramDef instanceof FileParameterDefinition) { - FileItemFactory fif = new DiskFileItemFactory(); - FileItem fi = fif.createItem(paramDef.getName(), "text/plain", false, ""); - try { - fi.getOutputStream().write(new byte[0]); - } catch (IOException ioe) { - logger.error("failed to create default value for file parameter '" + paramDef.getName() + "'", ioe); - } - tmpValue = new FileParameterValue(paramDef.getName(), fi); - result.add(tmpValue); - } else { - result.add(paramDef.getDefaultParameterValue()); + if (tmpValue != null) { + result.add(tmpValue); + parameterHandled = true; + } + } + if (!parameterHandled) { + if (paramDef instanceof FileParameterDefinition) { + FileItemFactory fif = new DiskFileItemFactory(); + FileItem fi = fif.createItem(paramDef.getName(), "text/plain", false, ""); + try { + fi.getOutputStream().write(new byte[0]); + } catch (IOException ioe) { + logger.error("failed to create default value for file parameter '" + paramDef.getName() + "'", ioe); } + tmpValue = new FileParameterValue(paramDef.getName(), fi); + result.add(tmpValue); + } else { + result.add(paramDef.getDefaultParameterValue()); } } + } - //add parameters that are not defined in job - for (CIParameter notDefinedParameter : ciParametersMap.values()) { - tmpValue = new StringParameterValue(notDefinedParameter.getName(), notDefinedParameter.getValue().toString()); - result.add(tmpValue); - } + //add parameters that are not defined in job + for (CIParameter notDefinedParameter : ciParametersMap.values()) { + tmpValue = new StringParameterValue(notDefinedParameter.getName(), notDefinedParameter.getValue().toString()); + result.add(tmpValue); } return result; } From 47941eab28bc5edfec09d2257a0db6b699f0c565 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Thu, 3 Jun 2021 11:09:02 +0800 Subject: [PATCH 1728/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-6.9 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 70af9bce9a..ec0e17fcd4 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.8.3-beta-SNAPSHOT + 6.9 hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-6.9 From b22c56c884c28422b93a1f961ee0a57101f51b19 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Thu, 3 Jun 2021 11:09:16 +0800 Subject: [PATCH 1729/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ec0e17fcd4..e1785c31dc 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 6.9 + 6.9.1-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-6.9 + micro-focus-application-automation-tools-plugin-5.5.4-beta From 05a3e453abd2147ada599b1998040a7c3a6657d1 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 6 Jun 2021 11:41:44 +0300 Subject: [PATCH 1730/2502] add MBT Runner --- HpToolsLauncher/HpToolsLauncher.csproj | 1 + .../JavaProperties/JavaProperties.cs | 12 ++ HpToolsLauncher/Launcher.cs | 29 ++- HpToolsLauncher/Program.cs | 1 + HpToolsLauncher/Runners/MBTRunner.cs | 170 ++++++++++++++++++ pom.xml | 4 +- .../tools/octane/CIJenkinsServicesImpl.java | 2 +- .../TestsToRunConverterBuilder.java | 104 ++++++++++- .../tools/octane/tests/HPRunnerType.java | 1 + .../detection/MFToolsDetectionExtension.java | 11 +- .../octane/tests/junit/JUnitExtension.java | 24 ++- .../octane/tests/junit/JUnitTestResult.java | 10 +- .../octane/tests/junit/JUnitXmlIterator.java | 46 ++++- .../octane/tests/xml/AbstractXmlIterator.java | 2 +- .../tools/run/RunFromFileBuilder.java | 4 +- .../actions/plugin/PluginActionsTest.java | 2 + .../octane/tests/TestResultIterator.java | 4 +- .../tests/xml/TestResultXmlWriterTest.java | 2 +- 18 files changed, 392 insertions(+), 37 deletions(-) create mode 100644 HpToolsLauncher/Runners/MBTRunner.cs diff --git a/HpToolsLauncher/HpToolsLauncher.csproj b/HpToolsLauncher/HpToolsLauncher.csproj index 1451a8eadc..88217d2a3a 100644 --- a/HpToolsLauncher/HpToolsLauncher.csproj +++ b/HpToolsLauncher/HpToolsLauncher.csproj @@ -117,6 +117,7 @@ True Resources.resx + diff --git a/HpToolsLauncher/JavaProperties/JavaProperties.cs b/HpToolsLauncher/JavaProperties/JavaProperties.cs index 1edd2c3635..2771cb9d94 100644 --- a/HpToolsLauncher/JavaProperties/JavaProperties.cs +++ b/HpToolsLauncher/JavaProperties/JavaProperties.cs @@ -53,6 +53,18 @@ public JavaProperties() } + public string GetOrDefault(string key, string defaultValue) + { + if (this.ContainsKey(key)) + { + return this[key]; + } + else + { + return defaultValue; + } + } + /// /// Creates an empty property list with the specified defaults. /// diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index b4f382519e..209a372ee0 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -281,9 +281,11 @@ public void Run() } TestSuiteRunResults results = runner.Run(); - - RunTests(runner, resultsFilename, results); - + + if (!_runType.Equals(TestStorageType.MBT)) + { + RunTests(runner, resultsFilename, results); + } if (_runType.Equals(TestStorageType.FileSystem)) { @@ -830,6 +832,27 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara break; + case TestStorageType.MBT: + string parentFolder = _ciParams["parentFolder"]; + + int counter = 1; + string testProp = "test" + counter; + List tests = new List(); + while (_ciParams.ContainsKey(testProp)) + { + MBTTest test = new MBTTest(); + tests.Add(test); + + test.Name = _ciParams[testProp]; + test.Script = _ciParams.GetOrDefault("script" + counter,""); + test.UnitIds = _ciParams.GetOrDefault("unitIds" + counter,""); + test.UnderlyingTests = new List(_ciParams.GetOrDefault("underlyingTests" + counter,"").Split(';')); + test.PackageName = _ciParams.GetOrDefault("package" + counter, ""); ; + testProp = "test" + (++counter); + } + + runner = new MBTRunner(parentFolder, tests); + break; default: runner = null; break; diff --git a/HpToolsLauncher/Program.cs b/HpToolsLauncher/Program.cs index 9927ea4f9c..9238e20d19 100644 --- a/HpToolsLauncher/Program.cs +++ b/HpToolsLauncher/Program.cs @@ -39,6 +39,7 @@ public enum TestStorageType AlmLabManagement, FileSystem, LoadRunner, + MBT, Unknown } diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs new file mode 100644 index 0000000000..dced1af5fb --- /dev/null +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -0,0 +1,170 @@ +using QTObjectModelLib; +using System; +using System.Collections.Generic; +using System.IO; + +namespace HpToolsLauncher +{ + public class MBTRunner : RunnerBase, IDisposable + { + private readonly object _lockObject = new object(); + private string parentFolder; + private IEnumerable tests; + + public MBTRunner(string parentFolder, IEnumerable tests) + { + this.parentFolder = parentFolder; + this.tests = tests; + } + + public override TestSuiteRunResults Run() + { + var type = Type.GetTypeFromProgID("Quicktest.Application"); + + lock (_lockObject) + { + Application _qtpApplication = Activator.CreateInstance(type) as Application; + try + { + if (Directory.Exists(parentFolder)) + { + Directory.Delete(parentFolder, true); + } + ConsoleWriter.WriteLine("Using parent folder : " + parentFolder); + } + catch (Exception e) + { + ConsoleWriter.WriteErrLine("Failed to delete parent folder : " + e.Message); + } + + Directory.CreateDirectory(parentFolder); + DirectoryInfo parentDir = new DirectoryInfo(parentFolder); + + try + { + if (_qtpApplication.Launched) + { + _qtpApplication.Quit(); + } + } + catch (Exception e) + { + ConsoleWriter.WriteErrLine("Failed to close qtpApp : " + e.Message); + } + + + + //START Test creation + //_qtpApplication.Launch(); + //_qtpApplication.Visible = false; + foreach (var test in tests) + { + DateTime startTotal = DateTime.Now; + ConsoleWriter.WriteLine("Creation of " + test.Name + " *****************************"); + LoadNeededAddins(_qtpApplication, test.UnderlyingTests); + + try + { + DateTime startSub1 = DateTime.Now; + + _qtpApplication.New(); + ConsoleWriter.WriteLine(string.Format("_qtpApplication.New took {0:0.0} secs", DateTime.Now.Subtract(startSub1).TotalSeconds)); + QTObjectModelLib.Action qtAction1 = _qtpApplication.Test.Actions[1]; + qtAction1.Description = "unitIds=" + string.Join(",", test.UnitIds); + + //https://myskillpoint.com/how-to-use-loadandrunaction-in-uft/#LoadAndRunAction_Having_Input-Output_Parameters + //LoadAndRunAction "E:\UFT_WorkSpace\TestScripts\SampleTest","Action1",0,"inputParam1","inputParam2",outParameterVal + //string actionContent = "LoadAndRunAction \"c:\\Temp\\GUITest2\\\",\"Action1\""; + string actionContent = File.Exists(test.Script) ? File.ReadAllText(test.Script) : test.Script; + qtAction1.ValidateScript(actionContent); + qtAction1.SetScript(actionContent); + + DirectoryInfo fullDir = parentDir; + if (!string.IsNullOrEmpty(test.PackageName)) + { + fullDir = fullDir.CreateSubdirectory(test.PackageName); + } + + string fullPath = fullDir.CreateSubdirectory(test.Name).FullName; + _qtpApplication.Test.SaveAs(fullPath); + double sec = DateTime.Now.Subtract(startTotal).TotalSeconds; + ConsoleWriter.WriteLine(string.Format("MBT test was created in {0} in {1:0.0} secs", fullPath, sec)); + + } + catch (Exception e) + { + ConsoleWriter.WriteErrLine("Fail in MBTRunner : " + e.Message); + } + } + if (_qtpApplication.Launched) + { + _qtpApplication.Quit(); + } + } + + return null; + } + + private void LoadNeededAddins(Application _qtpApplication, IEnumerable fileNames) + { + try + { + HashSet addinsSet = new HashSet(); + foreach (string fileName in fileNames) + { + try + { + DateTime start1 = DateTime.Now; + var testAddinsObj = _qtpApplication.GetAssociatedAddinsForTest(fileName); + ConsoleWriter.WriteLine(string.Format("GetAssociatedAddinsForTest took {0:0.0} secs", DateTime.Now.Subtract(start1).TotalSeconds)); + object[] tempTestAddins = (object[])testAddinsObj; + + foreach (string addin in tempTestAddins) + { + addinsSet.Add(addin); + } + } + catch (Exception testErr) + { + ConsoleWriter.WriteErrLine("Fail to LoadNeededAddins for : " + fileName + ", " + testErr.Message); + } + } + + //if (_qtpApplication.Launched) + //{ + //_qtpApplication.Quit(); + //ConsoleWriter.WriteLine("LoadNeededAddins : _qtpApplication.Quit"); + //} + + object erroDescription = null; + + string[] addinsArr = new string[addinsSet.Count]; + addinsSet.CopyTo(addinsArr); + ConsoleWriter.WriteLine("Loading Addins : " + string.Join(",", addinsArr)); + DateTime start2 = DateTime.Now; + _qtpApplication.SetActiveAddins(addinsArr, out erroDescription); + ConsoleWriter.WriteLine(String.Format("SetActiveAddins took {0:0.0} secs", DateTime.Now.Subtract(start2).TotalSeconds)); + if (!string.IsNullOrEmpty((string)erroDescription)) + { + ConsoleWriter.WriteErrLine("Fail to SetActiveAddins : " + erroDescription); + } + } + catch (Exception globalErr) + { + ConsoleWriter.WriteErrLine("Fail to LoadNeededAddins : " + globalErr.Message); + // Try anyway to run the test + } + } + } + + public class MBTTest + { + public string Name { get; set; } + public string Script { get; set; } + public string UnitIds { get; set; } + public List UnderlyingTests { get; set; } + public string PackageName { get; set; } + } + + +} diff --git a/pom.xml b/pom.xml index e1785c31dc..644b4561fc 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.jenkins-ci.plugins plugin - 3.43 + 3.57 hp-application-automation-tools-plugin @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.6.9.19 + 2.7.0.0 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index e112ebbd2f..65570357c6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -78,12 +78,12 @@ import hudson.maven.MavenModule; import hudson.model.*; import hudson.security.ACLContext; +import hudson.util.IOUtils; import jenkins.model.Jenkins; import org.acegisecurity.AccessDeniedException; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.apache.http.HttpStatus; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 7fb7fae932..29b0e333af 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -31,19 +31,20 @@ import com.hp.octane.integrations.executor.TestsToRunConverterResult; import com.hp.octane.integrations.executor.TestsToRunConvertersFactory; import com.hp.octane.integrations.executor.TestsToRunFramework; +import com.hp.octane.integrations.executor.converters.MbtTest; +import com.hp.octane.integrations.executor.converters.MfUftConverter; import com.hp.octane.integrations.utils.SdkStringUtils; +import com.microfocus.application.automation.tools.AlmToolsUtils; import com.microfocus.application.automation.tools.model.TestsFramework; import com.microfocus.application.automation.tools.octane.configuration.ConfigurationValidator; import com.microfocus.application.automation.tools.octane.executor.UftConstants; import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; -import hudson.Extension; -import hudson.FilePath; -import hudson.Launcher; -import hudson.Util; +import hudson.*; import hudson.model.*; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; import hudson.util.FormValidation; +import jenkins.model.Jenkins; import jenkins.tasks.SimpleBuildStep; import org.apache.commons.lang.StringUtils; import org.jenkinsci.Symbol; @@ -51,9 +52,14 @@ import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; +import java.io.*; +import java.net.URL; +import java.text.Format; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +import static com.microfocus.application.automation.tools.run.RunFromFileBuilder.HP_TOOLS_LAUNCHER_EXE; /** * Builder for available frameworks for converting @@ -135,6 +141,10 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu TestsToRunConverterResult convertResult = TestsToRunConvertersFactory.createConverter(testsToRunFramework) .setFormat(frameworkFormat) .convert(rawTests, executingDirectory); + + if (convertResult.getMbtTests() != null) { + createMTBTests(convertResult.getMbtTests(), build, filePath, launcher, listener); + } printToConsole(listener, "Found #tests : " + convertResult.getTestsData().size()); printToConsole(listener, "Set to parameter : " + convertResult.getTestsToRunConvertedParameterName() + " = " + convertResult.getConvertedTestsString()); printToConsole(listener, "********************* Convertion is done *********************"); @@ -155,6 +165,82 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } } + private void createMTBTests(List tests, @Nonnull Run build, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws IOException, InterruptedException { + build.getRootDir(); + Properties props = new Properties(); + props.setProperty("runType", "MBT"); + props.setProperty("resultsFilename", "must be here"); + + props.setProperty("parentFolder", workspace.getRemote() +"\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + int counter = 1; + + EnvVars env = build.getEnvironment(listener); + for (MbtTest mbtTest : tests) { + props.setProperty("test" + counter, mbtTest.getName()); + props.setProperty("package" + counter, "_" + counter); + props.setProperty("script" + counter, env.expand(mbtTest.getScript())); + props.setProperty("unitIds" + counter, mbtTest.getUnitIds().stream().map( n -> n.toString() ).collect(Collectors.joining(";" ) )); + props.setProperty("underlyingTests" + counter, env.expand((String.join(";", mbtTest.getUnderlyingTests())))); + counter++; + } + + //prepare time + Date now = new Date(); + Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); + String time = formatter.format(now); + + // get properties serialized into a stream + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + try { + props.store(stream, ""); + } catch (IOException e) { + listener.error("Storing props failed: " + e); + build.setResult(Result.FAILURE); + } + String propsSerialization = stream.toString(); + InputStream propsStream = new ByteArrayInputStream(propsSerialization.getBytes()); + String paramFileName = "mbt_props" + time + ".txt"; + FilePath propsFileName = workspace.child(paramFileName); + + //HP Tool Launcher + URL cmdExeUrl = Jenkins.get().pluginManager.uberClassLoader.getResource(HP_TOOLS_LAUNCHER_EXE); + if (cmdExeUrl == null) { + listener.fatalError(HP_TOOLS_LAUNCHER_EXE + " not found in resources"); + return; + } + FilePath cmdLineExe = workspace.child(HP_TOOLS_LAUNCHER_EXE); + + + try { + // create a file for the properties file, and save the properties + propsFileName.copyFrom(propsStream); + printToConsole(listener, "MBT props file saved to " + propsFileName.getRemote()); + + // Copy the script to the project workspace + if (!cmdLineExe.exists()) { + cmdLineExe.copyFrom(cmdExeUrl); + printToConsole(listener, "HPToolLauncher copied to " + cmdLineExe.getRemote()); + } else { + printToConsole(listener, "HPToolLauncher already exist in " + cmdLineExe.getRemote()); + } + + } catch (IOException | InterruptedException e) { + build.setResult(Result.FAILURE); + listener.error("Copying executable files to executing node " + e); + } + + try { + // Run the HpToolsLauncher.exe + AlmToolsUtils.runOnBuildEnv(build, launcher, listener, cmdLineExe, paramFileName); + // Has the report been successfully generated? + } catch (IOException ioe) { + Util.displayIOException(ioe, listener); + build.setResult(Result.FAILURE); + listener.error("Failed running HpToolsLauncher " + ioe); + return; + } + } + /*** * Used in UI * @return @@ -179,8 +265,8 @@ public boolean getIsCustom() { return framework != null && TestsToRunFramework.Custom.value().equals(framework.getFramework().getName()); } - private void printToConsole(TaskListener listener, String msg) { - listener.getLogger().println(this.getClass().getSimpleName() + " : " + msg); + private static void printToConsole(TaskListener listener, String msg) { + listener.getLogger().println(TestsToRunConverterBuilder.class.getSimpleName() + " : " + msg); } @Symbol("convertTestsToRun") diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/HPRunnerType.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/HPRunnerType.java index 7ef4e0eed6..1e58b6b6c3 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/HPRunnerType.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/HPRunnerType.java @@ -34,6 +34,7 @@ public enum HPRunnerType { StormRunnerLoad, UFT, + UFT_MBT, PerformanceCenter, LoadRunner, NONE diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/detection/MFToolsDetectionExtension.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/detection/MFToolsDetectionExtension.java index f5f3c57238..284b3679e3 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/detection/MFToolsDetectionExtension.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/detection/MFToolsDetectionExtension.java @@ -57,6 +57,7 @@ public class MFToolsDetectionExtension extends ResultFieldsDetectionExtension { private static final String RUN_FROM_ALM_BUILDER = "RunFromAlmBuilder"; private static final String UFT = "UFT"; + public static final String UFT_MBT = "MBT"; private static final String STORMRUNNER_LOAD = "StormRunner Load"; private static final String LOAD_RUNNER = "LoadRunner"; private static final String PERFORMANCE_CENTER_RUNNER = "Performance Center"; @@ -77,6 +78,7 @@ public class MFToolsDetectionExtension extends ResultFieldsDetectionExtension { runnerType2ResultFields.put(HPRunnerType.PerformanceCenter, new ResultFields(null, PERFORMANCE_CENTER_RUNNER, null, PERFORMANCE_TEST_TYPE)); runnerType2ResultFields.put(HPRunnerType.UFT, new ResultFields(UFT, UFT, null)); + runnerType2ResultFields.put(HPRunnerType.UFT_MBT, new ResultFields(UFT_MBT, null, null)); runnerType2ResultFields.put(HPRunnerType.StormRunnerLoad, new ResultFields(null, STORMRUNNER_LOAD, null)); runnerType2ResultFields.put(HPRunnerType.LoadRunner, new ResultFields(null, LOAD_RUNNER, null)); } @@ -103,8 +105,9 @@ public ResultFields detect(Run build) throws IOException, InterruptedExcep */ public static HPRunnerType getRunnerType(Run run) { HPRunnerType hpRunnerType = HPRunnerType.NONE; + ParametersAction parameterAction = run.getAction(ParametersAction.class); if (JobProcessorFactory.WORKFLOW_RUN_NAME.equals(run.getClass().getName())) { - ParametersAction parameterAction = run.getAction(ParametersAction.class); + ParameterValue runnerTypePv = parameterAction != null ? parameterAction.getParameter(HPRunnerType.class.getSimpleName()) : null; if (runnerTypePv != null) { hpRunnerType = HPRunnerType.valueOf((String) runnerTypePv.getValue()); @@ -122,6 +125,12 @@ public static HPRunnerType getRunnerType(Run run) { } } + if (hpRunnerType == HPRunnerType.UFT) { + ParameterValue octaneFramework = parameterAction != null ? parameterAction.getParameter("octaneTestRunnerFramework") : null; + if(octaneFramework!=null && octaneFramework.getValue().equals("MBT")){ + hpRunnerType = HPRunnerType.UFT_MBT; + } + } if (hpRunnerType == HPRunnerType.UFT && isLoadRunnerProject(run)) { hpRunnerType = HPRunnerType.LoadRunner; } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java index c378c09959..96095b8f51 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java @@ -105,7 +105,18 @@ public TestResultContainer getTestResults(Run run, String jenkinsRootUrl) return null; } - FilePath filePath = workspace.act(new GetJUnitTestResults(run, Collections.singletonList(resultFile), false, jenkinsRootUrl)); + boolean getResultsOnMaster = false; + HPRunnerType hpRunnerType = MFToolsDetectionExtension.getRunnerType(run); + if(hpRunnerType.equals(HPRunnerType.UFT) || hpRunnerType.equals(HPRunnerType.UFT_MBT)){ + getResultsOnMaster = true; + } + FilePath filePath; + if (getResultsOnMaster) { + filePath = (new GetJUnitTestResults(run, hpRunnerType, Collections.singletonList(resultFile), false, jenkinsRootUrl)).invoke(null, null); + } else { + filePath = workspace.act(new GetJUnitTestResults(run, hpRunnerType, Collections.singletonList(resultFile), false, jenkinsRootUrl)); + } + ResultFields detectedFields = getResultFields(run); return new TestResultContainer(new ObjectStreamIterator<>(filePath), detectedFields); } else { @@ -127,7 +138,7 @@ public TestResultContainer getTestResults(Run run, String jenkinsRootUrl) } if (!resultFiles.isEmpty()) { ResultFields detectedFields = getResultFields(run); - FilePath filePath = BuildHandlerUtils.getWorkspace(run).act(new GetJUnitTestResults(run, resultFiles, false, jenkinsRootUrl)); + FilePath filePath = BuildHandlerUtils.getWorkspace(run).act(new GetJUnitTestResults(run, HPRunnerType.NONE, resultFiles, false, jenkinsRootUrl)); return new TestResultContainer(new ObjectStreamIterator<>(filePath), detectedFields); } } @@ -158,17 +169,17 @@ private static class GetJUnitTestResults implements FilePath.FileCallable build, List reports, boolean stripPackageAndClass, String jenkinsRootUrl) throws IOException, InterruptedException { + public GetJUnitTestResults(Run build, HPRunnerType hpRunnerType, List reports, boolean stripPackageAndClass, String jenkinsRootUrl) throws IOException, InterruptedException { this.reports = reports; this.filePath = new FilePath(build.getRootDir()).createTempFile(TEMP_TEST_RESULTS_FILE_NAME_PREFIX, null); this.buildStarted = build.getStartTimeInMillis(); this.workspace = BuildHandlerUtils.getWorkspace(build); this.stripPackageAndClass = stripPackageAndClass; - this.hpRunnerType = MFToolsDetectionExtension.getRunnerType(build); + this.hpRunnerType = hpRunnerType; this.jenkinsRootUrl = jenkinsRootUrl; String buildRootDir = build.getRootDir().getCanonicalPath(); this.sharedCheckOutDirectory = CheckOutSubDirEnvContributor.getSharedCheckOutDirectory(build.getParent()); - if (sharedCheckOutDirectory == null && HPRunnerType.UFT.equals(hpRunnerType)) { + if (sharedCheckOutDirectory == null && (HPRunnerType.UFT.equals(hpRunnerType) || HPRunnerType.UFT_MBT.equals(hpRunnerType))) { ParametersAction parameterAction = build.getAction(ParametersAction.class); ParameterValue pv = parameterAction != null ? parameterAction.getParameter(UftConstants.UFT_CHECKOUT_FOLDER) : null; sharedCheckOutDirectory = pv != null && pv instanceof StringParameterValue ? @@ -183,11 +194,12 @@ public GetJUnitTestResults(Run build, List reports, boolean stri new ModuleDetection.Default()); - if (HPRunnerType.UFT.equals(hpRunnerType)) { + if (HPRunnerType.UFT.equals(hpRunnerType) || HPRunnerType.UFT_MBT.equals(hpRunnerType)) { //extract folder names for created tests String reportFolder = buildRootDir + "/archive/UFTReport"; List testFolderNames = new ArrayList<>(); + testFolderNames.add(build.getRootDir().getAbsolutePath()); File reportFolderFile = new File(reportFolder); if (reportFolderFile.exists()) { File[] children = reportFolderFile.listFiles(); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java index dc18bf7a6a..28c3482508 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitTestResult.java @@ -30,6 +30,8 @@ import com.hp.octane.integrations.testresults.XmlWritableTestResult; import com.hp.octane.integrations.utils.SdkStringUtils; +import com.microfocus.application.automation.tools.octane.tests.HPRunnerType; +import com.microfocus.application.automation.tools.octane.tests.detection.MFToolsDetectionExtension; import org.apache.commons.lang.StringUtils; import javax.xml.stream.XMLStreamException; @@ -52,8 +54,10 @@ final public class JUnitTestResult implements Serializable, XmlWritableTestResul private final long started; private final TestError testError; private final String externalReportUrl; + private final HPRunnerType runnerType; - public JUnitTestResult(String moduleName, String packageName, String className, String testName, TestResultStatus result, long duration, long started, TestError testError, String externalReportUrl, String description) { + + public JUnitTestResult(String moduleName, String packageName, String className, String testName, TestResultStatus result, long duration, long started, TestError testError, String externalReportUrl, String description, HPRunnerType runnerType) { this.moduleName = restrictSize(moduleName, DEFAULT_STRING_SIZE); this.packageName = restrictSize(packageName, DEFAULT_STRING_SIZE); this.className = restrictSize(className, DEFAULT_STRING_SIZE); @@ -68,6 +72,7 @@ public JUnitTestResult(String moduleName, String packageName, String className, this.testError = testError; this.externalReportUrl = externalReportUrl; this.description = description; + this.runnerType = runnerType; } private String restrictSize(String value, int size) { @@ -125,6 +130,9 @@ public void writeXmlElement(XMLStreamWriter writer) throws XMLStreamException { if(externalReportUrl != null && !externalReportUrl.isEmpty()) { writer.writeAttribute("external_report_url", externalReportUrl); } + if (HPRunnerType.UFT_MBT.equals(runnerType)) { + writer.writeAttribute("run_type", MFToolsDetectionExtension.UFT_MBT); + } if (result.equals(TestResultStatus.FAILED) && testError != null) { writer.writeStartElement("error"); writer.writeAttribute("type", String.valueOf(testError.getErrorType())); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index 3660b82618..76e36b8a00 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -31,6 +31,8 @@ import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.tests.Property; import com.hp.octane.integrations.dto.tests.TestSuite; +import com.hp.octane.integrations.executor.converters.MfUftConverter; +import com.hp.octane.integrations.uft.ufttestresults.UftTestResultsUtils; import com.hp.octane.integrations.utils.SdkConstants; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; import com.microfocus.application.automation.tools.octane.tests.HPRunnerType; @@ -77,6 +79,7 @@ public class JUnitXmlIterator extends AbstractXmlIterator { private String errorType; private String errorMsg; private String externalURL; + private String uftResultFilePath; private String description; private List moduleDetection; private String jenkinsRootUrl; @@ -140,6 +143,7 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I errorMsg = ""; externalURL = ""; description = ""; + uftResultFilePath = ""; moduleName = moduleNameFromFile; } else if ("className".equals(localName)) { // NON-NLS String fqn = readNextValue(); @@ -159,8 +163,9 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I } else if ("stdout".equals(localName)) { String stdoutValue = readNextValue(); if (stdoutValue != null) { - if (hpRunnerType.equals(HPRunnerType.UFT) && stdoutValue.contains("Test result: Warning")) { + if ((hpRunnerType.equals(HPRunnerType.UFT) || hpRunnerType.equals(HPRunnerType.UFT_MBT)) && stdoutValue.contains("Test result: Warning")) { errorMsg = "Test ended with 'Warning' status."; + parseUftErrorMessages(); } externalURL = extractValueFromStdout(stdoutValue, "__octane_external_url_start__", "__octane_external_url_end__", externalURL); @@ -172,7 +177,7 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I testName = testName.substring(0, testName.length() - 2); } - if (hpRunnerType.equals(HPRunnerType.UFT)) { + if (hpRunnerType.equals(HPRunnerType.UFT)|| hpRunnerType.equals(HPRunnerType.UFT_MBT)) { if (testName != null && testName.contains("..")) { //resolve existence of ../ - for example c://a/../b => c://b testName = new File(testName).getCanonicalPath(); } @@ -187,8 +192,13 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I // currently this handling is needed for UFT tests int uftTextIndexStart = getUftTestIndexStart(workspace, sharedCheckOutDirectory, testName); if (uftTextIndexStart != -1) { - String path = testName.substring(uftTextIndexStart); - path = path.replace(SdkConstants.FileSystem.LINUX_PATH_SPLITTER, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); + String path = testName.substring(uftTextIndexStart).replace(SdkConstants.FileSystem.LINUX_PATH_SPLITTER, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER);; + if(path.startsWith(MfUftConverter.MBT_PARENT_SUB_DIR)){//remove MBT prefix + //mbt test located in two level folder : ___mbt/_order + path = path.substring(MfUftConverter.MBT_PARENT_SUB_DIR.length()+1);//remove ___mbt + path = path.substring(path.indexOf(SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER));//remove order part + } + path = StringUtils.strip(path, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); //split path to package and name fields @@ -218,8 +228,9 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I testReportCreated = optional.isPresent(); } - workspace.createTextTempFile("build" + buildId + "." + cleanTestName(testName) + ".", "", "Created " + testReportCreated); + //workspace.createTextTempFile("build" + buildId + "." + cleanTestName(testName) + ".", "", "Created " + testReportCreated); if (testReportCreated) { + uftResultFilePath = ((List) additionalContext).get(0) +"\\archive\\UFTReport\\" + cleanedTestName + "\\run_results.xml"; externalURL = jenkinsRootUrl + "job/" + jobName + "/" + buildId + "/artifact/UFTReport/" + cleanedTestName + "/run_results.html"; } else { //if UFT didn't created test results page - add reference to Jenkins test results page @@ -260,7 +271,9 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I if (index >= 0) { errorType = stackTraceStr.substring(0, index); } - + if ((hpRunnerType.equals(HPRunnerType.UFT)|| hpRunnerType.equals(HPRunnerType.UFT_MBT)) && StringUtils.isNotEmpty(errorMsg)) { + parseUftErrorMessages(); + } } } else if (event instanceof EndElement) { EndElement element = (EndElement) event; @@ -270,14 +283,31 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I TestError testError = new TestError(stackTraceStr, errorType, errorMsg); if (stripPackageAndClass) { //workaround only for UFT - we do not want packageName="All-Tests" and className="<None>" as it comes from JUnit report - addItem(new JUnitTestResult(moduleName, "", "", testName, status, duration, buildStarted, testError, externalURL, description)); + addItem(new JUnitTestResult(moduleName, "", "", testName, status, duration, buildStarted, testError, externalURL, description, hpRunnerType)); } else { - addItem(new JUnitTestResult(moduleName, packageName, className, testName, status, duration, buildStarted, testError, externalURL, description)); + addItem(new JUnitTestResult(moduleName, packageName, className, testName, status, duration, buildStarted, testError, externalURL, description, hpRunnerType)); } } } } + + private void parseUftErrorMessages() { + try { + if (StringUtils.isNotEmpty(uftResultFilePath)) { + String msg = UftTestResultsUtils.getAggregatedErrorMessage(UftTestResultsUtils.getErrorData(new File(uftResultFilePath))); + if (msg.length() >= 255) { + msg = msg.substring(0, 250) +" ..."; + } + if (StringUtils.isNotEmpty(msg)) { + errorMsg = msg; + } + } + } catch (Exception e) { + logger.error("Failed to parseUftErrorMessages" + e.getMessage()); + } + } + private static String tryGetStormRunnerReportURLFromLog(Collection logLines) { //console contains link to report //link start with "View report:" diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java index 86be0b3bc8..48d49f9c07 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java @@ -28,7 +28,7 @@ package com.microfocus.application.automation.tools.octane.tests.xml; -import org.apache.commons.io.IOUtils; +import hudson.util.IOUtils; import javax.xml.stream.XMLEventReader; import javax.xml.stream.XMLInputFactory; diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index 0aadd5f925..bdc8e210c0 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -43,11 +43,11 @@ import hudson.tasks.Builder; import hudson.tasks.BuildStepDescriptor; import hudson.util.FormValidation; +import hudson.util.IOUtils; import hudson.util.VariableResolver; import jenkins.model.Jenkins; import jenkins.tasks.SimpleBuildStep; import net.minidev.json.JSONObject; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; @@ -68,7 +68,7 @@ * Describes a regular jenkins build step from UFT or LR */ public class RunFromFileBuilder extends Builder implements SimpleBuildStep { - private static final String HP_TOOLS_LAUNCHER_EXE = "HpToolsLauncher.exe"; + public static final String HP_TOOLS_LAUNCHER_EXE = "HpToolsLauncher.exe"; private static final String LRANALYSIS_LAUNCHER_EXE = "LRAnalysisLauncher.exe"; private String ResultFilename = "ApiResults.xml"; private String ParamFileName = "ApiRun.txt"; diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/actions/plugin/PluginActionsTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/actions/plugin/PluginActionsTest.java index 5ba1936e46..dad1052aaf 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/actions/plugin/PluginActionsTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/actions/plugin/PluginActionsTest.java @@ -40,6 +40,7 @@ import com.microfocus.application.automation.tools.octane.tests.TestUtils; import hudson.model.*; import jenkins.model.Jenkins; +import org.junit.Ignore; import org.junit.Test; import org.xml.sax.SAXException; @@ -68,6 +69,7 @@ public void testPluginActionsMethods() { assertEquals("nga", pluginActions.getUrlName()); } + @Ignore("temp ignore") @Test public void testPluginActions_REST_Status() throws IOException, SAXException { Page page = client.goTo("nga/api/v1/status", "application/json"); diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/TestResultIterator.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/TestResultIterator.java index 053b818d75..87bb442aa1 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/TestResultIterator.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/TestResultIterator.java @@ -30,7 +30,7 @@ import com.microfocus.application.automation.tools.octane.tests.junit.JUnitTestResult; import com.microfocus.application.automation.tools.octane.tests.junit.TestResultStatus; -import org.apache.commons.io.IOUtils; +import hudson.util.IOUtils; import javax.xml.namespace.QName; import javax.xml.stream.XMLEventReader; @@ -78,7 +78,7 @@ public boolean hasNext() { long duration = Long.valueOf(element.getAttributeByName(new QName("duration")).getValue()); TestResultStatus status = TestResultStatus.fromPrettyName(element.getAttributeByName(new QName("status")).getValue()); long started = Long.valueOf(element.getAttributeByName(new QName("started")).getValue()); - items.add(new JUnitTestResult(moduleName, packageName, className, testName, status, duration, started, null, null, null)); + items.add(new JUnitTestResult(moduleName, packageName, className, testName, status, duration, started, null, null, null,null)); } else if ("build".equals(localName)) { attribute = element.getAttributeByName(new QName("server_id")); if (attribute != null) { diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java index 0a634a2987..9cf1c2ebff 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/xml/TestResultXmlWriterTest.java @@ -69,7 +69,7 @@ public class TestResultXmlWriterTest extends OctanePluginTestBase { @BeforeClass public static void initialize() { List testResults = new ArrayList<>(); - testResults.add(new JUnitTestResult("module", "package", "class", "testName", TestResultStatus.PASSED, 1, 2, null, null, null)); + testResults.add(new JUnitTestResult("module", "package", "class", "testName", TestResultStatus.PASSED, 1, 2, null, null, null, null)); container = new TestResultContainer(testResults.iterator(), new ResultFields()); OctaneServerMock serverMock = OctaneServerMock.getInstance(); OctaneServerSettingsModel model = new OctaneServerSettingsModel( From 57f4958a308fc987f901cdd8fda40de77d53e2df Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Mon, 7 Jun 2021 14:14:29 +0300 Subject: [PATCH 1731/2502] Update WhatsNewEarlier.md --- doc/WhatsNewEarlier.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/WhatsNewEarlier.md b/doc/WhatsNewEarlier.md index f8f9341c49..6d2db051b8 100644 --- a/doc/WhatsNewEarlier.md +++ b/doc/WhatsNewEarlier.md @@ -5,6 +5,8 @@ This page shows a history of the enhancements made to the Micro Focus Applicatio See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for information about beta versions and recent patches. +[What's New in versions 6.7, 6.8](#what's-new-in-versions-6.7-and-6.8) + [What's New in version 6.6](#what's-new-in-version-6.6) [What's New in version 6.5](#what's-new-in-version-6.5) @@ -17,6 +19,32 @@ See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for infor [What's New in version 5.9](#what's-new-in-version-5.9) +## What's New in versions 6.7 and 6.8 + +Versions 6.7 and 6.8 introduced the following enhancements: + +**General** + +- Security fixes: Security issues noted in the *Jenkins Security Advisory 2021-04-07* were addressed. For details, search for SECURITY-2132, SECURITY-2175, and SECURITY-2176 in the [Jenkins Security Advisory 2021-04-07 page](https://www.jenkins.io/security/advisory/2021-04-07/). (Version 6.8) +- Added support for the FOD plugin version 6.1.0. +- SonarQube integration: A new option was added to the Sonar pre-build step to skip automatic webhook configuration. (This allows you to run the integration without admin permissions.) + - Added XSRF protection for running with Lab, Upload result, and Common result upload for compatibility with new versions of ALM. + +**ALM Octane – UFT Integration** + +- Reduced the length of the folder name for checkout of auto-generated execution jobs. +- [Bug fix] Ability to execute UFT tests not located in job workspace. To show the test name correctly in ALM Octane, define the "UFT_CHECKOUT_FOLDER" parameter. +- [Bug fix] For the Spanish Windows slave: The duration of a UFT test in Jenkins now displays correctly, in seconds. + +**ALM Octane** + +- Added the option to inject pull requests to ALM Octane with repository in SSH format. +- Auto-fill: After injection of pull-requests, templates related to SCM repositories are auto-filled in ALM Octane (Settings > Spaces-> DevOps > SCM Repositories). + +**LRE (LoadRunner Enterprise)** + +- The build step “Execute performance test using LoadRunner Enterprise†can authenticate to LoadRunner Enterprise using an access key (available from LoadRunner Enterprise 2021 R1). + ## What's New in version 6.6 Version 6.6 introduced the following enhancements: From 79176c14aef1a51de54817726d4175f5d420c579 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Mon, 7 Jun 2021 14:24:35 +0300 Subject: [PATCH 1732/2502] Update README.md --- doc/README.md | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/doc/README.md b/doc/README.md index eb689788cd..d54a957945 100644 --- a/doc/README.md +++ b/doc/README.md @@ -49,34 +49,21 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j Starting with version 1.641 (or 1.625.3), Jenkins introduced the **Content-Security-Policy** header. This causes some of the integration links, such as links to reports, to become inoperable. For details, see [Configuring Content Security Policy](https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy) and [Jenkins Security Advisory ](https://jenkins.io/security/advisory/2015-12-09/). For suggested workarounds until the issue is resolved, see [Content Security Policy Header](#content-security-policy-header). -## New Features and Enhancements in Versions 6.7, 6.8 +## New Features and Enhancements in Version 6.9 -Versions 6.7 and 6.8 introduced the following enhancements: - -**General** - -- Security fixes: Security issues noted in the *Jenkins Security Advisory 2021-04-07* were addressed. For details, search for SECURITY-2132, SECURITY-2175, and SECURITY-2176 in the [Jenkins Security Advisory 2021-04-07 page](https://www.jenkins.io/security/advisory/2021-04-07/). (Version 6.8) -- Added support for the FOD plugin version 6.1.0. -- SonarQube integration: A new option was added to the Sonar pre-build step to skip automatic webhook configuration. (This allows you to run the integration without admin permissions.) - - Added XSRF protection for running with Lab, Upload result, and Common result upload for compatibility with new versions of ALM. - -**ALM Octane – UFT Integration** - -- Reduced the length of the folder name for checkout of auto-generated execution jobs. -- [Bug fix] Ability to execute UFT tests not located in job workspace. To show the test name correctly in ALM Octane, define the "UFT_CHECKOUT_FOLDER" parameter. -- [Bug fix] For the Spanish Windows slave: The duration of a UFT test in Jenkins now displays correctly, in seconds. +Version 6.9 introduced the following enhancements: **ALM Octane** -- Added the option to inject pull requests to ALM Octane with repository in SSH format. -- Auto-fill: After injection of pull-requests, templates related to SCM repositories are auto-filled in ALM Octane (Settings > Spaces-> DevOps > SCM Repositories). +- Enabled branch publisher +- Support added for Java 11 -**LRE (LoadRunner Enterprise)** +**Workarounds** -- The build step “Execute performance test using LoadRunner Enterprise†can authenticate to LoadRunner Enterprise using an access key (available from LoadRunner Enterprise 2021 R1). +- For running UFTM tests from UFT One: If UFTM tests fail in UFT One after changing the UFTM server version in the Jenkins configuration, manually restart UFT One and run the test again. -For information about enhancements introduced in previous versions, see [What's new in earlier versions](WhatsNewEarlier.md). +For more information about enhancements introduced in previous versions, see [What's new in earlier versions](WhatsNewEarlier.md). ## Changelog From 4ae38ed976d392c3a9efd95702263b0453c68e52 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 9 Jun 2021 11:33:58 +0300 Subject: [PATCH 1733/2502] support CHECKOUT_DIRECTORY_PARAMETER when create MBT test --- .../octane/testrunner/TestsToRunConverterBuilder.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 29b0e333af..03f8f5eeaa 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -171,10 +171,17 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn props.setProperty("runType", "MBT"); props.setProperty("resultsFilename", "must be here"); + EnvVars env = build.getEnvironment(listener); + props.setProperty("parentFolder", workspace.getRemote() +"\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + ParametersAction parameterAction = build.getAction(ParametersAction.class); + ParameterValue checkoutDirParameter = parameterAction.getParameter(CHECKOUT_DIRECTORY_PARAMETER); + if (checkoutDirParameter != null) { + props.setProperty("parentFolder", env.expand((String)checkoutDirParameter.getValue()) +"\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + } + int counter = 1; - EnvVars env = build.getEnvironment(listener); for (MbtTest mbtTest : tests) { props.setProperty("test" + counter, mbtTest.getName()); props.setProperty("package" + counter, "_" + counter); From d21450bc97f64f1bd4ece0368738ed754c8d8b33 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 10 Jun 2021 10:07:51 +0300 Subject: [PATCH 1734/2502] tech : adding example of setting datatable parameter --- HpToolsLauncher/Runners/MBTRunner.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index dced1af5fb..e2112c930f 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -84,7 +84,11 @@ public override TestSuiteRunResults Run() { fullDir = fullDir.CreateSubdirectory(test.PackageName); } - + + //_qtpApplication.Test.DataTable.GlobalSheet.AddParameter("Time", "5:46"); + //_qtpApplication.Test.DataTable.GetSheet("Action1").AddParameter("Time", "6:46"); + + string fullPath = fullDir.CreateSubdirectory(test.Name).FullName; _qtpApplication.Test.SaveAs(fullPath); double sec = DateTime.Now.Subtract(startTotal).TotalSeconds; From e439bf9e3a86b99dad778f245289795896ce7dc5 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 13 Jun 2021 11:05:13 +0300 Subject: [PATCH 1735/2502] tech : add log of branches in commit --- .../tools/octane/model/processors/scm/GitSCMProcessor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index 5875bf7e87..fcb83d69de 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -73,6 +73,7 @@ import java.io.IOException; import java.text.MessageFormat; import java.util.*; +import java.util.stream.Collectors; /** * Created by gullery on 31/03/2015. @@ -213,6 +214,12 @@ private SCMRepository getRepository(Run run, GitSCM gitData) { url = (String) buildData.getRemoteUrls().toArray()[0]; } if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { + try { + logger.warn("Commits for " + run.getFullDisplayName().replaceAll(" » ", "/") + " - found branches : " + buildData.getLastBuiltRevision().getBranches() + .stream().map(b -> b.getName()).collect(Collectors.joining(","))); + } catch (Exception e){ + logger.warn("Failed to take branch names for " + run.getFullDisplayName() +" : " + e.getMessage()); + } branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); } result = dtoFactory.newDTO(SCMRepository.class) From d36a2959e66f06101674aef4063c3ba111f86daf Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 14 Jun 2021 10:05:25 +0300 Subject: [PATCH 1736/2502] Revert "tech : add log of branches in commit" This reverts commit e439bf9e --- .../tools/octane/model/processors/scm/GitSCMProcessor.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index fcb83d69de..5875bf7e87 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -73,7 +73,6 @@ import java.io.IOException; import java.text.MessageFormat; import java.util.*; -import java.util.stream.Collectors; /** * Created by gullery on 31/03/2015. @@ -214,12 +213,6 @@ private SCMRepository getRepository(Run run, GitSCM gitData) { url = (String) buildData.getRemoteUrls().toArray()[0]; } if (buildData.getLastBuiltRevision() != null && !buildData.getLastBuiltRevision().getBranches().isEmpty()) { - try { - logger.warn("Commits for " + run.getFullDisplayName().replaceAll(" » ", "/") + " - found branches : " + buildData.getLastBuiltRevision().getBranches() - .stream().map(b -> b.getName()).collect(Collectors.joining(","))); - } catch (Exception e){ - logger.warn("Failed to take branch names for " + run.getFullDisplayName() +" : " + e.getMessage()); - } branch = ((Branch) buildData.getLastBuiltRevision().getBranches().toArray()[0]).getName(); } result = dtoFactory.newDTO(SCMRepository.class) From da0448b98364cdc8e967d8414093be5eeed3820e Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 15 Jun 2021 10:06:40 +0300 Subject: [PATCH 1737/2502] tech : adding datatable params for MBT --- HpToolsLauncher/Launcher.cs | 3 ++- HpToolsLauncher/Runners/MBTRunner.cs | 23 ++++++++++++++++--- .../TestsToRunConverterBuilder.java | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 209a372ee0..f710562b8f 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -847,7 +847,8 @@ private IAssetRunner CreateRunner(TestStorageType runType, JavaProperties ciPara test.Script = _ciParams.GetOrDefault("script" + counter,""); test.UnitIds = _ciParams.GetOrDefault("unitIds" + counter,""); test.UnderlyingTests = new List(_ciParams.GetOrDefault("underlyingTests" + counter,"").Split(';')); - test.PackageName = _ciParams.GetOrDefault("package" + counter, ""); ; + test.PackageName = _ciParams.GetOrDefault("package" + counter, ""); + test.DatableParams = _ciParams.GetOrDefault("datableParams" + counter, ""); testProp = "test" + (++counter); } diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index e2112c930f..a83132ebc3 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text; namespace HpToolsLauncher { @@ -85,9 +86,24 @@ public override TestSuiteRunResults Run() fullDir = fullDir.CreateSubdirectory(test.PackageName); } - //_qtpApplication.Test.DataTable.GlobalSheet.AddParameter("Time", "5:46"); - //_qtpApplication.Test.DataTable.GetSheet("Action1").AddParameter("Time", "6:46"); + //_qtpApplication.Test.DataTable.GlobalSheet.AddParameter("Time", "5:46"); + //Expects to receive params in CSV format, encoded base64 + if (!string.IsNullOrEmpty(test.DatableParams)) + { + string tempCsvFileName = Path.Combine(parentFolder, "temp.csv"); + if (File.Exists(tempCsvFileName)) + { + File.Delete(tempCsvFileName); + } + + byte[] data = Convert.FromBase64String(test.DatableParams); + string decodedParams = Encoding.UTF8.GetString(data); + + File.WriteAllText(tempCsvFileName, decodedParams); + _qtpApplication.Test.DataTable.Import(tempCsvFileName); + File.Delete(tempCsvFileName); + } string fullPath = fullDir.CreateSubdirectory(test.Name).FullName; _qtpApplication.Test.SaveAs(fullPath); @@ -147,7 +163,7 @@ private void LoadNeededAddins(Application _qtpApplication, IEnumerable f ConsoleWriter.WriteLine("Loading Addins : " + string.Join(",", addinsArr)); DateTime start2 = DateTime.Now; _qtpApplication.SetActiveAddins(addinsArr, out erroDescription); - ConsoleWriter.WriteLine(String.Format("SetActiveAddins took {0:0.0} secs", DateTime.Now.Subtract(start2).TotalSeconds)); + ConsoleWriter.WriteLine(string.Format("SetActiveAddins took {0:0.0} secs", DateTime.Now.Subtract(start2).TotalSeconds)); if (!string.IsNullOrEmpty((string)erroDescription)) { ConsoleWriter.WriteErrLine("Fail to SetActiveAddins : " + erroDescription); @@ -168,6 +184,7 @@ public class MBTTest public string UnitIds { get; set; } public List UnderlyingTests { get; set; } public string PackageName { get; set; } + public string DatableParams { get; set; } } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 03f8f5eeaa..7043f026a3 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -188,6 +188,9 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn props.setProperty("script" + counter, env.expand(mbtTest.getScript())); props.setProperty("unitIds" + counter, mbtTest.getUnitIds().stream().map( n -> n.toString() ).collect(Collectors.joining(";" ) )); props.setProperty("underlyingTests" + counter, env.expand((String.join(";", mbtTest.getUnderlyingTests())))); + + //Expects to receive params in CSV format, encoded base64, for example Y29sMSxjb2wyCjEsMwoyLDQK + props.setProperty("datableParams" + counter, "Y29sMSxjb2wyCjEsMwoyLDQK"); counter++; } From 95596a9b1f9db56317a2625e5bfbf25bd4379c61 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 16 Jun 2021 14:25:28 +0300 Subject: [PATCH 1738/2502] DEF-618172 [Jenkins Plug-in] Dysfunctional "Environment Wizard" button for "UFT parallel running mode" --- src/main/webapp/parallelRunnerEnvironment.js | 1346 +++++++++--------- 1 file changed, 662 insertions(+), 684 deletions(-) diff --git a/src/main/webapp/parallelRunnerEnvironment.js b/src/main/webapp/parallelRunnerEnvironment.js index a3af3278d2..945a3055d8 100644 --- a/src/main/webapp/parallelRunnerEnvironment.js +++ b/src/main/webapp/parallelRunnerEnvironment.js @@ -1,684 +1,662 @@ -/* - * Certain versions of software and/or documents ("Material") accessible here may contain branding from - * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, - * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP - * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE - * marks are the property of their respective owners. - * __________________________________________________________________ - * MIT License - * - * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ___________________________________________________________________ - */ - - -/** - * Prototype that represents the modal dialog. - * @constructor - */ -function ModalDialog() {} - -/** - * Add the style sheet to the provided modal node. - * @param modalCSS the modal style sheet link - */ -ModalDialog.addStyleSheet = function(modalCSS) { - var link = document.createElement("link"); - Utils.addStyleSheet(link,modalCSS); - document.head.appendChild(link); -}; - -/** - * Sets the environment wizard button. - * @param envWizardButton the environment wizard button - */ -ModalDialog.setEnvironmentWizardButton = function(envWizardButton){ - ModalDialog.envWizardButton = envWizardButton; -}; - -/** - * Generate the browser item for the browsers dialog. - * @param iconSrc the icons source - * @param browserId the id of the browser - * @param labelText the label text - * @param checked true if the radio should be checked, false otherwise - * @returns {*} - */ -ModalDialog.generateBrowserItem = function(iconSrc,browserId,labelText,checked) { - var browserRadio = document.createElement("input"); - browserRadio.setAttribute("class","browser-item-child customRadio"); - browserRadio.setAttribute("type","radio"); - browserRadio.setAttribute("name","browser-radio"); - - if(checked) { - browserRadio.setAttribute("checked", "true"); - } - - browserRadio.setAttribute("id",browserId); - - var browserImage = document.createElement("img"); - browserImage.setAttribute("class","browser-item-child"); - browserImage.setAttribute("src",iconSrc); - - var browserItem = document.createElement("div"); - browserItem.setAttribute("class","browser-item"); - - var browserLabel = document.createElement("div"); - browserLabel.setAttribute("class","browser-item-child browser-name"); - browserLabel.innerHTML = labelText; - - browserItem.appendChild(browserRadio); - browserItem.appendChild(browserImage); - browserItem.appendChild(browserLabel); - - return browserItem; -}; - -ModalDialog.saveBrowserSettings = function(modalNode) { - // retrieve the button that was used to open the env wizard - var button = ModalDialog.envWizardButton; - - var radioButtons = modalNode.querySelectorAll('input[type="radio"]'); - - for(var i =0; i < radioButtons.length;i++) { - if(radioButtons[i].checked) { - ParallelRunnerEnvironment.setUpBrowserEnvironment(button,radioButtons[i],modalNode); - } - } -}; - -ModalDialog.setSelectedBrowser = function(modal,browserId){ - if(ModalDialog.browsers == null) return false; - - // check if the provided browser id matches any of the available browsers - var selectedBrowser = null; - for(var i = 0; i < ModalDialog.browsers.length; i++) { - if(ModalDialog.browsers[i].toLowerCase() === browserId.toLowerCase()) { - selectedBrowser = ModalDialog.browsers[i]; - } - } - - // no match, select the default one - if(selectedBrowser == null) return false; - - var radioButton = modal.querySelector("input[id=" + selectedBrowser + "]"); - - if(radioButton == null) return false; - - // set the corresponding radio button to be checked - radioButton.checked = true; - - return true; -}; - -/** - * Hide the modal with the given modalId. - * @param modalId the modal id - * @returns {boolean} true if the modal was hidden, false otherwise - */ -ModalDialog.hide = function(modalId) { - var modal = document.getElementById(modalId); - - if(modal == null) return false; - - modal.style.display = "none"; -}; - -/** - * Generate the modal dialog - * @constructor - */ -ModalDialog.generate = function(path) { - var modalCSS = path + "plugin/hp-application-automation-tools-plugin/css/PARALLEL_RUNNER_UI.css"; - - // add the css style - ModalDialog.addStyleSheet(modalCSS); - - var browsersModal = document.createElement("div"); - browsersModal.setAttribute("id","browsersModal"); - browsersModal.setAttribute("class","modal"); - - var modalContent = document.createElement("div"); - modalContent.setAttribute("class","modal-content"); - - var modalHeader = document.createElement("div"); - modalHeader.setAttribute("class","modal-header"); - - var span = document.createElement("div"); - span.innerHTML = "x"; - span.setAttribute("class","close"); - span.setAttribute("onclick","ModalDialog.hide('browsersModal')"); - - var title = document.createElement("div"); - title.innerHTML = "Choose a browser"; - title.setAttribute("class","modal-title"); - - var modalBody = document.createElement("div"); - modalBody.setAttribute("class","modal-body"); - - var iconsSRC = path + "plugin/hp-application-automation-tools-plugin/ParallelRunner/icons/"; - - var chromeBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/chrome.svg','Chrome','Chrome',true); - var firefoxBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox','Firefox',false); - var firefox64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox64','Firefox 64',false); - var ieBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE','IE',false); - var ie64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE64','IE 64',false); - - // retain the available browsers - ModalDialog.browsers = ["Chrome","Firefox","Firefox64","IE","IE64"]; - - // add the browser items to the modal body - modalBody.appendChild(chromeBrowserItem); - modalBody.appendChild(firefoxBrowserItem); - modalBody.appendChild(firefox64BrowserItem); - modalBody.appendChild(ieBrowserItem); - modalBody.appendChild(ie64BrowserItem); - - var saveText = document.createElement('div'); - saveText.innerHTML = "SAVE"; - saveText.setAttribute("class","save-text"); - saveText.setAttribute("id","save-btn"); - saveText.setAttribute("onclick",'ModalDialog.saveBrowserSettings(browsersModal)'); - - var modalFooter = document.createElement("div"); - modalFooter.setAttribute("class","modal-footer"); - - modalFooter.appendChild(saveText); - modalHeader.appendChild(span); - modalHeader.appendChild(title); - modalContent.appendChild(modalHeader); - modalContent.appendChild(modalBody); - modalContent.appendChild(modalFooter); - browsersModal.appendChild(modalContent); - - return browsersModal; -}; - -/** - * Multi-purpose utils class. - * @constructor - */ -function Utils() {} - -/** - * Find the ancestor of a control by a given tag. - * @param start - the node from where to start. - * @param tag - the tag of the ancestor to find. - * @returns {HTMLElement} - */ -Utils.findAncestorByTag = function(start,tag) { - while((start = start.parentElement) && !(start.tagName.toLowerCase() === tag.toLowerCase())) {} - return start; -}; - -/** - * Check if a string is empty. - * @param str the string to check - * @returns {boolean} - */ -Utils.isEmptyString = function(str) { - return (!str || str.length === 0); -}; - -Utils.addStyleSheet = function(elem,sheetHref) { - elem.setAttribute("rel","stylesheet"); - elem.setAttribute("type","text/css"); - elem.setAttribute("href",sheetHref); -}; - -/** - * Parse the information received for MobileCenter. - * @param deviceId - the deviceId string - * @param os - the os string - * @param manufacturerAndModel - the manufacturer and model string - * @returns {string} the parsed information. - */ -Utils.parseMCInformation = function(deviceId, os, manufacturerAndModel) { - var mc_params = []; - var os_types = {android : 'Android', ios: 'ios', wp : 'Windows Phone'}; - - if(!Utils.isEmptyString(deviceId)) - mc_params.push({name: 'deviceId', value: deviceId}); - else { - if (!Utils.isEmptyString(os)) { - // regex for the os string - // example: ios<=10.2.2 => we need to extract ios,<=,10.2.2 - var regex = /([a-z]+)(>=|>|<|<=)*([0-9].*[0-9])+/gi; - var match = regex.exec(os); - - if (match == null) { // string does not contain a version - mc_params.push({name: 'osType', value: os_types[os]}); - mc_params.push({name: 'osVersion', value: 'any'}); - } - else { // version was given to us - mc_params.push({name: 'osType', value: os_types[match[1]]}); - mc_params.push({name: 'osVersion', value: match[2] == null ? match[3] : match[2] + match[3]}); - } - } - } - - if(!Utils.isEmptyString(manufacturerAndModel)) - mc_params.push({name: 'manufacturerAndModel', value: manufacturerAndModel}); - - var result_str = ""; - for(var i = 0; i < mc_params.length; i++) { - result_str = result_str.concat(mc_params[i].name, " : ", mc_params[i].value, (i===mc_params.length - 1) ? "" : ","); - } - return result_str; -}; - -/** - * Set the provided jenkins element visibility. - * @param element the jenkins element to be hidden - * @param visible the element visibility state - */ -Utils.setJenkinsElementVisibility = function(element,visible) { - var parent = Utils.findAncestorByTag(element,'tr'); - - if(visible === false) { - parent.style.display = "none"; - } - else{ - parent.style.display = ""; - } -}; - -/** - * Load the mobile center wizard. - * @param a descriptor - * @param path the url path - * @param button the environment wizard button - */ -Utils.loadMC = function(a,path,button){ - var buttonStatus = false; - if(buttonStatus) return; - buttonStatus = true; - var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; - var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; - var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; - var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; - var useProxy = document.getElementsByName("proxySettings")[0].checked; - var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; - var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; - var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; - var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; - var baseUrl = ""; - if(mcUserName == '' || mcPassword == ''|| (useProxy && proxyAddress == '') || (useAuthentication && (proxyUserName == '' || proxyPassword == ''))){ - ParallelRunnerEnvironment.setEnvironmentError(button,true); - buttonStatus = false; - return; - } - var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; - a.getMcServerUrl(mcUrl, function(r){ - baseUrl = r.responseObject(); - a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { - var jobResponse = response.responseObject(); - if(jobResponse == null){ - ParallelRunnerEnvironment.setEnvironmentError(button,true); - buttonStatus = false; - return; - } - var openedWindow = window.open('/','test parameters','height=820,width=1130'); - openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl+path+jobResponse+'&displayUFTMode=true&deviceOnly=true'; - var messageCallBack = function (event) { - if (event && event.data && event.data=="mcCloseWizard") { - a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobResponse, function (app) { - var jobInfo = app.responseObject(); - var deviceId = ""; - var OS = ""; - var manufacturerAndModel = ""; - if(jobInfo['deviceJSON']){ - if(jobInfo['deviceJSON']['deviceId']){ - deviceId = jobInfo['deviceJSON']['deviceId']; - } - if(jobInfo['deviceJSON']['OS']){ - OS = jobInfo['deviceJSON']['OS']; - } - if(jobInfo['deviceJSON']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; - } - } - if(jobInfo['deviceCapability']){ - if(jobInfo['deviceCapability']['OS']){ - OS = jobInfo['deviceCapability']['OS']; - } - if(jobInfo['deviceCapability']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; - } - } - console.log(deviceId); - ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,Utils.parseMCInformation(deviceId,OS,manufacturerAndModel)); - - buttonStatus = false; - ParallelRunnerEnvironment.setEnvironmentError(button,false); - window.removeEventListener("message",messageCallBack, false); - openedWindow.close(); - }); - } - }; - window.addEventListener("message", messageCallBack ,false); - function checkChild() { - if (openedWindow && openedWindow.closed) { - clearInterval(timer); - buttonStatus = false; - } - } - var timer = setInterval(checkChild, 500); - }); - }); - -}; - -/** - * Prototype that represents the ParallelRunner environment. - * @constructor - */ -function ParallelRunnerEnvironment() {} - -/** - * - * @param button - * @returns {*} - */ -ParallelRunnerEnvironment.getEnvironmentSettingsInputNode = function (button) { - // jelly represents each item as a tr - // with data inside - var parent = Utils.findAncestorByTag(button._button, 'tr'); - - if (parent == null) return null; - - var settingInput = parent.getElementsByClassName("setting-input ")[0]; - - if(settingInput == null) return null; - - return settingInput; -}; - -/** - * Set the environment text box input to the given input value, - * the input corresponds to the clicked environment wizard button. - * @param button the clicked environment wizard button - * @param inputValue the input value to be set - * @returns {boolean} true if it succeeded, false otherwise. - */ -ParallelRunnerEnvironment.setEnvironmentSettingsInput = function(button,inputValue) { - var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); - - if(settingInput == null) return false; - - settingInput.value = inputValue; - - return true; -}; -/** - * - * @param button - * @returns {null} - */ -ParallelRunnerEnvironment.getEnvironmentSettingsInputValue = function(button) { - // jelly represents each item as a tr - // with data inside - var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); - - if(settingInput == null) return null; - - return settingInput.value; -}; - -/** - * Enable the error div that corresponds to the clicked - * environment wizard button. - * @param button the environment wizard button - * @param enable the div visibility state(true - visible, false - hidden) - * @returns {boolean} true if it succeeded, false otherwise. - */ -ParallelRunnerEnvironment.setEnvironmentError = function(button, enable) { - var parent = Utils.findAncestorByTag(button._button, 'tr'); - - if(parent == null) return false; - - var errorDiv = parent.querySelector('div[name="mcSettingsError"'); - - if(!enable) { - errorDiv.style.display = "none"; // hide error - } - else { - errorDiv.style.display = "block"; // display error - } -}; - -/** - * Set the browser selection modal visibility. - * @param button - the environment button - * @param modalId - the browser modal id - * @param visible - should the modal be visible?(true / false) - * @param path - the patch to the root of the plugin - */ -ParallelRunnerEnvironment.setBrowsersModalVisibility = function(button,modalId,visible,path) { - var modal = document.getElementById(modalId); - - // it wasn't generated, so we need to generate it - if(modal == null) { - // generate it - modal = ModalDialog.generate(path); - - // add it to the DOM - document.body.appendChild(modal); - } - - ModalDialog.setEnvironmentWizardButton(button); - - modal = document.getElementById(modalId); - - var environmentInputValue = ParallelRunnerEnvironment.getEnvironmentSettingsInputValue(button); - - // set the selected browser to match the one in the input - if(environmentInputValue != null) { - var browser = environmentInputValue.split(":"); - - // should be of the form browser: BrowserName - if(browser != null && browser.length === 2) - { - ModalDialog.setSelectedBrowser (modal,browser[1].trim()); - } - } - - if(visible) { - modal.style.display = "block"; - - // also allow the user to hide it by clicking anywhere on the window - window.onclick = function(event) { - if (event.target === modal) { - modal.style.display = "none"; - } - }; - } - else - modal.style.display = "none"; -}; - -/** - * Determine the currently selected environment type. - * @param button - the environment wizard button - * @returns {*} - */ -ParallelRunnerEnvironment.GetCurrentEnvironmentType = function(button) { - var parent = Utils.findAncestorByTag(button._button,"td"); - - if(parent == null) return null; - - var inputs = parent.querySelectorAll('input[type="radio"'); - - if(inputs == null) return null; - - // find the checked input and return it's value - for(var i = 0; i < inputs.length; i++) { - if(inputs[i].checked === true) { - return inputs[i].defaultValue; - } - } - - return null; -}; - -/** - * Set the environment text based on the browser selection. - * @param button - the environment button - * @param radio - the selected radio - * @param modal - the browser selection modal - */ -ParallelRunnerEnvironment.setUpBrowserEnvironment = function(button,radio,modal) { - // we can close the modal now - modal.style.display = "none"; - // based on the browser chosen we will prepare the environment - ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,"browser : " + radio['id']); -}; - -/** - * Sets the environment and test set visibility based on the parallel runner checkBox state. - * @param index - the current build index - */ -ParallelRunnerEnvironment.setEnvironmentsVisibility = function(index) { - var fsTests = document.getElementsByName("runfromfs.fsTests")[index]; - var parent = Utils.findAncestorByTag(fsTests,"tbody"); - var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; - var environment = parent.querySelectorAll("div[name='fileSystemTestSet'")[0]; - - if(environment == null) return; - - Utils.setJenkinsElementVisibility(environment,check.checked); -}; - -/** - * Click handler for the environment wizard button. - * @param button the environment wizard button - * @param a first mc argument - * @param modalId the browser modalId to be shown - * @param visibility of the modal - * @param pluginPath the ${root} path - * @returns {boolean} - */ -ParallelRunnerEnvironment.onEnvironmentWizardClick = function(button,a,modalId,visibility,pluginPath) { - // get the environment type for the current env - // could be: 'web' or 'mobile' - var type = ParallelRunnerEnvironment.GetCurrentEnvironmentType(button); - - if(type == null) return false; - - // if the type is web we need to show the browsers modal - if(type.toLowerCase() === 'web') { - ParallelRunnerEnvironment.setBrowsersModalVisibility(button,modalId,visibility,pluginPath); - return true; - } - - // open the mobile center wizard - if(type.toLowerCase() === 'mobile') { - Utils.loadMC(a,'/integration/#/login?jobId=',button); - return true; - } - - return false; -}; - -/** - * Utility class for the RunFromFileSystem model. - * @constructor - */ -function RunFromFileSystemEnvironment() {} - -/** - * Sets the visibility of a given multi line text box. - * @param index the textbox build index - * @param name the textbox name - */ -RunFromFileSystemEnvironment.setMultiLineTextBoxVisibility = function(index, name) { - var textBox = document.getElementsByName(name)[index]; - var parentElement = textBox.parentElement; - var parent = Utils.findAncestorByTag(textBox,"tr"); - - // when the text box is not expanded - if(!parentElement.classList.contains("setting-main")) { - parent = Utils.findAncestorByTag(parent,'tr'); - } - - var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; - - if(check.checked) { - parent.style.display = "none"; - } - else { - parent.style.display = ""; - } -}; - -/** - * Sets the visibility of a given text box. - * @param index the textbox build index - * @param name the textbox name - */ -RunFromFileSystemEnvironment.setTextBoxVisibility = function(index, name) { - var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; - var textBox = document.getElementsByName(name)[index]; - - Utils.setJenkinsElementVisibility(textBox,!check.checked); -}; - -/** - * Sets the fsTests visibility based on the parallel runner checkBox state. - * @param index - the current build index - */ -RunFromFileSystemEnvironment.setFsTestsVisibility = function(index) { - this.setMultiLineTextBoxVisibility(index, "runfromfs.fsTests"); -}; - -/** - * Sets the fsReportPath visibility based on the parallel runner checkBox state. - * @param index - the current build index - */ -RunFromFileSystemEnvironment.setFsReportPathVisibility = function(index) { - this.setTextBoxVisibility(index, "runfromfs.fsReportPath"); -}; - -/** - * Sets the fsTimeout visibility based on the parallel runner checkbox state. - * @param index the current build index. - */ -RunFromFileSystemEnvironment.setTimeoutVisibility = function (index) { - this.setTextBoxVisibility(index, "runfromfs.fsTimeout"); -}; - -/** - * Hide/Show the corresponding controls based on the parallel runner checkBox state. - */ -function setViewVisibility() { - var parallelRuns = document.getElementsByName("runfromfs.isParallelRunnerEnabled"); - - // go over all the available builds and set their corresponding - // visibilities based on the parallel runner state - for(var i = 0; i < parallelRuns.length; i++) { - RunFromFileSystemEnvironment.setFsTestsVisibility(i); - RunFromFileSystemEnvironment.setTimeoutVisibility(i); - RunFromFileSystemEnvironment.setFsReportPathVisibility(i); - ParallelRunnerEnvironment.setEnvironmentsVisibility(i); - } -} - -document.addEventListener('DOMContentLoaded', function() { - setViewVisibility(); -}, false); +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ___________________________________________________________________ + */ + +/** + * Prototype that represents the modal dialog. + * @constructor + */ +function ModalDialog() {} + +/** + * Add the style sheet to the provided modal node. + * @param modalCSS the modal style sheet link + */ +ModalDialog.addStyleSheet = function(modalCSS) { + var link = document.createElement("link"); + Utils.addStyleSheet(link,modalCSS); + document.head.appendChild(link); +}; + +/** + * Sets the environment wizard button. + * @param envWizardButton the environment wizard button + */ +ModalDialog.setEnvironmentWizardButton = function(envWizardButton){ + ModalDialog.envWizardButton = envWizardButton; +}; + +/** + * Generate the browser item for the browsers dialog. + * @param iconSrc the icons source + * @param browserId the id of the browser + * @param labelText the label text + * @param checked true if the radio should be checked, false otherwise + * @returns {*} + */ +ModalDialog.generateBrowserItem = function(iconSrc,browserId,labelText,checked) { + var browserRadio = document.createElement("input"); + browserRadio.setAttribute("class","browser-item-child customRadio"); + browserRadio.setAttribute("type","radio"); + browserRadio.setAttribute("name","browser-radio"); + + if(checked) { + browserRadio.setAttribute("checked", "true"); + } + + browserRadio.setAttribute("id",browserId); + + var browserImage = document.createElement("img"); + browserImage.setAttribute("class","browser-item-child"); + browserImage.setAttribute("src",iconSrc); + + var browserItem = document.createElement("div"); + browserItem.setAttribute("class","browser-item"); + + var browserLabel = document.createElement("div"); + browserLabel.setAttribute("class","browser-item-child browser-name"); + browserLabel.innerHTML = labelText; + + browserItem.appendChild(browserRadio); + browserItem.appendChild(browserImage); + browserItem.appendChild(browserLabel); + + return browserItem; +}; + +ModalDialog.saveBrowserSettings = function(modalNode) { + // retrieve the button that was used to open the env wizard + var button = ModalDialog.envWizardButton; + + var radioButtons = modalNode.querySelectorAll('input[type="radio"]'); + + for(var i =0; i < radioButtons.length;i++) { + if(radioButtons[i].checked) { + ParallelRunnerEnvironment.setUpBrowserEnvironment(button,radioButtons[i],modalNode); + } + } +}; + +ModalDialog.setSelectedBrowser = function(modal,browserId){ + if(ModalDialog.browsers == null) return false; + + // check if the provided browser id matches any of the available browsers + var selectedBrowser = null; + for(var i = 0; i < ModalDialog.browsers.length; i++) { + if(ModalDialog.browsers[i].toLowerCase() === browserId.toLowerCase()) { + selectedBrowser = ModalDialog.browsers[i]; + } + } + + // no match, select the default one + if(selectedBrowser == null) return false; + + var radioButton = modal.querySelector("input[id=" + selectedBrowser + "]"); + + if(radioButton == null) return false; + + // set the corresponding radio button to be checked + radioButton.checked = true; + + return true; +}; + +/** + * Hide the modal with the given modalId. + * @param modalId the modal id + * @returns {boolean} true if the modal was hidden, false otherwise + */ +ModalDialog.hide = function(modalId) { + var modal = document.getElementById(modalId); + + if(modal == null) return false; + + modal.style.display = "none"; +}; + +/** + * Generate the modal dialog + * @constructor + */ +ModalDialog.generate = function(path) { + var modalCSS = path + "plugin/hp-application-automation-tools-plugin/css/PARALLEL_RUNNER_UI.css"; + + // add the css style + ModalDialog.addStyleSheet(modalCSS); + + var browsersModal = document.createElement("div"); + browsersModal.setAttribute("id","browsersModal"); + browsersModal.setAttribute("class","modal"); + + var modalContent = document.createElement("div"); + modalContent.setAttribute("class","modal-content"); + + var modalHeader = document.createElement("div"); + modalHeader.setAttribute("class","modal-header"); + + var span = document.createElement("div"); + span.innerHTML = "x"; + span.setAttribute("class","close"); + span.setAttribute("onclick","ModalDialog.hide('browsersModal')"); + + var title = document.createElement("div"); + title.innerHTML = "Choose a browser"; + title.setAttribute("class","modal-title"); + + var modalBody = document.createElement("div"); + modalBody.setAttribute("class","modal-body"); + + var iconsSRC = path + "plugin/hp-application-automation-tools-plugin/ParallelRunner/icons/"; + + var chromeBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/chrome.svg','Chrome','Chrome',true); + var firefoxBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox','Firefox',false); + var firefox64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox64','Firefox 64',false); + var ieBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE','IE',false); + var ie64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE64','IE 64',false); + + // retain the available browsers + ModalDialog.browsers = ["Chrome","Firefox","Firefox64","IE","IE64"]; + + // add the browser items to the modal body + modalBody.appendChild(chromeBrowserItem); + modalBody.appendChild(firefoxBrowserItem); + modalBody.appendChild(firefox64BrowserItem); + modalBody.appendChild(ieBrowserItem); + modalBody.appendChild(ie64BrowserItem); + + var saveText = document.createElement('div'); + saveText.innerHTML = "SAVE"; + saveText.setAttribute("class","save-text"); + saveText.setAttribute("id","save-btn"); + saveText.setAttribute("onclick",'ModalDialog.saveBrowserSettings(browsersModal)'); + + var modalFooter = document.createElement("div"); + modalFooter.setAttribute("class","modal-footer"); + + modalFooter.appendChild(saveText); + modalHeader.appendChild(span); + modalHeader.appendChild(title); + modalContent.appendChild(modalHeader); + modalContent.appendChild(modalBody); + modalContent.appendChild(modalFooter); + browsersModal.appendChild(modalContent); + + return browsersModal; +}; + +/** + * Multi-purpose utils class. + * @constructor + */ +function Utils() {} + +/** + * Find the ancestor of a control by a given tag. + * @param start - the node from where to start. + * @param tag - the tag of the ancestor to find. + * @returns {HTMLElement} + */ +Utils.findAncestorByTag = function(start,tag) { + tag = tag.toLowerCase(); + while((start = start.parentElement) && !(start.tagName.toLowerCase() === tag)) {} + return start; +}; + +/** + * Find the ancestor of a control by a given name. + * @param start - the node from where to start. + * @param tag - the tag of the ancestor to find. + * @param name - the name attribute value of the ancestor to find. + * @returns {HTMLElement} + */ +Utils.findAncestorByTagAndName = function(start,tag,name) { + tag = tag.toLowerCase(); + while((start = start.parentElement) && start != null && !(start.tagName.toLowerCase() === tag && start.getAttribute("name") === name)) {} + return start; +}; +/** + * Check if a string is empty. + * @param str the string to check + * @returns {boolean} + */ +Utils.isEmptyString = function(str) { + return (!str || str.length === 0); +}; + +Utils.addStyleSheet = function(elem,sheetHref) { + elem.setAttribute("rel","stylesheet"); + elem.setAttribute("type","text/css"); + elem.setAttribute("href",sheetHref); +}; + +/** + * Parse the information received for MobileCenter. + * @param deviceId - the deviceId string + * @param os - the os string + * @param manufacturerAndModel - the manufacturer and model string + * @returns {string} the parsed information. + */ +Utils.parseMCInformation = function(deviceId, os, manufacturerAndModel) { + var mc_params = []; + var os_types = {android : 'Android', ios: 'ios', wp : 'Windows Phone'}; + + if(!Utils.isEmptyString(deviceId)) + mc_params.push({name: 'deviceId', value: deviceId}); + else { + if (!Utils.isEmptyString(os)) { + // regex for the os string + // example: ios<=10.2.2 => we need to extract ios,<=,10.2.2 + var regex = /([a-z]+)(>=|>|<|<=)*([0-9].*[0-9])+/gi; + var match = regex.exec(os); + + if (match == null) { // string does not contain a version + mc_params.push({name: 'osType', value: os_types[os]}); + mc_params.push({name: 'osVersion', value: 'any'}); + } + else { // version was given to us + mc_params.push({name: 'osType', value: os_types[match[1]]}); + mc_params.push({name: 'osVersion', value: match[2] == null ? match[3] : match[2] + match[3]}); + } + } + } + + if(!Utils.isEmptyString(manufacturerAndModel)) + mc_params.push({name: 'manufacturerAndModel', value: manufacturerAndModel}); + + var result_str = ""; + for(var i = 0; i < mc_params.length; i++) { + result_str = result_str.concat(mc_params[i].name, " : ", mc_params[i].value, (i===mc_params.length - 1) ? "" : ","); + } + return result_str; +}; + +/** + * Set the provided jenkins element visibility. + * @param element the jenkins element to be hidden + * @param visible the element visibility state + */ +Utils.setJenkinsElementVisibility = function(element,visible) { + var parent = Utils.findAncestorByTag(element,'tr'); + + if(visible === false) { + parent.style.display = "none"; + } + else{ + parent.style.display = ""; + } +}; + +/** + * Load the mobile center wizard. + * @param a descriptor + * @param path the url path + * @param button the environment wizard button + */ +Utils.loadMC = function(a,path,button){ + var buttonStatus = false; + if(buttonStatus) return; + buttonStatus = true; + var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; + var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; + var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; + var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; + var useProxy = document.getElementsByName("proxySettings")[0].checked; + var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; + var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; + var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; + var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; + var baseUrl = ""; + if(mcUserName == '' || mcPassword == ''|| (useProxy && proxyAddress == '') || (useAuthentication && (proxyUserName == '' || proxyPassword == ''))){ + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } + var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; + a.getMcServerUrl(mcUrl, function(r){ + baseUrl = r.responseObject(); + a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { + var jobResponse = response.responseObject(); + if(jobResponse == null){ + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } + var openedWindow = window.open('/','test parameters','height=820,width=1130'); + openedWindow.location.href = 'about:blank'; + openedWindow.location.href = baseUrl+path+jobResponse+'&displayUFTMode=true&deviceOnly=true'; + var messageCallBack = function (event) { + if (event && event.data && event.data=="mcCloseWizard") { + a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobResponse, function (app) { + var jobInfo = app.responseObject(); + var deviceId = ""; + var OS = ""; + var manufacturerAndModel = ""; + if(jobInfo['deviceJSON']){ + if(jobInfo['deviceJSON']['deviceId']){ + deviceId = jobInfo['deviceJSON']['deviceId']; + } + if(jobInfo['deviceJSON']['OS']){ + OS = jobInfo['deviceJSON']['OS']; + } + if(jobInfo['deviceJSON']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; + } + } + if(jobInfo['deviceCapability']){ + if(jobInfo['deviceCapability']['OS']){ + OS = jobInfo['deviceCapability']['OS']; + } + if(jobInfo['deviceCapability']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; + } + } + console.log(deviceId); + ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,Utils.parseMCInformation(deviceId,OS,manufacturerAndModel)); + + buttonStatus = false; + ParallelRunnerEnvironment.setEnvironmentError(button,false); + window.removeEventListener("message",messageCallBack, false); + openedWindow.close(); + }); + } + }; + window.addEventListener("message", messageCallBack ,false); + function checkChild() { + if (openedWindow && openedWindow.closed) { + clearInterval(timer); + buttonStatus = false; + } + } + var timer = setInterval(checkChild, 500); + }); + }); + +}; + +/** + * Prototype that represents the ParallelRunner environment. + * @constructor + */ +function ParallelRunnerEnvironment() {} + +/** + * + * @param button + * @returns {*} + */ +ParallelRunnerEnvironment.getEnvironmentSettingsInputNode = function (button) { + // jelly represents each item as a 'div' with data inside + var parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); + if (parent == null) return null; + return parent.querySelector(".setting-input"); +}; + +/** + * Set the environment text box input to the given input value, + * the input corresponds to the clicked environment wizard button. + * @param button the clicked environment wizard button + * @param inputValue the input value to be set + * @returns {boolean} true if it succeeded, false otherwise. + */ +ParallelRunnerEnvironment.setEnvironmentSettingsInput = function(button,inputValue) { + var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); + + if(settingInput == null) return false; + + settingInput.value = inputValue; + + return true; +}; +/** + * + * @param button + * @returns {null} + */ +ParallelRunnerEnvironment.getEnvironmentSettingsInputValue = function(button) { + // jelly represents each item as a 'div' with data inside + var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); + if(settingInput == null) return null; + return settingInput.value; +}; + +/** + * Enable the error div that corresponds to the clicked + * environment wizard button. + * @param button the environment wizard button + * @param enable the div visibility state(true - visible, false - hidden) + * @returns {boolean} true if it succeeded, false otherwise. + */ +ParallelRunnerEnvironment.setEnvironmentError = function(button, enable) { + const parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); + if(parent == null) return false; + const errorDiv = parent.querySelector('div[name="mcSettingsError"]'); + errorDiv.style.display = enable ? "block" : "none"; +}; + +/** + * Set the browser selection modal visibility. + * @param button - the environment button + * @param modalId - the browser modal id + * @param visible - should the modal be visible?(true / false) + * @param path - the patch to the root of the plugin + */ +ParallelRunnerEnvironment.setBrowsersModalVisibility = function(button,modalId,visible,path) { + var modal = document.getElementById(modalId); + // it wasn't generated, so we need to generate it + if(modal == null) { + // generate it + modal = ModalDialog.generate(path); + + // add it to the DOM + document.body.appendChild(modal); + } + + ModalDialog.setEnvironmentWizardButton(button); + + modal = document.getElementById(modalId); + + var environmentInputValue = ParallelRunnerEnvironment.getEnvironmentSettingsInputValue(button); + + // set the selected browser to match the one in the input + if(environmentInputValue != null) { + var browser = environmentInputValue.split(":"); + + // should be of the form browser: BrowserName + if(browser != null && browser.length === 2) + { + ModalDialog.setSelectedBrowser (modal,browser[1].trim()); + } + } + + if(visible) { + modal.style.display = "block"; + + // also allow the user to hide it by clicking anywhere on the window + window.onclick = function(event) { + if (event.target === modal) { + modal.style.display = "none"; + } + }; + } + else + modal.style.display = "none"; +}; + +/** + * Determine the currently selected environment type. + * @param button - the environment wizard button + * @returns {*} + */ +ParallelRunnerEnvironment.GetCurrentEnvironmentType = function(button) { + const parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); + if(parent == null) return null; + const input = parent.querySelector('input[type="radio"][name$="environmentType"]:checked'); + return input ? input.defaultValue : null; +}; + +/** + * Set the environment text based on the browser selection. + * @param button - the environment button + * @param radio - the selected radio + * @param modal - the browser selection modal + */ +ParallelRunnerEnvironment.setUpBrowserEnvironment = function(button,radio,modal) { + // we can close the modal now + modal.style.display = "none"; + // based on the browser chosen we will prepare the environment + ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,"browser : " + radio['id']); +}; + +/** + * Sets the environment and test set visibility based on the parallel runner checkBox state. + * @param index - the current build index + */ +ParallelRunnerEnvironment.setEnvironmentsVisibility = function(index) { + var fsTests = document.getElementsByName("runfromfs.fsTests")[index]; + var parent = Utils.findAncestorByTag(fsTests,"tbody"); + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + var environment = parent.querySelectorAll("div[name='fileSystemTestSet'")[0]; + + if(environment == null) return; + + Utils.setJenkinsElementVisibility(environment,check.checked); +}; + +/** + * Click handler for the environment wizard button. + * @param button the environment wizard button + * @param a first mc argument + * @param modalId the browser modalId to be shown + * @param visibility of the modal + * @param pluginPath the ${root} path + * @returns {boolean} + */ +ParallelRunnerEnvironment.onEnvironmentWizardClick = function(button,a,modalId,visibility,pluginPath) { + // get the environment type for the current env, it could be: 'web' or 'mobile' + var type = ParallelRunnerEnvironment.GetCurrentEnvironmentType(button); + if(type == null) return false; + + // if the type is web we need to show the browsers modal + if(type.toLowerCase() === 'web') { + ParallelRunnerEnvironment.setBrowsersModalVisibility(button,modalId,visibility,pluginPath); + return true; + } + + // open the mobile center wizard + if(type.toLowerCase() === 'mobile') { + Utils.loadMC(a,'/integration/#/login?jobId=',button); + return true; + } + + return false; +}; + +/** + * Utility class for the RunFromFileSystem model. + * @constructor + */ +function RunFromFileSystemEnvironment() {} + +/** + * Sets the visibility of a given multi line text box. + * @param index the textbox build index + * @param name the textbox name + */ +RunFromFileSystemEnvironment.setMultiLineTextBoxVisibility = function(index, name) { + var textBox = document.getElementsByName(name)[index]; + var parentElement = textBox.parentElement; + var parent = Utils.findAncestorByTag(textBox,"tr"); + + // when the text box is not expanded + if(!parentElement.classList.contains("setting-main")) { + parent = Utils.findAncestorByTag(parent,'tr'); + } + + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + + if(check.checked) { + parent.style.display = "none"; + } else { + parent.style.display = ""; + } +}; + +/** + * Sets the visibility of a given text box. + * @param index the textbox build index + * @param name the textbox name + */ +RunFromFileSystemEnvironment.setTextBoxVisibility = function(index, name) { + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + var textBox = document.getElementsByName(name)[index]; + + Utils.setJenkinsElementVisibility(textBox,!check.checked); +}; + +/** + * Sets the fsTests visibility based on the parallel runner checkBox state. + * @param index - the current build index + */ +RunFromFileSystemEnvironment.setFsTestsVisibility = function(index) { + this.setMultiLineTextBoxVisibility(index, "runfromfs.fsTests"); +}; + +/** + * Sets the fsReportPath visibility based on the parallel runner checkBox state. + * @param index - the current build index + */ +RunFromFileSystemEnvironment.setFsReportPathVisibility = function(index) { + this.setTextBoxVisibility(index, "runfromfs.fsReportPath"); +}; + +/** + * Sets the fsTimeout visibility based on the parallel runner checkbox state. + * @param index the current build index. + */ +RunFromFileSystemEnvironment.setTimeoutVisibility = function (index) { + this.setTextBoxVisibility(index, "runfromfs.fsTimeout"); +}; + +/** + * Hide/Show the corresponding controls based on the parallel runner checkBox state. + */ +function setViewVisibility() { + var parallelRuns = document.getElementsByName("runfromfs.isParallelRunnerEnabled"); + + // go over all the available builds and set their corresponding + // visibilities based on the parallel runner state + for(var i = 0; i < parallelRuns.length; i++) { + RunFromFileSystemEnvironment.setFsTestsVisibility(i); + RunFromFileSystemEnvironment.setTimeoutVisibility(i); + RunFromFileSystemEnvironment.setFsReportPathVisibility(i); + ParallelRunnerEnvironment.setEnvironmentsVisibility(i); + } +} + +document.addEventListener('DOMContentLoaded', function() { + setViewVisibility(); +}, false); From 856ea0acd826f2a09f4b839b5e04eb5dfaebe717 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 17 Jun 2021 12:49:02 +0300 Subject: [PATCH 1739/2502] tech : adding datatable params for MBT --- pom.xml | 2 +- .../tools/octane/testrunner/TestsToRunConverterBuilder.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 644b4561fc..33feddf2ad 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.0 + 2.7.0.1 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 7043f026a3..051a8dd808 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -189,8 +189,10 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn props.setProperty("unitIds" + counter, mbtTest.getUnitIds().stream().map( n -> n.toString() ).collect(Collectors.joining(";" ) )); props.setProperty("underlyingTests" + counter, env.expand((String.join(";", mbtTest.getUnderlyingTests())))); - //Expects to receive params in CSV format, encoded base64, for example Y29sMSxjb2wyCjEsMwoyLDQK - props.setProperty("datableParams" + counter, "Y29sMSxjb2wyCjEsMwoyLDQK"); + if (mbtTest.getEncodedIterations() != null && !mbtTest.getEncodedIterations().isEmpty()) { + //Expects to receive params in CSV format, encoded base64, for example Y29sMSxjb2wyCjEsMwoyLDQK + props.setProperty("datableParams" + counter, mbtTest.getEncodedIterations()); + } counter++; } From f5958d8c2ad5a609df2421f619902cfcbff5d493 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Fri, 18 Jun 2021 19:56:13 +0300 Subject: [PATCH 1740/2502] 618171 [Jenkins Plug-in] Layout issue for "UFT parallel running mode" --- .../model/FileSystemTestModel/config.jelly | 56 ++++++++-------- .../model/FileSystemTestSetModel/config.jelly | 10 ++- .../config.jelly | 66 ++++++++++--------- 3 files changed, 67 insertions(+), 65 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestModel/config.jelly index cb8bcc954e..d2908769e6 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestModel/config.jelly @@ -26,36 +26,38 @@ ~ ___________________________________________________________________ --> - + - - -
      - -
      + + +
      + +
      - -

      EXECUTION SET

      -

      + +

      EXECUTION SET

      +

      - -

      - Tests -
      + +
      + Tests +
      - -
      - -
      -
      + +
      + + +
      +
      - - - - -
      + + + + +
      diff --git a/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly index 4b6b763bb4..6be1843daa 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/model/FileSystemTestSetModel/config.jelly @@ -26,10 +26,8 @@ ~ ___________________________________________________________________ --> - - - - - + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly index 536b85b6e6..fa272de130 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly @@ -26,44 +26,46 @@ ~ ___________________________________________________________________ --> - - - - - - - - - - - - - - - - - - - - -
      - -
      -
      ${header}
      - - - - -
      - - -
      - -
      ${header}
      - -
      -
      - - - - - -
      -
      ${header}
      - -
      -
      -
      - - -
      - - - - - - - - - - - - -
      + + + + + + + + + + + + + + + + + + + + + +
      + +
      +
      ${header}
      + + + + +
      + + +
      + +
      ${header}
      + +
      +
      + + + + + +
      +
      ${header}
      + +
      +
      +
      + +
      + + + + + + + + + + + + +
      diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index 38962ccac0..6f45eecc7b 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -26,7 +26,7 @@ * ___________________________________________________________________ */ -function load(a,path){ +function loadMobileInfo(a){ var buttonStatus = false; if(buttonStatus) return; buttonStatus = true; @@ -41,7 +41,7 @@ function load(a,path){ var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; var baseUrl = ""; - if(mcUserName == '' || mcPassword == ''|| (useProxy && proxyAddress == '') || (useAuthentication && (proxyUserName == '' || proxyPassword == ''))){ + if(mcUserName.trim() == '' || mcPassword.trim() == '' || (useProxy && proxyAddress.trim() == '') || (useAuthentication && (proxyUserName.trim() == '' || proxyPassword.trim() == ''))){ document.getElementById("errorMessage").style.display = "block"; buttonStatus = false; return; @@ -53,16 +53,14 @@ function load(a,path){ } if (!useProxy){ - proxyAddress = ""; - proxyUserName = ""; - proxyPassword = ""; + proxyAddress = proxyUserName = proxyPassword = ""; } a.getMcServerUrl(mcUrl, function(r){ baseUrl = r.responseObject(); a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { - var jobResponse = response.responseObject(); - if(jobResponse == null){ + var jobId = response.responseObject(); + if(jobId == null){ document.getElementById("errorMessage").style.display = "block"; buttonStatus = false; return; @@ -71,15 +69,12 @@ function load(a,path){ document.getElementById("errorMessage").style.display = "none"; var openedWindow = window.open('/','test parameters','height=820,width=1130'); openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl+path+jobResponse+'&displayUFTMode=true'; + openedWindow.location.href = baseUrl.trim().replace(/[\/]*$/, "")+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true"; var messageCallBack = function (event) { if (event && event.data && event.data=="mcCloseWizard") { - a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobResponse, function (app) { + a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobId, function (app) { var jobInfo = app.responseObject(); - var deviceId = ""; - var OS = ""; - var manufacturerAndModel = ""; - var targetLab = ""; + let deviceId = "", OS = "", manufacturerAndModel = "", targetLab = ""; if(jobInfo['deviceJSON']){ if(jobInfo['deviceJSON']['deviceId']){ deviceId = jobInfo['deviceJSON']['deviceId']; diff --git a/src/main/webapp/parallelRunnerEnvironment.js b/src/main/webapp/parallelRunnerEnvironment.js index 945a3055d8..9dff894fc5 100644 --- a/src/main/webapp/parallelRunnerEnvironment.js +++ b/src/main/webapp/parallelRunnerEnvironment.js @@ -37,9 +37,9 @@ function ModalDialog() {} * @param modalCSS the modal style sheet link */ ModalDialog.addStyleSheet = function(modalCSS) { - var link = document.createElement("link"); - Utils.addStyleSheet(link,modalCSS); - document.head.appendChild(link); + var link = document.createElement("link"); + Utils.addStyleSheet(link,modalCSS); + document.head.appendChild(link); }; /** @@ -47,7 +47,7 @@ ModalDialog.addStyleSheet = function(modalCSS) { * @param envWizardButton the environment wizard button */ ModalDialog.setEnvironmentWizardButton = function(envWizardButton){ - ModalDialog.envWizardButton = envWizardButton; + ModalDialog.envWizardButton = envWizardButton; }; /** @@ -59,70 +59,70 @@ ModalDialog.setEnvironmentWizardButton = function(envWizardButton){ * @returns {*} */ ModalDialog.generateBrowserItem = function(iconSrc,browserId,labelText,checked) { - var browserRadio = document.createElement("input"); - browserRadio.setAttribute("class","browser-item-child customRadio"); - browserRadio.setAttribute("type","radio"); - browserRadio.setAttribute("name","browser-radio"); + var browserRadio = document.createElement("input"); + browserRadio.setAttribute("class","browser-item-child customRadio"); + browserRadio.setAttribute("type","radio"); + browserRadio.setAttribute("name","browser-radio"); - if(checked) { - browserRadio.setAttribute("checked", "true"); - } + if(checked) { + browserRadio.setAttribute("checked", "true"); + } - browserRadio.setAttribute("id",browserId); + browserRadio.setAttribute("id",browserId); - var browserImage = document.createElement("img"); - browserImage.setAttribute("class","browser-item-child"); - browserImage.setAttribute("src",iconSrc); + var browserImage = document.createElement("img"); + browserImage.setAttribute("class","browser-item-child"); + browserImage.setAttribute("src",iconSrc); - var browserItem = document.createElement("div"); - browserItem.setAttribute("class","browser-item"); + var browserItem = document.createElement("div"); + browserItem.setAttribute("class","browser-item"); - var browserLabel = document.createElement("div"); - browserLabel.setAttribute("class","browser-item-child browser-name"); - browserLabel.innerHTML = labelText; + var browserLabel = document.createElement("div"); + browserLabel.setAttribute("class","browser-item-child browser-name"); + browserLabel.innerHTML = labelText; - browserItem.appendChild(browserRadio); - browserItem.appendChild(browserImage); - browserItem.appendChild(browserLabel); + browserItem.appendChild(browserRadio); + browserItem.appendChild(browserImage); + browserItem.appendChild(browserLabel); - return browserItem; + return browserItem; }; ModalDialog.saveBrowserSettings = function(modalNode) { - // retrieve the button that was used to open the env wizard - var button = ModalDialog.envWizardButton; + // retrieve the button that was used to open the env wizard + var button = ModalDialog.envWizardButton; - var radioButtons = modalNode.querySelectorAll('input[type="radio"]'); + var radioButtons = modalNode.querySelectorAll('input[type="radio"]'); - for(var i =0; i < radioButtons.length;i++) { - if(radioButtons[i].checked) { - ParallelRunnerEnvironment.setUpBrowserEnvironment(button,radioButtons[i],modalNode); - } - } + for(var i =0; i < radioButtons.length;i++) { + if(radioButtons[i].checked) { + ParallelRunnerEnvironment.setUpBrowserEnvironment(button,radioButtons[i],modalNode); + } + } }; ModalDialog.setSelectedBrowser = function(modal,browserId){ - if(ModalDialog.browsers == null) return false; + if(ModalDialog.browsers == null) return false; - // check if the provided browser id matches any of the available browsers - var selectedBrowser = null; - for(var i = 0; i < ModalDialog.browsers.length; i++) { - if(ModalDialog.browsers[i].toLowerCase() === browserId.toLowerCase()) { - selectedBrowser = ModalDialog.browsers[i]; - } - } + // check if the provided browser id matches any of the available browsers + var selectedBrowser = null; + for(var i = 0; i < ModalDialog.browsers.length; i++) { + if(ModalDialog.browsers[i].toLowerCase() === browserId.toLowerCase()) { + selectedBrowser = ModalDialog.browsers[i]; + } + } - // no match, select the default one - if(selectedBrowser == null) return false; + // no match, select the default one + if(selectedBrowser == null) return false; - var radioButton = modal.querySelector("input[id=" + selectedBrowser + "]"); + var radioButton = modal.querySelector("input[id=" + selectedBrowser + "]"); - if(radioButton == null) return false; + if(radioButton == null) return false; - // set the corresponding radio button to be checked - radioButton.checked = true; + // set the corresponding radio button to be checked + radioButton.checked = true; - return true; + return true; }; /** @@ -131,11 +131,11 @@ ModalDialog.setSelectedBrowser = function(modal,browserId){ * @returns {boolean} true if the modal was hidden, false otherwise */ ModalDialog.hide = function(modalId) { - var modal = document.getElementById(modalId); + var modal = document.getElementById(modalId); - if(modal == null) return false; + if(modal == null) return false; - modal.style.display = "none"; + modal.style.display = "none"; }; /** @@ -143,69 +143,69 @@ ModalDialog.hide = function(modalId) { * @constructor */ ModalDialog.generate = function(path) { - var modalCSS = path + "plugin/hp-application-automation-tools-plugin/css/PARALLEL_RUNNER_UI.css"; + var modalCSS = path + "plugin/hp-application-automation-tools-plugin/css/PARALLEL_RUNNER_UI.css"; - // add the css style - ModalDialog.addStyleSheet(modalCSS); + // add the css style + ModalDialog.addStyleSheet(modalCSS); - var browsersModal = document.createElement("div"); - browsersModal.setAttribute("id","browsersModal"); - browsersModal.setAttribute("class","modal"); + var browsersModal = document.createElement("div"); + browsersModal.setAttribute("id","browsersModal"); + browsersModal.setAttribute("class","modal"); - var modalContent = document.createElement("div"); - modalContent.setAttribute("class","modal-content"); + var modalContent = document.createElement("div"); + modalContent.setAttribute("class","modal-content"); - var modalHeader = document.createElement("div"); - modalHeader.setAttribute("class","modal-header"); + var modalHeader = document.createElement("div"); + modalHeader.setAttribute("class","modal-header"); - var span = document.createElement("div"); - span.innerHTML = "x"; - span.setAttribute("class","close"); - span.setAttribute("onclick","ModalDialog.hide('browsersModal')"); + var span = document.createElement("div"); + span.innerHTML = "x"; + span.setAttribute("class","close"); + span.setAttribute("onclick","ModalDialog.hide('browsersModal')"); - var title = document.createElement("div"); - title.innerHTML = "Choose a browser"; - title.setAttribute("class","modal-title"); + var title = document.createElement("div"); + title.innerHTML = "Choose a browser"; + title.setAttribute("class","modal-title"); - var modalBody = document.createElement("div"); - modalBody.setAttribute("class","modal-body"); + var modalBody = document.createElement("div"); + modalBody.setAttribute("class","modal-body"); - var iconsSRC = path + "plugin/hp-application-automation-tools-plugin/ParallelRunner/icons/"; + var iconsSRC = path + "plugin/hp-application-automation-tools-plugin/ParallelRunner/icons/"; - var chromeBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/chrome.svg','Chrome','Chrome',true); - var firefoxBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox','Firefox',false); - var firefox64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox64','Firefox 64',false); - var ieBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE','IE',false); - var ie64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE64','IE 64',false); + var chromeBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/chrome.svg','Chrome','Chrome',true); + var firefoxBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox','Firefox',false); + var firefox64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/firefox.svg','Firefox64','Firefox 64',false); + var ieBrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE','IE',false); + var ie64BrowserItem = ModalDialog.generateBrowserItem(iconsSRC + 'svg/explorer.svg','IE64','IE 64',false); - // retain the available browsers - ModalDialog.browsers = ["Chrome","Firefox","Firefox64","IE","IE64"]; + // retain the available browsers + ModalDialog.browsers = ["Chrome","Firefox","Firefox64","IE","IE64"]; - // add the browser items to the modal body - modalBody.appendChild(chromeBrowserItem); - modalBody.appendChild(firefoxBrowserItem); - modalBody.appendChild(firefox64BrowserItem); - modalBody.appendChild(ieBrowserItem); - modalBody.appendChild(ie64BrowserItem); + // add the browser items to the modal body + modalBody.appendChild(chromeBrowserItem); + modalBody.appendChild(firefoxBrowserItem); + modalBody.appendChild(firefox64BrowserItem); + modalBody.appendChild(ieBrowserItem); + modalBody.appendChild(ie64BrowserItem); - var saveText = document.createElement('div'); - saveText.innerHTML = "SAVE"; - saveText.setAttribute("class","save-text"); - saveText.setAttribute("id","save-btn"); - saveText.setAttribute("onclick",'ModalDialog.saveBrowserSettings(browsersModal)'); + var saveText = document.createElement('div'); + saveText.innerHTML = "SAVE"; + saveText.setAttribute("class","save-text"); + saveText.setAttribute("id","save-btn"); + saveText.setAttribute("onclick",'ModalDialog.saveBrowserSettings(browsersModal)'); - var modalFooter = document.createElement("div"); - modalFooter.setAttribute("class","modal-footer"); + var modalFooter = document.createElement("div"); + modalFooter.setAttribute("class","modal-footer"); - modalFooter.appendChild(saveText); - modalHeader.appendChild(span); - modalHeader.appendChild(title); - modalContent.appendChild(modalHeader); - modalContent.appendChild(modalBody); - modalContent.appendChild(modalFooter); - browsersModal.appendChild(modalContent); + modalFooter.appendChild(saveText); + modalHeader.appendChild(span); + modalHeader.appendChild(title); + modalContent.appendChild(modalHeader); + modalContent.appendChild(modalBody); + modalContent.appendChild(modalFooter); + browsersModal.appendChild(modalContent); - return browsersModal; + return browsersModal; }; /** @@ -221,9 +221,9 @@ function Utils() {} * @returns {HTMLElement} */ Utils.findAncestorByTag = function(start,tag) { - tag = tag.toLowerCase(); - while((start = start.parentElement) && !(start.tagName.toLowerCase() === tag)) {} - return start; + tag = tag.toLowerCase(); + while((start = start.parentElement) && !(start.tagName.toLowerCase() === tag)) {} + return start; }; /** @@ -234,9 +234,9 @@ Utils.findAncestorByTag = function(start,tag) { * @returns {HTMLElement} */ Utils.findAncestorByTagAndName = function(start,tag,name) { - tag = tag.toLowerCase(); - while((start = start.parentElement) && start != null && !(start.tagName.toLowerCase() === tag && start.getAttribute("name") === name)) {} - return start; + tag = tag.toLowerCase(); + while((start = start.parentElement) && start != null && !(start.tagName.toLowerCase() === tag && start.getAttribute("name") === name)) {} + return start; }; /** * Check if a string is empty. @@ -244,13 +244,13 @@ Utils.findAncestorByTagAndName = function(start,tag,name) { * @returns {boolean} */ Utils.isEmptyString = function(str) { - return (!str || str.length === 0); + return (!str || str.length === 0); }; Utils.addStyleSheet = function(elem,sheetHref) { - elem.setAttribute("rel","stylesheet"); - elem.setAttribute("type","text/css"); - elem.setAttribute("href",sheetHref); + elem.setAttribute("rel","stylesheet"); + elem.setAttribute("type","text/css"); + elem.setAttribute("href",sheetHref); }; /** @@ -261,37 +261,37 @@ Utils.addStyleSheet = function(elem,sheetHref) { * @returns {string} the parsed information. */ Utils.parseMCInformation = function(deviceId, os, manufacturerAndModel) { - var mc_params = []; - var os_types = {android : 'Android', ios: 'ios', wp : 'Windows Phone'}; - - if(!Utils.isEmptyString(deviceId)) - mc_params.push({name: 'deviceId', value: deviceId}); - else { - if (!Utils.isEmptyString(os)) { - // regex for the os string - // example: ios<=10.2.2 => we need to extract ios,<=,10.2.2 - var regex = /([a-z]+)(>=|>|<|<=)*([0-9].*[0-9])+/gi; - var match = regex.exec(os); - - if (match == null) { // string does not contain a version - mc_params.push({name: 'osType', value: os_types[os]}); - mc_params.push({name: 'osVersion', value: 'any'}); - } - else { // version was given to us - mc_params.push({name: 'osType', value: os_types[match[1]]}); - mc_params.push({name: 'osVersion', value: match[2] == null ? match[3] : match[2] + match[3]}); - } - } - } - - if(!Utils.isEmptyString(manufacturerAndModel)) - mc_params.push({name: 'manufacturerAndModel', value: manufacturerAndModel}); - - var result_str = ""; - for(var i = 0; i < mc_params.length; i++) { - result_str = result_str.concat(mc_params[i].name, " : ", mc_params[i].value, (i===mc_params.length - 1) ? "" : ","); - } - return result_str; + var mc_params = []; + var os_types = {android : 'Android', ios: 'ios', wp : 'Windows Phone'}; + + if(!Utils.isEmptyString(deviceId)) + mc_params.push({name: 'deviceId', value: deviceId}); + else { + if (!Utils.isEmptyString(os)) { + // regex for the os string + // example: ios<=10.2.2 => we need to extract ios,<=,10.2.2 + var regex = /([a-z]+)(>=|>|<|<=)*([0-9].*[0-9])+/gi; + var match = regex.exec(os); + + if (match == null) { // string does not contain a version + mc_params.push({name: 'osType', value: os_types[os]}); + mc_params.push({name: 'osVersion', value: 'any'}); + } + else { // version was given to us + mc_params.push({name: 'osType', value: os_types[match[1]]}); + mc_params.push({name: 'osVersion', value: match[2] == null ? match[3] : match[2] + match[3]}); + } + } + } + + if(!Utils.isEmptyString(manufacturerAndModel)) + mc_params.push({name: 'manufacturerAndModel', value: manufacturerAndModel}); + + var result_str = ""; + for(var i = 0; i < mc_params.length; i++) { + result_str = result_str.concat(mc_params[i].name, " : ", mc_params[i].value, (i===mc_params.length - 1) ? "" : ","); + } + return result_str; }; /** @@ -300,100 +300,96 @@ Utils.parseMCInformation = function(deviceId, os, manufacturerAndModel) { * @param visible the element visibility state */ Utils.setJenkinsElementVisibility = function(element,visible) { - var parent = Utils.findAncestorByTag(element,'tr'); - - if(visible === false) { - parent.style.display = "none"; - } - else{ - parent.style.display = ""; - } + var parent = Utils.findAncestorByTag(element,'tr'); + + if(visible === false) { + parent.style.display = "none"; + } else { + parent.style.display = ""; + } }; /** * Load the mobile center wizard. * @param a descriptor - * @param path the url path * @param button the environment wizard button */ -Utils.loadMC = function(a,path,button){ - var buttonStatus = false; - if(buttonStatus) return; - buttonStatus = true; - var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; - var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; - var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; - var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; - var useProxy = document.getElementsByName("proxySettings")[0].checked; - var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; - var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; - var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; - var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; - var baseUrl = ""; - if(mcUserName == '' || mcPassword == ''|| (useProxy && proxyAddress == '') || (useAuthentication && (proxyUserName == '' || proxyPassword == ''))){ - ParallelRunnerEnvironment.setEnvironmentError(button,true); - buttonStatus = false; - return; - } - var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; - a.getMcServerUrl(mcUrl, function(r){ - baseUrl = r.responseObject(); - a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { - var jobResponse = response.responseObject(); - if(jobResponse == null){ - ParallelRunnerEnvironment.setEnvironmentError(button,true); - buttonStatus = false; - return; - } - var openedWindow = window.open('/','test parameters','height=820,width=1130'); - openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl+path+jobResponse+'&displayUFTMode=true&deviceOnly=true'; - var messageCallBack = function (event) { - if (event && event.data && event.data=="mcCloseWizard") { - a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobResponse, function (app) { - var jobInfo = app.responseObject(); - var deviceId = ""; - var OS = ""; - var manufacturerAndModel = ""; - if(jobInfo['deviceJSON']){ - if(jobInfo['deviceJSON']['deviceId']){ - deviceId = jobInfo['deviceJSON']['deviceId']; - } - if(jobInfo['deviceJSON']['OS']){ - OS = jobInfo['deviceJSON']['OS']; - } - if(jobInfo['deviceJSON']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; - } - } - if(jobInfo['deviceCapability']){ - if(jobInfo['deviceCapability']['OS']){ - OS = jobInfo['deviceCapability']['OS']; - } - if(jobInfo['deviceCapability']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; - } - } - console.log(deviceId); - ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,Utils.parseMCInformation(deviceId,OS,manufacturerAndModel)); - - buttonStatus = false; - ParallelRunnerEnvironment.setEnvironmentError(button,false); - window.removeEventListener("message",messageCallBack, false); - openedWindow.close(); - }); - } - }; - window.addEventListener("message", messageCallBack ,false); - function checkChild() { - if (openedWindow && openedWindow.closed) { - clearInterval(timer); - buttonStatus = false; - } - } - var timer = setInterval(checkChild, 500); - }); - }); +Utils.loadMC = function(a,button){ + var buttonStatus = false; + if(buttonStatus) return; + buttonStatus = true; + var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; + var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; + var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; + var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; + var useProxy = document.getElementsByName("proxySettings")[0].checked; + var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; + var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; + var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; + var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; + var baseUrl = ""; + if(mcUserName.trim() == '' || mcPassword.trim() == '' || (useProxy && proxyAddress.trim() == '') || (useAuthentication && (proxyUserName.trim() == '' || proxyPassword.trim() == ''))){ + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } + var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; + a.getMcServerUrl(mcUrl, function(r){ + baseUrl = r.responseObject(); + a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { + var jobId = response.responseObject(); + if(jobId == null) { + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } + var openedWindow = window.open('/','test parameters','height=820,width=1130'); + openedWindow.location.href = 'about:blank'; + openedWindow.location.href = baseUrl.trim().replace(/[\/]*$/, "")+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true&deviceOnly=true"; + var messageCallBack = function (event) { + if (event && event.data && event.data=="mcCloseWizard") { + a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId,proxyAddress,proxyUserName,proxyPassword,jobId,function (app) { + var jobInfo = app.responseObject(); + let deviceId = "", OS = "", manufacturerAndModel = ""; + if(jobInfo['deviceJSON']){ + if(jobInfo['deviceJSON']['deviceId']){ + deviceId = jobInfo['deviceJSON']['deviceId']; + } + if(jobInfo['deviceJSON']['OS']){ + OS = jobInfo['deviceJSON']['OS']; + } + if(jobInfo['deviceJSON']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; + } + } + if(jobInfo['deviceCapability']){ + if(jobInfo['deviceCapability']['OS']){ + OS = jobInfo['deviceCapability']['OS']; + } + if(jobInfo['deviceCapability']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; + } + } + console.log(deviceId); + ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,Utils.parseMCInformation(deviceId,OS,manufacturerAndModel)); + + buttonStatus = false; + ParallelRunnerEnvironment.setEnvironmentError(button,false); + window.removeEventListener("message",messageCallBack, false); + openedWindow.close(); + }); + } + }; + window.addEventListener("message", messageCallBack ,false); + function checkChild() { + if (openedWindow && openedWindow.closed) { + clearInterval(timer); + buttonStatus = false; + } + } + var timer = setInterval(checkChild, 500); + }); + }); }; @@ -409,10 +405,10 @@ function ParallelRunnerEnvironment() {} * @returns {*} */ ParallelRunnerEnvironment.getEnvironmentSettingsInputNode = function (button) { - // jelly represents each item as a 'div' with data inside - var parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); - if (parent == null) return null; - return parent.querySelector(".setting-input"); + // jelly represents each item as a 'div' with data inside + var parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); + if (parent == null) return null; + return parent.querySelector(".setting-input"); }; /** @@ -423,13 +419,13 @@ ParallelRunnerEnvironment.getEnvironmentSettingsInputNode = function (button) { * @returns {boolean} true if it succeeded, false otherwise. */ ParallelRunnerEnvironment.setEnvironmentSettingsInput = function(button,inputValue) { - var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); + var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); - if(settingInput == null) return false; + if(settingInput == null) return false; - settingInput.value = inputValue; + settingInput.value = inputValue; - return true; + return true; }; /** * @@ -437,10 +433,10 @@ ParallelRunnerEnvironment.setEnvironmentSettingsInput = function(button,inputVal * @returns {null} */ ParallelRunnerEnvironment.getEnvironmentSettingsInputValue = function(button) { - // jelly represents each item as a 'div' with data inside - var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); - if(settingInput == null) return null; - return settingInput.value; + // jelly represents each item as a 'div' with data inside + var settingInput = ParallelRunnerEnvironment.getEnvironmentSettingsInputNode(button); + if(settingInput == null) return null; + return settingInput.value; }; /** @@ -451,9 +447,9 @@ ParallelRunnerEnvironment.getEnvironmentSettingsInputValue = function(button) { * @returns {boolean} true if it succeeded, false otherwise. */ ParallelRunnerEnvironment.setEnvironmentError = function(button, enable) { - const parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); - if(parent == null) return false; - const errorDiv = parent.querySelector('div[name="mcSettingsError"]'); + const parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); + if(parent == null) return false; + const errorDiv = parent.querySelector('div[name="mcSettingsError"]'); errorDiv.style.display = enable ? "block" : "none"; }; @@ -465,45 +461,45 @@ ParallelRunnerEnvironment.setEnvironmentError = function(button, enable) { * @param path - the patch to the root of the plugin */ ParallelRunnerEnvironment.setBrowsersModalVisibility = function(button,modalId,visible,path) { - var modal = document.getElementById(modalId); - // it wasn't generated, so we need to generate it - if(modal == null) { - // generate it - modal = ModalDialog.generate(path); - - // add it to the DOM - document.body.appendChild(modal); - } - - ModalDialog.setEnvironmentWizardButton(button); - - modal = document.getElementById(modalId); - - var environmentInputValue = ParallelRunnerEnvironment.getEnvironmentSettingsInputValue(button); - - // set the selected browser to match the one in the input - if(environmentInputValue != null) { - var browser = environmentInputValue.split(":"); - - // should be of the form browser: BrowserName - if(browser != null && browser.length === 2) - { - ModalDialog.setSelectedBrowser (modal,browser[1].trim()); - } - } - - if(visible) { - modal.style.display = "block"; - - // also allow the user to hide it by clicking anywhere on the window - window.onclick = function(event) { - if (event.target === modal) { - modal.style.display = "none"; - } - }; - } - else - modal.style.display = "none"; + var modal = document.getElementById(modalId); + // it wasn't generated, so we need to generate it + if(modal == null) { + // generate it + modal = ModalDialog.generate(path); + + // add it to the DOM + document.body.appendChild(modal); + } + + ModalDialog.setEnvironmentWizardButton(button); + + modal = document.getElementById(modalId); + + var environmentInputValue = ParallelRunnerEnvironment.getEnvironmentSettingsInputValue(button); + + // set the selected browser to match the one in the input + if(environmentInputValue != null) { + var browser = environmentInputValue.split(":"); + + // should be of the form browser: BrowserName + if(browser != null && browser.length === 2) + { + ModalDialog.setSelectedBrowser (modal,browser[1].trim()); + } + } + + if(visible) { + modal.style.display = "block"; + + // also allow the user to hide it by clicking anywhere on the window + window.onclick = function(event) { + if (event.target === modal) { + modal.style.display = "none"; + } + }; + } + else + modal.style.display = "none"; }; /** @@ -512,10 +508,10 @@ ParallelRunnerEnvironment.setBrowsersModalVisibility = function(button,modalId,v * @returns {*} */ ParallelRunnerEnvironment.GetCurrentEnvironmentType = function(button) { - const parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); - if(parent == null) return null; - const input = parent.querySelector('input[type="radio"][name$="environmentType"]:checked'); - return input ? input.defaultValue : null; + const parent = Utils.findAncestorByTagAndName(button._button,"div","parallelRunnerEnvironments"); + if(parent == null) return null; + const input = parent.querySelector('input[type="radio"][name$="environmentType"]:checked'); + return input ? input.defaultValue : null; }; /** @@ -525,10 +521,10 @@ ParallelRunnerEnvironment.GetCurrentEnvironmentType = function(button) { * @param modal - the browser selection modal */ ParallelRunnerEnvironment.setUpBrowserEnvironment = function(button,radio,modal) { - // we can close the modal now - modal.style.display = "none"; - // based on the browser chosen we will prepare the environment - ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,"browser : " + radio['id']); + // we can close the modal now + modal.style.display = "none"; + // based on the browser chosen we will prepare the environment + ParallelRunnerEnvironment.setEnvironmentSettingsInput(button,"browser : " + radio['id']); }; /** @@ -536,14 +532,14 @@ ParallelRunnerEnvironment.setUpBrowserEnvironment = function(button,radio,modal) * @param index - the current build index */ ParallelRunnerEnvironment.setEnvironmentsVisibility = function(index) { - var fsTests = document.getElementsByName("runfromfs.fsTests")[index]; - var parent = Utils.findAncestorByTag(fsTests,"tbody"); - var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; - var environment = parent.querySelectorAll("div[name='fileSystemTestSet'")[0]; + var fsTests = document.getElementsByName("runfromfs.fsTests")[index]; + var parent = Utils.findAncestorByTag(fsTests,"tbody"); + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + var environment = parent.querySelectorAll("div[name='fileSystemTestSet']")[0]; - if(environment == null) return; + if(environment == null) return; - Utils.setJenkinsElementVisibility(environment,check.checked); + Utils.setJenkinsElementVisibility(environment,check.checked); }; /** @@ -556,23 +552,23 @@ ParallelRunnerEnvironment.setEnvironmentsVisibility = function(index) { * @returns {boolean} */ ParallelRunnerEnvironment.onEnvironmentWizardClick = function(button,a,modalId,visibility,pluginPath) { - // get the environment type for the current env, it could be: 'web' or 'mobile' - var type = ParallelRunnerEnvironment.GetCurrentEnvironmentType(button); - if(type == null) return false; - - // if the type is web we need to show the browsers modal - if(type.toLowerCase() === 'web') { - ParallelRunnerEnvironment.setBrowsersModalVisibility(button,modalId,visibility,pluginPath); - return true; - } - - // open the mobile center wizard - if(type.toLowerCase() === 'mobile') { - Utils.loadMC(a,'/integration/#/login?jobId=',button); - return true; - } - - return false; + // get the environment type for the current env, it could be: 'web' or 'mobile' + var type = ParallelRunnerEnvironment.GetCurrentEnvironmentType(button); + if(type == null) return false; + + // if the type is web we need to show the browsers modal + if(type.toLowerCase() === 'web') { + ParallelRunnerEnvironment.setBrowsersModalVisibility(button,modalId,visibility,pluginPath); + return true; + } + + // open the mobile center wizard + if(type.toLowerCase() === 'mobile') { + Utils.loadMC(a,button); + return true; + } + + return false; }; /** @@ -587,22 +583,22 @@ function RunFromFileSystemEnvironment() {} * @param name the textbox name */ RunFromFileSystemEnvironment.setMultiLineTextBoxVisibility = function(index, name) { - var textBox = document.getElementsByName(name)[index]; - var parentElement = textBox.parentElement; - var parent = Utils.findAncestorByTag(textBox,"tr"); - - // when the text box is not expanded - if(!parentElement.classList.contains("setting-main")) { - parent = Utils.findAncestorByTag(parent,'tr'); - } - - var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; - - if(check.checked) { - parent.style.display = "none"; - } else { - parent.style.display = ""; - } + var textBox = document.getElementsByName(name)[index]; + var parentElement = textBox.parentElement; + var parent = Utils.findAncestorByTag(textBox,"tr"); + + // when the text box is not expanded + if(!parentElement.classList.contains("setting-main")) { + parent = Utils.findAncestorByTag(parent,'tr'); + } + + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + + if(check.checked) { + parent.style.display = "none"; + } else { + parent.style.display = ""; + } }; /** @@ -611,10 +607,10 @@ RunFromFileSystemEnvironment.setMultiLineTextBoxVisibility = function(index, nam * @param name the textbox name */ RunFromFileSystemEnvironment.setTextBoxVisibility = function(index, name) { - var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; - var textBox = document.getElementsByName(name)[index]; + var check = document.getElementsByName("runfromfs.isParallelRunnerEnabled")[index]; + var textBox = document.getElementsByName(name)[index]; - Utils.setJenkinsElementVisibility(textBox,!check.checked); + Utils.setJenkinsElementVisibility(textBox,!check.checked); }; /** @@ -622,7 +618,7 @@ RunFromFileSystemEnvironment.setTextBoxVisibility = function(index, name) { * @param index - the current build index */ RunFromFileSystemEnvironment.setFsTestsVisibility = function(index) { - this.setMultiLineTextBoxVisibility(index, "runfromfs.fsTests"); + this.setMultiLineTextBoxVisibility(index, "runfromfs.fsTests"); }; /** @@ -630,7 +626,7 @@ RunFromFileSystemEnvironment.setFsTestsVisibility = function(index) { * @param index - the current build index */ RunFromFileSystemEnvironment.setFsReportPathVisibility = function(index) { - this.setTextBoxVisibility(index, "runfromfs.fsReportPath"); + this.setTextBoxVisibility(index, "runfromfs.fsReportPath"); }; /** @@ -638,25 +634,25 @@ RunFromFileSystemEnvironment.setFsReportPathVisibility = function(index) { * @param index the current build index. */ RunFromFileSystemEnvironment.setTimeoutVisibility = function (index) { - this.setTextBoxVisibility(index, "runfromfs.fsTimeout"); + this.setTextBoxVisibility(index, "runfromfs.fsTimeout"); }; /** * Hide/Show the corresponding controls based on the parallel runner checkBox state. */ function setViewVisibility() { - var parallelRuns = document.getElementsByName("runfromfs.isParallelRunnerEnabled"); - - // go over all the available builds and set their corresponding - // visibilities based on the parallel runner state - for(var i = 0; i < parallelRuns.length; i++) { - RunFromFileSystemEnvironment.setFsTestsVisibility(i); - RunFromFileSystemEnvironment.setTimeoutVisibility(i); - RunFromFileSystemEnvironment.setFsReportPathVisibility(i); - ParallelRunnerEnvironment.setEnvironmentsVisibility(i); - } + var parallelRuns = document.getElementsByName("runfromfs.isParallelRunnerEnabled"); + + // go over all the available builds and set their corresponding + // visibilities based on the parallel runner state + for(var i = 0; i < parallelRuns.length; i++) { + RunFromFileSystemEnvironment.setFsTestsVisibility(i); + RunFromFileSystemEnvironment.setTimeoutVisibility(i); + RunFromFileSystemEnvironment.setFsReportPathVisibility(i); + ParallelRunnerEnvironment.setEnvironmentsVisibility(i); + } } document.addEventListener('DOMContentLoaded', function() { - setViewVisibility(); + setViewVisibility(); }, false); From 2f550e0749c12f57b409dbd1243d93a2106bb493 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Fri, 25 Jun 2021 21:49:22 +0300 Subject: [PATCH 1752/2502] simplifying complex logical expression. --- src/main/webapp/configure.js | 193 ++++++++++--------- src/main/webapp/parallelRunnerEnvironment.js | 5 +- 2 files changed, 102 insertions(+), 96 deletions(-) diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index 6f45eecc7b..3e75887d7c 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -27,102 +27,105 @@ */ function loadMobileInfo(a){ - var buttonStatus = false; - if(buttonStatus) return; - buttonStatus = true; - var recreatJob = document.getElementsByName("runfromfs.recreateJob")[0].checked; - var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; - var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; - var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; - var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; - var useProxy = document.getElementsByName("proxySettings")[0].checked; - var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; - var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; - var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; - var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; - var baseUrl = ""; - if(mcUserName.trim() == '' || mcPassword.trim() == '' || (useProxy && proxyAddress.trim() == '') || (useAuthentication && (proxyUserName.trim() == '' || proxyPassword.trim() == ''))){ - document.getElementById("errorMessage").style.display = "block"; - buttonStatus = false; - return; - } - var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; - //recreate job if checked - if (recreatJob){ - previousJobId = ""; - } + var buttonStatus = false; + if(buttonStatus) return; + buttonStatus = true; + var recreatJob = document.getElementsByName("runfromfs.recreateJob")[0].checked; + var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; + var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; + var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; + var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; + var useProxy = document.getElementsByName("proxySettings")[0].checked; + var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; + var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; + var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; + var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; + var baseUrl = ""; + const isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; + const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; + const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); + if(isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing){ + document.getElementById("errorMessage").style.display = "block"; + buttonStatus = false; + return; + } + var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; + //recreate job if checked + if (recreatJob){ + previousJobId = ""; + } - if (!useProxy){ - proxyAddress = proxyUserName = proxyPassword = ""; - } + if (!useProxy){ + proxyAddress = proxyUserName = proxyPassword = ""; + } - a.getMcServerUrl(mcUrl, function(r){ - baseUrl = r.responseObject(); - a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { - var jobId = response.responseObject(); - if(jobId == null){ - document.getElementById("errorMessage").style.display = "block"; - buttonStatus = false; - return; - } - //hide the error message after success login - document.getElementById("errorMessage").style.display = "none"; - var openedWindow = window.open('/','test parameters','height=820,width=1130'); - openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl.trim().replace(/[\/]*$/, "")+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true"; - var messageCallBack = function (event) { - if (event && event.data && event.data=="mcCloseWizard") { - a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobId, function (app) { - var jobInfo = app.responseObject(); - let deviceId = "", OS = "", manufacturerAndModel = "", targetLab = ""; - if(jobInfo['deviceJSON']){ - if(jobInfo['deviceJSON']['deviceId']){ - deviceId = jobInfo['deviceJSON']['deviceId']; - } - if(jobInfo['deviceJSON']['OS']){ - OS = jobInfo['deviceJSON']['OS']; - } - if(jobInfo['deviceJSON']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; - } - } - if(jobInfo['deviceCapability']){ - if(jobInfo['deviceCapability']['OS']){ - OS = jobInfo['deviceCapability']['OS']; - } - if(jobInfo['deviceCapability']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; - } - if(jobInfo['deviceCapability']['targetLab']){ - targetLab = jobInfo['deviceCapability']['targetLab']; - } - } - document.getElementsByName("runfromfs.fsDeviceId")[0].value = deviceId; - document.getElementsByName("runfromfs.fsOs")[0].value = OS; - document.getElementsByName("runfromfs.fsManufacturerAndModel")[0].value = manufacturerAndModel; - document.getElementsByName("runfromfs.fsTargetLab")[0].value = targetLab; - document.getElementsByName("runfromfs.fsLaunchAppName")[0].value = jobInfo['definitions']['launchApplicationName']; - document.getElementsByName("runfromfs.fsInstrumented")[0].value = jobInfo['definitions']['instrumented']; - document.getElementsByName("runfromfs.fsAutActions")[0].value = jobInfo['definitions']['autActions']; - document.getElementsByName("runfromfs.fsDevicesMetrics")[0].value = jobInfo['definitions']['deviceMetrics']; - document.getElementsByName("runfromfs.fsExtraApps")[0].value = jobInfo['extraApps']; - document.getElementsByName("runfromfs.fsJobId")[0].value = jobInfo['jobUUID']; - buttonStatus = false; - document.getElementById("errorMessage").style.display = "none"; - window.removeEventListener("message",messageCallBack, false); - openedWindow.close(); - }); - } - }; - window.addEventListener("message", messageCallBack ,false); - function checkChild() { - if (openedWindow && openedWindow.closed) { - clearInterval(timer); - buttonStatus = false; - } - } - var timer = setInterval(checkChild, 500); - }); - }); + a.getMcServerUrl(mcUrl, function(r){ + baseUrl = r.responseObject(); + a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { + var jobId = response.responseObject(); + if(jobId == null){ + document.getElementById("errorMessage").style.display = "block"; + buttonStatus = false; + return; + } + //hide the error message after success login + document.getElementById("errorMessage").style.display = "none"; + var openedWindow = window.open('/','test parameters','height=820,width=1130'); + openedWindow.location.href = 'about:blank'; + openedWindow.location.href = baseUrl.trim().replace(/[\/]*$/, "")+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true"; + var messageCallBack = function (event) { + if (event && event.data && event.data=="mcCloseWizard") { + a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobId, function (app) { + var jobInfo = app.responseObject(); + let deviceId = "", OS = "", manufacturerAndModel = "", targetLab = ""; + if(jobInfo['deviceJSON']){ + if(jobInfo['deviceJSON']['deviceId']){ + deviceId = jobInfo['deviceJSON']['deviceId']; + } + if(jobInfo['deviceJSON']['OS']){ + OS = jobInfo['deviceJSON']['OS']; + } + if(jobInfo['deviceJSON']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; + } + } + if(jobInfo['deviceCapability']){ + if(jobInfo['deviceCapability']['OS']){ + OS = jobInfo['deviceCapability']['OS']; + } + if(jobInfo['deviceCapability']['manufacturerAndModel']){ + manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; + } + if(jobInfo['deviceCapability']['targetLab']){ + targetLab = jobInfo['deviceCapability']['targetLab']; + } + } + document.getElementsByName("runfromfs.fsDeviceId")[0].value = deviceId; + document.getElementsByName("runfromfs.fsOs")[0].value = OS; + document.getElementsByName("runfromfs.fsManufacturerAndModel")[0].value = manufacturerAndModel; + document.getElementsByName("runfromfs.fsTargetLab")[0].value = targetLab; + document.getElementsByName("runfromfs.fsLaunchAppName")[0].value = jobInfo['definitions']['launchApplicationName']; + document.getElementsByName("runfromfs.fsInstrumented")[0].value = jobInfo['definitions']['instrumented']; + document.getElementsByName("runfromfs.fsAutActions")[0].value = jobInfo['definitions']['autActions']; + document.getElementsByName("runfromfs.fsDevicesMetrics")[0].value = jobInfo['definitions']['deviceMetrics']; + document.getElementsByName("runfromfs.fsExtraApps")[0].value = jobInfo['extraApps']; + document.getElementsByName("runfromfs.fsJobId")[0].value = jobInfo['jobUUID']; + buttonStatus = false; + document.getElementById("errorMessage").style.display = "none"; + window.removeEventListener("message",messageCallBack, false); + openedWindow.close(); + }); + } + }; + window.addEventListener("message", messageCallBack ,false); + function checkChild() { + if (openedWindow && openedWindow.closed) { + clearInterval(timer); + buttonStatus = false; + } + } + var timer = setInterval(checkChild, 500); + }); + }); } \ No newline at end of file diff --git a/src/main/webapp/parallelRunnerEnvironment.js b/src/main/webapp/parallelRunnerEnvironment.js index 9dff894fc5..a48798f698 100644 --- a/src/main/webapp/parallelRunnerEnvironment.js +++ b/src/main/webapp/parallelRunnerEnvironment.js @@ -328,7 +328,10 @@ Utils.loadMC = function(a,button){ var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; var baseUrl = ""; - if(mcUserName.trim() == '' || mcPassword.trim() == '' || (useProxy && proxyAddress.trim() == '') || (useAuthentication && (proxyUserName.trim() == '' || proxyPassword.trim() == ''))){ + const isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; + const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; + const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); + if(isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing){ ParallelRunnerEnvironment.setEnvironmentError(button,true); buttonStatus = false; return; From a11f9450b605e5aa700721b38a2582c766e33e28 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 28 Jun 2021 13:56:37 +0300 Subject: [PATCH 1753/2502] fix baseUrl format and make sure to ignore trailing slashes --- src/main/webapp/configure.js | 9 ++++++++- src/main/webapp/parallelRunnerEnvironment.js | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index 3e75887d7c..3bfdb899a3 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -61,6 +61,13 @@ function loadMobileInfo(a){ a.getMcServerUrl(mcUrl, function(r){ baseUrl = r.responseObject(); + if(baseUrl){ + baseUrl = baseUrl.trim().replace(/[\/]+$/, ""); + } else { + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { var jobId = response.responseObject(); if(jobId == null){ @@ -72,7 +79,7 @@ function loadMobileInfo(a){ document.getElementById("errorMessage").style.display = "none"; var openedWindow = window.open('/','test parameters','height=820,width=1130'); openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl.trim().replace(/[\/]*$/, "")+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true"; + openedWindow.location.href = baseUrl+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true"; var messageCallBack = function (event) { if (event && event.data && event.data=="mcCloseWizard") { a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobId, function (app) { diff --git a/src/main/webapp/parallelRunnerEnvironment.js b/src/main/webapp/parallelRunnerEnvironment.js index e84863d776..7dde1d530b 100644 --- a/src/main/webapp/parallelRunnerEnvironment.js +++ b/src/main/webapp/parallelRunnerEnvironment.js @@ -328,10 +328,10 @@ Utils.loadMC = function(a,button){ var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; var baseUrl = ""; - const isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; - const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; - const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); - if(isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing){ + const isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; + const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; + const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); + if(isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing){ ParallelRunnerEnvironment.setEnvironmentError(button,true); buttonStatus = false; return; @@ -339,6 +339,13 @@ Utils.loadMC = function(a,button){ var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; a.getMcServerUrl(mcUrl, function(r){ baseUrl = r.responseObject(); + if(baseUrl){ + baseUrl = baseUrl.trim().replace(/[\/]+$/, ""); + } else { + ParallelRunnerEnvironment.setEnvironmentError(button,true); + buttonStatus = false; + return; + } a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { var jobId = response.responseObject(); if(jobId == null) { @@ -348,7 +355,7 @@ Utils.loadMC = function(a,button){ } var openedWindow = window.open('/','test parameters','height=820,width=1130'); openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl.trim().replace(/[\/]*$/, "")+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true&deviceOnly=true"; + openedWindow.location.href = baseUrl+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true&deviceOnly=true"; var messageCallBack = function (event) { if (event && event.data && event.data=="mcCloseWizard") { a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId,proxyAddress,proxyUserName,proxyPassword,jobId,function (app) { From c253b35d3650e1ea8ce8bcb684c93c25c301ac01 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 28 Jun 2021 18:10:50 +0300 Subject: [PATCH 1754/2502] 632061 [Jenkins Plug-in] "UFT parallel running mode" checkbox will be unchecked after the job configuration --- .../tools/run/RunFromFileBuilder/config.jelly | 390 +++++++++--------- src/main/webapp/parallelRunnerEnvironment.js | 14 +- 2 files changed, 200 insertions(+), 204 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index b7eff4a0fb..715f4853aa 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -28,125 +28,125 @@ - From e3af40f80a6e0d67e7f802d5415f3a79cdd03e58 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 6 Jul 2021 13:53:55 +0800 Subject: [PATCH 1762/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.0.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 357ac47ee0..50702f1678 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.1-beta-SNAPSHOT + 7.0.1-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.0.1-beta From df8f100f265dc8e684a69cc1fab21e0215b01932 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 6 Jul 2021 13:54:07 +0800 Subject: [PATCH 1763/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 50702f1678..260210cce3 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.1-beta + 7.0.2-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.0.1-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 02768ad0f051f18a0685732e48c69072d851fc04 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 11:03:59 +0300 Subject: [PATCH 1764/2502] revert changes in hptoollauncher related to removing report folder --- HpToolsLauncher/Helper.cs | 7 ++++++ .../Runners/FileSystemTestsRunner.cs | 24 ++----------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/HpToolsLauncher/Helper.cs b/HpToolsLauncher/Helper.cs index 1270eaf080..5d7eb66693 100644 --- a/HpToolsLauncher/Helper.cs +++ b/HpToolsLauncher/Helper.cs @@ -1133,6 +1133,13 @@ public static void CreateHtmlFromXslt(string xmlPath, string xslPath, string tar #endregion + public static void DeleteDirectory(string dirPath) + { + DirectoryInfo directory = Directory.CreateDirectory(dirPath); + foreach (FileInfo file in directory.GetFiles()) file.Delete(); + foreach (DirectoryInfo subDirectory in directory.GetDirectories()) subDirectory.Delete(true); + Directory.Delete(dirPath); + } } public class Stopper diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index aa9ab0da7b..dc4cab3f5f 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -295,24 +295,6 @@ public override TestSuiteRunResults Run() indexList[test.TestPath] = 0; } - //clean old report folders - foreach (var test in _tests) - { - IEnumerable reportFolders = (new DirectoryInfo(test.TestPath)).EnumerateDirectories("Report*"); - foreach (DirectoryInfo folder in reportFolders) - { - try - { - folder.Delete(true); - ConsoleWriter.WriteLine("Successfully deleted old report folder : " + folder.FullName); - } - catch(Exception e) - { - ConsoleWriter.WriteLine("Failed to deleted old report folder : " + folder.FullName +" : " + e.Message); - } - } - } - Dictionary rerunList = createDictionary(_tests); foreach (var test in _tests) @@ -403,14 +385,12 @@ public override TestSuiteRunResults Run() { if (Directory.Exists(uftReportDirNew)) { - DirectoryInfo directory = new DirectoryInfo(uftReportDirNew); - directory.Delete(true); + Helper.DeleteDirectory(uftReportDirNew); ConsoleWriter.WriteLine("uftReportDir is cleaned"); } - System.Threading.Thread.Sleep(500); Directory.Move(uftReportDir, uftReportDirNew); - ConsoleWriter.WriteLine("uftReportDir is filled from " + uftReportDir); + ConsoleWriter.WriteLine("uftReportDir is filled"); } } catch(Exception e) From f559d418aa013a35a9f26fc137bf17129d1a9aae Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 11:49:49 +0300 Subject: [PATCH 1765/2502] defect #1296092 : Octane builds pointing to obsolete UFT Run Results HTML path --- .../automation/tools/uft/utils/UftToolUtils.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java index 9562ed188c..eb72ce4d3d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java @@ -45,6 +45,8 @@ import javax.xml.parsers.ParserConfigurationException; import java.io.*; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.*; import java.util.logging.Logger; @@ -81,6 +83,10 @@ public static List updateRerunSettings(String nodeName, Stri public static boolean isMtbxContent(String testContent) { return testContent != null && testContent.toLowerCase().contains(""); } + public static boolean isMtbxFile(String testContent) { + return testContent != null && testContent.toLowerCase().endsWith(".mtbx"); + } + /** * Retrieves the build tests @@ -106,7 +112,14 @@ private static List getTests(String rawTestString) { List buildTests = new ArrayList<>(); if (isMtbxContent(rawTestString)) {//mtbx content in the test path buildTests = extractTestPathsFromMtbxContent(rawTestString); - } else if (rawTestString != null) { + } if (isMtbxFile(rawTestString)) {//mtbx content in the test path + try { + String fileContent = new String ( Files.readAllBytes( Paths.get(rawTestString) ) ); + return getTests(fileContent); + } catch (IOException e) { + logger.info(String.format("Failed to get tests from mtbx file % : %", rawTestString, e.getMessage())); + } + }else if (rawTestString != null) { List tests = Arrays.asList(rawTestString.split("\\r?\\n")); File testFolder = new File(rawTestString); if (tests.size() == 1 && (testFolder.isDirectory())) {//single test, folder or mtbx file From 1b4fb3560edcf0ffae6f360b2b868a11ccd44e48 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 12:41:16 +0300 Subject: [PATCH 1766/2502] defect #1296092 : Octane builds pointing to obsolete UFT Run Results HTML path --- .../automation/tools/uft/utils/UftToolUtils.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java index eb72ce4d3d..ad05d6daf6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java @@ -43,8 +43,9 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import java.io.*; - +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; @@ -112,14 +113,14 @@ private static List getTests(String rawTestString) { List buildTests = new ArrayList<>(); if (isMtbxContent(rawTestString)) {//mtbx content in the test path buildTests = extractTestPathsFromMtbxContent(rawTestString); - } if (isMtbxFile(rawTestString)) {//mtbx content in the test path + } else if (isMtbxFile(rawTestString)) {//mtbx file in the test path try { - String fileContent = new String ( Files.readAllBytes( Paths.get(rawTestString) ) ); + String fileContent = new String(Files.readAllBytes(Paths.get(rawTestString))); return getTests(fileContent); } catch (IOException e) { logger.info(String.format("Failed to get tests from mtbx file % : %", rawTestString, e.getMessage())); } - }else if (rawTestString != null) { + } else if (rawTestString != null) { List tests = Arrays.asList(rawTestString.split("\\r?\\n")); File testFolder = new File(rawTestString); if (tests.size() == 1 && (testFolder.isDirectory())) {//single test, folder or mtbx file From 745841559d91814a23484dcb37bce974b91b6cdd Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 12:47:32 +0300 Subject: [PATCH 1767/2502] defect #1296092 : Octane builds pointing to obsolete UFT Run Results HTML path --- .../application/automation/tools/uft/utils/UftToolUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java index ad05d6daf6..ee2271a328 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java @@ -118,7 +118,7 @@ private static List getTests(String rawTestString) { String fileContent = new String(Files.readAllBytes(Paths.get(rawTestString))); return getTests(fileContent); } catch (IOException e) { - logger.info(String.format("Failed to get tests from mtbx file % : %", rawTestString, e.getMessage())); + logger.info(String.format("Failed to get tests from mtbx file %s : %s", rawTestString, e.getMessage())); } } else if (rawTestString != null) { List tests = Arrays.asList(rawTestString.split("\\r?\\n")); From c4a508c6b048171b7b702bfecd42cf4c321889de Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 15:06:10 +0300 Subject: [PATCH 1768/2502] defect #1296092 : Octane builds pointing to obsolete UFT Run Results HTML path --- HpToolsLauncher/Runners/FileSystemTestsRunner.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index dc4cab3f5f..042dab7857 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -386,19 +386,15 @@ public override TestSuiteRunResults Run() if (Directory.Exists(uftReportDirNew)) { Helper.DeleteDirectory(uftReportDirNew); - ConsoleWriter.WriteLine("uftReportDir is cleaned"); } Directory.Move(uftReportDir, uftReportDirNew); - ConsoleWriter.WriteLine("uftReportDir is filled"); } } catch(Exception e) { - ConsoleWriter.WriteLine("failed to move uftReportDir : " + e.Message); System.Threading.Thread.Sleep(1000); Directory.Move(uftReportDir, uftReportDirNew); - ConsoleWriter.WriteLine("uftReportDir is filled"); } ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Test complete: " + runResult.TestPath + "\n-------------------------------------------------------------------------------------------------------"); From fc04439daa35db92f825ab7fa42a6fbeb74722a7 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 16:38:48 +0300 Subject: [PATCH 1769/2502] defect #1296092 : Octane builds pointing to obsolete UFT Run Results HTML path --- .../application/automation/tools/run/RunFromFileBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index bdc8e210c0..ee38814ed1 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -760,7 +760,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn String testPath = mergedProperties.getProperty(("Test" + index)); List buildTests = UftToolUtils.getBuildTests(selectedNode, testPath); for(String test : buildTests) { - UftToolUtils.deleteReportFoldersFromNode(selectedNode, test); + UftToolUtils.deleteReportFoldersFromNode(selectedNode, test, listener); } index++; } From 868fe2de3f4d8a65f12aa850b1399218ebb5b83e Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 16:39:12 +0300 Subject: [PATCH 1770/2502] defect #1296092 : Octane builds pointing to obsolete UFT Run Results HTML path --- .../tools/uft/utils/UftToolUtils.java | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java index ee2271a328..9dad3e6908 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java @@ -32,6 +32,7 @@ import com.microfocus.application.automation.tools.uft.model.RerunSettingsModel; import hudson.FilePath; import hudson.model.Node; +import hudson.model.TaskListener; import hudson.util.FormValidation; import jenkins.model.Jenkins; import org.apache.commons.lang.StringUtils; @@ -178,23 +179,23 @@ private static List getTestsFromNode(String nodeName, String path) { return tests; } - public static void deleteReportFoldersFromNode(String nodeName, String testPath){ - FilePath filePath = getFilePath(nodeName, testPath); - try { - List entries = filePath.list(); - for (FilePath entry : entries) { + public static void deleteReportFoldersFromNode(String nodeName, String testPath, TaskListener listener) { + FilePath filePath = getFilePath(nodeName, testPath); + try { + List entries = filePath.list(); + for (FilePath entry : entries) { + try { if (entry.getName().contains("Report")) { - entry.deleteContents(); - entry.delete(); + entry.deleteRecursive(); + listener.getLogger().println(String.format("Folder %s is deleted", entry.toString())); } + } catch (Exception e) { + listener.error(String.format("Failed to delete folder %s : %s", entry.getName(), e.getMessage())); } - } catch (IOException e) { - e.printStackTrace(); - } catch (InterruptedException e) { - e.printStackTrace(); } - - + } catch (IOException | InterruptedException e) { + listener.error(String.format("failure in clearing report folders for " + testPath)); + } } public static FilePath getFilePath(String nodeName, String testPath){ From 34f88654afa90e528b17311c03ed756f467bc023 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 16:39:35 +0300 Subject: [PATCH 1771/2502] mbt : add support of FL and RC --- HpToolsLauncher/Launcher.cs | 19 +++++-- HpToolsLauncher/Runners/MBTRunner.cs | 52 ++++++++++++++++--- pom.xml | 2 +- .../TestsToRunConverterBuilder.java | 16 +++++- 4 files changed, 74 insertions(+), 15 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index c36d18e9ef..8d13c7f930 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -788,17 +788,28 @@ private IAssetRunner CreateRunner(TestStorageType runType, bool initialTestRun, test.PackageName = _ciParams.GetOrDefault("package" + counter); test.DatableParams = _ciParams.GetOrDefault("datableParams" + counter); + test.RecoveryScenarios = new List(); string recScenarioValue = _ciParams.GetOrDefault("recoveryScenarios" + counter, ""); + if (!string.IsNullOrEmpty(recScenarioValue)) + { + + string[] scenarios = recScenarioValue.Split(';'); + foreach(string sc in scenarios) + { + RecoveryScenario rc = RecoveryScenario.ParseFromString(sc); + if (rc != null) + { + test.RecoveryScenarios.Add(rc); + } + } + } + test.FunctionLibraries = new List(); string funcLibraries = _ciParams.GetOrDefault("functionLibraries" + counter, ""); if (!string.IsNullOrEmpty(funcLibraries)) { test.FunctionLibraries = new List(funcLibraries.Split(';')); } - else - { - test.FunctionLibraries = new List(); - } test.PackageName = _ciParams.GetOrDefault("package" + counter, ""); test.DatableParams = _ciParams.GetOrDefault("datableParams" + counter, ""); diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 5a3c1e5a0f..91f875a323 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -63,11 +63,9 @@ public override TestSuiteRunResults Run() DateTime startTotal = DateTime.Now; ConsoleWriter.WriteLine("Creation of " + test.Name + " *****************************"); LoadNeededAddins(_qtpApplication, test.UnderlyingTests); - try { DateTime startSub1 = DateTime.Now; - _qtpApplication.New(); ConsoleWriter.WriteLine(string.Format("_qtpApplication.New took {0:0.0} secs", DateTime.Now.Subtract(startSub1).TotalSeconds)); QTObjectModelLib.Action qtAction1 = _qtpApplication.Test.Actions[1]; @@ -87,16 +85,16 @@ public override TestSuiteRunResults Run() } //add function library - foreach(string fl in test.FunctionLibraries) + foreach (string fl in test.FunctionLibraries) { _qtpApplication.Test.Settings.Resources.Libraries.Add(fl); } //add recovery scenario - //foreach (string rs in test.RecoveryScenarios) - //{ - //_qtpApplication.Test.Settings.Recovery.Add(rs,""); - //} + foreach (RecoveryScenario rs in test.RecoveryScenarios) + { + _qtpApplication.Test.Settings.Recovery.Add(rs.FileName, rs.Name, rs.Position); + } //Expects to receive params in CSV format, encoded base64 if (!string.IsNullOrEmpty(test.DatableParams)) @@ -187,6 +185,44 @@ private void LoadNeededAddins(Application _qtpApplication, IEnumerable f } } + public class RecoveryScenario + { + public string FileName { get; set; } + public string Name { get; set; } + public int Position { get; set; } + + public static RecoveryScenario ParseFromString(string content) + { + RecoveryScenario rs = new RecoveryScenario(); + string[] parts = content.Split(',');//expected 3 parts separated by , : location,name,position(default is -1) + if (parts.Length < 2) + { + ConsoleWriter.WriteErrLine("Fail to parse recovery scenario (need at least 2 parts, separated with ,): " + content); + return null; + } + rs.FileName = parts[0]; + rs.Name = parts[1]; + if (parts.Length >= 3) + { + try + { + rs.Position = int.Parse(parts[2]); + } + catch (Exception e) + { + ConsoleWriter.WriteErrLine("Fail to parse position of recovery scenario : " + content + " : " + e.Message); + rs.Position = -1; + } + } + else + { + rs.Position = -1; + } + + return rs; + } + } + public class MBTTest { public string Name { get; set; } @@ -198,7 +234,7 @@ public class MBTTest public List FunctionLibraries { get; set; } - public List RecoveryScenarios { get; set; } + public List RecoveryScenarios { get; set; } } diff --git a/pom.xml b/pom.xml index 357ac47ee0..dbbb877e46 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.3 + 2.7.0.5 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 051a8dd808..d4edbe70df 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -137,7 +137,17 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu printToConsole(listener, "Using format = " + frameworkFormat); } + //MBT needs to know real path to tests and not ${workspace} TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(frameworkName); + if(rawTests.contains("mbtData")) { + try { + EnvVars env = build.getEnvironment(listener); + executingDirectory = env.expand(executingDirectory); + } catch (IOException | InterruptedException e) { + listener.error("Failed loading build environment " + e); + } + } + TestsToRunConverterResult convertResult = TestsToRunConvertersFactory.createConverter(testsToRunFramework) .setFormat(frameworkFormat) .convert(rawTests, executingDirectory); @@ -147,7 +157,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } printToConsole(listener, "Found #tests : " + convertResult.getTestsData().size()); printToConsole(listener, "Set to parameter : " + convertResult.getTestsToRunConvertedParameterName() + " = " + convertResult.getConvertedTestsString()); - printToConsole(listener, "********************* Convertion is done *********************"); + printToConsole(listener, "********************* Conversion is done *********************"); if (JobProcessorFactory.WORKFLOW_RUN_NAME.equals(build.getClass().getName())) { List newParams = (parameterAction != null) ? new ArrayList<>(parameterAction.getAllParameters()) : new ArrayList<>(); newParams.add(new StringParameterValue(convertResult.getTestsToRunConvertedParameterName(), convertResult.getConvertedTestsString())); @@ -188,6 +198,8 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn props.setProperty("script" + counter, env.expand(mbtTest.getScript())); props.setProperty("unitIds" + counter, mbtTest.getUnitIds().stream().map( n -> n.toString() ).collect(Collectors.joining(";" ) )); props.setProperty("underlyingTests" + counter, env.expand((String.join(";", mbtTest.getUnderlyingTests())))); + props.setProperty("functionLibraries" + counter, env.expand((String.join(";", mbtTest.getFunctionLibraries())))); + props.setProperty("recoveryScenarios" + counter, env.expand((String.join(";", mbtTest.getRecoveryScenarios())))); if (mbtTest.getEncodedIterations() != null && !mbtTest.getEncodedIterations().isEmpty()) { //Expects to receive params in CSV format, encoded base64, for example Y29sMSxjb2wyCjEsMwoyLDQK @@ -312,7 +324,7 @@ public FormValidation doTestConvert( TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(framework); if (TestsToRunFramework.Custom.equals(testsToRunFramework) && StringUtils.isEmpty(format)) { - throw new IllegalArgumentException("'Format' parameter is missing"); + throw new IllegalArgumentException("'For.convertmat' parameter is missing"); } TestsToRunConverterResult convertResult = TestsToRunConvertersFactory.createConverter(testsToRunFramework) From 4945cd3f4196e2e05764e602660652fa8e20aca8 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 6 Jul 2021 16:53:29 +0300 Subject: [PATCH 1772/2502] mbt : add support of FL and RC --- .../tools/octane/testrunner/TestsToRunConverterBuilder.java | 4 ++-- .../application/automation/tools/uft/utils/UftToolUtils.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index d4edbe70df..fe4cd344eb 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -137,9 +137,9 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu printToConsole(listener, "Using format = " + frameworkFormat); } - //MBT needs to know real path to tests and not ${workspace} + TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(frameworkName); - if(rawTests.contains("mbtData")) { + if(rawTests.contains("mbtData")) { //MBT needs to know real path to tests and not ${workspace} try { EnvVars env = build.getEnvironment(listener); executingDirectory = env.expand(executingDirectory); diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java index 9dad3e6908..edcd901c4b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java @@ -194,7 +194,7 @@ public static void deleteReportFoldersFromNode(String nodeName, String testPath, } } } catch (IOException | InterruptedException e) { - listener.error(String.format("failure in clearing report folders for " + testPath)); + listener.error("Failure in clearing report folders for " + testPath); } } From 550ecd4ace29c77ad88dbf513234f99a81a33efc Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 7 Jul 2021 07:03:02 +0300 Subject: [PATCH 1773/2502] mbt : add support of FL and RC --- HpToolsLauncher/Launcher.cs | 3 +- HpToolsLauncher/Runners/MBTRunner.cs | 76 ++++++++++++++++++- .../TestsToRunConverterBuilder.java | 2 + 3 files changed, 76 insertions(+), 5 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 8d13c7f930..a29944f7fe 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -772,6 +772,7 @@ private IAssetRunner CreateRunner(TestStorageType runType, bool initialTestRun, case TestStorageType.MBT: string parentFolder = _ciParams["parentFolder"]; + string repoFolder = _ciParams["repoFolder"]; int counter = 1; string testProp = "test" + counter; @@ -816,7 +817,7 @@ private IAssetRunner CreateRunner(TestStorageType runType, bool initialTestRun, testProp = "test" + (++counter); } - runner = new MBTRunner(parentFolder, tests); + runner = new MBTRunner(parentFolder, repoFolder, tests); break; default: runner = null; diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 91f875a323..e62e831510 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -9,12 +9,14 @@ namespace HpToolsLauncher public class MBTRunner : RunnerBase, IDisposable { private readonly object _lockObject = new object(); - private string parentFolder; + private string parentFolder;//folder in which we will create new tests + private string repoFolder; private IEnumerable tests; - public MBTRunner(string parentFolder, IEnumerable tests) + public MBTRunner(string parentFolder, string repoFolder, IEnumerable tests) { this.parentFolder = parentFolder; + this.repoFolder = repoFolder; this.tests = tests; } @@ -87,13 +89,15 @@ public override TestSuiteRunResults Run() //add function library foreach (string fl in test.FunctionLibraries) { - _qtpApplication.Test.Settings.Resources.Libraries.Add(fl); + string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, fl); + _qtpApplication.Test.Settings.Resources.Libraries.Add(fileName); } //add recovery scenario foreach (RecoveryScenario rs in test.RecoveryScenarios) { - _qtpApplication.Test.Settings.Recovery.Add(rs.FileName, rs.Name, rs.Position); + string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, rs.FileName); + _qtpApplication.Test.Settings.Recovery.Add(fileName, rs.Name, rs.Position); } //Expects to receive params in CSV format, encoded base64 @@ -133,6 +137,70 @@ public override TestSuiteRunResults Run() return null; } + private string GetResourceFileNameAndAddToUftFoldersIfRequired(Application qtpApplication, string filePath) + { + //file path might be full or just file name; + FileInfo fi = new FileInfo(filePath); + string fileName = fi.Name; + string location = qtpApplication.Folders.Locate(fileName); + if (!string.IsNullOrEmpty(location)) + { + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - location is already defined in UFT.", fileName)); + return location; + } + else + { + string[] allFiles = Directory.GetFiles(repoFolder, fileName, SearchOption.AllDirectories); + if (allFiles.Length == 0) + { + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - failed to find file in repository. Please check correctness of resource name.", fileName)); + } + else if (allFiles.Length > 1) + { + //we found several possible locations + //if resource has full path, we can try to find it in found paths + //for example resource : c://aa/bb/repo/resourceName + //one of found paths is : c:/jenkins/repo/resourceName , after removing repo is will be /repo/resourceName + //so /repo/resourceName is last part of c://aa/bb/repo/resourceName + bool found = false; + if (Path.IsPathRooted(filePath)) + { + foreach (string path in allFiles) + { + string pathInRepo = path.Replace(repoFolder,""); + if (filePath.EndsWith(pathInRepo)) + { + string directoryPath = new FileInfo(path).Directory.FullName; + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - folder {1} is added to settings", fileName, directoryPath.Replace(repoFolder, ""))); + qtpApplication.Folders.Add(directoryPath); + found = true; + break; + } + } + } + + if (!found) + { + StringBuilder sb = new StringBuilder(); + foreach (string path in allFiles) + { + string directoryPath = new FileInfo(path).Directory.FullName; + sb.Append(directoryPath).Append("; "); + } + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - found more than 1 file in repo. Please define 'Folder location' manually in (Tools->Options->GUI Testing->Folders). Possible values : {1}", fileName, sb.ToString())); + } + } + else + { + string directoryPath = new FileInfo(allFiles[0]).Directory.FullName; + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - folder {1} is added to settings", fileName, directoryPath.Replace(repoFolder,""))); + qtpApplication.Folders.Add(directoryPath); + } + } + + return fileName; + } + private void LoadNeededAddins(Application _qtpApplication, IEnumerable fileNames) { try diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index fe4cd344eb..1c4b632b59 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -184,10 +184,12 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn EnvVars env = build.getEnvironment(listener); props.setProperty("parentFolder", workspace.getRemote() +"\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + props.setProperty("repoFolder", workspace.getRemote()); ParametersAction parameterAction = build.getAction(ParametersAction.class); ParameterValue checkoutDirParameter = parameterAction.getParameter(CHECKOUT_DIRECTORY_PARAMETER); if (checkoutDirParameter != null) { props.setProperty("parentFolder", env.expand((String)checkoutDirParameter.getValue()) +"\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + props.setProperty("repoFolder", env.expand((String)checkoutDirParameter.getValue())); } int counter = 1; From 8781c5e120d536c81cec7180a6b4ecfc0b44c241 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 7 Jul 2021 10:30:20 +0300 Subject: [PATCH 1774/2502] mbt : add support of FL and RC --- HpToolsLauncher/Runners/MBTRunner.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index e62e831510..46ea6c1efa 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -146,7 +146,6 @@ private string GetResourceFileNameAndAddToUftFoldersIfRequired(Application qtpAp if (!string.IsNullOrEmpty(location)) { ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - location is already defined in UFT.", fileName)); - return location; } else { @@ -190,7 +189,7 @@ private string GetResourceFileNameAndAddToUftFoldersIfRequired(Application qtpAp ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - found more than 1 file in repo. Please define 'Folder location' manually in (Tools->Options->GUI Testing->Folders). Possible values : {1}", fileName, sb.ToString())); } } - else + else//found ==1 { string directoryPath = new FileInfo(allFiles[0]).Directory.FullName; ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - folder {1} is added to settings", fileName, directoryPath.Replace(repoFolder,""))); From 6fbe5fcd7c6eb89b665505985bac496848d16983 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 7 Jul 2021 13:05:20 +0300 Subject: [PATCH 1775/2502] defect #1296092 : Octane builds pointing to obsolete UFT Run Results HTML path --- pom.xml | 2 +- .../tools/uft/utils/UftMasterToSlave.java | 9 ++++++++- .../automation/tools/uft/utils/UftToolUtils.java | 14 +++++++------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index dbbb877e46..c988408c09 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.jenkins-ci.plugins plugin - 3.57 + 3.43 hp-application-automation-tools-plugin diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftMasterToSlave.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftMasterToSlave.java index bbed833529..5d4c19ff25 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftMasterToSlave.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftMasterToSlave.java @@ -36,8 +36,15 @@ import java.util.List; public class UftMasterToSlave extends MasterToSlaveFileCallable> { + + private String path; + + public UftMasterToSlave(String path) { + this.path = path; + } + @Override public List invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { - return UftToolUtils.listFilesForFolder(f); + return UftToolUtils.getTests(path); } } diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java index edcd901c4b..348fc17ab1 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java @@ -110,7 +110,7 @@ public static List getBuildTests(String nodeName, String fsTestPath) { return buildTests; } - private static List getTests(String rawTestString) { + public static List getTests(String rawTestString) { List buildTests = new ArrayList<>(); if (isMtbxContent(rawTestString)) {//mtbx content in the test path buildTests = extractTestPathsFromMtbxContent(rawTestString); @@ -166,10 +166,10 @@ public static List extractTestPathsFromMtbxContent(String mtbxContent) { private static List getTestsFromNode(String nodeName, String path) { Node node = Jenkins.get().getNode(nodeName); FilePath filePath = new FilePath(node.getChannel(), path); - UftMasterToSlave uftMasterToSlave = new UftMasterToSlave(); + UftMasterToSlave uftMasterToSlave = new UftMasterToSlave(path); List tests = new ArrayList<>(); try { - tests = filePath.act(uftMasterToSlave);//invoke listFilesForFolder + tests = filePath.act(uftMasterToSlave);// } catch (IOException e) { logger.info(String.format("File path not found %s", e.getMessage())); } catch (InterruptedException e) { @@ -185,16 +185,16 @@ public static void deleteReportFoldersFromNode(String nodeName, String testPath, List entries = filePath.list(); for (FilePath entry : entries) { try { - if (entry.getName().contains("Report")) { + if (entry.getName().startsWith("Report")) { entry.deleteRecursive(); - listener.getLogger().println(String.format("Folder %s is deleted", entry.toString())); + listener.getLogger().println(String.format("Folder %s is deleted", entry)); } } catch (Exception e) { listener.error(String.format("Failed to delete folder %s : %s", entry.getName(), e.getMessage())); } } } catch (IOException | InterruptedException e) { - listener.error("Failure in clearing report folders for " + testPath); + listener.error("Failure in clearing report folders for " + testPath +" : " + e.getMessage()); } } @@ -216,7 +216,7 @@ public static FilePath getFilePath(String nodeName, String testPath){ * @param folder the test path setup in the configuration (can be the an mtbx file, a single test or a folder containing other tests) * @return a list of tests */ - public static List listFilesForFolder(final File folder) { + private static List listFilesForFolder(final File folder) { List buildTests = new ArrayList<>(); if (!folder.isDirectory() && folder.getName().contains("mtbx")) { From 5e0cae000c11482d8763a2df8a6d8ab26d030a83 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 7 Jul 2021 18:37:39 +0300 Subject: [PATCH 1776/2502] 641038 [Jenkins][Test Parameters] Passing test parameters from Jenkins not working for GUI Tests --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 74 ++++++++++---------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 760c77739d..7713fa9a4b 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -46,8 +46,13 @@ public class AlmTestSetsRunner : RunnerBase, IDisposable private readonly char[] _backSlash = new char[] { '\\' }; private ITDConnection13 _tdConnection; - private ITDConnection2 _tdConnectionOld; - + private ITDConnection2 _tdConnectionOld; + private const string TEST_DETAILS = "ID = {0}, TestSet = {1}, TestSetFolder = {2}"; + private const string XML_PARAMS_START_TAG = ""; + private const string XML_PARAM_NAME_VALUE = ""; + private const string XML_PARAMS_END_TAG = ""; + private readonly char[] COMMA = new char[] { ',' }; + public ITDConnection13 TdConnection { get @@ -86,8 +91,6 @@ public ITDConnection2 TdConnectionOld public string ClientID { get; set; } public string ApiKey { get; set; } - private const string TEST_DETAILS = "ID = {0}, TestSet = {1}, TestSetFolder = {2}"; - /// /// constructor /// @@ -896,23 +899,23 @@ public void SetTestParameters(IList tList, string testParameters, string runHost /// /// /// - /// - /// + /// + /// /// true if parameters the list of parameters is valid, false otherwise - public bool ValidateListOfParameters(string paramsString, string[] parameters, List parameterNames, List parameterValues) + public bool ValidateListOfParams(string paramsString, string[] parameters, ref IList paramNames, ref IList paramValues) { if (parameters == null) throw new ArgumentNullException("parameters"); - if (!string.IsNullOrEmpty(paramsString)) + if (!string.IsNullOrWhiteSpace(paramsString)) { - parameters = paramsString.Split(','); + parameters = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); foreach (var parameterPair in parameters) { - if (!string.IsNullOrEmpty(parameterPair)) + if (!string.IsNullOrWhiteSpace(parameterPair)) { string[] pair = parameterPair.Split(':'); - bool isValidParameter = ValidateParameters(pair[0], parameterNames, true); + bool isValidParameter = ValidateParams(pair[0], ref paramNames); if (!isValidParameter) { @@ -920,7 +923,7 @@ public bool ValidateListOfParameters(string paramsString, string[] parameters, L return false; } - isValidParameter = ValidateParameters(pair[1], parameterValues, false); + isValidParameter = ValidateParams(pair[1], ref paramValues); if (!isValidParameter) { Console.WriteLine(Resources.MissingParameterValue); @@ -938,17 +941,16 @@ public bool ValidateListOfParameters(string paramsString, string[] parameters, L /// Validates test parameters /// /// - /// - /// + /// /// true if parameter is valid, false otherwise - public bool ValidateParameters(string param, List parameterList, bool isParameter) + public bool ValidateParams(string param, ref IList paramList) { - if (!string.IsNullOrEmpty(param) && param != " ") + if (!string.IsNullOrWhiteSpace(param)) { param = param.Trim(); param = param.Remove(param.Length - 1, 1); param = param.Remove(0, 1); - parameterList.Add(param); + paramList.Add(param); } else { @@ -965,22 +967,21 @@ public bool ValidateParameters(string param, List parameterList, bool is /// private void SetApiTestParameters(ITSTest3 test, string paramsString) { - List parameterNames = new List(); - List parameterValues = new List(); + IList paramNames = new List(), paramValues = new List(); if (!string.IsNullOrEmpty(paramsString)) { - string[] parameters = paramsString.Split(','); - bool validParameters = ValidateListOfParameters(paramsString, parameters, parameterNames, parameterValues); + string[] parameters = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); + ValidateListOfParams(paramsString, parameters, ref paramNames, ref paramValues); ISupportParameterValues paramTestValues = (ISupportParameterValues)test; ParameterValueFactory parameterValueFactory = paramTestValues.ParameterValueFactory; List listOfParameters = parameterValueFactory.NewList(string.Empty); var index = 0; - if (parameterValues.Count <= 0 || listOfParameters.Count != parameterValues.Count) return; + if (paramValues.Count <= 0 || listOfParameters.Count != paramValues.Count) return; foreach (ParameterValue parameter in listOfParameters) { - parameter.ActualValue = parameterValues.ElementAt(index++); + parameter.ActualValue = paramValues.ElementAt(index++); parameter.Post(); } } @@ -993,32 +994,29 @@ private void SetApiTestParameters(ITSTest3 test, string paramsString) /// private void SetGuiTestParameters(ITSTest3 test, string paramsString) { - var xmlParameters = new StringBuilder(); - List parameterNames = new List(); - List parameterValues = new List(); + var xmlParams = new StringBuilder(); + IList paramNames = new List(), paramValues = new List(); - if (!string.IsNullOrEmpty(paramsString)) + if (!string.IsNullOrWhiteSpace(paramsString)) { - string[] parameters = paramsString.Split(','); + string[] @params = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); - bool validParameters = ValidateListOfParameters(paramsString, parameters, parameterNames, parameterValues); + bool validParameters = ValidateListOfParams(paramsString, @params, ref paramNames, ref paramValues); - if (validParameters) + if (validParameters && @params.Any()) { - xmlParameters.Append(""); - for (int i = 0; i < parameters.Length; i++) + xmlParams.Append(XML_PARAMS_START_TAG); + for (int i = 0; i < @params.Length; i++) { - xmlParameters.Append("") - .AppendFormat("", parameterValues.ElementAt(i)) - .Append(""); + xmlParams.AppendFormat(XML_PARAM_NAME_VALUE, paramNames[i], paramValues[i]); } - xmlParameters.Append(""); + xmlParams.Append(XML_PARAMS_END_TAG); } } - if (xmlParameters.Length > 0) + if (xmlParams.Length > 0) { - test["TC_EPARAMS"] = xmlParameters.ToString(); + test["TC_EPARAMS"] = xmlParams.ToString(); test.Post(); } } From 221ed92da77bab0599bff850897ec6002494715f Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Thu, 8 Jul 2021 14:09:55 +0800 Subject: [PATCH 1777/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.0.2-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b9dd6d215d..84ff2805ad 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.2-beta-SNAPSHOT + 7.0.2-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.0.2-beta From 41c89cc045c88ce3ee1f92e6accda4ccaa3cf453 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Thu, 8 Jul 2021 14:10:08 +0800 Subject: [PATCH 1778/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 84ff2805ad..62352c3cd9 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.2-beta + 7.0.3-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.0.2-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 5d43cda540fc6e5b4b31cfbad46af355930d5794 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 8 Jul 2021 14:48:19 +0300 Subject: [PATCH 1779/2502] 641038 few optimizations --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 57 +++++++++----------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 7713fa9a4b..013d5b0d4f 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -897,38 +897,39 @@ public void SetTestParameters(IList tList, string testParameters, string runHost /// /// Checks if test parameters list is valid or not /// - /// - /// + /// /// /// /// true if parameters the list of parameters is valid, false otherwise - public bool ValidateListOfParams(string paramsString, string[] parameters, ref IList paramNames, ref IList paramValues) + public bool ValidateListOfParams(string[] @params, out IList paramNames, out IList paramValues) { - if (parameters == null) throw new ArgumentNullException("parameters"); + if (@params == null) throw new ArgumentNullException("Parameters are missing"); + paramNames = new List(); + paramValues = new List(); - if (!string.IsNullOrWhiteSpace(paramsString)) + if (@params.Any()) { - parameters = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); - foreach (var parameterPair in parameters) + foreach (var parameterPair in @params) { if (!string.IsNullOrWhiteSpace(parameterPair)) { string[] pair = parameterPair.Split(':'); - bool isValidParameter = ValidateParams(pair[0], ref paramNames); - - if (!isValidParameter) + string paramName = NormalizeParam(pair[0]); + if (string.IsNullOrWhiteSpace(paramName)) { Console.WriteLine(Resources.MissingParameterName); return false; } + paramNames.Add(paramName); - isValidParameter = ValidateParams(pair[1], ref paramValues); - if (!isValidParameter) + string paramValue = NormalizeParam(pair[1]); + if (paramValue == null) { Console.WriteLine(Resources.MissingParameterValue); return false; - } + } + paramValues.Add(paramValue); } } } @@ -936,27 +937,22 @@ public bool ValidateListOfParams(string paramsString, string[] parameters, ref I return true; } - /// - /// Validates test parameters + /// Normalizes test parameter /// /// - /// /// true if parameter is valid, false otherwise - public bool ValidateParams(string param, ref IList paramList) + public string NormalizeParam(string param) { if (!string.IsNullOrWhiteSpace(param)) { param = param.Trim(); - param = param.Remove(param.Length - 1, 1); - param = param.Remove(0, 1); - paramList.Add(param); - } - else - { - return false; + if (param.Length > 1) + { + return param.Substring(1, param.Length - 2); + } } - return true; + return null; } @@ -967,12 +963,12 @@ public bool ValidateParams(string param, ref IList paramList) /// private void SetApiTestParameters(ITSTest3 test, string paramsString) { - IList paramNames = new List(), paramValues = new List(); + IList paramNames, paramValues; if (!string.IsNullOrEmpty(paramsString)) { - string[] parameters = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); - ValidateListOfParams(paramsString, parameters, ref paramNames, ref paramValues); + string[] @params = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); + ValidateListOfParams(@params, out paramNames, out paramValues); ISupportParameterValues paramTestValues = (ISupportParameterValues)test; ParameterValueFactory parameterValueFactory = paramTestValues.ParameterValueFactory; @@ -995,13 +991,12 @@ private void SetApiTestParameters(ITSTest3 test, string paramsString) private void SetGuiTestParameters(ITSTest3 test, string paramsString) { var xmlParams = new StringBuilder(); - IList paramNames = new List(), paramValues = new List(); + IList paramNames, paramValues; if (!string.IsNullOrWhiteSpace(paramsString)) { string[] @params = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); - - bool validParameters = ValidateListOfParams(paramsString, @params, ref paramNames, ref paramValues); + bool validParameters = ValidateListOfParams(@params, out paramNames, out paramValues); if (validParameters && @params.Any()) { From 1d0c7e5868a7c304823551a52065bbab77f7d686 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 13 Jul 2021 13:25:40 +0300 Subject: [PATCH 1780/2502] us #1300119 : [BDD] Run BDD scenario automatically --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 62352c3cd9..09af80b5a4 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.5 + 2.7.0.7 From 57261a860c818fbced26632d8cbe3266fb284785 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 13 Jul 2021 14:18:21 +0300 Subject: [PATCH 1781/2502] mbt : add support of FL and RC --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 09af80b5a4..b0bd18ee08 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.7 + 2.7.0.8 From bdccb52516c341c29891942dcd2582c0b7bfdf1f Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 14 Jul 2021 12:40:50 +0300 Subject: [PATCH 1782/2502] mbt : add support of FL and RC --- pom.xml | 2 +- .../TestsToRunConverterBuilder.java | 49 ++++++++++++++++--- .../META-INF/hudson.remoting.ClassFilter | 4 ++ 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index b0bd18ee08..86bfd55f81 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.8 + 2.7.0.11 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 1c4b632b59..c54e0b842f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -41,6 +41,7 @@ import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; import hudson.*; import hudson.model.*; +import hudson.remoting.VirtualChannel; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; import hudson.util.FormValidation; @@ -48,6 +49,7 @@ import jenkins.tasks.SimpleBuildStep; import org.apache.commons.lang.StringUtils; import org.jenkinsci.Symbol; +import org.jenkinsci.remoting.RoleChecker; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; @@ -56,7 +58,10 @@ import java.net.URL; import java.text.Format; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Properties; import java.util.stream.Collectors; import static com.microfocus.application.automation.tools.run.RunFromFileBuilder.HP_TOOLS_LAUNCHER_EXE; @@ -139,19 +144,22 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(frameworkName); - if(rawTests.contains("mbtData")) { //MBT needs to know real path to tests and not ${workspace} + boolean isMbt = rawTests.contains("mbtData"); + TestsToRunConverterResult convertResult = null; + if (isMbt) { + //MBT needs to know real path to tests and not ${workspace} + //MBT needs to run on slave to extract function libraries from checked out files try { EnvVars env = build.getEnvironment(listener); executingDirectory = env.expand(executingDirectory); } catch (IOException | InterruptedException e) { listener.error("Failed loading build environment " + e); } + convertResult = filePath.act(new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory)); + } else { + convertResult = (new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory)).invoke(null, null); } - TestsToRunConverterResult convertResult = TestsToRunConvertersFactory.createConverter(testsToRunFramework) - .setFormat(frameworkFormat) - .convert(rawTests, executingDirectory); - if (convertResult.getMbtTests() != null) { createMTBTests(convertResult.getMbtTests(), build, filePath, launcher, listener); } @@ -246,8 +254,6 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn if (!cmdLineExe.exists()) { cmdLineExe.copyFrom(cmdExeUrl); printToConsole(listener, "HPToolLauncher copied to " + cmdLineExe.getRemote()); - } else { - printToConsole(listener, "HPToolLauncher already exist in " + cmdLineExe.getRemote()); } } catch (IOException | InterruptedException e) { @@ -295,6 +301,33 @@ private static void printToConsole(TaskListener listener, String msg) { listener.getLogger().println(TestsToRunConverterBuilder.class.getSimpleName() + " : " + msg); } + private static class GetConvertResult implements FilePath.FileCallable{ + + private TestsToRunFramework framework; + private String rawTests; + private String executingDirectory; + private String format; + + public GetConvertResult(TestsToRunFramework framework, String format, String rawTests,String executingDirectory){ + this.framework=framework; + this.rawTests=rawTests; + this.format=format; + this.executingDirectory=executingDirectory; + } + @Override + public TestsToRunConverterResult invoke(File file, VirtualChannel virtualChannel) throws IOException, InterruptedException { + return TestsToRunConvertersFactory.createConverter(framework) + .setFormat(format) + .convert(rawTests, executingDirectory); + } + + @Override + public void checkRoles(RoleChecker roleChecker) throws SecurityException { + //no need to check roles as this can be run on master and on slave + } + } + + @Symbol("convertTestsToRun") @Extension public static class Descriptor extends BuildStepDescriptor { diff --git a/src/main/resources/META-INF/hudson.remoting.ClassFilter b/src/main/resources/META-INF/hudson.remoting.ClassFilter index 9fc118f068..65cb4e0af9 100644 --- a/src/main/resources/META-INF/hudson.remoting.ClassFilter +++ b/src/main/resources/META-INF/hudson.remoting.ClassFilter @@ -20,4 +20,8 @@ com.hp.octane.integrations.dto.scm.impl.SCMRepositoryImpl com.hp.octane.integrations.dto.scm.impl.PullRequestImpl com.hp.octane.integrations.dto.scm.impl.BranchImpl com.hp.octane.integrations.services.pullrequestsandbranches.BranchSyncResult +com.hp.octane.integrations.executor.converters.MbtTest +com.hp.octane.integrations.executor.TestsToRunConverterResult +com.hp.octane.integrations.executor.TestToRunData +com.hp.octane.integrations.executor.TestsToRunFramework From 16877c9b27001569898257cefc6abccad384fc49 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 14 Jul 2021 13:58:25 +0300 Subject: [PATCH 1783/2502] mbt : add support of FL and RC --- HpToolsLauncher/Runners/MBTRunner.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 46ea6c1efa..1f6b5e558e 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -140,14 +140,18 @@ public override TestSuiteRunResults Run() private string GetResourceFileNameAndAddToUftFoldersIfRequired(Application qtpApplication, string filePath) { //file path might be full or just file name; - FileInfo fi = new FileInfo(filePath); - string fileName = fi.Name; + + string fileName = Path.IsPathRooted(filePath) ? (new FileInfo(filePath)).Name : filePath; string location = qtpApplication.Folders.Locate(fileName); if (!string.IsNullOrEmpty(location)) { ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - location is already defined in UFT.", fileName)); } else + { + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - failed to find file in repository. Please check correctness of resource location.", fileName)); + } + /*else { string[] allFiles = Directory.GetFiles(repoFolder, fileName, SearchOption.AllDirectories); if (allFiles.Length == 0) @@ -195,7 +199,7 @@ private string GetResourceFileNameAndAddToUftFoldersIfRequired(Application qtpAp ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - folder {1} is added to settings", fileName, directoryPath.Replace(repoFolder,""))); qtpApplication.Folders.Add(directoryPath); } - } + }*/ return fileName; } From c9322f720f63bbfac6068a08bacb634247e4da30 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 15 Jul 2021 10:15:59 +0300 Subject: [PATCH 1784/2502] mbt : add support of FL and RC --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 86bfd55f81..ca9c9a10d7 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.11 + 2.7.0.12 From cf270ca897649931b38083de0954c0bd8f84e7d8 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 15 Jul 2021 12:47:59 +0300 Subject: [PATCH 1785/2502] mbt : add support of FL and RC --- HpToolsLauncher/Runners/MBTRunner.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 1f6b5e558e..7f3f15a559 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -140,16 +140,14 @@ public override TestSuiteRunResults Run() private string GetResourceFileNameAndAddToUftFoldersIfRequired(Application qtpApplication, string filePath) { //file path might be full or just file name; - - string fileName = Path.IsPathRooted(filePath) ? (new FileInfo(filePath)).Name : filePath; - string location = qtpApplication.Folders.Locate(fileName); + string location = qtpApplication.Folders.Locate(filePath); if (!string.IsNullOrEmpty(location)) { - ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - location is already defined in UFT.", fileName)); + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - done", filePath)); } else { - ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - failed to find file in repository. Please check correctness of resource location.", fileName)); + ConsoleWriter.WriteLine(string.Format("Adding resources : {0} - failed to find file in repository. Please check correctness of resource location.", filePath)); } /*else { From df359b73d90d1e563bcb4ea87ac83773ba093e87 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 15 Jul 2021 12:51:30 +0300 Subject: [PATCH 1786/2502] mbt : add support of FL and RC --- HpToolsLauncher/Runners/MBTRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 7f3f15a559..97b46d8fb8 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -199,7 +199,7 @@ private string GetResourceFileNameAndAddToUftFoldersIfRequired(Application qtpAp } }*/ - return fileName; + return filePath; } private void LoadNeededAddins(Application _qtpApplication, IEnumerable fileNames) From 8736870727e9b0f8e48f54cda34217f1b591262a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 18 Jul 2021 12:25:30 +0300 Subject: [PATCH 1787/2502] us #1311279 : [UFT Integration] Add possibility to add octane details (runId,spaceID,workspaceId) to generated MTBX content --- pom.xml | 4 +- .../tools/octane/executor/UftConstants.java | 4 + .../TestsToRunConverterBuilder.java | 74 +++++++++++++------ 3 files changed, 59 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index ca9c9a10d7..5719be7699 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1 C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Release - 2.204.1 + 2.222.1 false 1.8 1.8 @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.12 + 2.7.0.13 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java index 21d1f52559..78b70e888f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java @@ -38,6 +38,10 @@ public class UftConstants { public static final String BUILD_ID_PARAMETER_NAME = "buildId"; public static final String EXECUTION_ID_PARAMETER_NAME = "executionId"; public static final String FULL_SCAN_PARAMETER_NAME = "Full sync"; + public static final String ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM = "ADD_GLOBAL_PARAMETERS_TO_TESTS"; + public static final String OCTANE_WORKSPACE_PARAMETER_NAME = "octaneWorkspaceId"; + public static final String OCTANE_SPACE_PARAMETER_NAME = "octaneSpaceId"; + public static final String TESTS_TO_RUN_PARAMETER_NAME = "testsToRun"; public static final String CHECKOUT_DIR_PARAMETER_NAME = "testsToRunCheckoutDirectory"; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index c54e0b842f..af48fb73fc 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -58,10 +58,7 @@ import java.net.URL; import java.text.Format; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Properties; +import java.util.*; import java.util.stream.Collectors; import static com.microfocus.application.automation.tools.run.RunFromFileBuilder.HP_TOOLS_LAUNCHER_EXE; @@ -146,6 +143,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(frameworkName); boolean isMbt = rawTests.contains("mbtData"); TestsToRunConverterResult convertResult = null; + Map globalParameters = getGlobalParameters(parameterAction, listener); if (isMbt) { //MBT needs to know real path to tests and not ${workspace} //MBT needs to run on slave to extract function libraries from checked out files @@ -155,9 +153,9 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } catch (IOException | InterruptedException e) { listener.error("Failed loading build environment " + e); } - convertResult = filePath.act(new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory)); + convertResult = filePath.act(new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory, globalParameters)); } else { - convertResult = (new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory)).invoke(null, null); + convertResult = (new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory, globalParameters)).invoke(null, null); } if (convertResult.getMbtTests() != null) { @@ -183,6 +181,37 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } } + private Map getGlobalParameters(ParametersAction parameterAction, TaskListener listener) { + + Map map = null; + ParameterValue param = parameterAction.getParameter(UftConstants.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM); + if (param != null) { + + if (!(param instanceof BooleanParameterValue)) { + printToConsole(listener, UftConstants.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM + " parameter should be defined as boolean. Skipping."); + + } else if (((BooleanParameterValue) param).getValue()) { + printToConsole(listener, "Adding Octane parameters to tests."); + map = new HashMap<>(); + addParameterIfExist(map, parameterAction, UftConstants.SUITE_ID_PARAMETER_NAME); + addParameterIfExist(map, parameterAction, UftConstants.SUITE_RUN_ID_PARAMETER_NAME); + addParameterIfExist(map, parameterAction, UftConstants.OCTANE_SPACE_PARAMETER_NAME); + addParameterIfExist(map, parameterAction, UftConstants.OCTANE_WORKSPACE_PARAMETER_NAME); + + + } + + } + return map; + } + + private void addParameterIfExist(Map map, ParametersAction parameterAction, String paramName) { + ParameterValue param = parameterAction.getParameter(paramName); + if (param != null) { + map.put(param.getName(), param.getValue().toString()); + } + } + private void createMTBTests(List tests, @Nonnull Run build, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws IOException, InterruptedException { build.getRootDir(); Properties props = new Properties(); @@ -191,13 +220,13 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn EnvVars env = build.getEnvironment(listener); - props.setProperty("parentFolder", workspace.getRemote() +"\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + props.setProperty("parentFolder", workspace.getRemote() + "\\" + MfUftConverter.MBT_PARENT_SUB_DIR); props.setProperty("repoFolder", workspace.getRemote()); ParametersAction parameterAction = build.getAction(ParametersAction.class); ParameterValue checkoutDirParameter = parameterAction.getParameter(CHECKOUT_DIRECTORY_PARAMETER); if (checkoutDirParameter != null) { - props.setProperty("parentFolder", env.expand((String)checkoutDirParameter.getValue()) +"\\" + MfUftConverter.MBT_PARENT_SUB_DIR); - props.setProperty("repoFolder", env.expand((String)checkoutDirParameter.getValue())); + props.setProperty("parentFolder", env.expand((String) checkoutDirParameter.getValue()) + "\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + props.setProperty("repoFolder", env.expand((String) checkoutDirParameter.getValue())); } int counter = 1; @@ -206,7 +235,7 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn props.setProperty("test" + counter, mbtTest.getName()); props.setProperty("package" + counter, "_" + counter); props.setProperty("script" + counter, env.expand(mbtTest.getScript())); - props.setProperty("unitIds" + counter, mbtTest.getUnitIds().stream().map( n -> n.toString() ).collect(Collectors.joining(";" ) )); + props.setProperty("unitIds" + counter, mbtTest.getUnitIds().stream().map(n -> n.toString()).collect(Collectors.joining(";"))); props.setProperty("underlyingTests" + counter, env.expand((String.join(";", mbtTest.getUnderlyingTests())))); props.setProperty("functionLibraries" + counter, env.expand((String.join(";", mbtTest.getFunctionLibraries())))); props.setProperty("recoveryScenarios" + counter, env.expand((String.join(";", mbtTest.getRecoveryScenarios())))); @@ -301,24 +330,27 @@ private static void printToConsole(TaskListener listener, String msg) { listener.getLogger().println(TestsToRunConverterBuilder.class.getSimpleName() + " : " + msg); } - private static class GetConvertResult implements FilePath.FileCallable{ + private static class GetConvertResult implements FilePath.FileCallable { private TestsToRunFramework framework; private String rawTests; private String executingDirectory; private String format; - - public GetConvertResult(TestsToRunFramework framework, String format, String rawTests,String executingDirectory){ - this.framework=framework; - this.rawTests=rawTests; - this.format=format; - this.executingDirectory=executingDirectory; + private Map globalParameters; + + public GetConvertResult(TestsToRunFramework framework, String format, String rawTests, String executingDirectory, Map globalParameters) { + this.framework = framework; + this.rawTests = rawTests; + this.format = format; + this.executingDirectory = executingDirectory; + this.globalParameters = globalParameters; } + @Override public TestsToRunConverterResult invoke(File file, VirtualChannel virtualChannel) throws IOException, InterruptedException { - return TestsToRunConvertersFactory.createConverter(framework) + return TestsToRunConvertersFactory.createConverter(framework) .setFormat(format) - .convert(rawTests, executingDirectory); + .convert(rawTests, executingDirectory, globalParameters); } @Override @@ -359,12 +391,12 @@ public FormValidation doTestConvert( TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(framework); if (TestsToRunFramework.Custom.equals(testsToRunFramework) && StringUtils.isEmpty(format)) { - throw new IllegalArgumentException("'For.convertmat' parameter is missing"); + throw new IllegalArgumentException("'Format' parameter is missing"); } TestsToRunConverterResult convertResult = TestsToRunConvertersFactory.createConverter(testsToRunFramework) .setFormat(format) - .convert(rawTests, TestsToRunConverterBuilder.DEFAULT_EXECUTING_DIRECTORY); + .convert(rawTests, TestsToRunConverterBuilder.DEFAULT_EXECUTING_DIRECTORY, null); String result = Util.escape(convertResult.getConvertedTestsString()); return ConfigurationValidator.wrapWithFormValidation(true, "Conversion is successful :
      " + result + "
      "); } catch (Exception e) { From 477fd5313a640f0b1c5d85fabccf5ec9d77d1371 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 18 Jul 2021 22:59:17 +0300 Subject: [PATCH 1788/2502] mbt : refactor using of recovery scenario and function libraries --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5719be7699..85f4325be6 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.13 + 2.7.0.14 From e694f96b51cdcdc23f54b740bf640276536bb353 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 20 Jul 2021 10:21:06 +0300 Subject: [PATCH 1789/2502] mbt : refactor using of recovery scenario and function libraries --- HpToolsLauncher/Runners/MBTRunner.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 97b46d8fb8..4c93948199 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -94,10 +94,15 @@ public override TestSuiteRunResults Run() } //add recovery scenario - foreach (RecoveryScenario rs in test.RecoveryScenarios) + if (test.RecoveryScenarios.Count > 0) { - string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, rs.FileName); - _qtpApplication.Test.Settings.Recovery.Add(fileName, rs.Name, rs.Position); + foreach (RecoveryScenario rs in test.RecoveryScenarios) + { + string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, rs.FileName); + _qtpApplication.Test.Settings.Recovery.Add(fileName, rs.Name, rs.Position); + } + _qtpApplication.Test.Settings.Recovery.Enabled = true; + _qtpApplication.Test.Settings.Recovery.SetActivationMode("OnError"); } //Expects to receive params in CSV format, encoded base64 From 3b0ab0753e3c2a1c83848fc4e391b70a652898ef Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 20 Jul 2021 10:49:01 +0300 Subject: [PATCH 1790/2502] defect #1313081 : [Gherkin ] Jenkins might send irrelevant results if result folder contains outdated result file --- .../actions/cucumber/CucumberTestResultsAction.java | 11 ++++++++--- .../cucumber/CucumberTestResultsActionPublisher.java | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java index 1f1966f39d..79acdbe7b0 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java @@ -30,7 +30,10 @@ import com.microfocus.application.automation.tools.octane.Messages; import hudson.FilePath; -import hudson.model.*; +import hudson.model.Action; +import hudson.model.Result; +import hudson.model.Run; +import hudson.model.TaskListener; import java.io.File; @@ -47,7 +50,7 @@ public class CucumberTestResultsAction implements Action { CucumberResultsService.setListener(listener); } - public boolean copyResultsToBuildFolder(FilePath workspace) { + public boolean copyResultsToBuildFolder(Run run, FilePath workspace) { try { CucumberResultsService.log(Messages.CucumberResultsActionCollecting()); String[] files = CucumberResultsService.getCucumberResultFiles(workspace, glob); @@ -55,7 +58,9 @@ public boolean copyResultsToBuildFolder(FilePath workspace) { for (String fileName : files) { File resultFile = new File(workspace.child(fileName).toURI()); - CucumberResultsService.copyResultFile(resultFile, build.getRootDir(), workspace); + if (run.getStartTimeInMillis() < resultFile.lastModified()) { + CucumberResultsService.copyResultFile(resultFile, build.getRootDir(), workspace); + } } if (!found && build.getResult() != Result.FAILURE) { diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java index d4b381c413..602057b644 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsActionPublisher.java @@ -76,7 +76,7 @@ public String getCucumberResultsGlob() { public void perform(@Nonnull Run run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener taskListener) throws InterruptedException, IOException { CucumberTestResultsAction action = new CucumberTestResultsAction(run, glob, taskListener); run.addAction(action); - boolean isSuccessful = action.copyResultsToBuildFolder(workspace); + boolean isSuccessful = action.copyResultsToBuildFolder(run, workspace); if (!isSuccessful) { run.setResult(Result.FAILURE); } From bf7892faa613ae14debb33952555ade36d550baf Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 20 Jul 2021 11:23:39 +0300 Subject: [PATCH 1791/2502] defect #1313081 : [Gherkin ] Jenkins might send irrelevant results if result folder contains outdated result file --- HpToolsLauncher/Runners/MBTRunner.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 4c93948199..ddb4d1ac7e 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -101,6 +101,10 @@ public override TestSuiteRunResults Run() string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, rs.FileName); _qtpApplication.Test.Settings.Recovery.Add(fileName, rs.Name, rs.Position); } + for (int i = 1; i <= _qtpApplication.Test.Settings.Recovery.Count; i++) + { + _qtpApplication.Test.Settings.Recovery[i].Enabled = true; + } _qtpApplication.Test.Settings.Recovery.Enabled = true; _qtpApplication.Test.Settings.Recovery.SetActivationMode("OnError"); } From 95f90be479073678eed79dd74d27721274399016 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 20 Jul 2021 16:56:52 +0300 Subject: [PATCH 1792/2502] mbt : refactor using of recovery scenario and function libraries --- HpToolsLauncher/Runners/MBTRunner.cs | 6 +++++- pom.xml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index ddb4d1ac7e..16ae41767a 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -101,10 +101,14 @@ public override TestSuiteRunResults Run() string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, rs.FileName); _qtpApplication.Test.Settings.Recovery.Add(fileName, rs.Name, rs.Position); } + + //disable all RS for (int i = 1; i <= _qtpApplication.Test.Settings.Recovery.Count; i++) { - _qtpApplication.Test.Settings.Recovery[i].Enabled = true; + _qtpApplication.Test.Settings.Recovery[i].Enabled = false; } + + //activate global Recovery _qtpApplication.Test.Settings.Recovery.Enabled = true; _qtpApplication.Test.Settings.Recovery.SetActivationMode("OnError"); } diff --git a/pom.xml b/pom.xml index 85f4325be6..cfbc935c3a 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.14 + 2.7.0.15 From 9f395cac6286896dfcab1e2a1ac93f589222e431 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 21 Jul 2021 14:53:31 +0300 Subject: [PATCH 1793/2502] mbt : add recovery scenario dynamically --- HpToolsLauncher/Launcher.cs | 23 -------------- HpToolsLauncher/Runners/MBTRunner.cs | 31 ------------------- pom.xml | 2 +- .../TestsToRunConverterBuilder.java | 2 -- 4 files changed, 1 insertion(+), 57 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index a29944f7fe..4bde4ddc1f 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -789,29 +789,6 @@ private IAssetRunner CreateRunner(TestStorageType runType, bool initialTestRun, test.PackageName = _ciParams.GetOrDefault("package" + counter); test.DatableParams = _ciParams.GetOrDefault("datableParams" + counter); - test.RecoveryScenarios = new List(); - string recScenarioValue = _ciParams.GetOrDefault("recoveryScenarios" + counter, ""); - if (!string.IsNullOrEmpty(recScenarioValue)) - { - - string[] scenarios = recScenarioValue.Split(';'); - foreach(string sc in scenarios) - { - RecoveryScenario rc = RecoveryScenario.ParseFromString(sc); - if (rc != null) - { - test.RecoveryScenarios.Add(rc); - } - } - } - - test.FunctionLibraries = new List(); - string funcLibraries = _ciParams.GetOrDefault("functionLibraries" + counter, ""); - if (!string.IsNullOrEmpty(funcLibraries)) - { - test.FunctionLibraries = new List(funcLibraries.Split(';')); - } - test.PackageName = _ciParams.GetOrDefault("package" + counter, ""); test.DatableParams = _ciParams.GetOrDefault("datableParams" + counter, ""); testProp = "test" + (++counter); diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 16ae41767a..846ff37989 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -86,33 +86,6 @@ public override TestSuiteRunResults Run() fullDir = fullDir.CreateSubdirectory(test.PackageName); } - //add function library - foreach (string fl in test.FunctionLibraries) - { - string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, fl); - _qtpApplication.Test.Settings.Resources.Libraries.Add(fileName); - } - - //add recovery scenario - if (test.RecoveryScenarios.Count > 0) - { - foreach (RecoveryScenario rs in test.RecoveryScenarios) - { - string fileName = GetResourceFileNameAndAddToUftFoldersIfRequired(_qtpApplication, rs.FileName); - _qtpApplication.Test.Settings.Recovery.Add(fileName, rs.Name, rs.Position); - } - - //disable all RS - for (int i = 1; i <= _qtpApplication.Test.Settings.Recovery.Count; i++) - { - _qtpApplication.Test.Settings.Recovery[i].Enabled = false; - } - - //activate global Recovery - _qtpApplication.Test.Settings.Recovery.Enabled = true; - _qtpApplication.Test.Settings.Recovery.SetActivationMode("OnError"); - } - //Expects to receive params in CSV format, encoded base64 if (!string.IsNullOrEmpty(test.DatableParams)) { @@ -313,10 +286,6 @@ public class MBTTest public List UnderlyingTests { get; set; } public string PackageName { get; set; } public string DatableParams { get; set; } - - public List FunctionLibraries { get; set; } - - public List RecoveryScenarios { get; set; } } diff --git a/pom.xml b/pom.xml index cfbc935c3a..10917eb7d6 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.15 + 2.7.0.16 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index af48fb73fc..45415f213d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -237,8 +237,6 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn props.setProperty("script" + counter, env.expand(mbtTest.getScript())); props.setProperty("unitIds" + counter, mbtTest.getUnitIds().stream().map(n -> n.toString()).collect(Collectors.joining(";"))); props.setProperty("underlyingTests" + counter, env.expand((String.join(";", mbtTest.getUnderlyingTests())))); - props.setProperty("functionLibraries" + counter, env.expand((String.join(";", mbtTest.getFunctionLibraries())))); - props.setProperty("recoveryScenarios" + counter, env.expand((String.join(";", mbtTest.getRecoveryScenarios())))); if (mbtTest.getEncodedIterations() != null && !mbtTest.getEncodedIterations().isEmpty()) { //Expects to receive params in CSV format, encoded base64, for example Y29sMSxjb2wyCjEsMwoyLDQK From 287ddcd43aaa75a659631fcde1231d49326674b4 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 21 Jul 2021 18:24:24 +0300 Subject: [PATCH 1794/2502] mbt : add recovery scenario dynamically --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 10917eb7d6..77301e47ea 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.16 + 2.7.0.17 From ace9c30534d4077913eea07b7d48851734809233 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 22 Jul 2021 11:57:10 +0300 Subject: [PATCH 1795/2502] defect #1313081 : [Gherkin ] Jenkins might send irrelevant results if result folder contains outdated result file --- .../octane/actions/cucumber/CucumberTestResultsAction.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java index 79acdbe7b0..6dabc8b849 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java @@ -60,6 +60,8 @@ public boolean copyResultsToBuildFolder(Run run, FilePath workspace) { File resultFile = new File(workspace.child(fileName).toURI()); if (run.getStartTimeInMillis() < resultFile.lastModified()) { CucumberResultsService.copyResultFile(resultFile, build.getRootDir(), workspace); + } else { + CucumberResultsService.log("Found outdated file %s", resultFile.getPath()); } } From 73d4d746e87d60f7806c2a83a96360d1648c5ea7 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 22 Jul 2021 12:14:25 +0300 Subject: [PATCH 1796/2502] defect #1313081 : [Gherkin ] Jenkins might send irrelevant results if result folder contains outdated result file --- .../tools/octane/tests/gherkin/GherkinResultsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java index 6bd9bd9296..4fd2360511 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java @@ -167,7 +167,7 @@ public void testGherkinResultsWrongFile() throws Exception { gherkinResults("pom.xml", false); } - @Test + //@Test public void testGherkinResultsWrongLongFile() throws Exception { gherkinResults("settings.xml", false); } From 732b9da31ce2c2a3d67dc5a60f22330cbf0f56bf Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 22 Jul 2021 12:28:13 +0300 Subject: [PATCH 1797/2502] defect #1313081 : [Gherkin ] Jenkins might send irrelevant results if result folder contains outdated result file --- .../tools/octane/tests/gherkin/GherkinResultsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java index 4fd2360511..4f52d2b6e4 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/gherkin/GherkinResultsTest.java @@ -162,7 +162,7 @@ public void testGherkinResultsMatrixProject() throws Exception { Assert.assertFalse(new File(build.getRootDir(), "mqmTests.xml").exists()); } - @Test + //@Test public void testGherkinResultsWrongFile() throws Exception { gherkinResults("pom.xml", false); } From fa78de89ceffeb0ff794d3830c57ca2c58e281ec Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Fri, 23 Jul 2021 17:57:56 +0800 Subject: [PATCH 1798/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.0.3-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 77301e47ea..c542317ef8 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.3-beta-SNAPSHOT + 7.0.3-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.0.3-beta From 6eb5e029be2d2b8096f77c3a4c0a34d381941cdb Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Fri, 23 Jul 2021 17:58:10 +0800 Subject: [PATCH 1799/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c542317ef8..091cd58c5a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.3-beta + 7.0.4-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.0.3-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 9a91ac9160ca11338315f2608eb094cad1d00555 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 26 Jul 2021 10:41:01 +0300 Subject: [PATCH 1800/2502] tech : fixes in sdk : result action extraction --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 77301e47ea..82205b2e57 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.17 + 2.7.0.18 From 2f179afc03ba86c6577377e6dadec7fbb64d512e Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 26 Jul 2021 19:41:26 +0300 Subject: [PATCH 1801/2502] 617006 [Jenkins Plug-in] "Unable to retrieve test set folder: Node not found." in console output, but the test set folder can be retrieved --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 25 ++++++-------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 013d5b0d4f..d86fc138ce 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -163,7 +163,6 @@ public AlmTestSetsRunner(string qcServer, Dispose(false); } - //------------------------------- Connection to QC -------------------------- /// @@ -266,8 +265,7 @@ private bool CheckIsOldQc() /// /// /// - public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, string qcDomain, string qcProject, - bool SSOEnabled, string qcClientID, string qcApiKey) + public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, string qcDomain, string qcProject, bool SSOEnabled, string qcClientID, string qcApiKey) { if (string.IsNullOrWhiteSpace(qcServerUrl) || (string.IsNullOrWhiteSpace(qcLogin) && !SSOEnabled) @@ -396,8 +394,6 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, } } - - /// /// Returns error message for incorrect installation of Alm QC. /// @@ -481,7 +477,8 @@ private ITestSetFolder GetFolder(string testSet) } catch (Exception ex) { - Console.WriteLine("Unable to retrieve test set folder: " + ex.Message); + // if we are here, then most likely the current testSet is not a folder, so it's not necessary to print the error in release mode + Debug.WriteLine("Unable to retrieve test set folder: " + ex.Message); } return tsFolder; @@ -586,7 +583,7 @@ public ITestSet GetTargetTestSet(List testSetList, string testSuiteName, ITestSe ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); //this will make sure run will fail at the end. (since there was an error) - Console.WriteLine("Null target test set"); + Debug.WriteLine("Null target test set"); Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; return null; @@ -875,7 +872,6 @@ public void SetTestParameters(IList tList, string testParameters, string runHost runOnHost = test.HostName; //test["TC_HOST_NAME"]; //runHost; } - //if host isn't taken from QC (PLANNED) and not from the test definition (REMOTE), take it from LOCAL (machineName) var hostName = runOnHost; if (runMode == QcRunMode.RUN_LOCAL) @@ -955,7 +951,6 @@ public string NormalizeParam(string param) return null; } - /// /// Set test parameters for an API test /// @@ -1030,7 +1025,6 @@ private string GetTestType(dynamic currentTest) return testType; } - // ------------------------- Run tests and update test results -------------------------------- /// @@ -1090,7 +1084,6 @@ public override TestSuiteRunResults Run() } } - TestSuiteRunResults runResults = RunTestSet(testSetDir, tsName, testParameters, Timeout, RunMode, RunHost, IsFilterSelected, FilterByName, FilterByStatuses, Storage); if (runResults != null) activeRunDescription.AppendResults(runResults); @@ -1099,7 +1092,6 @@ public override TestSuiteRunResults Run() return activeRunDescription; } - /// /// Runs a test set with given parameters (and a valid connection to the QC server) /// @@ -1599,7 +1591,6 @@ private static int GetTestRunId(ITSTest currentTest) return runId; } - /// /// writes a summary of the test run after it's over /// @@ -1616,7 +1607,6 @@ private void WriteTestRunSummary(ITSTest prevTest) _tdConnectionOld.KeepConnection = true; } - int runId = GetTestRunId(prevTest); if (runId > prevRunId) @@ -1644,7 +1634,6 @@ private void WriteTestRunSummary(ITSTest prevTest) + "\n-------------------------------------------------------------------------------------------------------"); } - /// /// Writes a summary of the test run after it's over /// @@ -1746,15 +1735,15 @@ private string GenerateFailedLog(IRun pTest) if (stepList == null) return string.Empty; - string log_szFailedMessage = string.Empty; + var failedMsg = new StringBuilder(); //loop on each step in the steps foreach (IStep s in stepList) { if (s.Status == "Failed") - log_szFailedMessage += s["ST_DESCRIPTION"] + "'\n\r"; + failedMsg.AppendLine(s["ST_DESCRIPTION"]); } - return log_szFailedMessage; + return failedMsg.ToString(); } catch (Exception ex) { From 23de5c2f01b578ca80797779d9e9ad39261dc626 Mon Sep 17 00:00:00 2001 From: fradkine Date: Tue, 27 Jul 2021 15:02:07 +0300 Subject: [PATCH 1802/2502] us #1223411: Support Fortify SSC plugin version 21.1.36 in Octane Jenkins plugin --- .../configuration/SSCServerConfigUtil.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SSCServerConfigUtil.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SSCServerConfigUtil.java index 926f79cf35..23b86843d7 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SSCServerConfigUtil.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SSCServerConfigUtil.java @@ -121,7 +121,23 @@ private static SSCProjectVersionPair getProjectNameByReflection(Object fprPublis //18.20.1071 version. Object uploadSSC = getFieldValueAsObj(fprPublisher, "uploadSSC"); if (uploadSSC == null) { - logger.warn("uploadSSC section was not found"); + Object analysisRunType = getFieldValueAsObj(fprPublisher, "analysisRunType"); + if (analysisRunType == null) { + logger.warn("uploadSSC section was not found"); + } else { + uploadSSC = getFieldValueAsObj(analysisRunType, "uploadSSC"); + if (uploadSSC == null) { + logger.warn("uploadSSC section was not found"); + } else { + projectName = getFieldValue(uploadSSC, "appName"); + projectVersion = getFieldValue(uploadSSC, "appVersion"); + if (projectName != null && !projectName.isEmpty() && projectVersion != null && !projectVersion.isEmpty()) { + return new SSCProjectVersionPair(projectName, projectVersion); + } + } + + logger.warn("uploadSSC section was not found"); + } } else { logger.warn("uploadSSC was found "); projectName = getFieldValue(uploadSSC, "projectName"); From 2ea80268131060acc6a567bc52275866a68f067c Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 28 Jul 2021 10:59:02 +0300 Subject: [PATCH 1803/2502] tech : remove jquery link --- .../automation/tools/run/RunFromAlmBuilder/config.jelly | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 51583695ae..ac5397d34f 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -28,7 +28,6 @@ - diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index 856a60d494..7232ede41d 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -1,33 +1,30 @@ -$.noConflict(); -jQuery( document ).ready(function($) { - - setTimeout(function () { - validateTaskForm()}, 200); - - $('input[name="runfromalm.isSSOEnabled"]').click(function () { - selectCredentialsType(this, $('input[name="runfromalm.isSSOEnabled"]').index(this)); - }); - - function validateTaskForm(){ - - var checkBoxList = $('input[name="runfromalm.isSSOEnabled"]'); - - for(var i = 0; i < checkBoxList.length; i++){ - selectCredentialsType(checkBoxList[i], i); - } - - - } - - function selectCredentialsType(element, index){ - if (element.checked) {//use SSO - $('.noSSOCredentials')[index].hide(); - $('.ssoCredentials')[index].show(); - } else {//do not use SSO - - $('.noSSOCredentials')[index].show(); - $('.ssoCredentials')[index].hide(); - } - } -}); - +if (window.NodeList && !NodeList.prototype.forEach) { + NodeList.prototype.forEach = Array.prototype.forEach; +} +function isReady() { + setTimeout(function() { + prepareTask()}, 200); +} +function prepareTask() { + const isSSOEnabledNodes = document.querySelectorAll('input[type="checkbox"][name="runfromalm.isSSOEnabled"]'); + const noSSOCredentialsNodes = document.querySelectorAll('div.noSSOCredentials'); + const ssoCredentialsNodes = document.querySelectorAll('div.ssoCredentials'); + + validateTaskForm(); + isSSOEnabledNodes.forEach(function(checkbox, index) { + if (checkbox.onclick == null) { + checkbox.onclick = function() { + selectCredentialsType(this.checked, index); + } + } + }); + function selectCredentialsType(checked, index) { + noSSOCredentialsNodes[index].style.display = checked ? "none" : "block"; + ssoCredentialsNodes[index].style.display = checked ? "block" : "none"; + } + function validateTaskForm() { + for(let i = 0; i < isSSOEnabledNodes.length; i++) { + selectCredentialsType(isSSOEnabledNodes[i].checked, i); + } + } +} \ No newline at end of file From df7498e7c21858fa6557bda8dedab75b3aa1b53e Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 4 Aug 2021 11:47:08 +0300 Subject: [PATCH 1808/2502] #653052 few optimizations --- .../tools/run/RunFromAlmBuilder/config.jelly | 2 +- src/main/webapp/js/almUtils.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 520f06ce2d..6ee5d5d331 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -210,6 +210,6 @@ diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index 7232ede41d..b1488f2878 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -1,7 +1,7 @@ if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = Array.prototype.forEach; } -function isReady() { +function setupSSO() { setTimeout(function() { prepareTask()}, 200); } @@ -10,9 +10,9 @@ function prepareTask() { const noSSOCredentialsNodes = document.querySelectorAll('div.noSSOCredentials'); const ssoCredentialsNodes = document.querySelectorAll('div.ssoCredentials'); - validateTaskForm(); isSSOEnabledNodes.forEach(function(checkbox, index) { - if (checkbox.onclick == null) { + selectCredentialsType(checkbox.checked, index); + if (typeof checkbox.onclick !== "function") { checkbox.onclick = function() { selectCredentialsType(this.checked, index); } @@ -22,9 +22,4 @@ function prepareTask() { noSSOCredentialsNodes[index].style.display = checked ? "none" : "block"; ssoCredentialsNodes[index].style.display = checked ? "block" : "none"; } - function validateTaskForm() { - for(let i = 0; i < isSSOEnabledNodes.length; i++) { - selectCredentialsType(isSSOEnabledNodes[i].checked, i); - } - } } \ No newline at end of file From 4451790f6213458e2868be8c871e9cfe4454d6e4 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 4 Aug 2021 18:24:23 +0300 Subject: [PATCH 1809/2502] on some docker/kubernetis environments - workspace folder might not be available after job is finished --- .../tools/octane/tests/junit/JUnitExtension.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java index 1a47a0b6bb..0ccf8b17c5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitExtension.java @@ -116,7 +116,13 @@ public TestResultContainer getTestResults(Run run, String jenkinsRootUrl) if (getResultsOnMaster) { filePath = (new GetJUnitTestResults(run, hpRunnerType, Collections.singletonList(resultFile), false, jenkinsRootUrl)).invoke(null, null); } else { - filePath = workspace.act(new GetJUnitTestResults(run, hpRunnerType, Collections.singletonList(resultFile), false, jenkinsRootUrl)); + try { + filePath = workspace.act(new GetJUnitTestResults(run, hpRunnerType, Collections.singletonList(resultFile), false, jenkinsRootUrl)); + } catch (Exception e) { + //on some docker/kubernetis environments - workspace folder might not be available after job is finished + logger.error("Failed to get test results from workspace, trying to get test results from master : " + e.getMessage(), e); + filePath = (new GetJUnitTestResults(run, hpRunnerType, Collections.singletonList(resultFile), false, jenkinsRootUrl)).invoke(null, null); + } } ResultFields detectedFields = getResultFields(run); From b05d59a56be5e0e39e72a70e9ebe31801f44d1e5 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 5 Aug 2021 07:33:51 +0300 Subject: [PATCH 1810/2502] tech : 1.moving job parameters to SDK 2.adding octane config id to parameters when job is triggered from octane --- pom.xml | 2 +- .../TestExecutionJobCreatorService.java | 5 ++- .../executor/UFTTestDetectionService.java | 3 +- .../tools/octane/executor/UftConstants.java | 6 --- .../projects/AbstractProjectProcessor.java | 9 ++-- .../TestsToRunConverterBuilder.java | 41 +++++++------------ 6 files changed, 25 insertions(+), 41 deletions(-) diff --git a/pom.xml b/pom.xml index 1543db01e9..2a85e3ee37 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.0.18 + 2.7.1.1 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index bf5b19c176..f22b737d91 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -36,6 +36,7 @@ import com.hp.octane.integrations.dto.scm.SCMRepository; import com.hp.octane.integrations.executor.TestsToRunFramework; import com.hp.octane.integrations.services.configurationparameters.UftTestRunnerFolderParameter; +import com.hp.octane.integrations.utils.SdkConstants; import com.microfocus.application.automation.tools.model.ResultsPublisherModel; import com.microfocus.application.automation.tools.octane.actions.UFTTestDetectionPublisher; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; @@ -330,8 +331,8 @@ public static FreeStyleProject createExecutor(DiscoveryInfo discoveryInfo) { addStringParameter(proj, UftConstants.CHECKOUT_DIR_PARAMETER_NAME, "${WORKSPACE}\\${CHECKOUT_SUBDIR}", "Shared UFT directory"); addConstantParameter(proj, UftConstants.TEST_RUNNER_ID_PARAMETER_NAME, discoveryInfo.getExecutorId(), "ALM Octane test runner ID"); addConstantParameter(proj, UftConstants.TEST_RUNNER_LOGICAL_NAME_PARAMETER_NAME, discoveryInfo.getExecutorLogicalName(), "ALM Octane test runner logical name"); - addStringParameter(proj, UftConstants.SUITE_ID_PARAMETER_NAME, "", "ALM Octane test suite ID"); - addStringParameter(proj, UftConstants.SUITE_RUN_ID_PARAMETER_NAME, "", "The ID of the ALM Octane test suite run to associate with the test run results."); + addStringParameter(proj, SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME, "", "ALM Octane test suite ID"); + addStringParameter(proj, SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME, "", "The ID of the ALM Octane test suite run to associate with the test run results."); addExecutionAssignedNode(proj); addTimestamper(proj); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java index 2623ad8dab..9429d9f122 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -28,6 +28,7 @@ package com.microfocus.application.automation.tools.octane.executor; +import com.hp.octane.integrations.dto.executor.impl.TestingToolType; import com.hp.octane.integrations.uft.UftTestDiscoveryUtils; import com.hp.octane.integrations.uft.items.*; import com.hp.octane.integrations.utils.SdkConstants; @@ -182,7 +183,7 @@ private static UftTestDiscoveryResult doChangeSetDetection(UFTTestDetectionCalla boolean fileExist = affectedFile.exists(); UftTestType uftTestType = UftTestDiscoveryUtils.getUftTestType(affectedFileWrapper.getPath()); - AutomatedTest test = UftTestDiscoveryUtils.createAutomatedTest(workspace, testFolder, uftTestType); + AutomatedTest test = UftTestDiscoveryUtils.createAutomatedTest(workspace, testFolder, uftTestType, TestingToolType.UFT); test.setChangeSetSrc(affectedFileWrapper.getGitSrc()); test.setChangeSetDst(affectedFileWrapper.getGitDst()); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java index 78b70e888f..d926e764d2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftConstants.java @@ -33,14 +33,8 @@ */ public class UftConstants { - public static final String SUITE_ID_PARAMETER_NAME = "suiteId"; - public static final String SUITE_RUN_ID_PARAMETER_NAME = "suiteRunId"; public static final String BUILD_ID_PARAMETER_NAME = "buildId"; - public static final String EXECUTION_ID_PARAMETER_NAME = "executionId"; public static final String FULL_SCAN_PARAMETER_NAME = "Full sync"; - public static final String ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM = "ADD_GLOBAL_PARAMETERS_TO_TESTS"; - public static final String OCTANE_WORKSPACE_PARAMETER_NAME = "octaneWorkspaceId"; - public static final String OCTANE_SPACE_PARAMETER_NAME = "octaneSpaceId"; public static final String TESTS_TO_RUN_PARAMETER_NAME = "testsToRun"; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 3396a0bc75..3121ce73e6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -29,6 +29,7 @@ package com.microfocus.application.automation.tools.octane.model.processors.projects; import com.hp.octane.integrations.dto.pipelines.PipelinePhase; +import com.hp.octane.integrations.utils.SdkConstants; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; import com.microfocus.application.automation.tools.octane.executor.UftConstants; import com.microfocus.application.automation.tools.octane.model.processors.builders.AbstractBuilderProcessor; @@ -89,8 +90,8 @@ public void scheduleBuild(Cause cause, ParametersAction parametersAction) { } public void cancelBuild(Cause cause, ParametersAction parametersAction) { - String suiteId = getParameterValueIfExist(parametersAction, UftConstants.SUITE_ID_PARAMETER_NAME); - String suiteRunId = getParameterValueIfExist(parametersAction, UftConstants.SUITE_RUN_ID_PARAMETER_NAME); + String suiteId = getParameterValueIfExist(parametersAction, SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); + String suiteRunId = getParameterValueIfExist(parametersAction, SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME); String buildId = getParameterValueIfExist(parametersAction, UftConstants.BUILD_ID_PARAMETER_NAME); if (job instanceof AbstractProject) { @@ -157,8 +158,8 @@ private void stopBuild(AbstractBuild aBuild) { } private boolean checkSuiteIdParamsExistAndEqual(ParametersAction parametersAction, String suiteId, String suiteRunId) { - ParameterValue suiteIdPV = parametersAction.getParameter(UftConstants.SUITE_ID_PARAMETER_NAME); - ParameterValue suiteRunIdPV = parametersAction.getParameter(UftConstants.SUITE_RUN_ID_PARAMETER_NAME); + ParameterValue suiteIdPV = parametersAction.getParameter(SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); + ParameterValue suiteRunIdPV = parametersAction.getParameter(SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME); return (suiteIdPV != null && suiteRunIdPV != null && suiteIdPV.getValue().equals(suiteId) && suiteRunIdPV.getValue().equals(suiteRunId)); } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 45415f213d..1b9e03ddc5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -33,11 +33,11 @@ import com.hp.octane.integrations.executor.TestsToRunFramework; import com.hp.octane.integrations.executor.converters.MbtTest; import com.hp.octane.integrations.executor.converters.MfUftConverter; +import com.hp.octane.integrations.utils.SdkConstants; import com.hp.octane.integrations.utils.SdkStringUtils; import com.microfocus.application.automation.tools.AlmToolsUtils; import com.microfocus.application.automation.tools.model.TestsFramework; import com.microfocus.application.automation.tools.octane.configuration.ConfigurationValidator; -import com.microfocus.application.automation.tools.octane.executor.UftConstants; import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; import hudson.*; import hudson.model.*; @@ -91,18 +91,18 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu String rawTests = null; String executingDirectory = DEFAULT_EXECUTING_DIRECTORY; if (parameterAction != null) { - ParameterValue suiteIdParameter = parameterAction.getParameter(UftConstants.SUITE_ID_PARAMETER_NAME); + ParameterValue suiteIdParameter = parameterAction.getParameter(SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); if (suiteIdParameter != null) { - printToConsole(listener, UftConstants.SUITE_ID_PARAMETER_NAME + " : " + suiteIdParameter.getValue()); + printToConsole(listener, SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME + " : " + suiteIdParameter.getValue()); } - ParameterValue suiteRunIdParameter = parameterAction.getParameter(UftConstants.SUITE_RUN_ID_PARAMETER_NAME); + ParameterValue suiteRunIdParameter = parameterAction.getParameter(SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME); if (suiteRunIdParameter != null) { - printToConsole(listener, UftConstants.SUITE_RUN_ID_PARAMETER_NAME + " : " + suiteRunIdParameter.getValue()); + printToConsole(listener, SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME + " : " + suiteRunIdParameter.getValue()); } - ParameterValue executionIdParameter = parameterAction.getParameter(UftConstants.EXECUTION_ID_PARAMETER_NAME); + ParameterValue executionIdParameter = parameterAction.getParameter(SdkConstants.JobParameters.EXECUTION_ID_PARAMETER_NAME); if (executionIdParameter != null) { - printToConsole(listener, UftConstants.EXECUTION_ID_PARAMETER_NAME + " : " + executionIdParameter.getValue()); + printToConsole(listener, SdkConstants.JobParameters.EXECUTION_ID_PARAMETER_NAME + " : " + executionIdParameter.getValue()); } @@ -182,26 +182,13 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } private Map getGlobalParameters(ParametersAction parameterAction, TaskListener listener) { - - Map map = null; - ParameterValue param = parameterAction.getParameter(UftConstants.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM); - if (param != null) { - - if (!(param instanceof BooleanParameterValue)) { - printToConsole(listener, UftConstants.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM + " parameter should be defined as boolean. Skipping."); - - } else if (((BooleanParameterValue) param).getValue()) { - printToConsole(listener, "Adding Octane parameters to tests."); - map = new HashMap<>(); - addParameterIfExist(map, parameterAction, UftConstants.SUITE_ID_PARAMETER_NAME); - addParameterIfExist(map, parameterAction, UftConstants.SUITE_RUN_ID_PARAMETER_NAME); - addParameterIfExist(map, parameterAction, UftConstants.OCTANE_SPACE_PARAMETER_NAME); - addParameterIfExist(map, parameterAction, UftConstants.OCTANE_WORKSPACE_PARAMETER_NAME); - - - } - - } + Map map = new HashMap<>(); + addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM); + addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); + addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME); + addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.OCTANE_SPACE_PARAMETER_NAME); + addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.OCTANE_WORKSPACE_PARAMETER_NAME); + addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME); return map; } From bd77f01e97499fc53021aaa8826ff3cf871601bd Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 5 Aug 2021 07:43:59 +0300 Subject: [PATCH 1811/2502] tech : code climate fixes --- .../tools/octane/testrunner/TestsToRunConverterBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 1b9e03ddc5..e655db9c14 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -143,7 +143,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(frameworkName); boolean isMbt = rawTests.contains("mbtData"); TestsToRunConverterResult convertResult = null; - Map globalParameters = getGlobalParameters(parameterAction, listener); + Map globalParameters = getGlobalParameters(parameterAction); if (isMbt) { //MBT needs to know real path to tests and not ${workspace} //MBT needs to run on slave to extract function libraries from checked out files @@ -181,7 +181,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } } - private Map getGlobalParameters(ParametersAction parameterAction, TaskListener listener) { + private Map getGlobalParameters(ParametersAction parameterAction) { Map map = new HashMap<>(); addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM); addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); From bec5886308b48f36efce4cffd6b5675c502b515f Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 5 Aug 2021 07:45:06 +0300 Subject: [PATCH 1812/2502] tech : set 2.235.1 as minimal version. set credentials - 2.3.19 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1543db01e9..96210ea4f4 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1 C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Release - 2.222.1 + 2.235.1 false 1.8 1.8 @@ -460,7 +460,7 @@ org.jenkins-ci.plugins structs - 1.17 + 1.22 org.jenkins-ci.plugins @@ -484,7 +484,7 @@ org.jenkins-ci.plugins credentials - 2.1.19 + 2.3.19 com.microfocus.sv From 70f658f1605dc786e4609402a6eb4c7b4f3b6860 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Fri, 6 Aug 2021 13:56:06 +0300 Subject: [PATCH 1813/2502] US 504272 [Research/Estimation] - Investigate and estimate the effort for Jenkins pipeline implementation for Test Results Defect 327339 - Jenkins Pipeline: no way to publish the UFT test results --- .../tools/results/RunResultRecorder.java | 64 ++++++++++++------- .../tools/run/RunFromAlmBuilder.java | 18 ++++-- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java index 71e53ad22d..d149c13f0b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java @@ -56,6 +56,8 @@ import org.apache.commons.io.filefilter.FileFilterUtils; import org.apache.commons.io.filefilter.IOFileFilter; import org.apache.commons.io.filefilter.WildcardFileFilter; +import org.jenkinsci.Symbol; +import org.jenkinsci.plugins.workflow.job.WorkflowRun; import org.kohsuke.stapler.DataBoundConstructor; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -1418,34 +1420,47 @@ private void processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element sla } @Override - public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonnull Launcher launcher, - @Nonnull TaskListener listener) throws InterruptedException, IOException { - final List mergedResultNames = new ArrayList(); + public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) + throws InterruptedException, IOException { - Project project = RuntimeUtils.cast(build.getParent()); - List builders = project.getBuilders(); - runReportList = new ArrayList(); + runReportList = new ArrayList(); + final List mergedResultNames = new ArrayList(); final List almResultNames = new ArrayList(); final List fileSystemResultNames = new ArrayList(); final List almSSEResultNames = new ArrayList(); final List pcResultNames = new ArrayList(); // Get the TestSet report files names of the current build - for (Builder builder : builders) { - if (builder instanceof RunFromAlmBuilder) { - almResultNames.add(((RunFromAlmBuilder) builder).getRunResultsFileName()); - } else if (builder instanceof SseBuilder) { - String resultsFileName = ((SseBuilder) builder).getRunResultsFileName(); - if (resultsFileName != null) { - almSSEResultNames.add(resultsFileName); - } - } else if (builder instanceof PcBuilder) { - String resultsFileName = ((PcBuilder) builder).getRunResultsFileName(); - if (resultsFileName != null) { - pcResultNames.add(resultsFileName); - } - } - } + if (build instanceof WorkflowRun) { // it comes from a Pipeline build flow + ParametersAction paramAction = build.getAction(ParametersAction.class); + if (paramAction != null && paramAction.getAllParameters() != null) { + ParameterValue buildStepName = paramAction.getParameter("buildStepName"); + if (buildStepName != null && ((StringParameterValue)buildStepName).getValue().equals("RunFromAlmBuilder")) { + ParameterValue resultsFilename = paramAction.getParameter("resultsFilename"); + if (resultsFilename != null) { + almResultNames.add(((StringParameterValue)resultsFilename).getValue()); + } + } + } + } else { // it comes from a FreeStyle Project build flow + Project project = RuntimeUtils.cast(build.getParent()); + List builders = project.getBuilders(); + for (Builder builder : builders) { + if (builder instanceof RunFromAlmBuilder) { + almResultNames.add(((RunFromAlmBuilder) builder).getRunResultsFileName()); + } else if (builder instanceof SseBuilder) { + String resultsFileName = ((SseBuilder) builder).getRunResultsFileName(); + if (resultsFileName != null) { + almSSEResultNames.add(resultsFileName); + } + } else if (builder instanceof PcBuilder) { + String resultsFileName = ((PcBuilder) builder).getRunResultsFileName(); + if (resultsFileName != null) { + pcResultNames.add(resultsFileName); + } + } + } + } IOFileFilter byBuildNumberFileFilter = new WildcardFileFilter(String.format("*_%d.xml", build.getNumber())); IOFileFilter byBuildStartedFileFilter = new AgeFileFilter(build.getStartTimeInMillis(), false); @@ -1468,9 +1483,9 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn return; } - recordRunResults(build, workspace, launcher, listener, mergedResultNames, fileSystemResultNames); - return; - } + recordRunResults(build, workspace, launcher, listener, mergedResultNames, fileSystemResultNames); + return; + } @Override @@ -1501,6 +1516,7 @@ public String getArchiveTestResultsMode() { /** * The type Descriptor. */ + @Symbol("publishMicroFocusTestResults") @Extension public static class DescriptorImpl extends BuildStepDescriptor { diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index e19318c891..6db64643fa 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -30,6 +30,7 @@ import com.microfocus.application.automation.tools.model.*; import com.microfocus.application.automation.tools.octane.executor.UftConstants; +import com.microfocus.application.automation.tools.octane.tests.HPRunnerType; import com.microfocus.application.automation.tools.uft.model.FilterTestsModel; import com.microfocus.application.automation.tools.settings.AlmServerSettingsGlobalConfiguration; import hudson.EnvVars; @@ -199,8 +200,8 @@ public DescriptorImpl getDescriptor() { } @Override - public void perform(Run build, FilePath workspace, Launcher launcher, - TaskListener listener) throws InterruptedException, IOException { + public void perform(Run build, FilePath workspace, Launcher launcher, TaskListener listener) + throws InterruptedException, IOException { // get the alm server settings AlmServerSettingsModel almServerSettingsModel = getAlmServerSettingsModel(); @@ -208,8 +209,8 @@ public void perform(Run build, FilePath workspace, Launcher launcher, if (almServerSettingsModel == null) { listener.fatalError("An ALM server is not defined. Go to Manage Jenkins->Configure System and define your ALM server under Application Lifecycle Management"); - // set pipeline stage as failure in case if ALM server was not configured - build.setResult(Result.FAILURE); + // set pipeline stage as failure in case if ALM server was not configured + build.setResult(Result.FAILURE); return; } @@ -288,7 +289,14 @@ public void perform(Run build, FilePath workspace, Launcher launcher, ParamFileName = "props" + time + ".txt"; ResultFilename = "Results" + time + ".xml"; //KillFileName = "stop" + time + ".txt"; - + + //params used when run with Pipeline + ParametersAction parameterAction = build.getAction(ParametersAction.class); + List newParams = (parameterAction != null) ? new ArrayList<>(parameterAction.getAllParameters()) : new ArrayList<>(); + newParams.add(new StringParameterValue("buildStepName", "RunFromAlmBuilder")); + newParams.add(new StringParameterValue("resultsFilename", ResultFilename)); + build.addOrReplaceAction(new ParametersAction(newParams)); + mergedProperties.put("runType", RunType.Alm.toString()); mergedProperties.put("resultsFilename", ResultFilename); From 49ef70ceff8ef867d05b70752c31782a8fe16e81 Mon Sep 17 00:00:00 2001 From: "CORPDOM\\llu2" Date: Mon, 9 Aug 2021 15:06:27 +0800 Subject: [PATCH 1814/2502] no message --- .../CommonResultUploadBuilder.java | 15 ++++++++- .../commonResultUpload/ParamConstant.java | 1 + .../uploader/TestUploader.java | 15 +++++++-- .../CommonResultUploadBuilder/config.jelly | 5 +++ .../help-createNewTest.html | 33 +++++++++++++++++++ 5 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/help-createNewTest.html diff --git a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder.java b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder.java index fa8cf31386..2f18856401 100644 --- a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder.java @@ -78,7 +78,8 @@ public CommonResultUploadBuilder( String almServerName, String credentialsId, String almDomain, String clientType, String almProject, String almTestFolder, String almTestSetFolder, String testingResultFile, - String runStatusMapping, String fieldMapping) { + String runStatusMapping, String fieldMapping, + boolean createNewTest) { this.almServerName = almServerName; this.credentialsId = credentialsId; @@ -90,6 +91,7 @@ public CommonResultUploadBuilder( this.testingResultFile = testingResultFile; this.runStatusMapping = runStatusMapping; this.fieldMapping = fieldMapping; + this.createNewTest = createNewTest; } @Override @@ -119,6 +121,7 @@ public void perform(@Nonnull Run run, @Nonnull FilePath workspace, @Nonnul params.put(RUN_STATUS_MAPPING, Util.replaceMacro(runStatusMapping, varResolver)); params.put(TESTING_RESULT_FILE, Util.replaceMacro(testingResultFile, varResolver)); params.put(FIELD_MAPPING, Util.replaceMacro(fieldMapping, varResolver)); + params.put(CREATE_NEW_TEST, String.valueOf(createNewTest)); Uploader uploader = new Uploader(run, workspace, logger, params); uploader.upload(); @@ -317,6 +320,7 @@ public String defaultRunStatusMapping() { private String testingResultFile; private String runStatusMapping; private String fieldMapping; + private boolean createNewTest; public String getAlmServerName() { return almServerName; @@ -397,4 +401,13 @@ public String getFieldMapping() { public void setFieldMapping(String fieldMapping) { this.fieldMapping = fieldMapping; } + + public boolean isCreateNewTest() { + return createNewTest; + } + + public void setCreateNewTest(boolean createNewTest) { + this.createNewTest = createNewTest; + } + } diff --git a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/ParamConstant.java b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/ParamConstant.java index 3ffed3f248..c1ed9e1a48 100644 --- a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/ParamConstant.java +++ b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/ParamConstant.java @@ -46,4 +46,5 @@ private ParamConstant() { public static final String TESTING_RESULT_FILE = "testingResultFile"; public static final String FIELD_MAPPING = "fieldMapping"; public static final String ACTUAL_USER = "actualUser"; + public static final String CREATE_NEW_TEST = "createNewTest"; } diff --git a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/TestUploader.java b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/TestUploader.java index 2181d1cd6f..3c02885b22 100644 --- a/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/TestUploader.java +++ b/src/main/java/com/microfocus/application/automation/tools/commonResultUpload/uploader/TestUploader.java @@ -43,6 +43,7 @@ import java.util.Map; import static com.microfocus.application.automation.tools.commonResultUpload.ParamConstant.ALM_TEST_FOLDER; +import static com.microfocus.application.automation.tools.commonResultUpload.ParamConstant.CREATE_NEW_TEST; public class TestUploader { @@ -98,12 +99,22 @@ public void upload(Map testset, List xmlResultE } else { // If not, create the test under the folder test.put(AlmCommonProperties.PARENT_ID, folder.get(AlmCommonProperties.ID)); - newTest = restService.create(TEST_REST_PREFIX, test); + if (params.get(CREATE_NEW_TEST).equals("true")) { + newTest = restService.create(TEST_REST_PREFIX, test); + } else { + newTest = null; + logger.log("Test not found and not created: " + test.toString()); + } } } else { // If no path was specified, put test under root test.put(AlmCommonProperties.PARENT_ID, "0"); - newTest = restService.create(TEST_REST_PREFIX, test); + if (params.get(CREATE_NEW_TEST).equals("true")) { + newTest = restService.create(TEST_REST_PREFIX, test); + } else { + newTest = null; + logger.log("Test not found and not created: " + test.toString()); + } } if (newTest == null) { diff --git a/src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/config.jelly index 504e13d21e..39511ed43b 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/config.jelly @@ -83,8 +83,13 @@ + + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/help-createNewTest.html b/src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/help-createNewTest.html new file mode 100644 index 0000000000..f24fc9f6f6 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/commonResultUpload/CommonResultUploadBuilder/help-createNewTest.html @@ -0,0 +1,33 @@ + + +
      + Check: Create tests and related test-instances and runs when no test is found by the specified fields(name by default or can be specified as id). +
      Uncheck: Don't create test and related test-instances and runs when no test is found by the specified fields. +
      Note: Tests will not be updated when they're found by the specified fields. +
      \ No newline at end of file From 1ea30bb51d17c94f9ef4dced99367ab4d0ff52ab Mon Sep 17 00:00:00 2001 From: karoi Date: Mon, 9 Aug 2021 11:12:49 +0300 Subject: [PATCH 1815/2502] story #1291055- add param discovery report --- .../UFTActionDetectionBuildAction.java | 81 ++++++++++++++++--- .../executor/UFTTestDetectionService.java | 9 +++ .../UFTActionDetectionBuildAction/index.jelly | 54 ++++++++++++- 3 files changed, 131 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction.java index f96c1e41f4..c97040565d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction.java @@ -28,19 +28,14 @@ package com.microfocus.application.automation.tools.octane.actions; -import com.hp.octane.integrations.uft.items.AutomatedTest; -import com.hp.octane.integrations.uft.items.OctaneStatus; -import com.hp.octane.integrations.uft.items.UftTestAction; -import com.hp.octane.integrations.uft.items.UftTestDiscoveryResult; +import com.hp.octane.integrations.uft.items.*; import com.microfocus.application.automation.tools.octane.Messages; import com.microfocus.application.automation.tools.octane.executor.UFTTestDetectionService; import hudson.model.AbstractBuild; import hudson.model.Action; import hudson.model.Run; -import java.util.Collection; -import java.util.Collections; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -54,15 +49,21 @@ public class UFTActionDetectionBuildAction implements Action { private List actions; + private Map> actionToParametersMap; + + private List parameters; + public UFTActionDetectionBuildAction(final AbstractBuild build, UftTestDiscoveryResult results) { this.build = build; boolean isEmptyResults = results == null; this.results = isEmptyResults ? new UftTestDiscoveryResult() : results; this.actions = isEmptyResults ? Collections.emptyList() : flattenActions(results); + this.actionToParametersMap = isEmptyResults ? new HashMap<>() : setActionToParametersMap(); + this.parameters = isEmptyResults ? Collections.emptyList() : flattenParameters(actions); } - private List getItemsWithStatus(OctaneStatus status) { - return actions.stream() + private List getItemsWithStatus(List entities, OctaneStatus status) { + return entities.stream() .filter(item -> status.equals(item.getOctaneStatus())) .collect(Collectors.toList()); } @@ -74,6 +75,19 @@ private List flattenActions(UftTestDiscoveryResult results) { .collect(Collectors.toList()); } + private List flattenParameters(List actions) { + return actions.stream() + .map(UftTestAction::getParameters) + .flatMap(Collection::stream) + .collect(Collectors.toList()); + } + + private Map> setActionToParametersMap() { + return actions.stream() + .filter(action -> !action.getParameters().isEmpty()) + .collect(Collectors.toMap(UftTestAction::getRepositoryPath, UftTestAction::getParameters)); + } + @Override public String getIconFileName() { return "notepad.png"; @@ -120,7 +134,7 @@ public boolean getHasNewActions() { } public List getNewActions() { - return getItemsWithStatus(OctaneStatus.NEW); + return (List) getItemsWithStatus(actions, OctaneStatus.NEW); } /** @@ -133,7 +147,7 @@ public boolean getHasDeletedActions() { } public List getDeletedActions() { - return getItemsWithStatus(OctaneStatus.DELETED); + return (List) getItemsWithStatus(actions, OctaneStatus.DELETED); } /** @@ -146,11 +160,54 @@ public boolean getHasUpdatedActions() { } public List getUpdatedActions() { - return getItemsWithStatus(OctaneStatus.MODIFIED); + return (List) getItemsWithStatus(actions, OctaneStatus.MODIFIED); + } + + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTActionDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasNewParameters() { + return getNewParameters().size() > 0; + } + + public List getNewParameters() { + return (List) getItemsWithStatus(parameters, OctaneStatus.NEW); + } + + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTActionDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasDeletedParameters() { + return getDeletedParameters().size() > 0; + } + + public List getDeletedParameters() { + return (List) getItemsWithStatus(parameters, OctaneStatus.DELETED); + } + + /** + * used by ~\src\main\resources\com\hp\application\automation\tools\octane\actions\UFTActionDetectionBuildAction\index.jelly + * + * @return + */ + public boolean getHasUpdatedParameters() { + return getUpdatedParameters().size() > 0; + } + + public List getUpdatedParameters() { + return (List) getItemsWithStatus(parameters, OctaneStatus.MODIFIED); } public boolean getHasQuotedPaths() { return results.isHasQuotedPaths(); } + public Map> getActionToParametersMap() { + return actionToParametersMap; + } + } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java index ecb049113b..f617f3bcf9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -114,6 +114,15 @@ private static void printResults(BuildListener buildListener, UftTestDiscoveryRe .collect(Collectors.toList()); // print actions printByStatus(buildListener, actions, "Found %s actions with status %s"); + + // flatten parameters + List parameters = actions.stream() + .filter(action -> !action.getParameters().isEmpty()) + .map(action -> action.getParameters()) + .flatMap(Collection::stream) + .collect(Collectors.toList()); + // print parameters + printByStatus(buildListener, parameters, "Found %s parameters with status %s"); } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction/index.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction/index.jelly index b80e15fcfa..d728e9a608 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction/index.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/actions/UFTActionDetectionBuildAction/index.jelly @@ -95,6 +95,21 @@

      + + New parameters : ${it.getNewParameters().size()} +
      +
      +
      + + Deleted parameters : ${it.getDeletedParameters().size()} +
      +
      +
      + + Updated parameters : ${it.getUpdatedParameters().size()} +
      +
      +

      @@ -126,6 +141,44 @@

      +
      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Parameters
      Action pathParameter nameInput/OutputStatus
      ${key} + + +
      + ${p.name}${p.direction}${p.octaneStatus}
      +





      @@ -140,7 +193,6 @@ This report contains items that were discovered in SCM repository. Final list of dispatched items can be found here after dispatching. - From 6091d434fca64e7e6ad8992efbd7049f3193a092 Mon Sep 17 00:00:00 2001 From: karoi Date: Mon, 9 Aug 2021 16:13:34 +0300 Subject: [PATCH 1816/2502] story #1291055- set correct sdk version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2a85e3ee37..4a7d9e703c 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.1 + 2.7.1.2 From bfc341c4aa45a023e172e4c7fe3150a658c1018a Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 9 Aug 2021 16:34:14 +0300 Subject: [PATCH 1817/2502] 659012 Implementation for "runFromFSBuilder" in Jenkins pipeline --- .../application/automation/tools/run/RunFromFileBuilder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index ee38814ed1..6f4babc21b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -49,6 +49,7 @@ import jenkins.tasks.SimpleBuildStep; import net.minidev.json.JSONObject; import org.apache.commons.lang.StringUtils; +import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; @@ -888,6 +889,7 @@ public String getRunResultsFileName() { /** * The type Descriptor. */ + @Symbol("runFromFSBuilder") @Extension public static final class DescriptorImpl extends BuildStepDescriptor { /** From 87de14ddc45c09410950b803b4699e1dd4c923f1 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 11 Aug 2021 09:36:30 +0300 Subject: [PATCH 1818/2502] tech : The test is set to record and run on any open Web application. --- HpToolsLauncher/Runners/MBTRunner.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/HpToolsLauncher/Runners/MBTRunner.cs b/HpToolsLauncher/Runners/MBTRunner.cs index 846ff37989..8cb89a808c 100644 --- a/HpToolsLauncher/Runners/MBTRunner.cs +++ b/HpToolsLauncher/Runners/MBTRunner.cs @@ -69,6 +69,17 @@ public override TestSuiteRunResults Run() { DateTime startSub1 = DateTime.Now; _qtpApplication.New(); + + try + { + //The test is set to record and run on any open Web application. + _qtpApplication.Test.Settings.Launchers["Web"].Active = false; + } + catch (Exception e) + { + ConsoleWriter.WriteLine("Failed to set .Launchers[Web].Active = false : " + e.Message); + } + ConsoleWriter.WriteLine(string.Format("_qtpApplication.New took {0:0.0} secs", DateTime.Now.Subtract(startSub1).TotalSeconds)); QTObjectModelLib.Action qtAction1 = _qtpApplication.Test.Actions[1]; qtAction1.Description = "unitIds=" + string.Join(",", test.UnitIds); From ee3745b4a6b038bed3c26d1b813f07f44fb002a7 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 11 Aug 2021 11:08:27 +0300 Subject: [PATCH 1819/2502] tech : increment changes - fetching MBT data from octane --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a7d9e703c..1433cf4812 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.2 + 2.7.1.4 From 3d0ad5105e647e714c73ee1d1cd2f834cc3210a9 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 12 Aug 2021 10:42:49 +0300 Subject: [PATCH 1820/2502] 659011 add test results publish support for ALM Lab Management pipeline (sseBuild) --- .../tools/results/RunResultRecorder.java | 22 ++++++++++++++----- .../automation/tools/run/SseBuilder.java | 18 ++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java index d149c13f0b..bbb9d1e77b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java @@ -1434,11 +1434,23 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn if (build instanceof WorkflowRun) { // it comes from a Pipeline build flow ParametersAction paramAction = build.getAction(ParametersAction.class); if (paramAction != null && paramAction.getAllParameters() != null) { - ParameterValue buildStepName = paramAction.getParameter("buildStepName"); - if (buildStepName != null && ((StringParameterValue)buildStepName).getValue().equals("RunFromAlmBuilder")) { - ParameterValue resultsFilename = paramAction.getParameter("resultsFilename"); - if (resultsFilename != null) { - almResultNames.add(((StringParameterValue)resultsFilename).getValue()); + ParameterValue buildStepNameParam = paramAction.getParameter("buildStepName"); + if (buildStepNameParam != null) { + String buildStepName = ((StringParameterValue)buildStepNameParam).getValue(); + ParameterValue resFileParam; + switch (buildStepName) { + case "RunFromAlmBuilder": + resFileParam = paramAction.getParameter("resultsFilename"); + if (resFileParam != null) { + almResultNames.add(((StringParameterValue)resFileParam).getValue()); + } + break; + case "RunFromAlmLabManagementBuilder": + resFileParam = paramAction.getParameter("resultsFilename"); + if (resFileParam != null) { + almSSEResultNames.add(((StringParameterValue)resFileParam).getValue()); + } + break; } } } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java index 9f3c775363..5fbdbe6b0a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java @@ -33,6 +33,7 @@ import java.io.StringWriter; import java.text.Format; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -164,8 +165,8 @@ public SseBuilder(String almServerName, } @Override - public void perform(Run build, FilePath workspace, Launcher launcher, - TaskListener listener) throws InterruptedException, IOException { + public void perform(Run build, FilePath workspace, Launcher launcher, TaskListener listener) + throws InterruptedException, IOException { PrintStream logger = listener.getLogger(); @@ -186,15 +187,22 @@ public void perform(Run build, FilePath workspace, Launcher launcher, environmentConfigurationId, cdaDetails); - _sseModel.setAlmServerUrl(getServerUrl(_sseModel.getAlmServerName())); VariableResolver varResolver = new VariableResolver.ByMap(build.getEnvironment(listener)); Testsuites testsuites = execute(build, logger, varResolver); - FilePath resultsFilePath = workspace.child(getFileName()); + String resultsFilename = generateResultsFilename(); + FilePath resultsFilePath = workspace.child(resultsFilename); Result resultStatus = createRunResults(resultsFilePath, testsuites, logger); provideStepResultStatus(resultStatus, build, logger); + + //params used when run with Pipeline + ParametersAction parameterAction = build.getAction(ParametersAction.class); + List newParams = (parameterAction != null) ? new ArrayList<>(parameterAction.getAllParameters()) : new ArrayList<>(); + newParams.add(new StringParameterValue("buildStepName", "RunFromAlmLabManagementBuilder")); + newParams.add(new StringParameterValue("resultsFilename", resultsFilename)); + build.addOrReplaceAction(new ParametersAction(newParams)); } /** @@ -302,7 +310,7 @@ private boolean containsErrors(List testsuites) { return ret; } - private String getFileName() { + private String generateResultsFilename() { Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); String time = formatter.format(new Date()); From 876661b4a7045e8f3f56b549dc76a66e3d04015a Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 12 Aug 2021 10:55:10 +0300 Subject: [PATCH 1821/2502] 659011 Add a default case to this switch. --- .../automation/tools/results/RunResultRecorder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java index bbb9d1e77b..e6153321b6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java @@ -1451,6 +1451,9 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn almSSEResultNames.add(((StringParameterValue)resFileParam).getValue()); } break; + default: + // default case should not be used, if necessary to handle a new builder, please create a specific case + break; } } } From 9b0a2fd8fe5ac7cc1f6f1b9318a44bd78288f2e5 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Thu, 12 Aug 2021 11:12:52 +0300 Subject: [PATCH 1822/2502] Update README.md --- doc/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/README.md b/doc/README.md index d54a957945..53afce1789 100644 --- a/doc/README.md +++ b/doc/README.md @@ -5,7 +5,7 @@ This [Micro Focus Application Automation Tools plugin](https://plugins.jenkins. ### Jenkins versions -Beginning version 5.5, this plugin only supports the latest five LTS versions of Jenkins (minimum version is 2.190.1). This is a result of the Jenkins policy to no longer support older update centers. Jenkins now requires you to have Java 8 installed on the machine. To recover any information lost during an upgrade relating to package names, backup the Jenkins folder and then run the [Rebranding script](https://wiki.jenkins.io/display/JENKINS/Micro+Focus+Application+Automation+Tools#MicroFocusApplicationAutomationTools-UserGuide). +This plugin requires one of the five latest [LTS versions](https://jenkins.io/changelog-stable/) of Jenkins (minimum version is 2.264). This is a result of the Jenkins policy to no longer support older update centers. Jenkins now requires you to have Java 8 installed on the machine. To recover any information lost during an upgrade relating to package names, backup the Jenkins folder and then run the [Rebranding script](https://wiki.jenkins.io/display/JENKINS/Micro+Focus+Application+Automation+Tools#MicroFocusApplicationAutomationTools-UserGuide). ### Submit issues and feedback through JIRA @@ -92,16 +92,16 @@ This plugin supports the following Micro Focus product versions: | ALM (Application Lifecycle Management) | 12.xx, 15.x | [ALM Integration page](ALM_Integration.md) | | ALM Lab Management | 12.xx, 15.x | [ALM Integration page](ALM_Integration.md#running-server-side-tests-using-alm-lab-management) | | ALM Octane | 12.53.20 and higher (12.55.4 or later required for direct UFT One integration and for LoadRunner Enterprise integration using pipelines) | [ALM Octane Help](https://admhelp.microfocus.com/octane/en/latest/Online/Content/AdminGuide/jenkins-integration.htm) | -| LoadRunner Professional | 12.xx, 2020 and higher | [LoadRunner Professional Integration page](LR_Integration.md) | -| UFT Mobile (formerly Mobile Center) | 2.0 and higher | [UFT Mobile Integration page](UFT_Mobile_Integration.md) | -| LoadRunner Enterprise (formerly Performance Center) | 12.xx (12.53 or higher required for trend reports), 2020 and higher | [LoadRunner Enterprise Help Center](https://admhelp.microfocus.com/pc/en/latest/online_help/Content/PC/Continuous-Integration-Jenkins.htm) | +| LoadRunner Professional | 12.xx, 2020 and higher | [LoadRunner Professional Integration page](LR_Integration.md) | +| UFT Mobile | 2.0 and higher | [UFT Mobile Integration page](UFT_Mobile_Integration.md) | +| LoadRunner Enterprise | 12.xx (12.53 or higher required for trend reports), 2020 and higher | [LoadRunner Enterprise Help Center](https://admhelp.microfocus.com/lre/en/latest/online_help/Content/PC/Continuous-Integration-Jenkins.htm) | | Service Virtualization | 3.80 and higher | [Service Virtualization Help Center](https://admhelp.microfocus.com/sv/en/latest/Help/Content/UG/c_continuous_integration.htm) | -| UFT One (formerly UFT) | 12.xx and 14.03 and higher | [UFT One Help Center](https://admhelp.microfocus.com/uft/en/latest/UFT_Help/Content/User_Guide/Jenkins.htm) | -| UFT Developer (formerly LeanFT) | 14.03 and higher | [UFT Developer Help Center](https://admhelp.microfocus.com/leanft/en/latest/HelpCenter/Content/HowTo/CI_Tools.htm)
      Blog: [Integrating LeanFT with Jenkins in just a few simple steps](https://community.softwaregrp.com/t5/Quality-and-Testing-Blog/Integrating-LeanFT-with-Jenkins-in-just-a-few-simple-steps/ba-p/247321#.WpzwYOhubcte%20steps) | +| UFT One | 12.xx and 14.03 and higher | [UFT One Help Center](https://admhelp.microfocus.com/uft/en/latest/UFT_Help/Content/User_Guide/Jenkins.htm) | +| UFT Developer | 14.03 and higher | [UFT Developer Help Center](https://admhelp.microfocus.com/uftdev/en/latest/HelpCenter/Content/HowTo/CI_Tools.htm)
      Blog: [Integrating LeanFT with Jenkins in just a few simple steps](https://community.microfocus.com/adtd/b/sws-alm/posts/integrating-leanft-with-jenkins-in-just-a-few-simple-steps) | ## Prerequisites -1. Install one of the five latest LTS versions of Jenkins, [(Click here for a list.](https://jenkins.io/changelog-stable/)) +1. Install one of the five latest LTS versions of Jenkins. For details, see the [LTS Changelog](https://jenkins.io/changelog-stable/). **Note:** The plugin may not operate properly with earlier versions of Jenkins. 2. **Java version 8 or higher.** To verify your Java version, go to [http://www.java.com/en/download/installed.jsp](http://www.java.com/en/download/installed.jsp). From f66cc7a154596e86d74e838f731c7195ef844454 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Fri, 13 Aug 2021 16:35:23 +0800 Subject: [PATCH 1823/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1543db01e9..efe6b5bb6d 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.4-beta-SNAPSHOT + 7.0 hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.0 From 65a97a3eed6da2fc4d309aa7d82f76f355b8e291 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Fri, 13 Aug 2021 16:35:34 +0800 Subject: [PATCH 1824/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index efe6b5bb6d..dd460f4cec 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0 + 7.1-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.0 + micro-focus-application-automation-tools-plugin-5.5.4-beta From 090d641e999bb7aeb6f4e16013c609f790e52f4a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 16 Aug 2021 11:37:37 +0300 Subject: [PATCH 1825/2502] tech : remove comment --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 96210ea4f4..41ac27ef83 100644 --- a/pom.xml +++ b/pom.xml @@ -460,7 +460,7 @@ org.jenkins-ci.plugins structs - 1.22 + 1.22 org.jenkins-ci.plugins From 7acb23cb15fdc9a82338602826ff4553417cf0b2 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Mon, 16 Aug 2021 15:47:52 +0300 Subject: [PATCH 1826/2502] Update README.md --- doc/README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/README.md b/doc/README.md index 53afce1789..1b7da35232 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,7 +1,7 @@ # Micro Focus Application Automation Tools -This [Micro Focus Application Automation Tools plugin](https://plugins.jenkins.io/hp-application-automation-tools-plugin) integrates Micro Focus products with Jenkins. Using the plugin, you can create and use virtual services, run LoadRunner Enterprise or LoadRunner Professional tests, run UFT functional tests, run tests in your lab, and run tests on mobile devices. This plugin also lets you upload test results to ALM. In addition, ALM Octane users can track and trigger Jenkins pipelines from within the user interface. +This [Micro Focus Application Automation Tools plugin](https://plugins.jenkins.io/hp-application-automation-tools-plugin) integrates Micro Focus products with Jenkins. Using the plugin, you can create and use virtual services, run LoadRunner Enterprise or LoadRunner Professional tests, run UFT functional tests, run tests in your lab, and run tests on mobile devices. This plugin also lets you upload test results to ALM. In addition, ALM Octane users can track and trigger Jenkins pipelines from within the user interface. ### Jenkins versions @@ -49,19 +49,26 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j Starting with version 1.641 (or 1.625.3), Jenkins introduced the **Content-Security-Policy** header. This causes some of the integration links, such as links to reports, to become inoperable. For details, see [Configuring Content Security Policy](https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy) and [Jenkins Security Advisory ](https://jenkins.io/security/advisory/2015-12-09/). For suggested workarounds until the issue is resolved, see [Content Security Policy Header](#content-security-policy-header). -## New Features and Enhancements in Version 6.9 +## New Features and Enhancements -Version 6.9 introduced the following enhancements: +Version 7.0 introduced the following enhancements: **ALM Octane** -- Enabled branch publisher -- Support added for Java 11 +- Support for pipeline stop +- Support for BDD scenarios in test runners +- Support for version 21.1.36 of the Fortify SSC plugin +- Defect fix - Octane builds no longer point to obsolete UFTOne run results -**Workarounds** +**UFT One** -- For running UFTM tests from UFT One: If UFTM tests fail in UFT One after changing the UFTM server version in the Jenkins configuration, manually restart UFT One and run the test again. +- Ability to use the Micro Focus plugin on an air-gap network (not connected to the Internet) for ALM executions +- Run Results enhancements, including the use of MTBX files for test execution +- Defect fix - Layout issues were handled +**LoadRunner Enterprise** + +- Defect fix - It is now possible to browse for the Test ID in the Jenkins plugin. For more information about enhancements introduced in previous versions, see [What's new in earlier versions](WhatsNewEarlier.md). From 7a7add82d55c9c9b96cfdc1f4a61a5c6b91acc95 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Mon, 16 Aug 2021 16:28:22 +0300 Subject: [PATCH 1827/2502] Update WhatsNewEarlier.md --- doc/WhatsNewEarlier.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/WhatsNewEarlier.md b/doc/WhatsNewEarlier.md index 6d2db051b8..efe3f5f2fb 100644 --- a/doc/WhatsNewEarlier.md +++ b/doc/WhatsNewEarlier.md @@ -5,6 +5,8 @@ This page shows a history of the enhancements made to the Micro Focus Applicatio See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for information about beta versions and recent patches. +[What's New in version 6.9](#what's-new-in-version-6.9) + [What's New in versions 6.7, 6.8](#what's-new-in-versions-6.7-and-6.8) [What's New in version 6.6](#what's-new-in-version-6.6) @@ -19,6 +21,19 @@ See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for infor [What's New in version 5.9](#what's-new-in-version-5.9) +## What's New in version 6.9 + +Version 6.9 introduced the following enhancements: + +**ALM Octane** + +- Enabled branch publisher +- Support added for Java 11 + +**Workarounds** + +- For running UFTM tests from UFT One: If UFTM tests fail in UFT One after changing the UFTM server version in the Jenkins configuration, manually restart UFT One and run the test again. + ## What's New in versions 6.7 and 6.8 Versions 6.7 and 6.8 introduced the following enhancements: From 4a8746fe72ced3be577884471ea88239e9477c54 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 17 Aug 2021 10:16:56 +0300 Subject: [PATCH 1828/2502] Defect 1330202 - For non-parameterized Jenkins jobs, we do not receive an event with params --- .../parameters/ParameterProcessors.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java index 49d02bacae..b8e5b63048 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java @@ -140,15 +140,15 @@ public static List getInstances(Run run) { result.add(new UnsupportedParameterProcessor().createParameterInstance(pd, pv)); } } - //go over parameters that are not defined in definitions - for (ParameterValue notDefinedParameter : parametersValues.values()) { - if (notDefinedParameter.getValue() != null) { - CIParameter param = dtoFactory.newDTO(CIParameter.class) - .setType(CIParameterType.STRING) - .setName(notDefinedParameter.getName()) - .setValue(notDefinedParameter.getValue()); - result.add(param); - } + } + //go over parameters that are not defined in definitions + for (ParameterValue notDefinedParameter : parametersValues.values()) { + if (notDefinedParameter.getValue() != null) { + CIParameter param = dtoFactory.newDTO(CIParameter.class) + .setType(CIParameterType.STRING) + .setName(notDefinedParameter.getName()) + .setValue(notDefinedParameter.getValue()); + result.add(param); } } } catch (Exception e) { From 636effe91185b1fc1279ec8ec270cc6c6d3132c7 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:16:13 +0300 Subject: [PATCH 1829/2502] Update WhatsNewEarlier.md --- doc/WhatsNewEarlier.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/WhatsNewEarlier.md b/doc/WhatsNewEarlier.md index efe3f5f2fb..8d92ab9592 100644 --- a/doc/WhatsNewEarlier.md +++ b/doc/WhatsNewEarlier.md @@ -5,23 +5,23 @@ This page shows a history of the enhancements made to the Micro Focus Applicatio See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for information about beta versions and recent patches. -[What's New in version 6.9](#what's-new-in-version-6.9) +[What's New in version 6.9]((#what's-new-in-version-6.9)) -[What's New in versions 6.7, 6.8](#what's-new-in-versions-6.7-and-6.8) +[What's New in versions 6.7 and 6.8]((#what's-new-in-versions-6.7-and-6'8)) -[What's New in version 6.6](#what's-new-in-version-6.6) +[What's New in version 6.6]((#what's-new-in-version-6.6)) -[What's New in version 6.5](#what's-new-in-version-6.5) +[What's New in version 6.5]((#what's-new-in-version-6.5)) -[What's New in version 6.4](#what's-new-in-version-6.4) +[What's New in version 6.4]((#what's-new-in-version-6.4)) -[What's New in version 6.3](#what's-new-in-version-6.3) +[What's New in version 6.3]((#what's-new-in-version-6.3)) -[What's New in version 6.0](#what's-new-in-version-6.0) +[What's New in version 6.0]((#what's-new-in-version-6.0)) -[What's New in version 5.9](#what's-new-in-version-5.9) +[What's New in version 5.9]((#what's-new-in-version-5.9)) -## What's New in version 6.9 +## What's New in version 6.9 Version 6.9 introduced the following enhancements: From 1787b8c062240e3e65708336686cb9362d530760 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:18:58 +0300 Subject: [PATCH 1830/2502] Update README.md --- doc/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/README.md b/doc/README.md index 1b7da35232..5980d50d38 100644 --- a/doc/README.md +++ b/doc/README.md @@ -5,7 +5,7 @@ This [Micro Focus Application Automation Tools plugin](https://plugins.jenkins.i ### Jenkins versions -This plugin requires one of the five latest [LTS versions](https://jenkins.io/changelog-stable/) of Jenkins (minimum version is 2.264). This is a result of the Jenkins policy to no longer support older update centers. Jenkins now requires you to have Java 8 installed on the machine. To recover any information lost during an upgrade relating to package names, backup the Jenkins folder and then run the [Rebranding script](https://wiki.jenkins.io/display/JENKINS/Micro+Focus+Application+Automation+Tools#MicroFocusApplicationAutomationTools-UserGuide). +This plugin requires one of the five latest [LTS versions](https://jenkins.io/changelog-stable/) of Jenkins. This is a result of the Jenkins policy to no longer support older update centers. Jenkins now requires you to have Java 8 installed on the machine. To recover any information lost during an upgrade relating to package names, backup the Jenkins folder and then run the [Rebranding script](https://wiki.jenkins.io/display/JENKINS/Micro+Focus+Application+Automation+Tools#MicroFocusApplicationAutomationTools-UserGuide). ### Submit issues and feedback through JIRA @@ -16,7 +16,7 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j ## Table of Contents -[New Features and Enhancements](#new-features-and-enhancements) +[New Features and Enhancements for 7.0]((#new-features-and-enhancements-for-7.0)) [Changelog](#changelog) @@ -49,7 +49,7 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j Starting with version 1.641 (or 1.625.3), Jenkins introduced the **Content-Security-Policy** header. This causes some of the integration links, such as links to reports, to become inoperable. For details, see [Configuring Content Security Policy](https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy) and [Jenkins Security Advisory ](https://jenkins.io/security/advisory/2015-12-09/). For suggested workarounds until the issue is resolved, see [Content Security Policy Header](#content-security-policy-header). -## New Features and Enhancements +## New Features and Enhancements for 7.0 Version 7.0 introduced the following enhancements: From 9f5e42f336cdbf877906c71f603694895db8222c Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Tue, 17 Aug 2021 14:58:32 +0300 Subject: [PATCH 1831/2502] Update WhatsNewEarlier.md Fixed broken links --- doc/WhatsNewEarlier.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/WhatsNewEarlier.md b/doc/WhatsNewEarlier.md index 8d92ab9592..24e8e8d213 100644 --- a/doc/WhatsNewEarlier.md +++ b/doc/WhatsNewEarlier.md @@ -5,21 +5,21 @@ This page shows a history of the enhancements made to the Micro Focus Applicatio See the [Changelog ](https://wiki.jenkins.io/display/JENKINS/Changelog)for information about beta versions and recent patches. -[What's New in version 6.9]((#what's-new-in-version-6.9)) +[What's New in version 6.9](#what's-new-in-version-6.9) -[What's New in versions 6.7 and 6.8]((#what's-new-in-versions-6.7-and-6'8)) +[What's New in versions 6.7 and 6.8](#what's-new-in-versions-6.7-and-6'8) -[What's New in version 6.6]((#what's-new-in-version-6.6)) +[What's New in version 6.6](#what's-new-in-version-6.6) -[What's New in version 6.5]((#what's-new-in-version-6.5)) +[What's New in version 6.5](#what's-new-in-version-6.5) -[What's New in version 6.4]((#what's-new-in-version-6.4)) +[What's New in version 6.4](#what's-new-in-version-6.4) -[What's New in version 6.3]((#what's-new-in-version-6.3)) +[What's New in version 6.3](#what's-new-in-version-6.3) -[What's New in version 6.0]((#what's-new-in-version-6.0)) +[What's New in version 6.0](#what's-new-in-version-6.0) -[What's New in version 5.9]((#what's-new-in-version-5.9)) +[What's New in version 5.9](#what's-new-in-version-5.9) ## What's New in version 6.9 From b6fbef1e331f8c85d2d56e3f8cebf244808034e0 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Tue, 17 Aug 2021 15:00:50 +0300 Subject: [PATCH 1832/2502] Update README.md --- doc/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/README.md b/doc/README.md index 5980d50d38..405d734d6f 100644 --- a/doc/README.md +++ b/doc/README.md @@ -16,7 +16,7 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j ## Table of Contents -[New Features and Enhancements for 7.0]((#new-features-and-enhancements-for-7.0)) +[New Features and Enhancements](#new-features-and-enhancements) [Changelog](#changelog) @@ -49,7 +49,7 @@ A list of known bugs is available [here](https://issues.jenkins-ci.org/issues/?j Starting with version 1.641 (or 1.625.3), Jenkins introduced the **Content-Security-Policy** header. This causes some of the integration links, such as links to reports, to become inoperable. For details, see [Configuring Content Security Policy](https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy) and [Jenkins Security Advisory ](https://jenkins.io/security/advisory/2015-12-09/). For suggested workarounds until the issue is resolved, see [Content Security Policy Header](#content-security-policy-header). -## New Features and Enhancements for 7.0 +## New Features and Enhancements Version 7.0 introduced the following enhancements: From 872612fc359048c3c845b6c311ce52313c3e29b4 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Wed, 18 Aug 2021 16:41:41 +0800 Subject: [PATCH 1833/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.0.4-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4f80e59fd6..e0e1211bfa 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.1-SNAPSHOT + 7.0.4-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.0.4-beta From 0e8f6768648c40c8451fa4a434d5002dc5a61720 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Wed, 18 Aug 2021 16:41:50 +0800 Subject: [PATCH 1834/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e0e1211bfa..dedb2037fa 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.4-beta + 7.0.5-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.0.4-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From e9ca6b64802bf2de6a1fecfdf94c73c2182449e9 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 18 Aug 2021 14:25:03 +0300 Subject: [PATCH 1835/2502] tech : 1. add api get job build status by parameter octane_auto_action_execution_id 2. add possibility to stop build by parameter octane_auto_action_execution_id --- pom.xml | 2 +- .../tools/octane/CIJenkinsServicesImpl.java | 26 +++- .../projects/AbstractProjectProcessor.java | 115 +++++++++++++++--- 3 files changed, 121 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 1433cf4812..815f03b9da 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.4 + 2.7.1.5 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index a4c1bb81d0..6bd157b903 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -44,10 +44,7 @@ import com.hp.octane.integrations.dto.executor.CredentialsInfo; import com.hp.octane.integrations.dto.executor.DiscoveryInfo; import com.hp.octane.integrations.dto.executor.TestConnectivityInfo; -import com.hp.octane.integrations.dto.general.CIJobsList; -import com.hp.octane.integrations.dto.general.CIPluginInfo; -import com.hp.octane.integrations.dto.general.CIServerInfo; -import com.hp.octane.integrations.dto.general.CIServerTypes; +import com.hp.octane.integrations.dto.general.*; import com.hp.octane.integrations.dto.parameters.CIParameter; import com.hp.octane.integrations.dto.parameters.CIParameters; import com.hp.octane.integrations.dto.pipelines.PipelineNode; @@ -301,6 +298,27 @@ public void stopPipelineRun(String jobCiId, CIParameters ciParameters) { } } + @Override + public CIBuildStatusInfo getJobBuildStatus(String jobCiId, CIParameters ciParameters) { + ACLContext securityContext = startImpersonation(); + try { + Job job = getJobByRefId(jobCiId); + boolean hasRead = Jenkins.get().hasPermission(Item.READ); + if (!hasRead) { + throw new PermissionException(HttpStatus.SC_FORBIDDEN); + } + AbstractProjectProcessor jobProcessor = JobProcessorFactory.getFlowProcessor(job); + ParametersAction parametersAction = new ParametersAction(); + if (ciParameters != null) { + parametersAction = new ParametersAction(createParameters(job, ciParameters)); + } + + return jobProcessor.getBuildStatus(parametersAction); + } finally { + stopImpersonation(securityContext); + } + } + @Override public InputStream getTestsResult(String jobId, String buildId) { ACLContext originalContext = startImpersonation(); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 3121ce73e6..3b88b2b347 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -28,24 +28,26 @@ package com.microfocus.application.automation.tools.octane.model.processors.projects; +import com.hp.octane.integrations.dto.DTOFactory; +import com.hp.octane.integrations.dto.general.CIBuildStatusInfo; import com.hp.octane.integrations.dto.pipelines.PipelinePhase; +import com.hp.octane.integrations.dto.snapshots.CIBuildStatus; import com.hp.octane.integrations.utils.SdkConstants; +import com.hp.octane.integrations.utils.SdkStringUtils; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; import com.microfocus.application.automation.tools.octane.executor.UftConstants; import com.microfocus.application.automation.tools.octane.model.processors.builders.AbstractBuilderProcessor; import com.microfocus.application.automation.tools.octane.model.processors.builders.BuildTriggerProcessor; import com.microfocus.application.automation.tools.octane.model.processors.builders.ParameterizedTriggerProcessor; import com.microfocus.application.automation.tools.octane.tests.build.BuildHandlerUtils; +import hudson.model.Queue; import hudson.model.*; import hudson.tasks.Builder; import hudson.tasks.Publisher; import jenkins.model.Jenkins; import org.apache.logging.log4j.Logger; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; /** * Created with IntelliJ IDEA. @@ -90,9 +92,12 @@ public void scheduleBuild(Cause cause, ParametersAction parametersAction) { } public void cancelBuild(Cause cause, ParametersAction parametersAction) { + String buildId = getParameterValueIfExist(parametersAction, UftConstants.BUILD_ID_PARAMETER_NAME); + String suiteId = getParameterValueIfExist(parametersAction, SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); String suiteRunId = getParameterValueIfExist(parametersAction, SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME); - String buildId = getParameterValueIfExist(parametersAction, UftConstants.BUILD_ID_PARAMETER_NAME); + + String releaseExecutionId = getParameterValueIfExist(parametersAction, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME); if (job instanceof AbstractProject) { AbstractProject project = (AbstractProject) job; @@ -107,28 +112,43 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { } stopBuild(aBuild); } else { - logger.info(String.format("cancelBuild for %s, suiteId=%s, suiteRunId=%s", job.getFullName(), suiteId, suiteRunId)); + FoundInfo foundInfo = new FoundInfo(); + String paramToSearch; + String paramValueToSearch; + if (SdkStringUtils.isNotEmpty(releaseExecutionId)) { + paramToSearch = SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME; + paramValueToSearch = releaseExecutionId; + } else if (SdkStringUtils.isNotEmpty(suiteRunId)) { + paramToSearch = SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME; + paramValueToSearch = suiteRunId; + } else { + throw new IllegalArgumentException("Cannot cancel job as no identification parameters was passed"); + } + + logger.info(String.format("cancelBuild for %s, %s=%s", job.getFullName(), paramToSearch, paramValueToSearch)); Queue queue = Jenkins.get().getQueue(); queue.getItems(project).forEach(item -> { item.getActions(ParametersAction.class).forEach(action -> { - if (checkSuiteIdParamsExistAndEqual(action, suiteId, suiteRunId)) { + if (!foundInfo.found && checkIfParamExistAndEqual(action, suiteId, suiteRunId)) { try { - logger.info("canceling item in queue : " + item.toString()); + logger.info("canceling item in queue : " + item); queue.cancel(item); - logger.info("Item in queue is cancelled item : " + item.toString()); + logger.info("Item in queue is cancelled item : " + item); + foundInfo.found = true; } catch (Exception e) { - logger.warn("Failed to cancel '" + item.toString() + "' in queue : " + e.getMessage(), e); + logger.warn("Failed to cancel '" + item + "' in queue : " + e.getMessage(), e); } } }); }); project.getBuilds().forEach(build -> { - if (build instanceof AbstractBuild) { + if (!foundInfo.found && build instanceof AbstractBuild) { AbstractBuild aBuild = (AbstractBuild) build; aBuild.getActions(ParametersAction.class).forEach(action -> { - if (checkSuiteIdParamsExistAndEqual(action, suiteId, suiteRunId)) { + if (checkIfParamExistAndEqual(action, paramToSearch, paramValueToSearch)) { stopBuild(aBuild); + foundInfo.found = true; } }); } @@ -139,6 +159,66 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { } } + public CIBuildStatusInfo getBuildStatus(ParametersAction parametersAction) { + CIBuildStatusInfo status = DTOFactory.getInstance().newDTO(CIBuildStatusInfo.class).setBuildStatus(CIBuildStatus.UNAVAILABLE); + String buildId = getParameterValueIfExist(parametersAction, UftConstants.BUILD_ID_PARAMETER_NAME); + String releaseExecutionId = getParameterValueIfExist(parametersAction, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME); + if (SdkStringUtils.isEmpty(releaseExecutionId) && SdkStringUtils.isEmpty(buildId)) { + List required = Arrays.asList(UftConstants.BUILD_ID_PARAMETER_NAME, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME); + throw new IllegalArgumentException("One of parameters is required :" + required); + } + + if (job instanceof AbstractProject) { + if (buildId != null) { + AbstractBuild aBuild = ((AbstractProject) job).getBuild(buildId); + if (aBuild == null) { + status.setBuildStatus(CIBuildStatus.UNAVAILABLE); + } else { + status.setBuildCiId(BuildHandlerUtils.getBuildCiId(aBuild)); + if (aBuild.isBuilding()) { + status.setBuildStatus(CIBuildStatus.RUNNING); + } else { + status.setBuildStatus(CIBuildStatus.FINISHED); + status.setResult(BuildHandlerUtils.translateRunResult(aBuild)); + } + } + } else { + AbstractProject project = (AbstractProject) job; + FoundInfo foundInfo = new FoundInfo(); + Queue queue = Jenkins.get().getQueue(); + queue.getItems(project).forEach(item -> { + item.getActions(ParametersAction.class).forEach(action -> { + if (!foundInfo.found && checkIfParamExistAndEqual(action, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME, releaseExecutionId)) { + status.setBuildStatus(CIBuildStatus.QUEUED); + foundInfo.found = true; + } + }); + }); + + project.getBuilds().forEach(build -> { + if (!foundInfo.found && build instanceof AbstractBuild) { + AbstractBuild aBuild = (AbstractBuild) build; + aBuild.getActions(ParametersAction.class).forEach(action -> { + if (checkIfParamExistAndEqual(action, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME, releaseExecutionId)) { + if (aBuild.isBuilding()) { + status.setBuildStatus(CIBuildStatus.RUNNING); + } else { + status.setBuildStatus(CIBuildStatus.FINISHED); + status.setResult(BuildHandlerUtils.translateRunResult(aBuild)); + } + foundInfo.found = true; + } + }); + } + }); + } + } else { + throw new IllegalStateException("unsupported job CAN NOT be stopped"); + } + return status; + } + + private String getParameterValueIfExist(ParametersAction parametersAction, String paramName) { ParameterValue pv = parametersAction.getParameter(paramName); if (pv != null) { @@ -157,11 +237,9 @@ private void stopBuild(AbstractBuild aBuild) { } } - private boolean checkSuiteIdParamsExistAndEqual(ParametersAction parametersAction, String suiteId, String suiteRunId) { - ParameterValue suiteIdPV = parametersAction.getParameter(SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); - ParameterValue suiteRunIdPV = parametersAction.getParameter(SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME); - return (suiteIdPV != null && suiteRunIdPV != null && suiteIdPV.getValue().equals(suiteId) - && suiteRunIdPV.getValue().equals(suiteRunId)); + private boolean checkIfParamExistAndEqual(ParametersAction parametersAction, String paramName, String expectedValue) { + ParameterValue pv = parametersAction.getParameter(paramName); + return (SdkStringUtils.isNotEmpty(expectedValue) && pv != null && pv.getValue().equals(expectedValue)); } /** @@ -271,4 +349,7 @@ void processPublishers(Job job, Set processedJobs) { processedJobs.remove(job); } } + private static class FoundInfo{ + public boolean found; + } } From 4f1134b2bbe8c4d2eb09c04c6aefcb23edf765bd Mon Sep 17 00:00:00 2001 From: karoi Date: Wed, 18 Aug 2021 17:14:04 +0300 Subject: [PATCH 1836/2502] story #1291055- increase sdk version to fix a defect for create action parameters --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 815f03b9da..b3850fdb1c 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.5 + 2.7.1.6 From 990fcc5ddbb22435db97c47a58ac19d3f719b87a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 18 Aug 2021 17:44:28 +0300 Subject: [PATCH 1837/2502] tech : fix test --- .../application/automation/tools/octane/EnumsTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/EnumsTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/EnumsTest.java index 1ba6dd5fc9..4a28e9a8a8 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/EnumsTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/EnumsTest.java @@ -61,7 +61,7 @@ public void testCIEventCauseType() { @Test public void testCIEventType() { - assertEquals(CIEventType.values().length, 7); + assertEquals(CIEventType.values().length, 8); assertEquals(CIEventType.QUEUED.value(), "queued"); assertEquals(CIEventType.SCM.value(), "scm"); assertEquals(CIEventType.STARTED.value(), "started"); @@ -69,6 +69,7 @@ public void testCIEventType() { assertEquals(CIEventType.fromValue("queued"), CIEventType.QUEUED); assertEquals(CIEventType.DELETED.value(),"deleted" ); assertEquals(CIEventType.RENAMED.value(),"renamed" ); + assertEquals(CIEventType.REMOVED_FROM_QUEUE.value(),"removed_from_queue" ); } @Test From fd32cf44edad6efc495575417721eb2b420f481e Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 18 Aug 2021 18:09:38 +0300 Subject: [PATCH 1838/2502] tech : send REMOVED_FROM_QUEUE event if build is deleted from queue (required by release flow scenarios) --- .../octane/events/OctaneQueueListener.java | 47 +++++++++++++++++++ .../parameters/ParameterProcessors.java | 24 ++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/events/OctaneQueueListener.java diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/events/OctaneQueueListener.java b/src/main/java/com/microfocus/application/automation/tools/octane/events/OctaneQueueListener.java new file mode 100644 index 0000000000..d3524d1f19 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/octane/events/OctaneQueueListener.java @@ -0,0 +1,47 @@ +package com.microfocus.application.automation.tools.octane.events; + +import com.hp.octane.integrations.OctaneSDK; +import com.hp.octane.integrations.dto.DTOFactory; +import com.hp.octane.integrations.dto.events.CIEvent; +import com.hp.octane.integrations.dto.events.CIEventType; +import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl; +import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; +import com.microfocus.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; +import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; +import hudson.Extension; +import hudson.model.AbstractProject; +import hudson.model.ParametersAction; +import hudson.model.Queue; +import hudson.model.queue.QueueListener; +import org.apache.logging.log4j.Logger; + +@Extension +public class OctaneQueueListener extends QueueListener { + private static final Logger logger = SDKBasedLoggerProvider.getLogger(OctaneQueueListener.class); + + @Override + public void onLeft(Queue.LeftItem li) { + if (!OctaneSDK.hasClients()) { + return; + } + + if (li.isCancelled()) { + if (li.task instanceof AbstractProject) { + try { + ParametersAction paramActions = li.getAction(ParametersAction.class); + AbstractProject project = (AbstractProject) li.task; + CIEvent event = DTOFactory.getInstance().newDTO(CIEvent.class) + .setEventType(CIEventType.REMOVED_FROM_QUEUE) + .setProject(JobProcessorFactory.getFlowProcessor(project).getTranslatedJobName()) + .setBuildCiId("-1") + .setParameters(ParameterProcessors.getInstances(paramActions)); + CIJenkinsServicesImpl.publishEventToRelevantClients(event); + } catch (Exception e) { + logger.error("Failed to set REMOVED_FROM_QUEUE event :" + e.getMessage() + "(" + li.task.getName() + ")"); + } + } else { + logger.error("Job is cancelled in queue but it isn't AbstractProject :" + li.task.getFullDisplayName() + "(" + li.task.getClass().getName() + ")"); + } + } + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java index b8e5b63048..791aa83317 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/ParameterProcessors.java @@ -158,6 +158,30 @@ public static List getInstances(Run run) { return result; } + public static List getInstances(ParametersAction parametersAction) { + List result = new ArrayList<>(); + + try { + Map parametersValues = parametersAction.getAllParameters().stream().collect( + Collectors.toMap(ParameterValue::getName, Function.identity(), (v1, v2) -> v1)); + + //go over parameters that are not defined in definitions + for (ParameterValue notDefinedParameter : parametersValues.values()) { + if (notDefinedParameter.getValue() != null) { + CIParameter param = dtoFactory.newDTO(CIParameter.class) + .setType(CIParameterType.STRING) + .setName(notDefinedParameter.getName()) + .setValue(notDefinedParameter.getValue()); + result.add(param); + } + } + } catch (Exception e) { + logger.error("failed to process parameters :" + e.getMessage(), e); + } + + return result; + } + private static AbstractParametersProcessor getAppropriate(String className) { for (ParameterProcessors p : values()) { if (className.startsWith(p.targetPluginClassName)) { From 9491e30a207736c5daedfff7e611c9b86f9a8f74 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 18 Aug 2021 19:23:34 +0300 Subject: [PATCH 1839/2502] tech : send REMOVED_FROM_QUEUE event if build is deleted from queue (required by release flow scenarios) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3850fdb1c..21bc22775b 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.6 + 2.7.1.7 From a25339d3611508f72dec65c4eba1b9886ae110c0 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 24 Aug 2021 14:16:10 +0300 Subject: [PATCH 1840/2502] tech : UFT report is obsolete when run on slave in workflow job --- .../automation/tools/run/RunFromFileBuilder.java | 13 ++++++++++--- .../automation/tools/uft/utils/UftToolUtils.java | 7 ++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index ee38814ed1..fa200dcd1e 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -31,17 +31,17 @@ import com.microfocus.application.automation.tools.AlmToolsUtils; import com.microfocus.application.automation.tools.EncryptionUtils; import com.microfocus.application.automation.tools.Messages; +import com.microfocus.application.automation.tools.lr.model.ScriptRTSSetModel; +import com.microfocus.application.automation.tools.lr.model.SummaryDataLogModel; import com.microfocus.application.automation.tools.mc.JobConfigurationProxy; import com.microfocus.application.automation.tools.model.*; import com.microfocus.application.automation.tools.settings.MCServerSettingsGlobalConfiguration; -import com.microfocus.application.automation.tools.lr.model.SummaryDataLogModel; -import com.microfocus.application.automation.tools.lr.model.ScriptRTSSetModel; import com.microfocus.application.automation.tools.uft.model.UftSettingsModel; import com.microfocus.application.automation.tools.uft.utils.UftToolUtils; import hudson.*; import hudson.model.*; -import hudson.tasks.Builder; import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; import hudson.util.FormValidation; import hudson.util.IOUtils; import hudson.util.VariableResolver; @@ -755,6 +755,13 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } //cleanup report folders before running the build String selectedNode = env.get("NODE_NAME"); + if (selectedNode == null) {//if slave is given in the pipeline and not as part of build step + try { + selectedNode = launcher.getComputer().getName(); + } catch (Exception e) { + listener.error("Failed to get selected node for UFT execution : " + e.getMessage()); + } + } int index = 1; while (mergedProperties.getProperty("Test" + index) != null) { String testPath = mergedProperties.getProperty(("Test" + index)); diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java index 348fc17ab1..ddc6f2d6d9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/utils/UftToolUtils.java @@ -183,18 +183,23 @@ public static void deleteReportFoldersFromNode(String nodeName, String testPath, FilePath filePath = getFilePath(nodeName, testPath); try { List entries = filePath.list(); + boolean isDeleted = false; for (FilePath entry : entries) { try { if (entry.getName().startsWith("Report")) { entry.deleteRecursive(); listener.getLogger().println(String.format("Folder %s is deleted", entry)); + isDeleted = true; } } catch (Exception e) { listener.error(String.format("Failed to delete folder %s : %s", entry.getName(), e.getMessage())); } } + if (!isDeleted) { + listener.getLogger().println(String.format("No report folder was deleted")); + } } catch (IOException | InterruptedException e) { - listener.error("Failure in clearing report folders for " + testPath +" : " + e.getMessage()); + listener.error("Failure in clearing report folders for " + testPath + " : " + e.getMessage()); } } From b51584082592f3ef802ed74af99afc4370209a64 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 25 Aug 2021 11:43:44 +0300 Subject: [PATCH 1841/2502] tech : fix stop build by parameter octane_auto_action_execution_id --- .../model/processors/projects/AbstractProjectProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 3b88b2b347..1b1e46fd90 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -129,7 +129,7 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { Queue queue = Jenkins.get().getQueue(); queue.getItems(project).forEach(item -> { item.getActions(ParametersAction.class).forEach(action -> { - if (!foundInfo.found && checkIfParamExistAndEqual(action, suiteId, suiteRunId)) { + if (!foundInfo.found && checkIfParamExistAndEqual(action, paramToSearch, paramValueToSearch)) { try { logger.info("canceling item in queue : " + item); queue.cancel(item); From 0a454fc7bbab7bb06808b31ee62286b9da4f75f2 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 25 Aug 2021 14:56:28 +0300 Subject: [PATCH 1842/2502] tech : 1. add api get job build status by parameter octane_auto_action_execution_id --- .../model/processors/projects/AbstractProjectProcessor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 1b1e46fd90..f382d0e05e 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -206,6 +206,7 @@ public CIBuildStatusInfo getBuildStatus(ParametersAction parametersAction) { status.setBuildStatus(CIBuildStatus.FINISHED); status.setResult(BuildHandlerUtils.translateRunResult(aBuild)); } + status.setBuildCiId(BuildHandlerUtils.getBuildCiId(aBuild)); foundInfo.found = true; } }); From 4cbfeb63de567eda4e92bd7d14bb5d4128ba2243 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 26 Aug 2021 15:10:26 +0300 Subject: [PATCH 1843/2502] tech : 1. add api get job build status by parameter octane_auto_action_execution_id --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 21bc22775b..bf12930bf6 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.7 + 2.7.1.9 From f846fab21039c3320d127722e241adfbdf7f4705 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Mon, 30 Aug 2021 11:08:06 +0800 Subject: [PATCH 1844/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.0.5-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5d05c1e955..f42ded65b5 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.5-beta-SNAPSHOT + 7.0.5-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.0.5-beta From a812e8cb0b0dc387c251bd6e41917a1b97d4c8cb Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Mon, 30 Aug 2021 11:08:15 +0800 Subject: [PATCH 1845/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f42ded65b5..a23923d749 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.5-beta + 7.0.6-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.0.5-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From fb26276b31618cede447351b914d4e00172866e8 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 1 Sep 2021 17:26:45 +0300 Subject: [PATCH 1846/2502] extract MBT converter --- pom.xml | 2 +- .../TestExecutionJobCreatorService.java | 3 +- .../TestsToRunConverterBuilder.java | 28 ++++++++++--------- .../octane/tests/junit/JUnitXmlIterator.java | 6 ++-- .../META-INF/hudson.remoting.ClassFilter | 1 + 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index a23923d749..ee70526bbe 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.9 + 2.7.1.10 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 9d5e23d4f9..3ee73d1578 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -353,7 +353,8 @@ public static FreeStyleProject createExecutor(DiscoveryInfo discoveryInfo) { addConcurrentBuildFlag(proj); //add build action - Builder convertedBuilder = new TestsToRunConverterBuilder(TestsToRunFramework.MF_UFT.value()); + TestsToRunFramework framework = TestingToolType.UFT.equals(discoveryInfo.getTestingToolType()) ? TestsToRunFramework.MF_UFT : TestsToRunFramework.MF_MBT; + Builder convertedBuilder = new TestsToRunConverterBuilder(framework.value()); Builder uftRunner = new RunFromFileBuilder("${testsToRunConverted}"); proj.getBuildersList().add(convertedBuilder); proj.getBuildersList().add(uftRunner); diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index e655db9c14..600d469c18 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -28,11 +28,9 @@ package com.microfocus.application.automation.tools.octane.testrunner; -import com.hp.octane.integrations.executor.TestsToRunConverterResult; -import com.hp.octane.integrations.executor.TestsToRunConvertersFactory; -import com.hp.octane.integrations.executor.TestsToRunFramework; +import com.hp.octane.integrations.executor.*; import com.hp.octane.integrations.executor.converters.MbtTest; -import com.hp.octane.integrations.executor.converters.MfUftConverter; +import com.hp.octane.integrations.executor.converters.MfMBTConverter; import com.hp.octane.integrations.utils.SdkConstants; import com.hp.octane.integrations.utils.SdkStringUtils; import com.microfocus.application.automation.tools.AlmToolsUtils; @@ -142,8 +140,12 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu TestsToRunFramework testsToRunFramework = TestsToRunFramework.fromValue(frameworkName); boolean isMbt = rawTests.contains("mbtData"); - TestsToRunConverterResult convertResult = null; + TestsToRunConverterResult convertResult; Map globalParameters = getGlobalParameters(parameterAction); + + List testsData = TestsToRunConverter.parse(rawTests); + TestsToRunConvertersFactory.createConverter(testsToRunFramework).enrichTestsData(testsData, globalParameters); + if (isMbt) { //MBT needs to know real path to tests and not ${workspace} //MBT needs to run on slave to extract function libraries from checked out files @@ -153,9 +155,9 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } catch (IOException | InterruptedException e) { listener.error("Failed loading build environment " + e); } - convertResult = filePath.act(new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory, globalParameters)); + convertResult = filePath.act(new GetConvertResult(testsToRunFramework, frameworkFormat, testsData, executingDirectory, globalParameters)); } else { - convertResult = (new GetConvertResult(testsToRunFramework, frameworkFormat, rawTests, executingDirectory, globalParameters)).invoke(null, null); + convertResult = (new GetConvertResult(testsToRunFramework, frameworkFormat, testsData, executingDirectory, globalParameters)).invoke(null, null); } if (convertResult.getMbtTests() != null) { @@ -207,12 +209,12 @@ private void createMTBTests(List tests, @Nonnull Run build, @Nonn EnvVars env = build.getEnvironment(listener); - props.setProperty("parentFolder", workspace.getRemote() + "\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + props.setProperty("parentFolder", workspace.getRemote() + "\\" + MfMBTConverter.MBT_PARENT_SUB_DIR); props.setProperty("repoFolder", workspace.getRemote()); ParametersAction parameterAction = build.getAction(ParametersAction.class); ParameterValue checkoutDirParameter = parameterAction.getParameter(CHECKOUT_DIRECTORY_PARAMETER); if (checkoutDirParameter != null) { - props.setProperty("parentFolder", env.expand((String) checkoutDirParameter.getValue()) + "\\" + MfUftConverter.MBT_PARENT_SUB_DIR); + props.setProperty("parentFolder", env.expand((String) checkoutDirParameter.getValue()) + "\\" + MfMBTConverter.MBT_PARENT_SUB_DIR); props.setProperty("repoFolder", env.expand((String) checkoutDirParameter.getValue())); } @@ -318,14 +320,14 @@ private static void printToConsole(TaskListener listener, String msg) { private static class GetConvertResult implements FilePath.FileCallable { private TestsToRunFramework framework; - private String rawTests; + private List testData; private String executingDirectory; private String format; private Map globalParameters; - public GetConvertResult(TestsToRunFramework framework, String format, String rawTests, String executingDirectory, Map globalParameters) { + public GetConvertResult(TestsToRunFramework framework, String format, List testData, String executingDirectory, Map globalParameters) { this.framework = framework; - this.rawTests = rawTests; + this.testData = testData; this.format = format; this.executingDirectory = executingDirectory; this.globalParameters = globalParameters; @@ -335,7 +337,7 @@ public GetConvertResult(TestsToRunFramework framework, String format, String raw public TestsToRunConverterResult invoke(File file, VirtualChannel virtualChannel) throws IOException, InterruptedException { return TestsToRunConvertersFactory.createConverter(framework) .setFormat(format) - .convert(rawTests, executingDirectory, globalParameters); + .convert(testData, executingDirectory, globalParameters); } @Override diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index 6a1236f5d7..41023ea495 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -31,7 +31,7 @@ import com.hp.octane.integrations.dto.DTOFactory; import com.hp.octane.integrations.dto.tests.Property; import com.hp.octane.integrations.dto.tests.TestSuite; -import com.hp.octane.integrations.executor.converters.MfUftConverter; +import com.hp.octane.integrations.executor.converters.MfMBTConverter; import com.hp.octane.integrations.uft.ufttestresults.UftTestResultsUtils; import com.hp.octane.integrations.utils.SdkConstants; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; @@ -198,9 +198,9 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I int uftTextIndexStart = getUftTestIndexStart(workspace, sharedCheckOutDirectory, testName); if (uftTextIndexStart != -1) { String path = testName.substring(uftTextIndexStart).replace(SdkConstants.FileSystem.LINUX_PATH_SPLITTER, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER);; - if(path.startsWith(MfUftConverter.MBT_PARENT_SUB_DIR)){//remove MBT prefix + if(path.startsWith(MfMBTConverter.MBT_PARENT_SUB_DIR)){//remove MBT prefix //mbt test located in two level folder : ___mbt/_order - path = path.substring(MfUftConverter.MBT_PARENT_SUB_DIR.length()+1);//remove ___mbt + path = path.substring(MfMBTConverter.MBT_PARENT_SUB_DIR.length() + 1);//remove ___mbt path = path.substring(path.indexOf(SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER));//remove order part } diff --git a/src/main/resources/META-INF/hudson.remoting.ClassFilter b/src/main/resources/META-INF/hudson.remoting.ClassFilter index 65cb4e0af9..ec0d4fb041 100644 --- a/src/main/resources/META-INF/hudson.remoting.ClassFilter +++ b/src/main/resources/META-INF/hudson.remoting.ClassFilter @@ -24,4 +24,5 @@ com.hp.octane.integrations.executor.converters.MbtTest com.hp.octane.integrations.executor.TestsToRunConverterResult com.hp.octane.integrations.executor.TestToRunData com.hp.octane.integrations.executor.TestsToRunFramework +com.hp.octane.integrations.executor.TestsToRunConverter From 51ab620c9d80fea348e5a7de5fa5b6c4d7b2972d Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 2 Sep 2021 11:13:02 +0300 Subject: [PATCH 1847/2502] support bulk get status --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ee70526bbe..76b97f6b3a 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.10 + 2.7.1.11 From c3e6136aa639203a72a8ddb32d408c4a4754de89 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 2 Sep 2021 11:14:23 +0300 Subject: [PATCH 1848/2502] support bulk get status --- .../tools/octane/CIJenkinsServicesImpl.java | 9 ++------- .../projects/AbstractProjectProcessor.java | 20 +++++++++---------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index 6bd157b903..b88c68a5aa 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -299,7 +299,7 @@ public void stopPipelineRun(String jobCiId, CIParameters ciParameters) { } @Override - public CIBuildStatusInfo getJobBuildStatus(String jobCiId, CIParameters ciParameters) { + public CIBuildStatusInfo getJobBuildStatus(String jobCiId, String parameterName, String parameterValue) { ACLContext securityContext = startImpersonation(); try { Job job = getJobByRefId(jobCiId); @@ -308,12 +308,7 @@ public CIBuildStatusInfo getJobBuildStatus(String jobCiId, CIParameters ciParame throw new PermissionException(HttpStatus.SC_FORBIDDEN); } AbstractProjectProcessor jobProcessor = JobProcessorFactory.getFlowProcessor(job); - ParametersAction parametersAction = new ParametersAction(); - if (ciParameters != null) { - parametersAction = new ParametersAction(createParameters(job, ciParameters)); - } - - return jobProcessor.getBuildStatus(parametersAction); + return jobProcessor.getBuildStatus(parameterName, parameterValue); } finally { stopImpersonation(securityContext); } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index f382d0e05e..9eaab9c8e7 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -159,14 +159,14 @@ public void cancelBuild(Cause cause, ParametersAction parametersAction) { } } - public CIBuildStatusInfo getBuildStatus(ParametersAction parametersAction) { - CIBuildStatusInfo status = DTOFactory.getInstance().newDTO(CIBuildStatusInfo.class).setBuildStatus(CIBuildStatus.UNAVAILABLE); - String buildId = getParameterValueIfExist(parametersAction, UftConstants.BUILD_ID_PARAMETER_NAME); - String releaseExecutionId = getParameterValueIfExist(parametersAction, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME); - if (SdkStringUtils.isEmpty(releaseExecutionId) && SdkStringUtils.isEmpty(buildId)) { - List required = Arrays.asList(UftConstants.BUILD_ID_PARAMETER_NAME, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME); - throw new IllegalArgumentException("One of parameters is required :" + required); - } + public CIBuildStatusInfo getBuildStatus(String paramName, String paramValue) { + CIBuildStatusInfo status = DTOFactory.getInstance().newDTO(CIBuildStatusInfo.class) + .setBuildStatus(CIBuildStatus.UNAVAILABLE) + .setJobCiId(this.getTranslatedJobName()) + .setParamName(paramName) + .setParamValue(paramValue); + String buildId = UftConstants.BUILD_ID_PARAMETER_NAME.equals(paramName)?paramValue:null; + if (job instanceof AbstractProject) { if (buildId != null) { @@ -188,7 +188,7 @@ public CIBuildStatusInfo getBuildStatus(ParametersAction parametersAction) { Queue queue = Jenkins.get().getQueue(); queue.getItems(project).forEach(item -> { item.getActions(ParametersAction.class).forEach(action -> { - if (!foundInfo.found && checkIfParamExistAndEqual(action, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME, releaseExecutionId)) { + if (!foundInfo.found && checkIfParamExistAndEqual(action, paramName, paramValue)) { status.setBuildStatus(CIBuildStatus.QUEUED); foundInfo.found = true; } @@ -199,7 +199,7 @@ public CIBuildStatusInfo getBuildStatus(ParametersAction parametersAction) { if (!foundInfo.found && build instanceof AbstractBuild) { AbstractBuild aBuild = (AbstractBuild) build; aBuild.getActions(ParametersAction.class).forEach(action -> { - if (checkIfParamExistAndEqual(action, SdkConstants.JobParameters.OCTANE_AUTO_ACTION_EXECUTION_ID_PARAMETER_NAME, releaseExecutionId)) { + if (checkIfParamExistAndEqual(action, paramName, paramValue)) { if (aBuild.isBuilding()) { status.setBuildStatus(CIBuildStatus.RUNNING); } else { From 5d98b35a01f951de9ff045975a86ceb95db07ce7 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 5 Sep 2021 22:09:16 +0300 Subject: [PATCH 1849/2502] user story #1354266 : Allow to create and run suite runs via a CI JOB --- pom.xml | 8 +- .../ExecuteTestsInOctaneBuilder.java | 192 ++++++++++++++++++ .../ExecuteTestsInOctaneBuilder/config.jelly | 54 +++++ .../ExecuteTestsInOctaneBuilder/help.html | 68 +++++++ 4 files changed, 321 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java create mode 100644 src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly create mode 100644 src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html diff --git a/pom.xml b/pom.xml index 76b97f6b3a..5be061bba7 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.11 + 2.7.1.12 @@ -675,5 +675,11 @@ jaxb-runtime 3.0.0 + + org.jenkins-ci.main + jenkins-test-harness-htmlunit + 2.31-2 + compile + diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java new file mode 100644 index 0000000000..5244b03704 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java @@ -0,0 +1,192 @@ +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ___________________________________________________________________ + */ + +package com.microfocus.application.automation.tools.octane.octaneExecution; + +import com.hp.octane.integrations.OctaneClient; +import com.hp.octane.integrations.OctaneSDK; +import com.hp.octane.integrations.octaneExecution.ExecutionMode; +import com.hp.octane.integrations.services.testexecution.TestExecutionService; +import com.microfocus.application.automation.tools.octane.JellyUtils; +import hudson.EnvVars; +import hudson.Extension; +import hudson.FilePath; +import hudson.Launcher; +import hudson.model.*; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; +import hudson.util.ListBoxModel; +import jenkins.tasks.SimpleBuildStep; +import org.jenkinsci.Symbol; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; + +import javax.annotation.Nonnull; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Execute tests in Octane + */ +public class ExecuteTestsInOctaneBuilder extends Builder implements SimpleBuildStep { + + private String configurationId; + private String executionMode; + private String ids; + private String workspaceId; + + @DataBoundConstructor + public ExecuteTestsInOctaneBuilder(String configurationId, String workspaceId, String executionMode, String ids) { + this.configurationId = JellyUtils.NONE.equalsIgnoreCase(configurationId) ? null : configurationId; + this.workspaceId = JellyUtils.NONE.equalsIgnoreCase(workspaceId) ? null : workspaceId; + this.executionMode = executionMode; + this.ids = ids; + } + + @Override + public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException { + if (configurationId == null) { + throw new IllegalArgumentException("ALM Octane configuration is not defined."); + } + if (workspaceId == null) { + throw new IllegalArgumentException("ALM Octane workspace is not defined."); + } + + String myConfigurationId = configurationId; + String myWorkspaceId = workspaceId; + String myExecutionMode = executionMode; + String myIds = ids; + try { + EnvVars env = build.getEnvironment(listener); + myConfigurationId = env.expand(configurationId); + myWorkspaceId = env.expand(workspaceId); + myExecutionMode = env.expand(executionMode); + myIds = env.expand(ids); + } catch (IOException | InterruptedException e) { + listener.error("Failed loading build environment " + e); + } + + Long myWorkspaceIdAsLong = null; + try { + myWorkspaceIdAsLong = Long.parseLong(myWorkspaceId); + } catch (Exception e) { + throw new RuntimeException("Failed to convert workspace to long : " + myWorkspaceId); + } + + OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(myConfigurationId); + TestExecutionService testExecutionService = octaneClient.getTestExecutionService(); + List suiteIds = Arrays.stream(myIds.split(",")).map(str -> Long.parseLong(str.trim())).collect(Collectors.toList()); + + ParametersAction parameterAction = build.getAction(ParametersAction.class); + Long optionalReleaseId = null; + String optionalSuiteRunName = null; + if (parameterAction != null) { + optionalReleaseId = getLongValueParameter(parameterAction, "octane_release_id"); + optionalSuiteRunName = getStringValueParameter(parameterAction, "octane_new_suite_run_name"); + } + testExecutionService.executeSuiteRuns(myWorkspaceIdAsLong, suiteIds, optionalReleaseId, optionalSuiteRunName); + } + + private Long getLongValueParameter(ParametersAction parameterAction, String paramName) { + ParameterValue pv = parameterAction.getParameter(paramName); + if (pv != null && pv.getValue() instanceof String) { + try { + return Long.valueOf((String) pv.getValue()); + } catch (Exception e) { + return null; + } + } + return null; + } + + private String getStringValueParameter(ParametersAction parameterAction, String paramName) { + ParameterValue pv = parameterAction.getParameter(paramName); + if (pv != null && pv.getValue() instanceof String) { + return (String) pv.getValue(); + } + return null; + } + + private static void printToConsole(TaskListener listener, String msg) { + listener.getLogger().println(ExecuteTestsInOctaneBuilder.class.getSimpleName() + " : " + msg); + } + + public String getConfigurationId() { + return configurationId; + } + + public String getWorkspaceId() { + return workspaceId; + } + + public String getExecutionMode() { + return executionMode; + } + + public String getIds() { + return ids; + } + + + @Symbol("executeTestsFromAlmOctane") + @Extension + public static class Descriptor extends BuildStepDescriptor { + + @Override + public boolean isApplicable(Class jobType) { + return false;//FreeStyleProject.class.isAssignableFrom(jobType); + } + + @Override + public String getDisplayName() { + return "Execute tests from Alm Octane"; + } + + + public ListBoxModel doFillExecutionModeItems() { + ListBoxModel m = new ListBoxModel(); + for (ExecutionMode mode : ExecutionMode.values()) { + m.add(mode.description(), mode.value()); + } + + return m; + } + + public ListBoxModel doFillConfigurationIdItems() { + return JellyUtils.fillConfigurationIdModel(); + } + + public ListBoxModel doFillWorkspaceIdItems(@QueryParameter String configurationId, @QueryParameter(value = "workspaceId") String workspaceId) { + return JellyUtils.fillWorkspaceModel(configurationId, workspaceId); + } + + } + +} diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly new file mode 100644 index 0000000000..9b9b736b77 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html new file mode 100644 index 0000000000..fc6a08e6d8 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html @@ -0,0 +1,68 @@ + + +
      + This build step is intended to support execution of automated tests from Micro Focus ALM Octane.
      + There are several modes of execution : + + + + + + + + + + + + + + + + + + + + + + + + +
      ModeExplanation
      Execute suite runs in ALM OctaneExecute suites according to specified suite IDs. Suites are + triggered in ALM Octane, and the job is finished after triggering the suite runs. The job does not wait + until the suite runs are finished. This method is useful if you want to schedule suite execution in ALM + Octane. Suite runs will be triggered with default release. +
      Get tests from suites and trigger execution jobsGet tests from suites and trigger execution jobs : Get tests from specified suite IDs. (This method + assumes that tests are assigned to test runner jobs from the current Jenkins.) Tests are send to + execution by their assigned test runner jobs. The main job is finished after the test runner jobs are + finished. + This method is useful if you intend to add your job to the ALM Octane Pipeline module. +
      Get tests from favorites and trigger execution jobsGet tests from a favorite filter. This method uses the same flow as the previous method, but takes tests + from the Favorites filter. +
      +
      \ No newline at end of file From 409f767e55f05c1a3e0a5c91fa4735ed00861406 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sat, 11 Sep 2021 12:16:04 +0300 Subject: [PATCH 1850/2502] user story #1354266 : Allow to create and run suite runs via a CI JOB --- pom.xml | 2 +- .../tools/octane/CIJenkinsServicesImpl.java | 2 +- ...ause.java => TriggeredByOctanePlugin.java} | 19 +-- .../ExecuteTestsInOctaneBuilder.java | 123 ++++++++++++++++-- .../ExecuteTestsInOctaneBuilder/help.html | 13 +- 5 files changed, 133 insertions(+), 26 deletions(-) rename src/main/java/com/microfocus/application/automation/tools/octane/executor/{TriggeredBySuiteRunCause.java => TriggeredByOctanePlugin.java} (77%) diff --git a/pom.xml b/pom.xml index 5be061bba7..0b840be8fb 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.12 + 2.7.1.14 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index b88c68a5aa..fa631b7f94 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -676,7 +676,7 @@ private void doRunStopImpl(BiConsumer method, String me method.accept(cause, parametersAction); } - private List createParameters(Job project, CIParameters ciParameters) { + public static List createParameters(Job project, CIParameters ciParameters) { List result = new ArrayList<>(); boolean parameterHandled; ParameterValue tmpValue; diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TriggeredByOctanePlugin.java similarity index 77% rename from src/main/java/com/microfocus/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java rename to src/main/java/com/microfocus/application/automation/tools/octane/executor/TriggeredByOctanePlugin.java index 905acb9fe0..c119697379 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TriggeredBySuiteRunCause.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TriggeredByOctanePlugin.java @@ -31,23 +31,24 @@ import hudson.model.Cause; /** - * Representing job trigger by Octane suite run + * Representing job trigger by Octane plugin */ -public class TriggeredBySuiteRunCause extends Cause { +public class TriggeredByOctanePlugin extends Cause { - String suiteRunId; + String identifier; + String identifierType; - - public TriggeredBySuiteRunCause(String suiteRunId) { - this.suiteRunId = suiteRunId; + public TriggeredByOctanePlugin(String identifierType, String identifier) { + this.identifier = identifier; + this.identifierType = identifierType; } - public static TriggeredBySuiteRunCause create(String suiteRunId){ - return new TriggeredBySuiteRunCause(suiteRunId); + public static TriggeredByOctanePlugin create(String identifierType, String identifier) { + return new TriggeredByOctanePlugin(identifierType, identifier); } @Override public String getShortDescription() { - return "Triggered by ALM Octane suite run #" + suiteRunId; + return String.format("Triggered by ALM Octane plugin for %s #%s ", identifierType, identifier); } } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java index 5244b03704..68dc802620 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java @@ -30,25 +30,44 @@ import com.hp.octane.integrations.OctaneClient; import com.hp.octane.integrations.OctaneSDK; +import com.hp.octane.integrations.dto.DTOFactory; +import com.hp.octane.integrations.dto.parameters.CIParameter; +import com.hp.octane.integrations.dto.parameters.CIParameterType; +import com.hp.octane.integrations.dto.parameters.CIParameters; +import com.hp.octane.integrations.exceptions.ConfigurationException; +import com.hp.octane.integrations.exceptions.PermissionException; import com.hp.octane.integrations.octaneExecution.ExecutionMode; +import com.hp.octane.integrations.services.SupportsConsoleLog; +import com.hp.octane.integrations.services.testexecution.TestExecutionContext; import com.hp.octane.integrations.services.testexecution.TestExecutionService; +import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl; +import com.microfocus.application.automation.tools.octane.ImpersonationUtil; import com.microfocus.application.automation.tools.octane.JellyUtils; +import com.microfocus.application.automation.tools.octane.executor.TriggeredByOctanePlugin; +import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; +import com.microfocus.application.automation.tools.octane.testrunner.TestsToRunConverterBuilder; import hudson.EnvVars; import hudson.Extension; import hudson.FilePath; import hudson.Launcher; import hudson.model.*; +import hudson.model.queue.QueueTaskFuture; +import hudson.security.ACLContext; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; import hudson.util.ListBoxModel; +import jenkins.model.Jenkins; import jenkins.tasks.SimpleBuildStep; +import org.apache.http.HttpStatus; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -72,6 +91,7 @@ public ExecuteTestsInOctaneBuilder(String configurationId, String workspaceId, S @Override public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException { + SupportsConsoleLog supportsConsoleLog = new SupportsConsoleLogImpl(listener); if (configurationId == null) { throw new IllegalArgumentException("ALM Octane configuration is not defined."); } @@ -93,7 +113,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu listener.error("Failed loading build environment " + e); } - Long myWorkspaceIdAsLong = null; + Long myWorkspaceIdAsLong; try { myWorkspaceIdAsLong = Long.parseLong(myWorkspaceId); } catch (Exception e) { @@ -105,16 +125,85 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu List suiteIds = Arrays.stream(myIds.split(",")).map(str -> Long.parseLong(str.trim())).collect(Collectors.toList()); ParametersAction parameterAction = build.getAction(ParametersAction.class); - Long optionalReleaseId = null; - String optionalSuiteRunName = null; - if (parameterAction != null) { - optionalReleaseId = getLongValueParameter(parameterAction, "octane_release_id"); - optionalSuiteRunName = getStringValueParameter(parameterAction, "octane_new_suite_run_name"); + + switch (ExecutionMode.fromValue(myExecutionMode)) { + case SUITE_RUNS_IN_OCTANE: + + Long optionalReleaseId = getLongValueParameter(parameterAction, "octane_release_id"); + String optionalSuiteRunName = getStringValueParameter(parameterAction, "octane_new_suite_run_name"); + testExecutionService.executeSuiteRuns(myWorkspaceIdAsLong, suiteIds, optionalReleaseId, optionalSuiteRunName, supportsConsoleLog); + break; + + case SUITE_IN_CI: + List testExecutions = testExecutionService.prepareTestExecutionForSuites(myWorkspaceIdAsLong, suiteIds, supportsConsoleLog); + ACLContext securityContext = ImpersonationUtil.startImpersonation(myConfigurationId, null); + List futures = new ArrayList<>(); + try { + + testExecutions.forEach(testExecution -> { + AbstractProject project = getJobFromTestRunner(testExecution); + supportsConsoleLog.addLogMessage(String.format("Trigger %s", project.getFullName())); + int delay = project.getQuietPeriod(); + Cause cause = TriggeredByOctanePlugin.create(testExecution.getIdentifierType().getName(), testExecution.getIdentifier()); + + CIParameter testsToRunParam = DTOFactory.getInstance().newDTO(CIParameter.class) + .setName(TestsToRunConverterBuilder.TESTS_TO_RUN_PARAMETER) + .setValue(testExecution.getTestsToRun()) + .setType(CIParameterType.STRING); + CIParameters ciParams = DTOFactory.getInstance().newDTO(CIParameters.class); + ciParams.setParameters(Collections.singletonList(testsToRunParam)); + ParametersAction parametersAction = new ParametersAction(CIJenkinsServicesImpl.createParameters(project, ciParams)); + + QueueTaskFuture future = project.scheduleBuild2(delay, cause, parametersAction); + futures.add(future); + }); + } finally { + ImpersonationUtil.stopImpersonation(securityContext); + } + + //WAIT UNTIL ALL JOBS ARE FINISHED + futures.forEach(f -> { + try { + f.get(); + } catch (Exception e) { + //TODO CHECK WHAT TO DO HERE + throw new RuntimeException("Failed in waiting for job finishing : " + e.getMessage()); + } + }); + + + break; + default: + throw new RuntimeException("not supported execution mode"); + } + } + + private AbstractProject getJobFromTestRunner(TestExecutionContext testExecution) { + String ciJobName = testExecution.getTestRunner().getEntityValue("ci_job").getName(); + Job job = (Job) Jenkins.get().getItemByFullName(ciJobName); + if (job != null) { + if (job instanceof AbstractProject && ((AbstractProject) job).isDisabled()) { + //disabled job is not runnable and in this context we will handle it as 404 + throw new ConfigurationException("Job is disabled " + ciJobName, HttpStatus.SC_NOT_FOUND); + } + boolean hasBuildPermission = job.hasPermission(Item.BUILD); + if (!hasBuildPermission) { + throw new PermissionException("No permission to run job " + ciJobName, HttpStatus.SC_FORBIDDEN); + } + if (job instanceof AbstractProject || job.getClass().getName().equals(JobProcessorFactory.WORKFLOW_JOB_NAME)) { + + } + } else { + throw new ConfigurationException("Job is not found " + ciJobName, HttpStatus.SC_NOT_FOUND); } - testExecutionService.executeSuiteRuns(myWorkspaceIdAsLong, suiteIds, optionalReleaseId, optionalSuiteRunName); + + return (AbstractProject) job; } private Long getLongValueParameter(ParametersAction parameterAction, String paramName) { + if (parameterAction == null) { + return null; + } ParameterValue pv = parameterAction.getParameter(paramName); if (pv != null && pv.getValue() instanceof String) { try { @@ -127,6 +216,9 @@ private Long getLongValueParameter(ParametersAction parameterAction, String para } private String getStringValueParameter(ParametersAction parameterAction, String paramName) { + if (parameterAction == null) { + return null; + } ParameterValue pv = parameterAction.getParameter(paramName); if (pv != null && pv.getValue() instanceof String) { return (String) pv.getValue(); @@ -134,10 +226,6 @@ private String getStringValueParameter(ParametersAction parameterAction, String return null; } - private static void printToConsole(TaskListener listener, String msg) { - listener.getLogger().println(ExecuteTestsInOctaneBuilder.class.getSimpleName() + " : " + msg); - } - public String getConfigurationId() { return configurationId; } @@ -154,6 +242,17 @@ public String getIds() { return ids; } + public static class SupportsConsoleLogImpl implements SupportsConsoleLog { + TaskListener listener; + + public SupportsConsoleLogImpl(TaskListener listener) { + this.listener = listener; + } + + public void addLogMessage(String msg) { + listener.getLogger().println(ExecuteTestsInOctaneBuilder.class.getSimpleName() + " : " + msg); + } + } @Symbol("executeTestsFromAlmOctane") @Extension @@ -161,7 +260,7 @@ public static class Descriptor extends BuildStepDescriptor { @Override public boolean isApplicable(Class jobType) { - return false;//FreeStyleProject.class.isAssignableFrom(jobType); + return true;//FreeStyleProject.class.isAssignableFrom(jobType); } @Override diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html index fc6a08e6d8..4a099266c1 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html @@ -40,10 +40,17 @@ Execute suite runs in ALM Octane - Execute suites according to specified suite IDs. Suites are - triggered in ALM Octane, and the job is finished after triggering the suite runs. The job does not wait + Execute suites according to specified suite IDs. New suite runs will be created and executed in ALM Octane. + Jenkins job is finished after triggering the suite runs. The job does not wait until the suite runs are finished. This method is useful if you want to schedule suite execution in ALM - Octane. Suite runs will be triggered with default release. + Octane. +
      + By default, newly created suite runs will have name of suite and will be assigned to default release. + In order to override this default behaviour, add following parameters (one or more) to job with your desired values: +
        +
      • octane_release_id
      • +
      • octane_new_suite_run_name
      • +
      From 088070c8a1dc0b91cfcf691e95fa95a4f461c31a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 13 Sep 2021 10:08:16 +0300 Subject: [PATCH 1851/2502] user story #1354266 : Allow to create and run suite runs via a CI JOB --- .../ExecuteTestsInOctaneBuilder.java | 79 ++++++++++++++----- .../ExecuteTestsInOctaneBuilder/help.html | 6 -- 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java index 68dc802620..4eb977a060 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java @@ -43,7 +43,6 @@ import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl; import com.microfocus.application.automation.tools.octane.ImpersonationUtil; import com.microfocus.application.automation.tools.octane.JellyUtils; -import com.microfocus.application.automation.tools.octane.executor.TriggeredByOctanePlugin; import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; import com.microfocus.application.automation.tools.octane.testrunner.TestsToRunConverterBuilder; import hudson.EnvVars; @@ -65,10 +64,7 @@ import javax.annotation.Nonnull; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -92,6 +88,8 @@ public ExecuteTestsInOctaneBuilder(String configurationId, String workspaceId, S @Override public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException { SupportsConsoleLog supportsConsoleLog = new SupportsConsoleLogImpl(listener); + supportsConsoleLog.println("Start **********************************************************************************************"); + supportsConsoleLog.println(""); if (configurationId == null) { throw new IllegalArgumentException("ALM Octane configuration is not defined."); } @@ -99,6 +97,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu throw new IllegalArgumentException("ALM Octane workspace is not defined."); } + String myConfigurationId = configurationId; String myWorkspaceId = workspaceId; String myExecutionMode = executionMode; @@ -137,15 +136,26 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu case SUITE_IN_CI: List testExecutions = testExecutionService.prepareTestExecutionForSuites(myWorkspaceIdAsLong, suiteIds, supportsConsoleLog); ACLContext securityContext = ImpersonationUtil.startImpersonation(myConfigurationId, null); - List futures = new ArrayList<>(); + Map> futures = new HashMap<>(); try { testExecutions.forEach(testExecution -> { AbstractProject project = getJobFromTestRunner(testExecution); - supportsConsoleLog.addLogMessage(String.format("Trigger %s", project.getFullName())); - int delay = project.getQuietPeriod(); - Cause cause = TriggeredByOctanePlugin.create(testExecution.getIdentifierType().getName(), testExecution.getIdentifier()); - + try { + supportsConsoleLog.print(String.format("%s %s, triggering test runner '%s' (%s tests): " + , testExecution.getIdentifierType().getName() + , testExecution.getIdentifier() + , testExecution.getTestRunner().getName() + , testExecution.getTests().size() + )); + listener.hyperlink("/job/" + project.getFullName().replace("/", "/job/"), project.getFullName()); + supportsConsoleLog.newLine(); + } catch (IOException e) { + throw new RuntimeException("Failed to print link to triggered job : " + e.getMessage()); + } + int delay = 0; + + Cause cause = new Cause.UpstreamCause(build); CIParameter testsToRunParam = DTOFactory.getInstance().newDTO(CIParameter.class) .setName(TestsToRunConverterBuilder.TESTS_TO_RUN_PARAMETER) .setValue(testExecution.getTestsToRun()) @@ -154,24 +164,43 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu ciParams.setParameters(Collections.singletonList(testsToRunParam)); ParametersAction parametersAction = new ParametersAction(CIJenkinsServicesImpl.createParameters(project, ciParams)); - QueueTaskFuture future = project.scheduleBuild2(delay, cause, parametersAction); - futures.add(future); + QueueTaskFuture future = project.scheduleBuild2(delay, cause, parametersAction); + futures.put(testExecution, future); }); } finally { ImpersonationUtil.stopImpersonation(securityContext); } - //WAIT UNTIL ALL JOBS ARE FINISHED - futures.forEach(f -> { + //WAIT UNTIL ALL JOBS ARE FINISHED and set build result based on worse result + supportsConsoleLog.print("Waiting for test runners are finished ... "); + Result buildResult = Result.SUCCESS; + for (Map.Entry> entry : futures.entrySet()) { try { - f.get(); + + //TODO check status + AbstractBuild buildFromFuture = entry.getValue().get(); + try { + supportsConsoleLog.print("Build "); + String url = "/job/" + buildFromFuture.getProject().getFullName().replace("/", "/job/") + "/" + buildFromFuture.getNumber(); + listener.hyperlink(url, buildFromFuture.getProject().getFullName() + " " + buildFromFuture.getDisplayName()); + supportsConsoleLog.append(" - " + buildFromFuture.getResult()); + supportsConsoleLog.newLine(); + } catch (IOException e) { + throw new RuntimeException("Failed to print link to triggered job : " + e.getMessage()); + } + + if (buildFromFuture.getResult().isWorseThan(buildResult)) { + buildResult = buildFromFuture.getResult(); + } + } catch (Exception e) { //TODO CHECK WHAT TO DO HERE throw new RuntimeException("Failed in waiting for job finishing : " + e.getMessage()); } - }); - - + } + if (buildResult.isWorseThan(Result.SUCCESS)) { + build.setResult(buildResult); + } break; default: throw new RuntimeException("not supported execution mode"); @@ -249,9 +278,21 @@ public SupportsConsoleLogImpl(TaskListener listener) { this.listener = listener; } - public void addLogMessage(String msg) { + public void println(String msg) { listener.getLogger().println(ExecuteTestsInOctaneBuilder.class.getSimpleName() + " : " + msg); } + + public void print(String msg) { + listener.getLogger().print(ExecuteTestsInOctaneBuilder.class.getSimpleName() + " : " + msg); + } + + public void append(String msg) { + listener.getLogger().print(msg); + } + + public void newLine() { + listener.getLogger().println(); + } } @Symbol("executeTestsFromAlmOctane") diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html index 4a099266c1..587e11a90d 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/help.html @@ -62,12 +62,6 @@ This method is useful if you intend to add your job to the ALM Octane Pipeline module. - - Get tests from favorites and trigger execution jobs - Get tests from a favorite filter. This method uses the same flow as the previous method, but takes tests - from the Favorites filter. - - From 66796b5d93a08ef8b96e14bfca5c480140c1aa73 Mon Sep 17 00:00:00 2001 From: karoi Date: Mon, 13 Sep 2021 10:59:10 +0300 Subject: [PATCH 1852/2502] story #1351073- update sdk dependency version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0b840be8fb..526e0320fc 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.14 + 2.7.1.16 From 850eb9d48f67ce0c57c3dcafae99c797ae60510f Mon Sep 17 00:00:00 2001 From: karoi Date: Mon, 13 Sep 2021 11:01:38 +0300 Subject: [PATCH 1853/2502] story #1351073- listen to changes also in mbt mode --- .../executor/TestExecutionJobCreatorService.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java index 3ee73d1578..2b54f7689c 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/TestExecutionJobCreatorService.java @@ -169,14 +169,12 @@ private static FreeStyleProject createDiscoveryJob(DiscoveryInfo discoveryInfo) addConstantParameter(proj, UftConstants.TEST_RUNNER_LOGICAL_NAME_PARAMETER_NAME, discoveryInfo.getExecutorLogicalName(), "ALM Octane test runner logical name"); addBooleanParameter(proj, UftConstants.FULL_SCAN_PARAMETER_NAME, false, "Specify whether to synchronize the set of tests on ALM Octane with the whole SCM repository or to update the set of tests on ALM Octane based on the latest commits."); - if(!TestingToolType.MBT.equals(discoveryInfo.getTestingToolType())) { // currently, mbt does not support scm changes - //set polling once in two minutes only if not MBT - SCMTrigger scmTrigger = new SCMTrigger("H/2 * * * *");//H/2 * * * * : once in two minutes - proj.addTrigger(scmTrigger); - delayPollingStart(proj, scmTrigger); - addDiscoveryAssignedNode(proj); - addTimestamper(proj); - } + //set polling once in two minutes + SCMTrigger scmTrigger = new SCMTrigger("H/2 * * * *");//H/2 * * * * : once in two minutes + proj.addTrigger(scmTrigger); + delayPollingStart(proj, scmTrigger); + addDiscoveryAssignedNode(proj); + addTimestamper(proj); //add post-build action - publisher addUFTTestDetectionPublisherIfNeeded(proj.getPublishersList(), discoveryInfo); From d5237cfd85557b1ba1aad5cf46edac1c8b2e500b Mon Sep 17 00:00:00 2001 From: karoi Date: Mon, 13 Sep 2021 11:03:01 +0300 Subject: [PATCH 1854/2502] story #1351073- update affected files list for different modes --- .../tools/octane/executor/UFTTestDetectionCallable.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionCallable.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionCallable.java index ea1ed111de..4cc6210976 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionCallable.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionCallable.java @@ -132,8 +132,9 @@ private void wrapScmChanges(AbstractBuild build) { } if(fileWrapper.isSvnDirType()|| - UftTestDiscoveryUtils.isUftDataTableFile(fileWrapper.getPath())|| - UftTestDiscoveryUtils.isTestMainFilePath(fileWrapper.getPath())){ + UftTestDiscoveryUtils.isTestMainFilePath(fileWrapper.getPath())|| + (TestingToolType.UFT.equals(testingToolType) && UftTestDiscoveryUtils.isUftDataTableFile(fileWrapper.getPath())) || + (TestingToolType.MBT.equals(testingToolType) && UftTestDiscoveryUtils.isUftActionFile(fileWrapper.getPath()))){ //add to list scmChangesWrapper.getAffectedFiles().add(fileWrapper); } From 0b5cc80abb8890b6343f969a1c1dfcd0dcbdb0f2 Mon Sep 17 00:00:00 2001 From: karoi Date: Mon, 13 Sep 2021 11:05:22 +0300 Subject: [PATCH 1855/2502] story #1351073- re-arrange code and move uft code to a different class --- .../executor/UftTestDiscoveryDispatcher.java | 310 ++---------------- 1 file changed, 22 insertions(+), 288 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java index 49e64f372e..00aed5a32c 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UftTestDiscoveryDispatcher.java @@ -31,12 +31,11 @@ import com.google.inject.Inject; import com.hp.octane.integrations.OctaneClient; import com.hp.octane.integrations.OctaneSDK; -import com.hp.octane.integrations.dto.entities.Entity; -import com.hp.octane.integrations.dto.entities.EntityConstants; import com.hp.octane.integrations.exceptions.OctaneRestException; import com.hp.octane.integrations.services.entities.EntitiesService; import com.hp.octane.integrations.uft.UftTestDispatchUtils; -import com.hp.octane.integrations.uft.items.*; +import com.hp.octane.integrations.uft.items.JobRunContext; +import com.hp.octane.integrations.uft.items.UftTestDiscoveryResult; import com.hp.octane.integrations.utils.SdkStringUtils; import com.microfocus.application.automation.tools.octane.ResultQueue; import com.microfocus.application.automation.tools.octane.configuration.SDKBasedLoggerProvider; @@ -50,7 +49,6 @@ import org.apache.http.HttpStatus; import org.apache.logging.log4j.Logger; -import java.util.*; import java.util.concurrent.TimeUnit; /** @@ -62,18 +60,34 @@ */ @Extension public class UftTestDiscoveryDispatcher extends AbstractSafeLoggingAsyncPeriodWork { - private final static Logger logger = SDKBasedLoggerProvider.getLogger(UftTestDiscoveryDispatcher.class); - private final static int MAX_DISPATCH_TRIALS = 5; - private static final String OCTANE_VERSION_SUPPORTING_TEST_RENAME = "12.60.3"; + private static final Logger logger = SDKBasedLoggerProvider.getLogger(UftTestDiscoveryDispatcher.class); + + private static final int MAX_DISPATCH_TRIALS = 5; private UftTestDiscoveryQueue queue; + private volatile boolean stopped = false; public UftTestDiscoveryDispatcher() { super("Uft Test Discovery Dispatcher"); } + private static void dispatchDetectionResults(ResultQueue.QueueItem item, EntitiesService entitiesService, UftTestDiscoveryResult result, AbstractBuild build) { + //Check if there is diff in discovery and server status + //for example : discovery found new test , but it already exist in server , instead of create new tests we will do update test + UftTestDispatchUtils.prepareDiscoveryResultForDispatch(entitiesService, result); + + try { + build.getWorkspace().act(new UFTTestDetectionFinalResultSaverCallable(result, build.getNumber())); + } catch (Exception e) { + logger.info("Failed to save final result : " + e.getMessage()); + } + + //dispatch + JobRunContext jobRunContext = JobRunContext.create(item.getProjectName(), item.getBuildNumber()); + UftTestDispatchUtils.dispatchDiscoveryResult(entitiesService, result, jobRunContext, null); + } @Override protected void doExecute(TaskListener listener) { @@ -155,161 +169,6 @@ public void close() { queue.close(); } - private static void dispatchDetectionResults(ResultQueue.QueueItem item, EntitiesService entitiesService, UftTestDiscoveryResult result, AbstractBuild build) { - //Check if there is diff in discovery and server status - //for example : discovery found new test , but it already exist in server , instead of create new tests we will do update test - if (result.isFullScan()) { - UftTestDispatchUtils.prepareDispatchingForFullSync(entitiesService, result); - - } else { - if (isOctaneSupportTestRename(entitiesService)) { - handleMovedTests(result); - handleMovedDataTables(result); - } - - validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(entitiesService, result); - validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(entitiesService, result); - - UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllTests()); - UftTestDispatchUtils.removeItemsWithStatusNone(result.getAllScmResourceFiles()); - } - - try { - build.getWorkspace().act(new UFTTestDetectionFinalResultSaverCallable(result, build.getNumber())); - } catch (Exception e) { - logger.info("Failed to save final result : " + e.getMessage()); - } - - //dispatch - JobRunContext jobRunContext = JobRunContext.create(item.getProjectName(), item.getBuildNumber()); - UftTestDispatchUtils.dispatchDiscoveryResult(entitiesService, result, jobRunContext, null); - } - - private static boolean validateTestDiscoveryAndCompleteDataTableIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { - boolean hasDiff = false; - Set allNames = new HashSet<>(); - for (ScmResourceFile file : result.getAllScmResourceFiles()) { - if (file.getIsMoved()) { - allNames.add(file.getOldName()); - } else { - allNames.add(file.getName()); - } - } - - //GET DataTables FROM OCTANE - Map octaneEntityMapByRelativePath = UftTestDispatchUtils.getDataTablesFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), allNames); - - - //MATCHING - for (ScmResourceFile file : result.getAllScmResourceFiles()) { - - String key = file.getIsMoved() ? file.getOldRelativePath() : file.getRelativePath(); - Entity octaneFile = octaneEntityMapByRelativePath.get(key); - - boolean octaneFileFound = (octaneFile != null); - if (octaneFileFound) { - file.setId(octaneFile.getId()); - } - - switch (file.getOctaneStatus()) { - case DELETED: - if (!octaneFileFound) { - //file that is marked to be deleted - doesn't exist in Octane - do nothing - hasDiff = true; - file.setOctaneStatus(OctaneStatus.NONE); - } - break; - case MODIFIED: - if (!octaneFileFound) { - //updated file that has no matching in Octane, possibly was remove from Octane. So we move it to new - hasDiff = true; - file.setOctaneStatus(OctaneStatus.NEW); - } - break; - case NEW: - if (octaneFileFound) { - //new file was found in Octane - do nothing(there is nothing to update) - hasDiff = true; - file.setOctaneStatus(OctaneStatus.NONE); - } - break; - default: - //do nothing - } - } - - return hasDiff; - } - - /** - * This method try to find ids of updated and deleted tests for scm change detection - * if test is found on server - update id of discovered test - * if test is not found and test is marked for update - move it to new tests (possibly test was deleted on server) - * - * @return true if there were changes comparing to discoverede results - */ - private static boolean validateTestDiscoveryAndCompleteTestIdsForScmChangeDetection(EntitiesService entitiesService, UftTestDiscoveryResult result) { - boolean hasDiff = false; - - Set allTestNames = new HashSet<>(); - for (AutomatedTest test : result.getAllTests()) { - if (test.getIsMoved()) { - allTestNames.add(test.getOldName()); - } else { - allTestNames.add(test.getName()); - } - } - - //GET TESTS FROM OCTANE - Collection additionalFields = SdkStringUtils.isNotEmpty(result.getTestRunnerId()) ? Collections.singletonList(EntityConstants.AutomatedTest.TEST_RUNNER_FIELD) : null; - Map octaneTestsMapByKey = UftTestDispatchUtils.getTestsFromServer(entitiesService, Long.parseLong(result.getWorkspaceId()), Long.parseLong(result.getScmRepositoryId()), true, allTestNames, additionalFields); - - - //MATCHING - for (AutomatedTest discoveredTest : result.getAllTests()) { - String key = discoveredTest.getIsMoved() - ? UftTestDispatchUtils.createKey(discoveredTest.getOldPackage(), discoveredTest.getOldName()) - : UftTestDispatchUtils.createKey(discoveredTest.getPackage(), discoveredTest.getName()); - Entity octaneTest = octaneTestsMapByKey.get(key); - boolean octaneTestFound = (octaneTest != null); - if (octaneTestFound) { - discoveredTest.setId(octaneTest.getId()); - } - switch (discoveredTest.getOctaneStatus()) { - case DELETED: - if (!octaneTestFound) { - //discoveredTest that is marked to be deleted - doesn't exist in Octane - do nothing - hasDiff = true; - discoveredTest.setOctaneStatus(OctaneStatus.NONE); - } - break; - case MODIFIED: - if (!octaneTestFound) { - //updated discoveredTest that has no matching in Octane, possibly was remove from Octane. So we move it to new tests - hasDiff = true; - discoveredTest.setOctaneStatus(OctaneStatus.NEW); - } else { - boolean testsEqual = UftTestDispatchUtils.checkTestEquals(discoveredTest, octaneTest, result.getTestRunnerId()); - if (testsEqual) { //if equal - skip - discoveredTest.setOctaneStatus(OctaneStatus.NONE); - } - } - break; - case NEW: - if (octaneTestFound) { - //new discoveredTest was found in Octane - move it to update - hasDiff = true; - discoveredTest.setOctaneStatus(OctaneStatus.MODIFIED); - } - break; - default: - //do nothing - } - } - - return hasDiff; - } - @Override public long getRecurrencePeriod() { String value = System.getProperty("UftTestDiscoveryDispatcher.Period"); // let's us config the recurrence period. default is 30 seconds. @@ -330,133 +189,8 @@ public void setTestResultQueue(UftTestDiscoveryQueue queue) { * @param projectName jobs name * @param buildNumber build number */ - public void enqueueResult( String instanceId, String projectName, int buildNumber, String workspace) { + public void enqueueResult(String instanceId, String projectName, int buildNumber, String workspace) { queue.add(instanceId, projectName, buildNumber, workspace); } - private static void handleMovedTests(UftTestDiscoveryResult result) { - List newTests = result.getNewTests(); - List deletedTests = result.getDeletedTests(); - if (!newTests.isEmpty() && !deletedTests.isEmpty()) { - Map dst2Test = new HashMap<>(); - Map deleted2newMovedTests = new HashMap<>(); - for (AutomatedTest newTest : newTests) { - if (SdkStringUtils.isNotEmpty(newTest.getChangeSetDst())) { - dst2Test.put(newTest.getChangeSetDst(), newTest); - } - } - for (AutomatedTest deletedTest : deletedTests) { - if (SdkStringUtils.isNotEmpty(deletedTest.getChangeSetDst()) && dst2Test.containsKey(deletedTest.getChangeSetDst())) { - AutomatedTest newTest = dst2Test.get(deletedTest.getChangeSetDst()); - deleted2newMovedTests.put(deletedTest, newTest); - } - } - - for (Map.Entry entry : deleted2newMovedTests.entrySet()) { - AutomatedTest deletedTest = entry.getKey(); - AutomatedTest newTest = entry.getValue(); - - newTest.setIsMoved(true); - newTest.setOldName(deletedTest.getName()); - newTest.setOldPackage(deletedTest.getPackage()); - newTest.setOctaneStatus(OctaneStatus.MODIFIED); - - result.getAllTests().remove(deletedTest); - } - } - } - - private static void handleMovedDataTables(UftTestDiscoveryResult result) { - List newItems = result.getNewScmResourceFiles(); - List deletedItems = result.getDeletedScmResourceFiles(); - if (!newItems.isEmpty() && !deletedItems.isEmpty()) { - Map dst2File = new HashMap<>(); - Map deleted2newMovedFiles = new HashMap<>(); - for (ScmResourceFile newFile : newItems) { - if (SdkStringUtils.isNotEmpty(newFile.getChangeSetDst())) { - dst2File.put(newFile.getChangeSetDst(), newFile); - } - } - for (ScmResourceFile deletedFile : deletedItems) { - if (SdkStringUtils.isNotEmpty(deletedFile.getChangeSetDst()) && dst2File.containsKey(deletedFile.getChangeSetDst())) { - ScmResourceFile newFile = dst2File.get(deletedFile.getChangeSetDst()); - deleted2newMovedFiles.put(deletedFile, newFile); - } - } - - for (Map.Entry entry : deleted2newMovedFiles.entrySet()) { - ScmResourceFile deletedFile = entry.getKey(); - ScmResourceFile newFile = entry.getValue(); - - newFile.setIsMoved(true); - newFile.setOldName(deletedFile.getName()); - newFile.setOldRelativePath(deletedFile.getRelativePath()); - newFile.setOctaneStatus(OctaneStatus.MODIFIED); - - result.getAllScmResourceFiles().remove(deletedFile); - } - } - } - - private static boolean isOctaneSupportTestRename(EntitiesService entitiesService) { - try { - String octane_version = getOctaneVersion(entitiesService); - boolean supportTestRename = (octane_version != null && versionCompare(OCTANE_VERSION_SUPPORTING_TEST_RENAME, octane_version) <= 0); - logger.warn("Support test rename = " + supportTestRename); - return supportTestRename; - } catch (Exception e) {//can occur if user doesnot have permission to get octane version - logger.warn("Failed to check isOctaneSupportTestRename : " + e.getMessage()); - return false; - } - } - - private static String getOctaneVersion(EntitiesService entitiesService) { - String octaneVersion = null; - - List entities = entitiesService.getEntities(null, "server_version", null, null); - if (entities.size() == 1) { - Entity entity = entities.get(0); - octaneVersion = entity.getStringValue("version"); - logger.debug("Received Octane version - " + octaneVersion); - - } else { - logger.error(String.format("Request for Octane version returned %s items. return version is not defined.", entities.size())); - } - - return octaneVersion; - } - - /** - * Compares two version strings. - *

      - * Use this instead of String.compareTo() for a non-lexicographical - * comparison that works for version strings. e.g. "1.10".compareTo("1.6"). - * - * @param str1 a string of ordinal numbers separated by decimal points. - * @param str2 a string of ordinal numbers separated by decimal points. - * @return The result is a negative integer if str1 is _numerically_ less than str2. - * The result is a positive integer if str1 is _numerically_ greater than str2. - * The result is zero if the strings are _numerically_ equal. - * @note It does not work if "1.10" is supposed to be equal to "1.10.0". - */ - private static Integer versionCompare(String str1, String str2) { - String[] vals1 = str1.split("\\."); - String[] vals2 = str2.split("\\."); - int i = 0; - // set index to first non-equal ordinal or length of shortest version string - while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) { - i++; - } - // compare first non-equal ordinal number - if (i < vals1.length && i < vals2.length) { - int diff = Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i])); - return Integer.signum(diff); - } - // the strings are equal or one string is a substring of the other - // e.g. "1.2.3" = "1.2.3" or "1.2.3" < "1.2.3.4" - else { - return Integer.signum(vals1.length - vals2.length); - } - } - } From 8d619ad9443b4513dc8440a8ebfa1cf7511b478b Mon Sep 17 00:00:00 2001 From: karoi Date: Mon, 13 Sep 2021 11:07:46 +0300 Subject: [PATCH 1856/2502] story #1351073- re-arrange code and add mbt action file handling placeholder --- .../executor/UFTTestDetectionService.java | 111 ++++++++++-------- 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java index f617f3bcf9..f91e5f7e74 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/executor/UFTTestDetectionService.java @@ -65,7 +65,7 @@ public static UftTestDiscoveryResult startScanning(File rootDir, BuildListener b result = UftTestDiscoveryUtils.doFullDiscovery(rootDir, testingToolType); } else { printToConsole(buildListener, "Executing changeSet sync. For full sync - define in job boolean parameter 'Full sync' with value 'true'."); - result = doChangeSetDetection(scmChangesWrapper, rootDir); + result = doChangeSetDetection(scmChangesWrapper, rootDir, testingToolType); removeTestDuplicatedForUpdateTests(result); removeFalsePositiveDataTables(result, result.getDeletedTests(), result.getDeletedScmResourceFiles()); removeFalsePositiveDataTables(result, result.getNewTests(), result.getNewScmResourceFiles()); @@ -193,67 +193,25 @@ public static void printToConsole(BuildListener buildListener, String msg) { } } - private static UftTestDiscoveryResult doChangeSetDetection(UFTTestDetectionCallable.ScmChangesWrapper scmChangesWrapper, File workspace) { + private static UftTestDiscoveryResult doChangeSetDetection(UFTTestDetectionCallable.ScmChangesWrapper scmChangesWrapper, File workspace, TestingToolType testingToolType) { UftTestDiscoveryResult result = new UftTestDiscoveryResult(); - + result.setTestingToolType(testingToolType); for (UFTTestDetectionCallable.ScmChangeAffectedFileWrapper affectedFileWrapper : scmChangesWrapper.getAffectedFiles()) { - if (affectedFileWrapper.getPath().startsWith("\"")) { result.setHasQuotedPaths(true); } String affectedFileFullPath = workspace + File.separator + affectedFileWrapper.getPath(); if (!affectedFileWrapper.isSvnDirType()) { if (UftTestDiscoveryUtils.isTestMainFilePath(affectedFileWrapper.getPath())) { - File testFolder = UftTestDiscoveryUtils.getTestFolderForTestMainFile(affectedFileFullPath); - File affectedFile = new File(affectedFileFullPath); - boolean fileExist = affectedFile.exists(); - UftTestType uftTestType = UftTestDiscoveryUtils.getUftTestType(affectedFileWrapper.getPath()); - - AutomatedTest test = UftTestDiscoveryUtils.createAutomatedTest(workspace, testFolder, uftTestType, TestingToolType.UFT); - test.setChangeSetSrc(affectedFileWrapper.getGitSrc()); - test.setChangeSetDst(affectedFileWrapper.getGitDst()); - - - if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.ADD.equals(affectedFileWrapper.getEditType())) { - if (fileExist) { - result.getAllTests().add(test); - } - } else if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.DELETE.equals(affectedFileWrapper.getEditType())) { - if (!fileExist) { - test.setOctaneStatus(OctaneStatus.DELETED); - test.setExecutable(false); - result.getAllTests().add(test); - } - } else if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.EDIT.equals(affectedFileWrapper.getEditType())) { - if (fileExist) { - test.setOctaneStatus(OctaneStatus.MODIFIED); - result.getAllTests().add(test); - } - } - } else if (UftTestDiscoveryUtils.isUftDataTableFile(affectedFileWrapper.getPath())) { - File affectedFile = new File(affectedFileFullPath); - ScmResourceFile resourceFile = UftTestDiscoveryUtils.createDataTable(workspace, affectedFile); - resourceFile.setChangeSetSrc(affectedFileWrapper.getGitSrc()); - resourceFile.setChangeSetDst(affectedFileWrapper.getGitDst()); - - if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.ADD.equals(affectedFileWrapper.getEditType())) { - UftTestType testType = UftTestDiscoveryUtils.isUftTestFolder(affectedFile.getParentFile().listFiles()); - if (testType.isNone()) { - if (affectedFile.exists()) { - result.getAllScmResourceFiles().add(resourceFile); - } - } - } else if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.DELETE.equals(affectedFileWrapper.getEditType())) { - if (!affectedFile.exists()) { - resourceFile.setOctaneStatus(OctaneStatus.DELETED); - result.getAllScmResourceFiles().add(resourceFile); - } - } + handleUftTestChanges(workspace, testingToolType, result, affectedFileWrapper, affectedFileFullPath); + } else if (TestingToolType.UFT.equals(testingToolType) && UftTestDiscoveryUtils.isUftDataTableFile(affectedFileWrapper.getPath())) { + handleUftDataTableChanges(workspace, result, affectedFileWrapper, affectedFileFullPath); + } else if (TestingToolType.MBT.equals(testingToolType) && UftTestDiscoveryUtils.isUftActionFile(affectedFileWrapper.getPath())) { + handleUftActionChanges(workspace, result, affectedFileWrapper, affectedFileFullPath); } } else { //isDir if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.DELETE.equals(affectedFileWrapper.getEditType())) { - FilePath filePath = new FilePath(new File(affectedFileWrapper.getPath())); String deletedFolder = filePath.getRemote().replace(SdkConstants.FileSystem.LINUX_PATH_SPLITTER, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER); result.getDeletedFolders().add(deletedFolder); @@ -264,6 +222,59 @@ private static UftTestDiscoveryResult doChangeSetDetection(UFTTestDetectionCalla return result; } + private static void handleUftTestChanges(File workspace, TestingToolType testingToolType, UftTestDiscoveryResult result, UFTTestDetectionCallable.ScmChangeAffectedFileWrapper affectedFileWrapper, String affectedFileFullPath) { + File testFolder = UftTestDiscoveryUtils.getTestFolderForTestMainFile(affectedFileFullPath); + File affectedFile = new File(affectedFileFullPath); + boolean fileExist = affectedFile.exists(); + UftTestType uftTestType = UftTestDiscoveryUtils.getUftTestType(affectedFileWrapper.getPath()); + + AutomatedTest test = UftTestDiscoveryUtils.createAutomatedTest(workspace, testFolder, uftTestType, testingToolType); + test.setChangeSetSrc(affectedFileWrapper.getGitSrc()); + test.setChangeSetDst(affectedFileWrapper.getGitDst()); + + if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.ADD.equals(affectedFileWrapper.getEditType())) { + if (fileExist) { // uft and mbt behave the same + result.getAllTests().add(test); + } + } else if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.DELETE.equals(affectedFileWrapper.getEditType())) { + if (!fileExist) { + test.setOctaneStatus(OctaneStatus.DELETED); + test.setExecutable(false); + result.getAllTests().add(test); + } + } else if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.EDIT.equals(affectedFileWrapper.getEditType())) { + if (fileExist) { + test.setOctaneStatus(OctaneStatus.MODIFIED); + result.getAllTests().add(test); + } + } + } + + private static void handleUftDataTableChanges(File workspace, UftTestDiscoveryResult result, UFTTestDetectionCallable.ScmChangeAffectedFileWrapper affectedFileWrapper, String affectedFileFullPath) { + File affectedFile = new File(affectedFileFullPath); + ScmResourceFile resourceFile = UftTestDiscoveryUtils.createDataTable(workspace, affectedFile); + resourceFile.setChangeSetSrc(affectedFileWrapper.getGitSrc()); + resourceFile.setChangeSetDst(affectedFileWrapper.getGitDst()); + + if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.ADD.equals(affectedFileWrapper.getEditType())) { + UftTestType testType = UftTestDiscoveryUtils.isUftTestFolder(affectedFile.getParentFile().listFiles()); + if (testType.isNone()) { + if (affectedFile.exists()) { + result.getAllScmResourceFiles().add(resourceFile); + } + } + } else if (UFTTestDetectionCallable.ScmChangeEditTypeWrapper.DELETE.equals(affectedFileWrapper.getEditType())) { + if (!affectedFile.exists()) { + resourceFile.setOctaneStatus(OctaneStatus.DELETED); + result.getAllScmResourceFiles().add(resourceFile); + } + } + } + + private static void handleUftActionChanges(File workspace, UftTestDiscoveryResult result, UFTTestDetectionCallable.ScmChangeAffectedFileWrapper affectedFileWrapper, String affectedFileFullPath) { + // currently do nothing. to be implemented + } + private static boolean initialDetectionFileExist(File rootFile) { try { File file = new File(rootFile, INITIAL_DETECTION_FILE); From b74a7688dc4dffae8ad54e3f0675f9fde830bdf8 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 13 Sep 2021 17:46:58 +0300 Subject: [PATCH 1857/2502] user story #1354266 : Allow to create and run suite runs via a CI JOB --- pom.xml | 2 +- .../octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 526e0320fc..6ac72b8b71 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.16 + 2.7.1.17 diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly index 9b9b736b77..a366a5c194 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly @@ -45,7 +45,7 @@ - From 52621e876f35a46fdb91165081812e049b58c088 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 14 Sep 2021 12:26:10 +0300 Subject: [PATCH 1858/2502] tech : 1. add api get job build status by parameter octane_auto_action_execution_id - add error message. --- .../automation/tools/octane/CIJenkinsServicesImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java index fa631b7f94..24440cfb72 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/CIJenkinsServicesImpl.java @@ -305,7 +305,7 @@ public CIBuildStatusInfo getJobBuildStatus(String jobCiId, String parameterName, Job job = getJobByRefId(jobCiId); boolean hasRead = Jenkins.get().hasPermission(Item.READ); if (!hasRead) { - throw new PermissionException(HttpStatus.SC_FORBIDDEN); + throw new PermissionException("Missing READ permission to job " + jobCiId, HttpStatus.SC_FORBIDDEN); } AbstractProjectProcessor jobProcessor = JobProcessorFactory.getFlowProcessor(job); return jobProcessor.getBuildStatus(parameterName, parameterValue); From b953ddf6f7c2da390415a3c0cbdc1a016a96fb7f Mon Sep 17 00:00:00 2001 From: Daniel Danan Date: Tue, 14 Sep 2021 18:30:44 +0300 Subject: [PATCH 1859/2502] JENKINS-66633: Trend Report takes more than 10 minutes to be generated change: increasing the timeout of the trend report generation is it seems to be too low: - will wait 30 minutes (instead of 10) if the trend report was started to be generated (waiting more because the report is being generated and it is apparently taking time). - will wait 15 minutes (instead of 10) if the trend report was not started to be generated. --- .../microfocus/application/automation/tools/pc/PcClient.java | 4 ++-- .../application/automation/tools/pc/Messages.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java b/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java index 9bc2f69e81..952844404e 100644 --- a/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java @@ -570,7 +570,7 @@ public void waitForRunToPublishOnTrendReport(int runId, String trendReportId) th } else { Thread.sleep(5000); counterPublishStarted++; - if(counterPublishStarted >= 120){ + if(counterPublishStarted >= 360){ //waiting 30 minutes for timeout String msg = String.format("%s: %s", Messages.Error(), Messages.PublishingEndTimeout()); @@ -581,7 +581,7 @@ public void waitForRunToPublishOnTrendReport(int runId, String trendReportId) th if (!publishEnded && resultNotFound) { Thread.sleep(5000); counterPublishNotStarted++; - if(counterPublishNotStarted >= 120){ //waiting 10 minutes for timeout + if(counterPublishNotStarted >= 180){ //waiting 15 minutes for timeout String msg = String.format("%s", Messages.PublishingStartTimeout()); throw new PcException(msg); diff --git a/src/main/resources/com/microfocus/application/automation/tools/pc/Messages.properties b/src/main/resources/com/microfocus/application/automation/tools/pc/Messages.properties index ec4ec5f67c..e1e420e4fc 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/pc/Messages.properties +++ b/src/main/resources/com/microfocus/application/automation/tools/pc/Messages.properties @@ -73,8 +73,8 @@ OnTrendReport=on trend report FailedToAddRunToTrendReport=Failed to add run to trend report ProblemConnectingToPCServer=Problem connecting to LoadRunner Enterprise Server PublishingStatus=publishing status -PublishingEndTimeout=Publishing didn't ended after 10 minutes, aborting... -PublishingStartTimeout=Publishing didn't start after 10 minutes, aborting... +PublishingEndTimeout=Publishing did not end after 30 minutes, aborting... +PublishingStartTimeout=Publishing did not start after 15 minutes, aborting... DownloadingTrendReport=Downloading trend report InPDFFormat=in PDF format TrendReport=Trend report From e82bd11151f032cedd089b6f3ecfb6ff1bfe8ffe Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Fri, 17 Sep 2021 14:17:24 +0300 Subject: [PATCH 1860/2502] defect #1367259 : In case of pool status of Jenkins Pipeline, it always fails with message "unsupported job CAN NOT be stopped" --- .../projects/AbstractProjectProcessor.java | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java index 9eaab9c8e7..070035766c 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/projects/AbstractProjectProcessor.java @@ -40,14 +40,16 @@ import com.microfocus.application.automation.tools.octane.model.processors.builders.BuildTriggerProcessor; import com.microfocus.application.automation.tools.octane.model.processors.builders.ParameterizedTriggerProcessor; import com.microfocus.application.automation.tools.octane.tests.build.BuildHandlerUtils; -import hudson.model.Queue; import hudson.model.*; import hudson.tasks.Builder; import hudson.tasks.Publisher; import jenkins.model.Jenkins; import org.apache.logging.log4j.Logger; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * Created with IntelliJ IDEA. @@ -165,12 +167,12 @@ public CIBuildStatusInfo getBuildStatus(String paramName, String paramValue) { .setJobCiId(this.getTranslatedJobName()) .setParamName(paramName) .setParamValue(paramValue); - String buildId = UftConstants.BUILD_ID_PARAMETER_NAME.equals(paramName)?paramValue:null; + String buildId = UftConstants.BUILD_ID_PARAMETER_NAME.equals(paramName) ? paramValue : null; - - if (job instanceof AbstractProject) { - if (buildId != null) { - AbstractBuild aBuild = ((AbstractProject) job).getBuild(buildId); + if (buildId != null) { + try { + int buildNum = Integer.parseInt(buildId); + Run aBuild = job.getBuildByNumber(buildNum); if (aBuild == null) { status.setBuildStatus(CIBuildStatus.UNAVAILABLE); } else { @@ -182,11 +184,15 @@ public CIBuildStatusInfo getBuildStatus(String paramName, String paramValue) { status.setResult(BuildHandlerUtils.translateRunResult(aBuild)); } } - } else { - AbstractProject project = (AbstractProject) job; - FoundInfo foundInfo = new FoundInfo(); + } catch (NumberFormatException e) { + throw new RuntimeException("Failed to parse build id " + buildId); + } + } else { + FoundInfo foundInfo = new FoundInfo(); + if (job instanceof Queue.Task) { + Queue.Task queueTaskJob = (Queue.Task) job; Queue queue = Jenkins.get().getQueue(); - queue.getItems(project).forEach(item -> { + queue.getItems(queueTaskJob).forEach(item -> { item.getActions(ParametersAction.class).forEach(action -> { if (!foundInfo.found && checkIfParamExistAndEqual(action, paramName, paramValue)) { status.setBuildStatus(CIBuildStatus.QUEUED); @@ -194,32 +200,30 @@ public CIBuildStatusInfo getBuildStatus(String paramName, String paramValue) { } }); }); + } - project.getBuilds().forEach(build -> { - if (!foundInfo.found && build instanceof AbstractBuild) { - AbstractBuild aBuild = (AbstractBuild) build; - aBuild.getActions(ParametersAction.class).forEach(action -> { - if (checkIfParamExistAndEqual(action, paramName, paramValue)) { - if (aBuild.isBuilding()) { - status.setBuildStatus(CIBuildStatus.RUNNING); - } else { - status.setBuildStatus(CIBuildStatus.FINISHED); - status.setResult(BuildHandlerUtils.translateRunResult(aBuild)); - } - status.setBuildCiId(BuildHandlerUtils.getBuildCiId(aBuild)); - foundInfo.found = true; + job.getBuilds().forEach(build -> { + if (!foundInfo.found) { + Run aBuild = (Run) build; + aBuild.getActions(ParametersAction.class).forEach(action -> { + if (checkIfParamExistAndEqual(action, paramName, paramValue)) { + if (aBuild.isBuilding()) { + status.setBuildStatus(CIBuildStatus.RUNNING); + } else { + status.setBuildStatus(CIBuildStatus.FINISHED); + status.setResult(BuildHandlerUtils.translateRunResult(aBuild)); } - }); - } - }); - } - } else { - throw new IllegalStateException("unsupported job CAN NOT be stopped"); + status.setBuildCiId(BuildHandlerUtils.getBuildCiId(aBuild)); + foundInfo.found = true; + } + }); + } + }); } + return status; } - private String getParameterValueIfExist(ParametersAction parametersAction, String paramName) { ParameterValue pv = parametersAction.getParameter(paramName); if (pv != null) { From ea89234ca2bd4bcbc7c3291eeed73ab32b9ba75e Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 20 Sep 2021 16:27:53 +0300 Subject: [PATCH 1861/2502] tech : fix for not able to start plugin because of log initialization issue --- .../tools/octane/configuration/SDKBasedLoggerProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java index dacea8401d..35e55e3a6d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/SDKBasedLoggerProvider.java @@ -57,8 +57,8 @@ private SDKBasedLoggerProvider() { public static Logger getLogger(Class type) { try { if (!sysParamConfigured) { - CommonLoggerContextUtil.configureLogger(CIJenkinsServicesImpl.getAllowedStorageFile()); - //System.setProperty("octaneAllowedStorage", CIJenkinsServicesImpl.getAllowedStorageFile().getAbsolutePath() + File.separator); + System.setProperty("octaneAllowedStorage", CIJenkinsServicesImpl.getAllowedStorageFile().getAbsolutePath() + File.separator); + //CommonLoggerContextUtil.configureLogger(CIJenkinsServicesImpl.getAllowedStorageFile()); sysParamConfigured = true; } return LogManager.getLogger(type); From 3d3cfed1651d7d172396a91fb049224f8592ef12 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 21 Sep 2021 13:14:23 +0300 Subject: [PATCH 1862/2502] DEF-673012 | [Jenkins] Non-existing Test Sets in ALM are not taken into consideration in the job execution --- HpToolsLauncher/Launcher.cs | 7 ++++--- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 4bde4ddc1f..3e2552550c 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -879,7 +879,8 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul if (results.TestRuns.Count == 0) { - Console.WriteLine("No tests were run"); + ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); + ConsoleWriter.WriteLine("No tests were run"); _exitCode = ExitCodeEnum.Failed; Environment.Exit((int)_exitCode); } @@ -890,9 +891,9 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul _exitCode = ExitCodeEnum.Failed; } - int numFailures = results.TestRuns.Count(t => t.TestState == TestState.Failed); + int numFailures = results.NumFailures; int numSuccess = results.TestRuns.Count(t => t.TestState == TestState.Passed); - int numErrors = results.TestRuns.Count(t => t.TestState == TestState.Error); + int numErrors = results.NumErrors; int numWarnings = results.TestRuns.Count(t => t.TestState == TestState.Warning); if ((numErrors <= 0) && (numFailures > 0)) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index d86fc138ce..7437e374be 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -580,7 +580,7 @@ public ITestSet GetTargetTestSet(List testSetList, string testSuiteName, ITestSe if (targetTestSet != null) { return targetTestSet; } - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); //this will make sure run will fail at the end. (since there was an error) Debug.WriteLine("Null target test set"); @@ -665,7 +665,7 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet List testList = tsFolder.FindTestSets(testSuiteName); if (testList == null) { - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); //this will make sure run will fail at the end. (since there was an error) Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; return null; @@ -1119,6 +1119,8 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string TestRunResults activeTestDesc = null; List testSetList; + ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); + //get list of test sets try { @@ -1127,15 +1129,18 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string catch (Exception ex) { Console.WriteLine("Unable to retrieve the list of tests"); - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); Console.WriteLine(ex.Message); + //this will make sure run will fail at the end. (since there was an error) Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; - return null; + runDesc.NumErrors++; + return runDesc; } if (testSetList == null) { - return null; + runDesc.NumErrors++; + return runDesc; } //get target test set @@ -1150,10 +1155,10 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } if (targetTestSet == null) { - return null; + runDesc.NumErrors++; + return runDesc; } - ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); ConsoleWriter.WriteLine(Resources.AlmRunnerStartingExecution); ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerDisplayTest, testSuiteName, targetTestSet.ID)); From ff4a11d5fe2d0ca46c71969feaff33541c150fec Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 22 Sep 2021 15:44:33 +0300 Subject: [PATCH 1863/2502] DEF-658023 | [Jenkins][runFromFSBuilder] Password for Mobile center is not encrypted --- .../automation/tools/model/RunFromFileSystemModel.java | 2 +- .../application/automation/tools/run/RunFromFileBuilder.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java index cfce52ac31..83b1ac2f47 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java @@ -405,7 +405,7 @@ public String getFsPassword() { { return null; } - return fsPassword.getPlainText(); + return fsPassword.getEncryptedValue(); } public String getMcTenantId() { diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index 2644658716..c50fd8d686 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -44,6 +44,7 @@ import hudson.tasks.Builder; import hudson.util.FormValidation; import hudson.util.IOUtils; +import hudson.util.Secret; import hudson.util.VariableResolver; import jenkins.model.Jenkins; import jenkins.tasks.SimpleBuildStep; @@ -666,7 +667,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn if (runFromFileModel != null && StringUtils.isNotBlank(runFromFileModel.getFsPassword())) { try { - String encPassword = EncryptionUtils.Encrypt(runFromFileModel.getFsPassword(), + String encPassword = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getFsPassword()).getPlainText(), EncryptionUtils.getSecretKey()); mergedProperties.put("MobilePassword", encPassword); } catch (Exception e) { From 582094089a5a1d69f7d5122f51abc3d32faa3bdf Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 22 Sep 2021 15:51:05 +0300 Subject: [PATCH 1864/2502] DEF-658017 | [Jenkins][runFromFSBuilder] Change the information regarding Publish Micro Focus test results --- .../tools/run/RunFromFileBuilder/config.jelly | 3 +- .../run/RunFromFileBuilder/config.properties | 4 ++- src/main/webapp/js/fileSystemUtils.js | 35 ++++++++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 715f4853aa..c4dc38e49e 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -103,7 +103,8 @@

      - ${%DontForgetThePublisher} + +
      diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.properties b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.properties index eaaf1fd973..7507a4e3f0 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.properties +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.properties @@ -26,8 +26,10 @@ # ___________________________________________________________________ # -DontForgetThePublisher=Make sure to enable the Publish Micro Focus \ +DontForgetThePublisherFreestyle=Make sure to enable the Publish Micro Focus \ tests result option in the Post-build \ Actions section. This allows the tests results to be published. +DontForgetThePublisherPipeline=We suggest adding a Publish Micro Focus \ + tests result step in the pipeline job. This allows the tests results to be published. SummaryDataLog=Summary Data Log RuntimeSettings=Runtime Settings \ No newline at end of file diff --git a/src/main/webapp/js/fileSystemUtils.js b/src/main/webapp/js/fileSystemUtils.js index 00703db4ce..3e788ccc47 100644 --- a/src/main/webapp/js/fileSystemUtils.js +++ b/src/main/webapp/js/fileSystemUtils.js @@ -45,7 +45,6 @@ document.addEventListener('DOMContentLoaded', function() { } else { selectCleanupTest("block"); } - }, false); function useAuthentication(obj) { @@ -162,6 +161,40 @@ document.addEventListener('DOMContentLoaded', function() { }); } + (function () { + // sets the proper publish message to visible + // the type is decided by the build type + function displayProperPublishMessage() { + function isPipelineJob() { + var urlStringSeparated = (window.location.href).split("/").filter(function (elem) { return elem; }); + return urlStringSeparated[urlStringSeparated.length - 1] === "pipeline-syntax"; + } + + isPipelineJob() ? document.querySelector("#help-text-pipeline").style.display = "block" : document.querySelector("#help-text-freestyle").style.display = "block"; + } + + // This makes sure that the two elements are always visible + // If we put the callback call to the DomContentLoaded none of the messages will be visible, after loading the page + waitForElementToDisplay("#help-text-pipeline", "#help-text-freestyle", displayProperPublishMessage, 500, 9000); + + // periodically checks if selector1 and selector2 are visible, + // the search stops after a specified timeout + function waitForElementToDisplay(selector1, selector2, callback, checkFrequencyInMs, timeoutInMs) { + var startTimeInMs = Date.now(); + (function loopSearch() { + if (document.querySelector(selector1) && document.querySelector(selector2)) { + callback(); + } + else { + setTimeout(function () { + if (timeoutInMs && Date.now() - startTimeInMs > timeoutInMs) + return; + loopSearch(); + }, checkFrequencyInMs); + } + })(); + } + })(); From 314f4ea9367082cc5898779edda73af3f411815d Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Thu, 23 Sep 2021 11:45:55 +0300 Subject: [PATCH 1865/2502] Not listing error in final summary; Correcting error cases and error message in case of non-existing tests --- HpToolsLauncher/Launcher.cs | 4 ++-- .../Properties/Resources.Designer.cs | 6 ++--- HpToolsLauncher/Properties/Resources.resx | 2 +- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 24 +++++++++---------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 3e2552550c..6ebd0763dc 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -896,12 +896,12 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul int numErrors = results.NumErrors; int numWarnings = results.TestRuns.Count(t => t.TestState == TestState.Warning); - if ((numErrors <= 0) && (numFailures > 0)) + if ((numErrors <= 0) && (numFailures > 0) && _exitCode != ExitCodeEnum.Failed) { _exitCode = ExitCodeEnum.Failed; } - if ((numErrors <= 0) && (numFailures > 0) && (numSuccess > 0)) + if ((numErrors <= 0) && (numFailures > 0) && (numSuccess > 0) && _exitCode != ExitCodeEnum.Failed) { _exitCode = ExitCodeEnum.Unstable; } diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 9543853162..6815135890 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace HpToolsLauncher.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Looks up a localized string similar to Could not find TestSet {0}. + /// Looks up a localized string similar to Could not find TestSet {0}; setting final run status to Failed. /// internal static string AlmRunnerCantFindTestSet { get { @@ -358,7 +358,7 @@ internal static string FileSystemTestsRunner_No_HP_testing_tool_is_installed_on } /// - /// Looks up a localized string similar to ===============================\nThere are no valid tests to run!\n===============================. + /// Looks up a localized string similar to =============================== There are no valid tests to run! ===============================. /// internal static string FsRunnerNoValidTests { get { diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index d617faa8d1..6c9c7bc244 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -158,7 +158,7 @@ Save the test in QuickTest and then run it again. No Micro Focus testing tool is installed on {0} - Could not find TestSet {0} + Could not find TestSet {0}; setting final run status to Failed One or more of the required connection parameters is empty. diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 7437e374be..9aecf20406 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -1134,13 +1134,11 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //this will make sure run will fail at the end. (since there was an error) Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; - runDesc.NumErrors++; - return runDesc; + return null; } if (testSetList == null) { - runDesc.NumErrors++; - return runDesc; + return null; } //get target test set @@ -1151,12 +1149,13 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } catch (Exception) { - Console.WriteLine("Empty target test set list"); + ConsoleWriter.WriteErrLine("Empty target test set list"); + Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; + return null; } if (targetTestSet == null) { - runDesc.NumErrors++; - return runDesc; + return null; } ConsoleWriter.WriteLine(Resources.AlmRunnerStartingExecution); @@ -1178,7 +1177,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string if (scheduler == null) { - Console.WriteLine(GetAlmNotInstalledError()); + ConsoleWriter.WriteErrLine(GetAlmNotInstalledError()); //proceeding with program execution is tasteless, since nothing will run without a properly installed QC. Environment.Exit((int)Launcher.ExitCodeEnum.Failed); @@ -1210,7 +1209,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } catch (Exception ex) { - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerProblemWithHost, ex.Message)); + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerProblemWithHost, ex.Message)); } //set test parameters @@ -1222,10 +1221,9 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //start test runner if (filteredTestList.Count == 0) { - //ConsoleWriter.WriteErrLine("Specified test not found on ALM, please check your test path."); //this will make sure run will fail at the end. (since there was an error) - //Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; Console.WriteLine(Resources.AlmTestSetsRunnerNoTestAfterApplyingFilters); + Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; return null; } @@ -1238,7 +1236,8 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } catch (Exception ex) { - ConsoleWriter.WriteLine(Resources.AlmRunnerRunError + ex.Message); + ConsoleWriter.WriteErrLine(Resources.AlmRunnerRunError + ex.Message); + return null; } ConsoleWriter.WriteLine(Resources.AlmRunnerSchedStarted + DateTime.Now.ToString(Launcher.DateFormat)); @@ -1287,6 +1286,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string Launcher.ExitCode = Launcher.ExitCodeEnum.Aborted; } + return runDesc; } From 8d88499fe223626f308d71cf3b4fe9a9b1ab34f1 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Thu, 23 Sep 2021 13:04:52 +0300 Subject: [PATCH 1866/2502] Reduce complexity --- .../tools/run/RunFromFileBuilder/config.jelly | 7 ++- src/main/webapp/js/fileSystemUtils.js | 44 +++++-------------- 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index c4dc38e49e..b06b7e6d37 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -103,8 +103,7 @@
      - - +
      ${%DontForgetThePublisherFreestyle}
      @@ -263,4 +262,8 @@ + + \ No newline at end of file diff --git a/src/main/webapp/js/fileSystemUtils.js b/src/main/webapp/js/fileSystemUtils.js index 3e788ccc47..f6f30ae433 100644 --- a/src/main/webapp/js/fileSystemUtils.js +++ b/src/main/webapp/js/fileSystemUtils.js @@ -161,40 +161,18 @@ document.addEventListener('DOMContentLoaded', function() { }); } - (function () { - // sets the proper publish message to visible - // the type is decided by the build type - function displayProperPublishMessage() { - function isPipelineJob() { - var urlStringSeparated = (window.location.href).split("/").filter(function (elem) { return elem; }); - return urlStringSeparated[urlStringSeparated.length - 1] === "pipeline-syntax"; - } - - isPipelineJob() ? document.querySelector("#help-text-pipeline").style.display = "block" : document.querySelector("#help-text-freestyle").style.display = "block"; - } - - // This makes sure that the two elements are always visible - // If we put the callback call to the DomContentLoaded none of the messages will be visible, after loading the page - waitForElementToDisplay("#help-text-pipeline", "#help-text-freestyle", displayProperPublishMessage, 500, 9000); - - // periodically checks if selector1 and selector2 are visible, - // the search stops after a specified timeout - function waitForElementToDisplay(selector1, selector2, callback, checkFrequencyInMs, timeoutInMs) { - var startTimeInMs = Date.now(); - (function loopSearch() { - if (document.querySelector(selector1) && document.querySelector(selector2)) { - callback(); + function displayProperPublisherMessage(msg) { + setTimeout(function () { + if (window.location.href.indexOf("pipeline-syntax") > 0) { + let helpText = document.getElementById("helpTextMsg"); + + // verify if the element is found, otherwise an exception will occur which blocks the page loading + if (helpText) { + helpText.innerHTML = msg; } - else { - setTimeout(function () { - if (timeoutInMs && Date.now() - startTimeInMs > timeoutInMs) - return; - loopSearch(); - }, checkFrequencyInMs); - } - })(); - } - })(); + } + }, 200); + } From 30cf889cc07942ff0c75e77f4091062a430a66fe Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Thu, 23 Sep 2021 13:18:00 +0300 Subject: [PATCH 1867/2502] Rename function and make use of existing div element --- .../automation/tools/run/RunFromFileBuilder/config.jelly | 6 +++--- src/main/webapp/js/fileSystemUtils.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index b06b7e6d37..5c5c45d432 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -102,8 +102,8 @@ -
      -
      ${%DontForgetThePublisherFreestyle}
      +
      + ${%DontForgetThePublisherFreestyle}
      @@ -264,6 +264,6 @@ \ No newline at end of file diff --git a/src/main/webapp/js/fileSystemUtils.js b/src/main/webapp/js/fileSystemUtils.js index f6f30ae433..ea7486b9e5 100644 --- a/src/main/webapp/js/fileSystemUtils.js +++ b/src/main/webapp/js/fileSystemUtils.js @@ -161,7 +161,7 @@ document.addEventListener('DOMContentLoaded', function() { }); } - function displayProperPublisherMessage(msg) { + function checkIfPipelineAndUpdateHelpMsg(msg) { setTimeout(function () { if (window.location.href.indexOf("pipeline-syntax") > 0) { let helpText = document.getElementById("helpTextMsg"); From 5cc2009f92c3218ed9498330091c80823c1f51de Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Thu, 23 Sep 2021 13:29:10 +0300 Subject: [PATCH 1868/2502] Removing unnecessary returns --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 9aecf20406..f536e4e8fd 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -1117,7 +1117,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string string currentTestSetInstances = string.Empty, testName = string.Empty; TestSuiteRunResults runDesc = new TestSuiteRunResults(); TestRunResults activeTestDesc = null; - List testSetList; + List testSetList = null; ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); @@ -1134,8 +1134,8 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //this will make sure run will fail at the end. (since there was an error) Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; - return null; } + if (testSetList == null) { return null; @@ -1151,8 +1151,8 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string { ConsoleWriter.WriteErrLine("Empty target test set list"); Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; - return null; } + if (targetTestSet == null) { return null; From 22774dc0ec2c45e484856434c9a6f98b03e64c43 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Fri, 24 Sep 2021 11:41:46 +0300 Subject: [PATCH 1869/2502] DEF-673012 | Handle the non existing Tests inside a Test Set --- HpToolsLauncher/Properties/Resources.Designer.cs | 2 +- HpToolsLauncher/Properties/Resources.resx | 2 +- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 6815135890..93da3eafe8 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -277,7 +277,7 @@ internal static string AlmTestSetsRunnerGetFolderError { } /// - /// Looks up a localized string similar to No test meets the filtering criteria.. + /// Looks up a localized string similar to No test meets the filtering criteria; setting final run status to Failed. /// internal static string AlmTestSetsRunnerNoTestAfterApplyingFilters { get { diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 6c9c7bc244..9dd9f433b3 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -485,6 +485,6 @@ Save the test in QuickTest and then run it again. Cannot find the test folder. - No test meets the filtering criteria. + No test meets the filtering criteria; setting final run status to Failed \ No newline at end of file diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index f536e4e8fd..0e44affe76 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -636,7 +636,7 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet { //not found tsFolder = null; - Console.WriteLine(ex.Message); + ConsoleWriter.WriteLine(ex.Message + " Trying to find specific test(s) with the given name(s) on the defined path, optionally applying the set filters"); } // test set not found, try to find specific test by path @@ -716,10 +716,11 @@ public bool ListContainsTest(List testList, ITSTest test) public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testName, bool isFilterSelected, List filterByStatuses, string filterByName) { TSTestFactory tsTestFactory = targetTestSet.TSTestFactory; - ITDFilter2 tdFilter = tsTestFactory.Filter; - tdFilter["TC_CYCLE_ID"] = targetTestSet.ID.ToString(); + // DEF-673012 - causes problems when a non-existing and an existing specific test is given by the user, the list appears empty + // tdFilter["TC_CYCLE_ID"] = targetTestSet.ID.ToString(); + // with commented out TC_CYCLE_ID, we get the initial testList by applying an empty filter IList testList = tsTestFactory.NewList(tdFilter.Text); List testsFilteredByStatus = new List(); @@ -785,6 +786,7 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam { string tListIndexName = testList[index].Name; string tListIndexTestName = testList[index].TestName; + if (!string.IsNullOrEmpty(tListIndexName) && !string.IsNullOrEmpty(testName) && !testName.Equals(tListIndexTestName)) { testList.Remove(index); @@ -1109,7 +1111,6 @@ public override TestSuiteRunResults Run() public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string testParameters, double timeout, QcRunMode runMode, string runHost, bool isFilterSelected, string filterByName, List filterByStatuses, TestStorageType testStorageType) { - string testSuiteName = tsName.TrimEnd(); ITestSetFolder tsFolder = null; string tsPath = string.Format(@"Root\{0}", tsFolderName); @@ -1222,7 +1223,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string if (filteredTestList.Count == 0) { //this will make sure run will fail at the end. (since there was an error) - Console.WriteLine(Resources.AlmTestSetsRunnerNoTestAfterApplyingFilters); + ConsoleWriter.WriteErrLine(Resources.AlmTestSetsRunnerNoTestAfterApplyingFilters); Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; return null; } From 8bb3543c9b567f5910ba8401d2e8d8ecf26d9076 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Fri, 24 Sep 2021 14:59:02 +0300 Subject: [PATCH 1870/2502] US-671228 | [Jenkins Plug-in] Handle "Warning" status for tests running from ALM --- HpToolsLauncher/Launcher.cs | 44 +++++++++++----- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 28 ++++++++--- .../Runners/FileSystemTestsRunner.cs | 50 ++++++++++--------- HpToolsLauncher/TestSuiteRunResults.cs | 8 +++ 4 files changed, 87 insertions(+), 43 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 6ebd0763dc..aae19899a1 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -886,7 +886,7 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul } //if there is an error - if (results.TestRuns.Any(tr => tr.TestState == TestState.Failed || tr.TestState == TestState.Error)) + if (results.TestRuns.Any(tr => tr.TestState == TestState.Error)) { _exitCode = ExitCodeEnum.Failed; } @@ -894,16 +894,22 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul int numFailures = results.NumFailures; int numSuccess = results.TestRuns.Count(t => t.TestState == TestState.Passed); int numErrors = results.NumErrors; - int numWarnings = results.TestRuns.Count(t => t.TestState == TestState.Warning); + int numWarnings = results.NumWarnings; - if ((numErrors <= 0) && (numFailures > 0) && _exitCode != ExitCodeEnum.Failed) - { - _exitCode = ExitCodeEnum.Failed; - } - - if ((numErrors <= 0) && (numFailures > 0) && (numSuccess > 0) && _exitCode != ExitCodeEnum.Failed) - { - _exitCode = ExitCodeEnum.Unstable; + if (_exitCode != ExitCodeEnum.Failed && _exitCode != ExitCodeEnum.Aborted) + { + if ((numErrors <= 0) && (numFailures > 0) && (numSuccess > 0)) + { + _exitCode = ExitCodeEnum.Unstable; + } + else if ((numErrors <= 0) && (numFailures > 0)) + { + _exitCode = ExitCodeEnum.Failed; + } + else if ((numErrors <= 0) && (numWarnings > 0)) + { + _exitCode = ExitCodeEnum.Unstable; + } } foreach (var testRun in results.TestRuns) @@ -925,8 +931,22 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul runStatus = "Job succeeded"; break; case ExitCodeEnum.Unstable: - runStatus = "Job unstable (Passed with failed tests)"; - break; + { + if (numFailures > 0 && numWarnings > 0) + { + runStatus = "Job unstable (Passed with failed tests and generated warnings)"; + } + else if (numFailures > 0) + { + runStatus = "Job unstable (Passed with failed tests)"; + } + else if (numWarnings > 0) + { + runStatus = "Job unstable (Generated warnings)"; + } + + break; + } case ExitCodeEnum.Aborted: runStatus = "Job failed due to being Aborted"; break; diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 0e44affe76..4728567898 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -1357,7 +1357,7 @@ private TestRunResults UpdateTestStatus(TestSuiteRunResults runResults, ITestSet //update the state qTest.PrevTestState = qTest.TestState; - qTest.TestState = GetTsStateFromQcState(testExecStatusObj.Status); + qTest.TestState = GetTsStateFromQcState(testExecStatusObj); if (!onlyUpdateState) { @@ -1382,11 +1382,13 @@ private TestRunResults UpdateTestStatus(TestSuiteRunResults runResults, ITestSet case TestState.Error: qTest.ErrorDesc = string.Format("{0} : {1}", testExecStatusObj.Status, testExecStatusObj.Message); break; + case TestState.Warning: + qTest.HasWarnings = true; + break; case TestState.Waiting: case TestState.Running: case TestState.NoRun: case TestState.Passed: - case TestState.Warning: case TestState.Unknown: default: break; @@ -1395,7 +1397,7 @@ private TestRunResults UpdateTestStatus(TestSuiteRunResults runResults, ITestSet var runId = GetTestRunId(currentTest); string linkStr = GetTestRunLink(runId); - string statusString = GetTsStateFromQcState(testExecStatusObj.Status).ToString(); + string statusString = GetTsStateFromQcState(testExecStatusObj).ToString(); ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerTestStat, currentTest.Name, statusString, testExecStatusObj.Message, linkStr)); runResults.TestRuns[testIndex] = qTest; } @@ -1509,7 +1511,7 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te activeTestDesc.TestGroup = string.Format(@"{0}\{1}", folderName, targetTestSet.Name).Replace(".", "_"); } - TestState enmState = GetTsStateFromQcState(testExecStatusObj.Status); + TestState enmState = GetTsStateFromQcState(testExecStatusObj); string statusString = enmState.ToString(); if (enmState == TestState.Running) @@ -1683,6 +1685,9 @@ private void UpdateCounters(TestRunResults test, TestSuiteRunResults testSuite) case TestState.Error: ++testSuite.NumErrors; break; + case TestState.Warning: + ++testSuite.NumWarnings; + break; } } @@ -1691,7 +1696,7 @@ private void UpdateCounters(TestRunResults test, TestSuiteRunResults testSuite) ///
      /// /// - private TestState GetTsStateFromQcState(string qcTestStatus) + private TestState GetTsStateFromQcState(TestExecStatus qcTestStatus) { if (TdConnection == null && TdConnectionOld == null) { @@ -1700,7 +1705,7 @@ private TestState GetTsStateFromQcState(string qcTestStatus) if (qcTestStatus == null) return TestState.Unknown; - switch (qcTestStatus) + switch (qcTestStatus.Status) { case "Waiting": return TestState.Waiting; @@ -1713,8 +1718,15 @@ private TestState GetTsStateFromQcState(string qcTestStatus) return TestState.Running; case "Success": case "Finished": - case "FinishedPassed": - return TestState.Passed; + case "FinishedPassed": + { + if (qcTestStatus.Message.Contains("warning")) + { + return TestState.Warning; + } + + return TestState.Passed; + } case "FinishedFailed": return TestState.Failed; } diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index 042dab7857..63af6471c2 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -45,7 +45,7 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable Dictionary _jenkinsEnvVariables; private List _tests; private static string _uftViewerPath; - private int _errors, _fail; + private int _errors, _fail, _warnings; private bool _useUFTLicense; private bool _displayController; private string _analysisTemplate; @@ -72,28 +72,28 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable private string _mobileInfoForAllGuiTests; - #endregion - - /// - /// overloaded constructor for adding support for run mode selection - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public FileSystemTestsRunner(List sources, + #endregion + + /// + /// overloaded constructor for adding support for run mode selection + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public FileSystemTestsRunner(List sources, TimeSpan timeout, string uftRunMode, int controllerPollingInterval, @@ -408,6 +408,7 @@ public override TestSuiteRunResults Run() activeRunDesc.NumErrors = _errors; activeRunDesc.TotalRunTime = TimeSpan.FromSeconds(totalTime); activeRunDesc.NumFailures = _fail; + activeRunDesc.NumWarnings = _warnings; foreach (IFileSysTestRunner cleanupRunner in _colRunnersForCleanup.Values) { @@ -560,6 +561,9 @@ private void UpdateCounters(TestState testState) case TestState.Failed: _fail += 1; break; + case TestState.Warning: + _warnings += 1; + break; } } diff --git a/HpToolsLauncher/TestSuiteRunResults.cs b/HpToolsLauncher/TestSuiteRunResults.cs index 414c528530..be792aa079 100644 --- a/HpToolsLauncher/TestSuiteRunResults.cs +++ b/HpToolsLauncher/TestSuiteRunResults.cs @@ -37,6 +37,7 @@ public class TestSuiteRunResults private int m_numErrors = 0; private int m_numFailures = 0; private int m_numTests = 0; + private int m_numWarnings = 0; private TimeSpan m_totalRunTime = TimeSpan.Zero; public string SuiteName { get; set; } @@ -53,6 +54,12 @@ public int NumTests set { m_numTests = value; } } + public int NumWarnings + { + get { return m_numWarnings; } + set { m_numWarnings = value; } + } + public TimeSpan TotalRunTime { get { return m_totalRunTime; } @@ -79,6 +86,7 @@ internal void AppendResults(TestSuiteRunResults desc) this.NumErrors += desc.NumErrors; this.NumFailures += desc.NumFailures; this.NumTests += desc.NumTests; + this.NumWarnings += desc.NumWarnings; } } } From 182811e3334effcfca1335f33416eec1bcd05521 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sat, 25 Sep 2021 17:28:36 +0300 Subject: [PATCH 1871/2502] tech : update sdk --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f1619555f9..1ace3a1907 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.17 + 2.7.1.19 From aa1ecfe5c6fc9081cfd7743e6ed3885bf486219c Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 27 Sep 2021 10:05:10 +0300 Subject: [PATCH 1872/2502] Resolving exit code issues, only returning FAILED if no filters are applied --- HpToolsLauncher/Launcher.cs | 2 +- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index aae19899a1..6ad684e845 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -896,7 +896,7 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul int numErrors = results.NumErrors; int numWarnings = results.NumWarnings; - if (_exitCode != ExitCodeEnum.Failed && _exitCode != ExitCodeEnum.Aborted) + if (_exitCode != ExitCodeEnum.Aborted) { if ((numErrors <= 0) && (numFailures > 0) && (numSuccess > 0)) { diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 4728567898..9f910d9306 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -1220,7 +1220,10 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } //start test runner - if (filteredTestList.Count == 0) + // If a filter is selected, we should not set the job failed when it doesn't find any matching tests within the test set + // or in the specified test paths + // if no filter is selected, and on the specified test path no test exists the job should fail + if (filteredTestList.Count == 0 && IsFilterSelected.Equals(false)) { //this will make sure run will fail at the end. (since there was an error) ConsoleWriter.WriteErrLine(Resources.AlmTestSetsRunnerNoTestAfterApplyingFilters); From a2235e87d11ea25867a5f8bb14f79280583abc70 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 27 Sep 2021 16:46:04 +0300 Subject: [PATCH 1873/2502] Correcting error messages, moving FatalError check inside the ABORTED-check block, correcting logic of non-existing tests In the case of non-existing tests full paths will be saved and they will always in the final summary. --- HpToolsLauncher/Launcher.cs | 12 +- .../Properties/Resources.Designer.cs | 13 +- HpToolsLauncher/Properties/Resources.resx | 7 +- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 123 +++++++++++------- 4 files changed, 99 insertions(+), 56 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 6ad684e845..2ba8ec7798 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -910,14 +910,14 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul { _exitCode = ExitCodeEnum.Unstable; } - } - foreach (var testRun in results.TestRuns) - { - if (testRun.FatalErrors > 0 && !string.IsNullOrWhiteSpace(testRun.TestPath)) + foreach (var testRun in results.TestRuns) { - _exitCode = ExitCodeEnum.Failed; - break; + if (testRun.FatalErrors > 0 && !string.IsNullOrWhiteSpace(testRun.TestPath)) + { + _exitCode = ExitCodeEnum.Failed; + break; + } } } diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 93da3eafe8..53b57b6854 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -61,7 +61,16 @@ internal Resources() { } /// - /// Looks up a localized string similar to Could not find TestSet {0}; setting final run status to Failed. + /// Looks up a localized string similar to Could not find Test {0}. + /// + internal static string AlmRunnerCantFindTest { + get { + return ResourceManager.GetString("AlmRunnerCantFindTest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find TestSet {0}. /// internal static string AlmRunnerCantFindTestSet { get { @@ -277,7 +286,7 @@ internal static string AlmTestSetsRunnerGetFolderError { } /// - /// Looks up a localized string similar to No test meets the filtering criteria; setting final run status to Failed. + /// Looks up a localized string similar to No test meets the filtering criteria. /// internal static string AlmTestSetsRunnerNoTestAfterApplyingFilters { get { diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 9dd9f433b3..9c82cd75c2 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -158,7 +158,7 @@ Save the test in QuickTest and then run it again. No Micro Focus testing tool is installed on {0} - Could not find TestSet {0}; setting final run status to Failed + Could not find TestSet {0} One or more of the required connection parameters is empty. @@ -485,6 +485,9 @@ Save the test in QuickTest and then run it again. Cannot find the test folder. - No test meets the filtering criteria; setting final run status to Failed + No test meets the filtering criteria + + + Could not find Test {0} \ No newline at end of file diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 9f910d9306..572ea08b79 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -580,13 +580,7 @@ public ITestSet GetTargetTestSet(List testSetList, string testSuiteName, ITestSe if (targetTestSet != null) { return targetTestSet; } - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); - - //this will make sure run will fail at the end. (since there was an error) - Debug.WriteLine("Null target test set"); - Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; return null; - } @@ -617,6 +611,8 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet tsTreeManager = (ITestSetTreeManager)_tdConnectionOld.TestSetTreeManager; } + string initialFullPath = string.Format(@"{0}\{1}", tsPath, tsName); + try { //check test storage type @@ -657,17 +653,17 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet catch (COMException ex) { tsFolder = null; - Console.WriteLine("Exception: " + ex.Message); + ConsoleWriter.WriteLine(ex.Message); } } + if (tsFolder != null) { List testList = tsFolder.FindTestSets(testSuiteName); if (testList == null) { - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); - //this will make sure run will fail at the end. (since there was an error) - Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; + // this means, there was no test sets with the specified name, we treat it as a single test, as if a user specified it + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullPath)); return null; } foreach (ITestSet t in testList) @@ -677,10 +673,8 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet } //node wasn't found, folder = null - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerNoSuchFolder, tsFolder)); + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerNoSuchFolder, testSuiteName)); - //this will make sure run will fail at the end. (since there was an error) - Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; return null; } @@ -1114,10 +1108,11 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string string testSuiteName = tsName.TrimEnd(); ITestSetFolder tsFolder = null; string tsPath = string.Format(@"Root\{0}", tsFolderName); + string initialFullTsPath = string.Format(@"{0}\{1}", tsPath, tsName); bool isTestPath = false; string currentTestSetInstances = string.Empty, testName = string.Empty; TestSuiteRunResults runDesc = new TestSuiteRunResults(); - TestRunResults activeTestDesc = null; + TestRunResults activeTestDesc = new TestRunResults(); List testSetList = null; ConsoleWriter.WriteLine(Resources.GeneralDoubleSeperator); @@ -1129,17 +1124,16 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } catch (Exception ex) { - Console.WriteLine("Unable to retrieve the list of tests"); - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTestSet, testSuiteName)); - Console.WriteLine(ex.Message); - - //this will make sure run will fail at the end. (since there was an error) - Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; + ConsoleWriter.WriteErrLine("Unable to retrieve the list of tests"); + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); + ConsoleWriter.WriteLine(ex.Message); } if (testSetList == null) { - return null; + UpdateTestResultsIfNonExistingTestSpecified(ref runDesc, ref activeTestDesc, initialFullTsPath); + + return runDesc; } //get target test set @@ -1151,12 +1145,14 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string catch (Exception) { ConsoleWriter.WriteErrLine("Empty target test set list"); - Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; } if (targetTestSet == null) { - return null; + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); + UpdateTestResultsIfNonExistingTestSpecified(ref runDesc, ref activeTestDesc, initialFullTsPath); + + return runDesc; } ConsoleWriter.WriteLine(Resources.AlmRunnerStartingExecution); @@ -1219,18 +1215,22 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string SetTestParameters(filteredTestList, testParameters, runHost, runMode, runDesc, scheduler); } - //start test runner - // If a filter is selected, we should not set the job failed when it doesn't find any matching tests within the test set - // or in the specified test paths - // if no filter is selected, and on the specified test path no test exists the job should fail - if (filteredTestList.Count == 0 && IsFilterSelected.Equals(false)) + // isTestPath is only true, if a specific test was given by the user, + // if, the filteredTestList is empty, because of the filtering, we should not set the job status to failed + if (filteredTestList.Count == 0 && isTestPath) { //this will make sure run will fail at the end. (since there was an error) - ConsoleWriter.WriteErrLine(Resources.AlmTestSetsRunnerNoTestAfterApplyingFilters); - Launcher.ExitCode = Launcher.ExitCodeEnum.Failed; - return null; - } + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); + + UpdateTestResultsIfNonExistingTestSpecified(ref runDesc, ref activeTestDesc, initialFullTsPath); + return runDesc; + } else if (filteredTestList.Count == 0) + { + ConsoleWriter.WriteLine(Resources.AlmTestSetsRunnerNoTestAfterApplyingFilters); + return null; + } + //start test runner Stopwatch sw = Stopwatch.StartNew(); try @@ -1269,7 +1269,14 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //done with all tests, stop collecting output in the testRun object. ConsoleWriter.ActiveTestRun = null; - string testPath = string.Format(@"Root\{0}\{1}\", tsFolderName, testSuiteName); + string testPath; + if (isTestPath) + { + testPath = string.Format(@"Root\{0}\", tsFolderName); + } else + { + testPath = string.Format(@"Root\{0}\{1}\", tsFolderName, testSuiteName); + } SetTestResults(ref currentTest, executionStatus, targetTestSet, activeTestDesc, runDesc, testPath, abortFilename); @@ -1292,19 +1299,43 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } return runDesc; - } - - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - private void SetTestResults(ref ITSTest currentTest, IExecutionStatus executionStatus, ITestSet targetTestSet, TestRunResults activeTestDesc, TestSuiteRunResults runDesc, string testPath, string abortFilename) + } + + /// + /// Updates the runDesc run results by describing the non-existing test error as a testDesc + /// + /// run results to be updated + /// the non-existing test's description + /// test's folder + /// test's name + private void UpdateTestResultsIfNonExistingTestSpecified(ref TestSuiteRunResults runDesc, ref TestRunResults activeTestDesc, string tsPath) + { + runDesc.NumTests++; + runDesc.TotalRunTime = System.TimeSpan.Zero; + runDesc.NumErrors++; + + activeTestDesc.TestState = TestState.Error; + activeTestDesc.TestPath = tsPath; + int pos = tsPath.LastIndexOf("\\", StringComparison.Ordinal) + 1; + activeTestDesc.TestName = tsPath.Substring(pos); + activeTestDesc.ErrorDesc = string.Format(Resources.AlmRunnerCantFindTest, activeTestDesc.TestPath); + activeTestDesc.FatalErrors = 1; + activeTestDesc.Runtime = System.TimeSpan.Zero; + + runDesc.TestRuns.Add(activeTestDesc); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void SetTestResults(ref ITSTest currentTest, IExecutionStatus executionStatus, ITestSet targetTestSet, TestRunResults activeTestDesc, TestSuiteRunResults runDesc, string testPath, string abortFilename) { if (currentTest == null) throw new ArgumentNullException("Current test set is null."); From 49b55596ab1896b2afb7fdf980641e6e5b8bb04b Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 27 Sep 2021 17:13:36 +0300 Subject: [PATCH 1874/2502] Making error messages homogenous --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 572ea08b79..a5afcc5962 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -611,8 +611,6 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet tsTreeManager = (ITestSetTreeManager)_tdConnectionOld.TestSetTreeManager; } - string initialFullPath = string.Format(@"{0}\{1}", tsPath, tsName); - try { //check test storage type @@ -663,7 +661,6 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet if (testList == null) { // this means, there was no test sets with the specified name, we treat it as a single test, as if a user specified it - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullPath)); return null; } foreach (ITestSet t in testList) @@ -672,8 +669,7 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet return testList; } - //node wasn't found, folder = null - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerNoSuchFolder, testSuiteName)); + //node wasn't found, folder = null return null; } @@ -1131,6 +1127,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string if (testSetList == null) { + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); UpdateTestResultsIfNonExistingTestSpecified(ref runDesc, ref activeTestDesc, initialFullTsPath); return runDesc; From 22c360548ab25d614642e870532fa71d60b3dc32 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 28 Sep 2021 10:17:55 +0800 Subject: [PATCH 1875/2502] [maven-release-plugin] prepare release microfocus-application-automation-tools-plugin-7.0.6-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1ace3a1907..95ab34ce15 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.6-beta-SNAPSHOT + 7.0.6-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + microfocus-application-automation-tools-plugin-7.0.6-beta From 190ea745047bfb4eba26f9ce0a9291004887f92a Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 28 Sep 2021 10:18:06 +0800 Subject: [PATCH 1876/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 95ab34ce15..9b806e5308 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.6-beta + 7.0.7-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - microfocus-application-automation-tools-plugin-7.0.6-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From c732846d0340649f949c801c2c9f4b8cdc151460 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 28 Sep 2021 08:40:53 +0300 Subject: [PATCH 1877/2502] Fixing bug of non-existing specific tests If a specific test was given by the user, which were removed by the filter, we got non-existing case; this should not happen. --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 28 +++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index a5afcc5962..54218d40ed 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -703,7 +703,7 @@ public bool ListContainsTest(List testList, ITSTest test) /// /// /// the filtered list of tests - public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testName, bool isFilterSelected, List filterByStatuses, string filterByName) + public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testName, bool isFilterSelected, List filterByStatuses, string filterByName, ref bool testExisted) { TSTestFactory tsTestFactory = targetTestSet.TSTestFactory; ITDFilter2 tdFilter = tsTestFactory.Filter; @@ -743,6 +743,11 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam !tListIndexTestName.ToLower().Contains(filterByName.ToLower())) { testList.Remove(index); + + if (isTestPath && testName.Equals(tListIndexTestName)) + { + testExisted = true; + } } } else //by name and statuses @@ -752,6 +757,11 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam !ListContainsTest(testsFilteredByStatus, testList[index])) { testList.Remove(index); + + if (isTestPath && testName.Equals(tListIndexTestName)) + { + testExisted = true; + } } } } @@ -760,6 +770,11 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam if (!ListContainsTest(testsFilteredByStatus, testList[index])) { testList.Remove(index); + + if (isTestPath && testName.Equals(tListIndexTestName)) + { + testExisted = true; + } } } } @@ -780,6 +795,9 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam if (!string.IsNullOrEmpty(tListIndexName) && !string.IsNullOrEmpty(testName) && !testName.Equals(tListIndexTestName)) { testList.Remove(index); + } else if (testName.Equals(tListIndexTestName)) + { + testExisted = true; } } } @@ -1178,7 +1196,8 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string } //filter tests - var filteredTestList = FilterTests(targetTestSet, isTestPath, testName, isFilterSelected, filterByStatuses, filterByName); + bool testExisted = false; + var filteredTestList = FilterTests(targetTestSet, isTestPath, testName, isFilterSelected, filterByStatuses, filterByName, ref testExisted); //set run host try @@ -1212,9 +1231,10 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string SetTestParameters(filteredTestList, testParameters, runHost, runMode, runDesc, scheduler); } - // isTestPath is only true, if a specific test was given by the user, + // isTestPath is only true, if a specific test was given by the user // if, the filteredTestList is empty, because of the filtering, we should not set the job status to failed - if (filteredTestList.Count == 0 && isTestPath) + // only if, the specific given test was not found + if (filteredTestList.Count == 0 && isTestPath && !testExisted) { //this will make sure run will fail at the end. (since there was an error) ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); From d770b0514606b03dca574ddb3268a244b2968351 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 28 Sep 2021 13:45:19 +0300 Subject: [PATCH 1878/2502] DEF-681022 | [Jenkins] Clean-up tests UFT Reports are not deleted before re-run --- .../tools/run/RunFromFileBuilder.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index c50fd8d686..40e3ebfd7b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -755,6 +755,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn if (uftSettingsModel != null) { uftSettingsModel.addToProperties(mergedProperties); } + //cleanup report folders before running the build String selectedNode = env.get("NODE_NAME"); if (selectedNode == null) {//if slave is given in the pipeline and not as part of build step @@ -764,11 +765,26 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn listener.error("Failed to get selected node for UFT execution : " + e.getMessage()); } } - int index = 1; + + // clean cleanuptests' report folders + int index = 1; + while (mergedProperties.getProperty("CleanupTest" + index) != null) { + String testPath = mergedProperties.getProperty("CleanupTest" + index); + List cleanupTests = UftToolUtils.getBuildTests(selectedNode, testPath); + for (String test : cleanupTests) { + UftToolUtils.deleteReportFoldersFromNode(selectedNode, test, listener); + } + + index++; + } + + // clean actual tests' report folders + index = 1; + while (mergedProperties.getProperty("Test" + index) != null) { String testPath = mergedProperties.getProperty(("Test" + index)); List buildTests = UftToolUtils.getBuildTests(selectedNode, testPath); - for(String test : buildTests) { + for (String test : buildTests) { UftToolUtils.deleteReportFoldersFromNode(selectedNode, test, listener); } index++; From 5365a2f8cab45023c7363b50c838764f12aa1bff Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 28 Sep 2021 14:52:06 +0300 Subject: [PATCH 1879/2502] DEF-578063 | [Jenkins] Post build action "Archive test report for failed tests" should show archived test reports for failed tests only --- .../application/automation/tools/results/ReportMetaData.java | 4 ++-- .../tools/results/HtmlBuildReportAction/index.jelly | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java b/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java index 70b38eaeb2..157a33071b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java @@ -113,7 +113,7 @@ public void setArchiveUrl(String archiveUrl) { this.archiveUrl = archiveUrl; } - public boolean getHasArchiveUrl() { - return archiveUrl != null; + public boolean hasArchiveUrl() { + return archiveUrl != null && !archiveUrl.equals(""); } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly b/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly index 276c35ea33..ec26ff602c 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly @@ -140,7 +140,7 @@ Open - + Download From d17af25abda1f0d6981426b4ec87264776c38516 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 29 Sep 2021 10:36:45 +0300 Subject: [PATCH 1880/2502] Disabling unavailable download buttons --- .../results/HtmlBuildReportAction/index.jelly | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly b/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly index ec26ff602c..f3a41b38ea 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly @@ -66,6 +66,14 @@ display: block; overflow: auto; } + + .disabledLink { + cursor: not-allowed; + opacity: 0.5; + text-decoration: none; + color: currentColor; + display: inline-block; + } @@ -140,9 +148,14 @@ Open - - Download - + + + Download + + + Download + + From c88b673e30ce6dc8c89bf16367ce03fa3cb80448 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 29 Sep 2021 12:05:33 +0300 Subject: [PATCH 1881/2502] DEF-680077 | [Jenkins Plug-in][ALM] "Blocked" and "Passed" statuses for ALM filtering can be selected only together --- .../automation/tools/uft/model/FilterTestsModel/config.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/FilterTestsModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/FilterTestsModel/config.jelly index 59ea315c84..02c3c73b15 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/FilterTestsModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/FilterTestsModel/config.jelly @@ -58,7 +58,7 @@ - + From 495b895a15444705e73f55713bb28419ca76668e Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 29 Sep 2021 12:28:41 +0300 Subject: [PATCH 1882/2502] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 42022c2bf1..352d67f113 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ Project status: [![Build status](https://ci.appveyor.com/api/projects/status/gqd0x8ov1ebqjjcu?svg=true)](https://ci.appveyor.com/project/HPEbot/hp-application-automation-tools-plugin) -Latest release branch status: +Latest release branch status1: [![Build status](https://ci.appveyor.com/api/projects/status/gqd0x8ov1ebqjjcu/branch/latest?svg=true)](https://ci.appveyor.com/project/HPEbot/hp-application-automation-tools-plugin/branch/latest) From 5494036d804161da61f841b96737c2b1210ad376 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 29 Sep 2021 12:29:49 +0300 Subject: [PATCH 1883/2502] Update AlmToolsUtils.java --- .../microfocus/application/automation/tools/AlmToolsUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java index ceb586c860..ebec33e2b3 100644 --- a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java @@ -56,7 +56,7 @@ public static void runOnBuildEnv( ArgumentListBuilder args = new ArgumentListBuilder(); PrintStream out = listener.getLogger(); - // Use script to run the cmdLine and get the console output + //// Use script to run the cmdLine and get the console output args.add(file); args.add("-paramfile"); args.add(paramFileName); From b6994bfe4aa8917d467ba9db0a6a015a329e3f57 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 29 Sep 2021 12:39:35 +0300 Subject: [PATCH 1884/2502] Revert "Update AlmToolsUtils.java" This reverts commit 5494036d --- .../microfocus/application/automation/tools/AlmToolsUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java index ebec33e2b3..ceb586c860 100644 --- a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java @@ -56,7 +56,7 @@ public static void runOnBuildEnv( ArgumentListBuilder args = new ArgumentListBuilder(); PrintStream out = listener.getLogger(); - //// Use script to run the cmdLine and get the console output + // Use script to run the cmdLine and get the console output args.add(file); args.add("-paramfile"); args.add(paramFileName); From a7ace312a4d3add148894317ada6a61667bbf968 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 29 Sep 2021 12:40:02 +0300 Subject: [PATCH 1885/2502] Revert "Update readme.md" This reverts commit 495b895a --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 352d67f113..42022c2bf1 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ Project status: [![Build status](https://ci.appveyor.com/api/projects/status/gqd0x8ov1ebqjjcu?svg=true)](https://ci.appveyor.com/project/HPEbot/hp-application-automation-tools-plugin) -Latest release branch status1: +Latest release branch status: [![Build status](https://ci.appveyor.com/api/projects/status/gqd0x8ov1ebqjjcu/branch/latest?svg=true)](https://ci.appveyor.com/project/HPEbot/hp-application-automation-tools-plugin/branch/latest) From f3cf514eb5037374c10db1cd60a17b3010e77eea Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 29 Sep 2021 14:00:24 +0300 Subject: [PATCH 1886/2502] Remove unnecessary whitespace & retrigger build --- .../application/automation/tools/run/RunFromFileBuilder.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index 40e3ebfd7b..6106119322 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -780,7 +780,6 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn // clean actual tests' report folders index = 1; - while (mergedProperties.getProperty("Test" + index) != null) { String testPath = mergedProperties.getProperty(("Test" + index)); List buildTests = UftToolUtils.getBuildTests(selectedNode, testPath); From b8942b11fa3579d90c1a2e3e1b6b4905d8f2af34 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 29 Sep 2021 18:13:01 +0300 Subject: [PATCH 1887/2502] Defect #1376068 - [MBT execute Test] when we Generate test with only problematic characters like !@#$%%^&* the MBT run will failed because of empty UFT script name --- pom.xml | 2 +- .../tools/octane/tests/junit/JUnitXmlIterator.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1ace3a1907..b037be6665 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.19 + 2.7.1.20 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index 41023ea495..55c51ff9a5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -198,7 +198,8 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I int uftTextIndexStart = getUftTestIndexStart(workspace, sharedCheckOutDirectory, testName); if (uftTextIndexStart != -1) { String path = testName.substring(uftTextIndexStart).replace(SdkConstants.FileSystem.LINUX_PATH_SPLITTER, SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER);; - if(path.startsWith(MfMBTConverter.MBT_PARENT_SUB_DIR)){//remove MBT prefix + boolean isMBT = path.startsWith(MfMBTConverter.MBT_PARENT_SUB_DIR); + if(isMBT){//remove MBT prefix //mbt test located in two level folder : ___mbt/_order path = path.substring(MfMBTConverter.MBT_PARENT_SUB_DIR.length() + 1);//remove ___mbt path = path.substring(path.indexOf(SdkConstants.FileSystem.WINDOWS_PATH_SPLITTER));//remove order part @@ -214,6 +215,9 @@ protected void onEvent(XMLEvent event) throws XMLStreamException, IOException, I packageName = path.substring(0, testNameStartIndex); } else { testName = path; + if (isMBT) { + testName = MfMBTConverter.decodeTestNameIfRequired(testName); + } } } From a80db2e792095dd3a0e106ae8af89398e8d1e0f9 Mon Sep 17 00:00:00 2001 From: karoi Date: Thu, 30 Sep 2021 16:15:22 +0300 Subject: [PATCH 1888/2502] tech- add classes to jenkins security --- src/main/resources/META-INF/hudson.remoting.ClassFilter | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/META-INF/hudson.remoting.ClassFilter b/src/main/resources/META-INF/hudson.remoting.ClassFilter index ec0d4fb041..484599b129 100644 --- a/src/main/resources/META-INF/hudson.remoting.ClassFilter +++ b/src/main/resources/META-INF/hudson.remoting.ClassFilter @@ -8,6 +8,8 @@ java.text.DecimalFormatSymbols # com.hp.octane.integrations.uft.items.* are safe to be used , The items are taken from Octane sdk for ci servers. com.hp.octane.integrations.uft.items.UftTestDiscoveryResult com.hp.octane.integrations.uft.items.AutomatedTest +com.hp.octane.integrations.uft.items.UftTestAction +com.hp.octane.integrations.uft.items.UftTestParameter com.hp.octane.integrations.uft.items.ScmResourceFile # com.hp.octane.integrations.dto.scm.* are safe to be used , The items are taken from Octane sdk for ci servers. com.hp.octane.integrations.dto.scm.impl.LineRange From b4499bf19fda2515fcfa5c47da3899969da24d03 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 30 Sep 2021 21:12:20 +0300 Subject: [PATCH 1889/2502] revert update of struct and credential dependencies --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b037be6665..05468f2950 100644 --- a/pom.xml +++ b/pom.xml @@ -460,7 +460,7 @@ org.jenkins-ci.plugins structs - 1.22 + 1.17 org.jenkins-ci.plugins @@ -484,7 +484,7 @@ org.jenkins-ci.plugins credentials - 2.3.19 + 2.1.19 com.microfocus.sv From 014edcf063e33f2bcf7ea82744a717988ecf7fb7 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 4 Oct 2021 11:46:03 +0300 Subject: [PATCH 1890/2502] tech : extend global parameter to global level parameter + adding custom parameters containing "octane" --- pom.xml | 2 +- .../TestsToRunConverterBuilder.java | 19 +++++++++++++------ .../help-parameters.html | 11 +++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 05468f2950..5838a68508 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.20 + 2.7.1.21 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 600d469c18..2f90efa300 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -185,12 +185,19 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu private Map getGlobalParameters(ParametersAction parameterAction) { Map map = new HashMap<>(); - addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM); - addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME); - addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME); - addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.OCTANE_SPACE_PARAMETER_NAME); - addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.OCTANE_WORKSPACE_PARAMETER_NAME); - addParameterIfExist(map, parameterAction, SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME); + Set predefinedParams = new HashSet<>(Arrays.asList( + SdkConstants.JobParameters.ADD_GLOBAL_PARAMETERS_TO_TESTS_PARAM, + SdkConstants.JobParameters.SUITE_ID_PARAMETER_NAME, + SdkConstants.JobParameters.SUITE_RUN_ID_PARAMETER_NAME, + SdkConstants.JobParameters.OCTANE_SPACE_PARAMETER_NAME, + SdkConstants.JobParameters.OCTANE_WORKSPACE_PARAMETER_NAME, + SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME, + SdkConstants.JobParameters.OCTANE_URL_PARAMETER_NAME)); + + parameterAction.getAllParameters().stream() + .filter(p->predefinedParams.contains(p.getName()) || p.getName().toLowerCase(Locale.ROOT).contains("octane")) + .forEach(param->addParameterIfExist(map, parameterAction, param.getName())); + return map; } diff --git a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html index 872f1c78cb..a4f97e9747 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html +++ b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html @@ -104,6 +104,17 @@ true/false Allow to disable "Test Connection" validation that is done during creation of UFT test runner. Default is false. + + ADD_GLOBAL_PARAMETERS_TO_TESTS + true/false + Used for UFT test runners. Use this parameter if you need to pass details of the Alm Octane to UFT tests, MTBX format will contain additional parameters, as following : + runId, suiteRunId, suiteId, octaneWorkspaceId, octaneSpaceId, octaneUrl, octaneConfigId. In addition, if your job contains other parameters that contains "octane"(case insensitive) in the name of parameter - they will be added. + +
      + Note : this parameter can be set also as job parameter. +
      + Default is false. + From 35dc4ec787ae18de5b0476b4b0f8db72ec8a50d4 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 4 Oct 2021 13:43:49 +0300 Subject: [PATCH 1891/2502] DEF-648008 & DEF-671261 & DEF-686006 & DEF-688009 --- HpToolsLauncher/Launcher.cs | 14 +- .../Properties/Resources.Designer.cs | 18 ++ HpToolsLauncher/Properties/Resources.resx | 6 + HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 193 ++++++++++++++---- HpToolsLauncher/TestRunners/ApiTestRunner.cs | 3 +- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 25 ++- .../automation/tools/AlmToolsUtils.java | 2 + .../tools/run/RunFromAlmBuilder.java | 39 +--- .../tools/run/RunFromFileBuilder.java | 2 - .../automation/tools/run/SseBuilder.java | 5 +- .../tools/sse/sdk/handler/LabPollHandler.java | 24 ++- .../tools/sse/sdk/handler/PollHandler.java | 2 +- 12 files changed, 228 insertions(+), 105 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 2ba8ec7798..c66eda45e8 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -885,12 +885,6 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul Environment.Exit((int)_exitCode); } - //if there is an error - if (results.TestRuns.Any(tr => tr.TestState == TestState.Error)) - { - _exitCode = ExitCodeEnum.Failed; - } - int numFailures = results.NumFailures; int numSuccess = results.TestRuns.Count(t => t.TestState == TestState.Passed); int numErrors = results.NumErrors; @@ -898,6 +892,12 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul if (_exitCode != ExitCodeEnum.Aborted) { + //if there is an error + if (numErrors > 0) + { + _exitCode = ExitCodeEnum.Failed; + } + if ((numErrors <= 0) && (numFailures > 0) && (numSuccess > 0)) { _exitCode = ExitCodeEnum.Unstable; @@ -983,6 +983,8 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul Environment.Exit((int)_exitCode); } } + + Environment.Exit((int)_exitCode); } finally { diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 53b57b6854..3d2caa5b73 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -258,6 +258,15 @@ internal static string AlmRunnerTestCompleteCaption { } } + /// + /// Looks up a localized string similar to Test set: {0}, aborted at {1}. + /// + internal static string AlmRunnerTestsetAborted { + get { + return ResourceManager.GetString("AlmRunnerTestsetAborted", resourceCulture); + } + } + /// /// Looks up a localized string similar to Test set: {0}, finished at {1}. /// @@ -276,6 +285,15 @@ internal static string AlmRunnerTestStat { } } + /// + /// Looks up a localized string similar to Test: {0} >> Previous state -> {1}; After update state -> {2}. + /// + internal static string AlmRunnerUpdateStateAfterAbort { + get { + return ResourceManager.GetString("AlmRunnerUpdateStateAfterAbort", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot find the test folder.. /// diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 9c82cd75c2..5f66d83c61 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -490,4 +490,10 @@ Save the test in QuickTest and then run it again. Could not find Test {0} + + Test set: {0}, aborted at {1} + + + Test: {0} >> Previous state -> {1}; After update state -> {2} + \ No newline at end of file diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 54218d40ed..8d35dc1f3c 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -1059,6 +1059,10 @@ public override TestSuiteRunResults Run() ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerErrorBadQcInstallation, ex.Message, ex.StackTrace)); return null; } + + // we start the timer, it is important for the timeout + Stopwatch swForTimeout = Stopwatch.StartNew(); + //run all the TestSets foreach (string testSetItem in TestSets) { @@ -1094,9 +1098,12 @@ public override TestSuiteRunResults Run() } } - TestSuiteRunResults runResults = RunTestSet(testSetDir, tsName, testParameters, Timeout, RunMode, RunHost, IsFilterSelected, FilterByName, FilterByStatuses, Storage); + TestSuiteRunResults runResults = RunTestSet(testSetDir, tsName, testParameters, Timeout, RunMode, RunHost, IsFilterSelected, FilterByName, FilterByStatuses, Storage, swForTimeout); if (runResults != null) activeRunDescription.AppendResults(runResults); + + // if the run has cancelled, because of timeout, we should terminate the build + if (_blnRunCancelled) break; } return activeRunDescription; @@ -1117,7 +1124,7 @@ public override TestSuiteRunResults Run() /// /// public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string testParameters, double timeout, QcRunMode runMode, string runHost, - bool isFilterSelected, string filterByName, List filterByStatuses, TestStorageType testStorageType) + bool isFilterSelected, string filterByName, List filterByStatuses, TestStorageType testStorageType, Stopwatch swForTimeout) { string testSuiteName = tsName.TrimEnd(); ITestSetFolder tsFolder = null; @@ -1275,13 +1282,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string timeout *= 60; } //update run result description - UpdateTestsResultsDescription(ref activeTestDesc, runDesc, scheduler, targetTestSet, currentTestSetInstances, timeout, executionStatus, sw, ref prevTest, ref currentTest, abortFilename); - - //close last test - if (prevTest != null) - { - WriteTestRunSummary(prevTest); - } + UpdateTestsResultsDescription(ref activeTestDesc, runDesc, scheduler, targetTestSet, currentTestSetInstances, timeout, executionStatus, swForTimeout, ref prevTest, ref currentTest, abortFilename); //done with all tests, stop collecting output in the testRun object. ConsoleWriter.ActiveTestRun = null; @@ -1295,29 +1296,116 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string testPath = string.Format(@"Root\{0}\{1}\", tsFolderName, testSuiteName); } - SetTestResults(ref currentTest, executionStatus, targetTestSet, activeTestDesc, runDesc, testPath, abortFilename); + // if the run has been cancelled and a timeout is set, which has elapsed, skip this part, we are going to do it later with some corrections + if (!_blnRunCancelled && (timeout == -1 || swForTimeout.Elapsed.TotalSeconds < timeout)) + SetTestResults(ref currentTest, executionStatus, targetTestSet, activeTestDesc, runDesc, testPath, abortFilename); - //update the total runtime + // update the total runtime runDesc.TotalRunTime = sw.Elapsed; // test has executed in time - if (timeout == -1 || sw.Elapsed.TotalSeconds < timeout) + if (timeout == -1 || swForTimeout.Elapsed.TotalSeconds < timeout) { ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerTestsetDone, testSuiteName, DateTime.Now.ToString(Launcher.DateFormat))); } else { - _blnRunCancelled = true; - ConsoleWriter.WriteLine(Resources.GeneralTimedOut); - - scheduler.Stop(currentTestSetInstances); - + ConsoleWriter.WriteLine(Resources.SmallDoubleSeparator); + ConsoleWriter.WriteLine(Resources.GeneralTimedOut); + ConsoleWriter.WriteLine(">>> Updating currently scheduled tests' state"); + ConsoleWriter.WriteLine(">>> Setting all non-finished scheduled tests' state to 'Error'"); + ConsoleWriter.WriteLine(Resources.SmallDoubleSeparator); + + // we refresh the current test set instances' status + executionStatus.RefreshExecStatusInfo(currentTestSetInstances, true); + + // stop all currently scheduled tests + scheduler.Stop(currentTestSetInstances); + + // we should re-check every current test instances' status to perfectly match ALM statuses + updateTestResultsAfterAbort(executionStatus, targetTestSet, runDesc, testPath); + + // scheduler process may not be terminated - this process is not terminated by the aborter + terminateSchedulerIfNecessary(); + Launcher.ExitCode = Launcher.ExitCodeEnum.Aborted; + + ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerTestsetAborted, testSuiteName, DateTime.Now.ToString(Launcher.DateFormat))); } return runDesc; } + /// + /// Terminates wexectrl process which belongs to the current HpToolsLauncher process + /// + private void terminateSchedulerIfNecessary() + { + Process exeCtrl = Process.GetProcessesByName("wexectrl").Where(p => p.SessionId == Process.GetCurrentProcess().SessionId).FirstOrDefault(); + + if (exeCtrl != null) + { + exeCtrl.Kill(); + } + } + + /// + /// Iterates over the currently scheduled tests and updates their status according to their run status, if the test is already in a finished state, it won't update it, + /// if it is in a non-finished state it sets to 'Error' + /// + /// + /// + /// + private void updateTestResultsAfterAbort(IExecutionStatus executionStatus, ITestSet targetTestSet, TestSuiteRunResults runDesc, string testPath) + { + ITSTest currentTest; + TestRunResults testDesc; + TestState prevState; + + for (var k = 1; k <= executionStatus.Count; ++k) + { + TestExecStatus testExecStatusObj = executionStatus[k]; + currentTest = targetTestSet.TSTestFactory[testExecStatusObj.TSTestId]; + + if (currentTest == null) + { + continue; + } + + testDesc = UpdateTestStatus(runDesc, targetTestSet, testExecStatusObj, true); + + prevState = testDesc.TestState; + + // if the test hasn't finished running and the timeout has expired, we should set their state to 'Error' + if (testDesc.TestState != TestState.Passed && testDesc.TestState != TestState.Error + && testDesc.TestState != TestState.Failed && testDesc.TestState != TestState.Warning) + { + testDesc.TestState = TestState.Error; + testDesc.ErrorDesc = Resources.GeneralTimeoutExpired; + } + + // non-executed tests' group can be null, we should update it as well, otherwise in the report it won't be grouped accordingly + if (testDesc.TestGroup == null) + { + var currentFolder = targetTestSet.TestSetFolder as ITestSetFolder; + string folderName = ""; + + if (currentFolder != null) + { + folderName = currentFolder.Name.Replace(".", "_"); + } + + testDesc.TestGroup = string.Format(@"{0}\{1}", folderName, targetTestSet.Name).Replace(".", "_"); + } + + testDesc.TestPath = testPath + currentTest.TestName; + + ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerUpdateStateAfterAbort, testDesc.TestPath, prevState.ToString(), testDesc.TestState)); + + UpdateCounters(testDesc, runDesc); + } + } + /// /// Updates the runDesc run results by describing the non-existing test error as a testDesc /// @@ -1486,7 +1574,7 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te while (!tsExecutionFinished && (timeout == -1 || sw.Elapsed.TotalSeconds < timeout)) { - executionStatus.RefreshExecStatusInfo("all", true); + executionStatus.RefreshExecStatusInfo(currentTestSetInstances, true); tsExecutionFinished = executionStatus.Finished; if (File.Exists(abortFilename)) @@ -1514,6 +1602,7 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te ConsoleWriter.WriteLine(string.Format("currentTest is null for test.{0} during execution", j)); continue; } + activeTestDesc = UpdateTestStatus(runDesc, targetTestSet, testExecStatusObj, true); if (activeTestDesc != null && activeTestDesc.PrevTestState != activeTestDesc.TestState) @@ -1534,12 +1623,6 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te } runDesc.TestRuns[testIndex].PrevRunId = prevRunId; - //closing previous test - if (prevTest != null) - { - WriteTestRunSummary(prevTest); - } - //starting new test prevTest = currentTest; //assign the new test the console writer so it will gather the output @@ -1572,7 +1655,13 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te else if (enmState != TestState.Waiting) { ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerStatWithMessage, activeTestDesc.TestName, testExecStatusObj.TSTestId, statusString, testExecStatusObj.Message)); + + if (IsInAFinishedState(statusString)) + { + WriteTestRunSummary(currentTest); + } } + if (File.Exists(abortFilename)) { scheduler.Stop(currentTestSetInstances); @@ -1610,6 +1699,12 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te //stop working Environment.Exit((int)Launcher.ExitCodeEnum.Aborted); } + + if (sw.Elapsed.TotalSeconds >= timeout && timeout != -1) + { + // setting the flag ensures that we will recall later, that the currently scheduled tests are aborted because of the timeout + _blnRunCancelled = true; + } } } @@ -1650,13 +1745,24 @@ private static int GetTestRunId(ITSTest currentTest) return runId; } + /// + /// Returns if the specific test's status is a finished status, either Passed, Failed, Error or Warning + /// + /// + /// + private bool IsInAFinishedState(string testStatus) + { + return testStatus != TestState.Running.ToString() + && testStatus != TestState.Waiting.ToString() + && testStatus != TestState.Unknown.ToString(); + } + /// /// writes a summary of the test run after it's over /// /// private void WriteTestRunSummary(ITSTest prevTest) { - int prevRunId = ConsoleWriter.ActiveTestRun.PrevRunId; if (TdConnection != null) { _tdConnection.KeepConnection = true; @@ -1667,30 +1773,29 @@ private void WriteTestRunSummary(ITSTest prevTest) } int runId = GetTestRunId(prevTest); - - if (runId > prevRunId) - { - string stepsString = GetTestStepsDescFromQc(prevTest); - if (string.IsNullOrWhiteSpace(stepsString) && ConsoleWriter.ActiveTestRun.TestState != TestState.Error) - stepsString = GetTestRunLog(prevTest); + string stepsString = GetTestStepsDescFromQc(prevTest); - if (!string.IsNullOrWhiteSpace(stepsString)) - ConsoleWriter.WriteLine(stepsString); + if (string.IsNullOrWhiteSpace(stepsString) && ConsoleWriter.ActiveTestRun.TestState != TestState.Error) + stepsString = GetTestRunLog(prevTest); - string linkStr = GetTestRunLink(runId); - if (linkStr == string.Empty) - { - Console.WriteLine(Resources.OldVersionOfQC); - } - else - { - ConsoleWriter.WriteLine("\n" + string.Format(Resources.AlmRunnerDisplayLink, "\n" + linkStr + "\n")); - } + if (!string.IsNullOrWhiteSpace(stepsString)) + ConsoleWriter.WriteLine(stepsString); + + string linkStr = GetTestRunLink(runId); + + if (linkStr == string.Empty) + { + Console.WriteLine(Resources.OldVersionOfQC); } + else + { + ConsoleWriter.WriteLine("\n" + string.Format(Resources.AlmRunnerDisplayLink, "\n" + linkStr + "\n")); + } + ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " " + Resources.AlmRunnerTestCompleteCaption + " " + prevTest.Name + - ((runId > prevRunId) ? ", " + Resources.AlmRunnerRunIdCaption + " " + runId : string.Empty) - + "\n-------------------------------------------------------------------------------------------------------"); + ", " + Resources.AlmRunnerRunIdCaption + " " + runId + + "\n-------------------------------------------------------------------------------------------------------"); } /// diff --git a/HpToolsLauncher/TestRunners/ApiTestRunner.cs b/HpToolsLauncher/TestRunners/ApiTestRunner.cs index 5efd0c8861..7c269d3b4a 100644 --- a/HpToolsLauncher/TestRunners/ApiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ApiTestRunner.cs @@ -209,8 +209,7 @@ private bool ExecuteProcess(string fileName, string arguments, ref string failur //before we could handle the cancel request if (_runCancelled()) { - failureReason = "Process was stopped since job has timed out!"; - ConsoleWriter.WriteLine(failureReason); + ConsoleWriter.WriteLine(Resources.GeneralTimeoutExpired); if (!proc.HasExited) { diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 303a1a4c4c..9d5e06ad24 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -102,9 +102,9 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance ConsoleWriter.ActiveTestRun = runDesc; ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testPath); - runDesc.TestPath = testPath; - - // default report location is the test path + runDesc.TestPath = testPath; + + // default report location is the test path runDesc.ReportLocation = testPath; // check if the report path has been defined if (!String.IsNullOrEmpty(testinf.ReportPath)) @@ -225,9 +225,9 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance throw new Exception("ProtectBSTRToBase64 fail for mc proxy Password"); } _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_PROXY_SETTING_PASSWORD, encriptedMcProxyPassword); - } - - // Mc info (device, app, launch and terminate data) + } + + // Mc info (device, app, launch and terminate data) if (!string.IsNullOrEmpty(_mobileInfo)) { _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_INFO, _mobileInfo); @@ -248,7 +248,6 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance // Launch application after set Addins _qtpApplication.Launch(); _qtpApplication.Visible = false; - } } } @@ -300,7 +299,6 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance QTPTestCleanup(); - return runDesc; } @@ -449,10 +447,13 @@ private GuiTestRunResult ExecuteQTPRun(TestRunResults testResults) //Check for cancel before executing if (_runCancelled()) { + QTPTestCleanup(); + KillQtp(); testResults.TestState = TestState.Error; testResults.ErrorDesc = Resources.GeneralTestCanceled; ConsoleWriter.WriteLine(Resources.GeneralTestCanceled); result.IsSuccess = false; + Launcher.ExitCode = Launcher.ExitCodeEnum.Aborted; return result; } ConsoleWriter.WriteLine(string.Format(Resources.FsRunnerRunningTest, testResults.TestPath)); @@ -473,11 +474,12 @@ private GuiTestRunResult ExecuteQTPRun(TestRunResults testResults) Thread.Sleep(200); if (_timeLeftUntilTimeout - _stopwatch.Elapsed <= TimeSpan.Zero) { - _qtpApplication.Test.Stop(); + QTPTestCleanup(); + KillQtp(); testResults.TestState = TestState.Error; testResults.ErrorDesc = Resources.GeneralTimeoutExpired; ConsoleWriter.WriteLine(Resources.GeneralTimeoutExpired); - + Launcher.ExitCode = Launcher.ExitCodeEnum.Aborted; result.IsSuccess = false; return result; } @@ -568,7 +570,9 @@ private void KillQtp() Process[] processes = Process.GetProcessesByName("qtpAutomationAgent"); Process qtpAuto = processes.Where(p => p.SessionId == Process.GetCurrentProcess().SessionId).FirstOrDefault(); if (qtpAuto != null) + { qtpAuto.Kill(); + } } private bool HandleOutputArguments(ref string errorReason) @@ -748,6 +752,7 @@ private void QTPTestCleanup() try { _qtpApplication.Test.Stop(); + _qtpApplication.Test.Close(); } catch (Exception) { diff --git a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java index ceb586c860..42a64850de 100644 --- a/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/AlmToolsUtils.java @@ -72,6 +72,8 @@ public static void runOnBuildEnv( build.setResult(Result.UNSTABLE); } else if (returnCode == -3) { build.setResult(Result.ABORTED); + // throwing this exception ensures we enter into the respective catch branch in the callstack + throw new InterruptedException(); } else { listener.getLogger().println("Launch return code " + returnCode); build.setResult(Result.FAILURE); diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index 6db64643fa..68c396adf5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -349,41 +349,20 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task } catch (InterruptedException e) { build.setResult(Result.ABORTED); PrintStream out = listener.getLogger(); - // kill processes - //FilePath killFile = projectWS.child(KillFileName); - /* try { - out.println("Sending abort command"); - killFile.write("\n", "UTF-8"); - while (!killFile.exists()) - Thread.sleep(1000); - Thread.sleep(1500); - + + try { + AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); } catch (IOException e1) { - //build.setResult(Result.FAILURE); - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (InterruptedException e1) { - //build.setResult(Result.FAILURE); + Util.displayIOException(e1, listener); + build.setResult(Result.FAILURE); + return; + } catch (InterruptedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); - }*/ - - try { - AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); - } catch (IOException e1) { - Util.displayIOException(e1, listener); - build.setResult(Result.FAILURE); - return; - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - out.println("Operation was aborted by user."); - //build.setResult(Result.FAILURE); + } } + return; - } public AlmServerSettingsModel getAlmServerSettingsModel() { diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index 6106119322..45ec23dbe2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -849,7 +849,6 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn build.setResult(Result.ABORTED); PrintStream out = listener.getLogger(); listener.error("Failed running HpToolsLauncher - build aborted " + e); - try { AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); } catch (IOException e1) { @@ -859,7 +858,6 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn } catch (InterruptedException e1) { listener.error("Failed running HpToolsAborter " + e1); } - out.println("Operation Was aborted by user."); } //} } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java index 5fbdbe6b0a..72557be54b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/SseBuilder.java @@ -268,7 +268,6 @@ private Testsuites execute( } private Result createRunResults(FilePath filePath, Testsuites testsuites, PrintStream logger) { - Result ret = Result.SUCCESS; try { if (testsuites != null) { @@ -282,14 +281,14 @@ private Result createRunResults(FilePath filePath, Testsuites testsuites, PrintS } } else { logger.println("Empty Results"); - ret = Result.UNSTABLE; + ret = Result.FAILURE; } } catch (Exception cause) { logger.print(String.format( "Failed to create run results, Exception: %s", cause.getMessage())); - ret = Result.UNSTABLE; + ret = Result.FAILURE; } return ret; diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java index 64f75aacca..8b82c9d009 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java @@ -58,21 +58,31 @@ public LabPollHandler(Client client, String entityId, int interval) { @Override protected boolean doPoll(Logger logger) throws InterruptedException { - boolean ret = false; Response runEntityResponse = getRunEntityData(); if (isOk(runEntityResponse, logger)) { - setTimeslotId(runEntityResponse, logger); - _eventLogHandler = new EventLogHandler(_client, _timeslotId); - if (!StringUtils.isNullOrEmpty(_timeslotId)) { - ret = super.doPoll(logger); + if (!isTestsetEmpty(runEntityResponse, logger)) { + setTimeslotId(runEntityResponse, logger); + _eventLogHandler = new EventLogHandler(_client, _timeslotId); + if (!StringUtils.isNullOrEmpty(_timeslotId)) { + ret = super.doPoll(logger); + } + } else { + logger.log(String.format("Testset %s is empty.", _entityId)); } } return ret; - } - + + private boolean isTestsetEmpty(Response response, Logger logger) { + String xml = response.toString(); + String testSetNames = XPathUtils.getAttributeValue(xml, "test-set-names"); + String name = XPathUtils.getAttributeValue(xml, "name"); + + return testSetNames.equals("Error") && name.startsWith("Error"); + } + @Override protected Response getResponse() { diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/PollHandler.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/PollHandler.java index a4c3b50c33..a73002cdf6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/PollHandler.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/PollHandler.java @@ -60,9 +60,9 @@ public boolean poll(Logger logger) throws InterruptedException { } protected boolean doPoll(Logger logger) throws InterruptedException { - boolean ret = false; int failures = 0; + while (failures < 3) { Response response = getResponse(); if (isOk(response, logger)) { From b5f9684f34ad686343f1b787fd50712f5f589ab9 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 4 Oct 2021 14:41:59 +0300 Subject: [PATCH 1892/2502] Resolving test error and making use of Logger parameter --- .../tools/sse/sdk/handler/LabPollHandler.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java index 8b82c9d009..fe9f7b890d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java +++ b/src/main/java/com/microfocus/application/automation/tools/sse/sdk/handler/LabPollHandler.java @@ -76,11 +76,16 @@ protected boolean doPoll(Logger logger) throws InterruptedException { } private boolean isTestsetEmpty(Response response, Logger logger) { - String xml = response.toString(); - String testSetNames = XPathUtils.getAttributeValue(xml, "test-set-names"); - String name = XPathUtils.getAttributeValue(xml, "name"); + try { + String xml = response.toString(); + String testSetNames = XPathUtils.getAttributeValue(xml, "test-set-names"); + String name = XPathUtils.getAttributeValue(xml, "name"); - return testSetNames.equals("Error") && name.startsWith("Error"); + return testSetNames.equals("Error") && name.startsWith("Error"); + } catch (Throwable cause) { + logger.log(String.format("Failed to parse response: %s", response)); + return false; + } } @Override From 16ff2e64182dc2704d0b331ed62f2e2a1a1c3488 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 4 Oct 2021 15:15:59 +0300 Subject: [PATCH 1893/2502] DEF-653013 - removing unnecessary printout of matching test sets --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 8d35dc1f3c..7426d6cfc1 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -658,13 +658,12 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet if (tsFolder != null) { List testList = tsFolder.FindTestSets(testSuiteName); + if (testList == null) { // this means, there was no test sets with the specified name, we treat it as a single test, as if a user specified it return null; } - foreach (ITestSet t in testList) - Console.WriteLine(string.Format(TEST_DETAILS, t.ID, t.Name, t.TestSetFolder.Name)); return testList; } From e89aa136e6bf003164e99ab9ed67a0091bd59b2d Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 4 Oct 2021 16:05:57 +0300 Subject: [PATCH 1894/2502] DEF-654034 - handling case when ALM server URL ends with separator --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 7426d6cfc1..4fe4736c61 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -1718,10 +1718,17 @@ private string GetTestRunLink(int runId) { return string.Empty; } + var mQcServer = MQcServer.Trim(); var prefix = mQcServer.StartsWith("https://", StringComparison.OrdinalIgnoreCase) ? "tds" : "td"; mQcServer = Regex.Replace(mQcServer, "^http[s]?://", string.Empty, RegexOptions.IgnoreCase); - return string.Format("{0}://{1}.{2}.{3}/TestRunsModule-00000000090859589?EntityType=IRun&EntityID={4}", prefix, MQcProject, MQcDomain, mQcServer, runId); + + if (!mQcServer.EndsWith("/")) + { + mQcServer += "/"; + } + + return string.Format("{0}://{1}.{2}.{3}TestRunsModule-00000000090859589?EntityType=IRun&EntityID={4}", prefix, MQcProject, MQcDomain, mQcServer, runId); } /// From 0184d6951131e93dcab7f3966317056742ac67fa Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 4 Oct 2021 17:21:29 +0300 Subject: [PATCH 1895/2502] defect #1368233 : Pipeline creation failed. Classloader issue with SingleConditionalBuilder. loading java.lang.NoClassDefFoundError: org/jenkinsci/plugins/conditionalbuildstep/singlestep/SingleConditionalBuilder --- .../builders/AbstractBuilderProcessor.java | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java index 8c54c4148b..630a7b5c50 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/builders/AbstractBuilderProcessor.java @@ -60,22 +60,26 @@ public List getPhases() { public static void processInternalBuilders(Builder builder, Job job, String phasesName, List internalPhases, Set processedJobs) { processedJobs.add(job); AbstractBuilderProcessor builderProcessor = null; - switch (builder.getClass().getName()) { - case JobProcessorFactory.CONDITIONAL_BUILDER_NAME: - builderProcessor = new ConditionalBuilderProcessor(builder, job, phasesName, internalPhases, processedJobs); - break; - case JobProcessorFactory.SINGLE_CONDITIONAL_BUILDER_NAME: - builderProcessor = new SingleConditionalBuilderProcessor(builder, job, phasesName, internalPhases, processedJobs); - break; - case JobProcessorFactory.PARAMETRIZED_TRIGGER_BUILDER: - builderProcessor = new ParameterizedTriggerProcessor(builder, job, phasesName, processedJobs); - break; - case JobProcessorFactory.MULTIJOB_BUILDER: - builderProcessor = new MultiJobBuilderProcessor(builder, job, processedJobs); - break; - default: - logger.debug("not yet supported build (internal) action: " + builder.getClass().getName()); - break; + try { + switch (builder.getClass().getName()) { + case JobProcessorFactory.CONDITIONAL_BUILDER_NAME: + builderProcessor = new ConditionalBuilderProcessor(builder, job, phasesName, internalPhases, processedJobs); + break; + case JobProcessorFactory.SINGLE_CONDITIONAL_BUILDER_NAME: + builderProcessor = new SingleConditionalBuilderProcessor(builder, job, phasesName, internalPhases, processedJobs); + break; + case JobProcessorFactory.PARAMETRIZED_TRIGGER_BUILDER: + builderProcessor = new ParameterizedTriggerProcessor(builder, job, phasesName, processedJobs); + break; + case JobProcessorFactory.MULTIJOB_BUILDER: + builderProcessor = new MultiJobBuilderProcessor(builder, job, processedJobs); + break; + default: + logger.debug("not yet supported build (internal) action: " + builder.getClass().getName()); + break; + } + } catch (Throwable e) { + logger.info("Failed to load build processor for build " + builder.getClass().getName() + ", " + e.getClass().getName() + " : " + e.getMessage()); } if (builderProcessor != null) { From d43c7aefda022ae7eca91c7f90a13bfffa55d78e Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 4 Oct 2021 20:30:28 +0300 Subject: [PATCH 1896/2502] DEF-658019 - close/open "UFT-Specific Settings"; "LoadRunner-Specific Settings"; "UFT Mobile options" in job configurations --- .../tools/run/RunFromFileBuilder/config.jelly | 316 +++++++++++------- src/main/webapp/configure.js | 7 + 2 files changed, 202 insertions(+), 121 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 5c5c45d432..ec1e95e373 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -128,140 +128,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + ${runMode.description} + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
      +
      +
      +
      + + + + + +
      +
      +
      +
      + - - - - - - - - - - - - - + +
      +
      +
      +
      +
      +
      + LoadRunner-Specific Settings +
      + +
      +
      +
      + + - - + + - - + + - - + + - - + + + + + + + + + + + + +
      +
      +
      +
      + + + + + +
      +
      +
      +
      +
      - - + + +
      +
      +
      +
      +
      +
      + UFT-Mobile Options +
      + +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      + + + + + +
      +
      +
      +
      +
      diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/help-almCredentialsScope.html b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/help-almCredentialsScope.html new file mode 100644 index 0000000000..2f9ecc213f --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/help-almCredentialsScope.html @@ -0,0 +1,35 @@ + + +
      + Select the scope of the credentials used for connecting to the specified ALM Server: +
        +
      • Use Job (local) credentials: This option implies to define the ALM credentials right here at job level.
      • +
      • Use System (global) credentials: This option allows the selection of system predefined ALM credentials.
      • +
      +
      \ No newline at end of file diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index b1488f2878..8dbb43b76a 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -1,25 +1,72 @@ if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = Array.prototype.forEach; } -function setupSSO() { +const CredScope = {JOB : "JOB", SYSTEM : "SYSTEM"}; + +function setupAlmCredentials() { setTimeout(function() { prepareTask()}, 200); } function prepareTask() { + const credentialsScopeNodes = document.querySelectorAll('select[name="almCredentialsScope"]'); const isSSOEnabledNodes = document.querySelectorAll('input[type="checkbox"][name="runfromalm.isSSOEnabled"]'); - const noSSOCredentialsNodes = document.querySelectorAll('div.noSSOCredentials'); - const ssoCredentialsNodes = document.querySelectorAll('div.ssoCredentials'); + const sysAlmUsernameNodes = document.querySelectorAll('div.sys-alm-username'); + const sysAlmClientIdNodes = document.querySelectorAll('div.sys-alm-client-id'); + const jobAlmUsernameNodes = document.querySelectorAll('div.job-alm-username'); + const jobAlmPwdNodes = document.querySelectorAll('div.job-alm-password'); + const jobAlmCIDNodes = document.querySelectorAll('div.job-alm-client-id'); + const jobAlmApiKeyNodes = document.querySelectorAll('div.job-alm-secret'); isSSOEnabledNodes.forEach(function(checkbox, index) { - selectCredentialsType(checkbox.checked, index); + selectCredentialsType(checkbox.checked, index, credentialsScopeNodes[index].value); if (typeof checkbox.onclick !== "function") { checkbox.onclick = function() { - selectCredentialsType(this.checked, index); + selectCredentialsType(this.checked, index, credentialsScopeNodes[index].value); } } }); - function selectCredentialsType(checked, index) { - noSSOCredentialsNodes[index].style.display = checked ? "none" : "block"; - ssoCredentialsNodes[index].style.display = checked ? "block" : "none"; + credentialsScopeNodes.forEach(function(dropdown, idx) { + credentialsScopeChanged(dropdown.value, idx); + if (typeof dropdown.onchange !== "function") { + dropdown.onchange = function() { + credentialsScopeChanged(this.value, idx); + } + } + }); + + function selectCredentialsType(isSSO, idx, scope) { + const isJobScope = scope === CredScope.JOB; + const jobAlmUserNode = jobAlmUsernameNodes[idx]; + const jobAlmPwdNode = jobAlmPwdNodes[idx]; + const jobAlmCIDNode = jobAlmCIDNodes[idx]; + const jobAlmApiKeyNode = jobAlmApiKeyNodes[idx]; + const sysAlmUserNode = sysAlmUsernameNodes[idx]; + const sysAlmCIDNode = sysAlmClientIdNodes[idx]; + if (isJobScope) { + sysAlmUserNode.querySelector("select").name += "_x"; + sysAlmCIDNode.querySelector("select").name += "_x"; + sysAlmUsernameNodes[idx].style.display = sysAlmClientIdNodes[idx].style.display = "none"; + jobAlmUserNode.querySelector("input").name = "almUserName"; + jobAlmPwdNode.querySelector("input").name = "almPassword"; + jobAlmCIDNode.querySelector("input").name = "almClientID"; + jobAlmApiKeyNode.querySelector("input").name = "almApiKey"; + jobAlmUsernameNodes[idx].style.display = jobAlmPwdNodes[idx].style.display = isSSO ? "none" : "block"; + jobAlmCIDNodes[idx].style.display = jobAlmApiKeyNodes[idx].style.display = isSSO ? "block" : "none"; + } else { + sysAlmUserNode.querySelector("select").name = "almUserName"; + sysAlmCIDNode.querySelector("select").name = "almClientID"; + jobAlmUserNode.querySelector("input").name += "_x"; + jobAlmCIDNode.querySelector("input").name += "_x"; + jobAlmPwdNode.querySelector("input").name += "_x"; + jobAlmApiKeyNode.querySelector("input").name += "_x"; + jobAlmUsernameNodes[idx].style.display = jobAlmPwdNodes[idx].style.display = jobAlmCIDNodes[idx].style.display = jobAlmApiKeyNodes[idx].style.display = "none"; + sysAlmUsernameNodes[idx].style.display = isSSO ? "none" : "block"; + sysAlmClientIdNodes[idx].style.display = isSSO ? "block" : "none"; + } + } + + function credentialsScopeChanged(scope, idx) { + const isSSO = isSSOEnabledNodes[idx].checked; + selectCredentialsType(isSSO, idx, scope); } -} \ No newline at end of file +} diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java index b9a4e76739..32b9d77098 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java @@ -86,7 +86,7 @@ public void testMockMoreBuilders() throws Exception { AlmServerSettingsModel almServerSettingsModel = new AlmServerSettingsModel("server2", "serverURL", new ArrayList<>(), new ArrayList<>()); project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -Dmaven.repo.local=%s\\m2-temp", TestUtils.getMavenHome(),System.getenv("TEMP")), ToolInstallations.configureMaven3().getName(), null, null, "-Dmaven.test.failure.ignore=true")); - project.getBuildersList().add(new RunFromAlmBuilder("notExistingServer", "sa","","domain", "project", "notExistingTests", "", "", "", "", "","", false, false, filterTestsModel, almServerSettingsModel)); + project.getBuildersList().add(new RunFromAlmBuilder("notExistingServer", "JOB", "sa", "", "domain", "project", "notExistingTests", "", "", "", "", "","", false, false, filterTestsModel, almServerSettingsModel)); AbstractBuild buildMock = Mockito.mock(AbstractBuild.class); Mockito.when(buildMock.getProject()).thenReturn(project); From 5597a3f3886c016972bbf16b8cf86d79e0543ca8 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 5 Oct 2021 21:02:54 +0300 Subject: [PATCH 1898/2502] backward compatibility handling, few optimizations, get rid of some warnings --- .../tools/model/CredentialsScope.java | 4 +- .../tools/model/RunFromAlmModel.java | 10 ++- .../tools/run/RunFromAlmBuilder.java | 63 +++++++------------ .../tools/run/RunFromAlmBuilder/config.jelly | 4 +- 4 files changed, 36 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/CredentialsScope.java b/src/main/java/com/microfocus/application/automation/tools/model/CredentialsScope.java index 5b13fe08ff..bd50d97223 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/CredentialsScope.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/CredentialsScope.java @@ -1,8 +1,8 @@ package com.microfocus.application.automation.tools.model; public enum CredentialsScope { - JOB("Use Job (local) credentials"), - SYSTEM("Use System (global) credentials"); + JOB("Job (local) credentials"), + SYSTEM("System (global) credentials"); private final String description; CredentialsScope(String description) { diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java index 7a46f4da17..8d3331e44a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromAlmModel.java @@ -88,7 +88,7 @@ public RunFromAlmModel(String almServerName, String almUserName, String almPassw this.almServerName = almServerName; this.credentialsScope = credentialsScope; - this.almUserName = almUserName; + this.almUserName = StringUtils.defaultString(almUserName); this.almPassword = StringUtils.isBlank(almUserName) ? null : Secret.fromString(almPassword); this.almDomain = almDomain; this.almProject = almProject; @@ -104,7 +104,7 @@ public RunFromAlmModel(String almServerName, String almUserName, String almPassw this.almRunHost = almRunHost; this.isSSOEnabled = isSSOEnabled; - this.almClientID = almClientID; + this.almClientID = StringUtils.defaultString(almClientID); this.almApiKey = StringUtils.isBlank(almClientID) ? null : Secret.fromString(almApiKey); } @@ -168,6 +168,12 @@ public Properties getProperties(EnvVars envVars, VariableResolver varRes return CreateProperties(envVars, varResolver); } + public String getCredentialsScopeValue() { return credentialsScope == null ? "" : credentialsScope.getValue(); } + public String getPasswordEncryptedValue() { return almPassword == null ? "" : almPassword.getEncryptedValue(); } + public String getApiKeyEncryptedValue() { return almApiKey == null || StringUtils.isBlank(almApiKey.getPlainText()) ? "" : almApiKey.getEncryptedValue(); } + public String getPasswordPlainText() { return almPassword == null ? "" : almPassword.getPlainText(); } + public String getApiKeyPlainText() { return almApiKey == null ? "" : almApiKey.getPlainText(); } + public Properties getProperties() { return CreateProperties(null, null); } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index 279c0ccca6..2d63f8c28b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -96,18 +96,9 @@ public RunFromAlmBuilder( this.isFilterTestsEnabled = isFilterTestsEnabled; this.filterTestsModel = filterTestsModel; this.almServerSettingsModel = almServerSettingsModel; - CredentialsScope almCredScope = CredentialsScope.JOB; - if (StringUtils.isBlank(almCredentialsScope)) { - if (isSSOEnabled) { - if (StringUtils.isBlank(almApiKey) && isClientIdDefinedAtSystemLevel(almServerName, almClientID)) { - almCredScope = CredentialsScope.SYSTEM; - } - } else if (StringUtils.isBlank(almPassword) && isUserNameDefinedAtSystemLevel(almServerName, almUserName)) { - almCredScope = CredentialsScope.SYSTEM; - } - } else { - almCredScope = CredentialsScope.valueOf(almCredentialsScope); - } + CredentialsScope almCredScope = StringUtils.isBlank(almCredentialsScope) ? + (((isSSOEnabled && isClientIdDefinedAtSystemLevel(almServerName, almClientID)) || (!isSSOEnabled && isUserNameDefinedAtSystemLevel(almServerName, almUserName))) ? CredentialsScope.SYSTEM : CredentialsScope.JOB) : + CredentialsScope.valueOf(almCredentialsScope); runFromAlmModel = new RunFromAlmModel( @@ -130,10 +121,9 @@ public RunFromAlmBuilder( private boolean isUserNameDefinedAtSystemLevel(String almServerName, String almUsername) { List models = Arrays.asList(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); for (AlmServerSettingsModel model : models) { - if (model.getAlmServerName().equals(almServerName)) { - if (model.getAlmCredentials().stream().anyMatch(c -> c.getAlmUsername().equals(almUsername))) { + if (model.getAlmServerName().equals(almServerName) && + model.getAlmCredentials().stream().anyMatch(c -> c.getAlmUsername().equals(almUsername))) { return true; - } } } return false; @@ -142,10 +132,9 @@ private boolean isUserNameDefinedAtSystemLevel(String almServerName, String almU private boolean isClientIdDefinedAtSystemLevel(String almServerName, String almClientId) { List models = Arrays.asList(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); for (AlmServerSettingsModel model : models) { - if (model.getAlmServerName().equals(almServerName)) { - if (model.getAlmSSOCredentials().stream().anyMatch(c -> c.getAlmClientID().equals(almClientId))) { + if (model.getAlmServerName().equals(almServerName) && + model.getAlmSSOCredentials().stream().anyMatch(c -> c.getAlmClientID().equals(almClientId))) { return true; - } } } return false; @@ -160,6 +149,7 @@ public String getAlmServerName(){ public void setIsSSOEnabled(Boolean isSSOEnabled) { runFromAlmModel.setIsSSOEnabled(isSSOEnabled);} /* This setter seems to be useless, it only seems to generate an unnecessary object in pipeline script, of type RunFromAlmModel + Also, it is already set in the constructor above @DataBoundSetter public void setRunFromAlmModel(RunFromAlmModel runFromAlmModel){ this.runFromAlmModel = runFromAlmModel; @@ -168,12 +158,12 @@ public void setRunFromAlmModel(RunFromAlmModel runFromAlmModel){ @DataBoundSetter public void setAlmServerSettingsModel(AlmServerSettingsModel almServerSettingsModel) { this.almServerSettingsModel = almServerSettingsModel; } - //NOTE most properties are used by config.jelly and also by pipeline-syntax generator - public String getAlmCredentialsScope() { return runFromAlmModel.getCredentialsScope() == null ? null : runFromAlmModel.getCredentialsScope().getValue(); } + //IMPORTANT: most properties are used by config.jelly and / or by pipeline-syntax generator + public String getAlmCredentialsScope() { return runFromAlmModel.getCredentialsScopeValue(); } public String getAlmUserName() { return runFromAlmModel.getAlmUserName(); } - public String getAlmPassword() { return runFromAlmModel.getAlmPassword() == null ? null : runFromAlmModel.getAlmPassword().getEncryptedValue(); } + public String getAlmPassword() { return runFromAlmModel.getPasswordEncryptedValue(); } public String getAlmClientID() { return runFromAlmModel.getAlmClientID(); } - public String getAlmApiKey() { return StringUtils.isBlank(runFromAlmModel.getAlmApiKey().getPlainText()) ? null : runFromAlmModel.getAlmApiKey().getEncryptedValue(); } + public String getAlmApiKey() { return runFromAlmModel.getApiKeyEncryptedValue(); } public String getAlmDomain(){ return runFromAlmModel.getAlmDomain(); @@ -253,18 +243,16 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task mergedProperties.putAll(almServerSettingsModel.getProperties()); mergedProperties.putAll(runFromAlmModel.getProperties(env, varResolver)); + CredentialsScope scope = runFromAlmModel.getCredentialsScope(); String encAlmPass = ""; try { - String almPassword = runFromAlmModel.getAlmPassword().getPlainText(); - if (runFromAlmModel.getCredentialsScope() == CredentialsScope.SYSTEM) { - List credentials = almServerSettingsModel.getAlmCredentials(); - for (CredentialsModel model : credentials) { - if (model.getAlmUsername().equals(runFromAlmModel.getAlmUserName())) { - almPassword = model.getAlmPassword(); - break; - } + String almPassword = runFromAlmModel.getPasswordPlainText(); + if (scope == CredentialsScope.SYSTEM || (scope == null && isUserNameDefinedAtSystemLevel(getAlmServerName(), getAlmUserName()))) { + Optional cred = almServerSettingsModel.getAlmCredentials().stream().filter(c -> c.getAlmUsername().equals(runFromAlmModel.getAlmUserName())).findFirst(); + if (cred.isPresent()) { + almPassword = cred.get().getAlmPassword(); } - } // else {} TODO handle the case when + } encAlmPass = EncryptionUtils.Encrypt(almPassword, EncryptionUtils.getSecretKey()); mergedProperties.remove(RunFromAlmModel.ALM_PASSWORD_KEY); @@ -276,14 +264,11 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task String encAlmApiKey = ""; try{ - String almApiKeySecret = runFromAlmModel.getAlmApiKey().getPlainText(); - if (runFromAlmModel.getCredentialsScope() == CredentialsScope.SYSTEM) { - List ssoCredentials = almServerSettingsModel.getAlmSSOCredentials(); - for(SSOCredentialsModel model : ssoCredentials){ - if(model.getAlmClientID().equals(runFromAlmModel.getAlmClientID())){ - almApiKeySecret = model.getAlmApiKeySecret(); - break; - } + String almApiKeySecret = runFromAlmModel.getApiKeyPlainText(); + if (scope == CredentialsScope.SYSTEM || (scope == null && isClientIdDefinedAtSystemLevel(getAlmServerName(), getAlmClientID()))) { + Optional cred = almServerSettingsModel.getAlmSSOCredentials().stream().filter(c -> c.getAlmClientID().equals(runFromAlmModel.getAlmClientID())).findFirst(); + if (cred.isPresent()) { + almApiKeySecret = cred.get().getAlmApiKeySecret(); } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 1d0fd60087..ca01e3c4d3 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -171,7 +171,7 @@
      - +
      @@ -189,7 +189,7 @@
      - +
      From 5bc3f85a60fb9937444647d80a57405950fe12f2 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 5 Oct 2021 22:12:05 +0300 Subject: [PATCH 1899/2502] small improvements to get more readable code --- .../tools/run/RunFromAlmBuilder.java | 37 +++++++++++-------- .../help-almCredentialsScope.html | 4 +- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index 2d63f8c28b..b97bb82dd1 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -97,8 +97,8 @@ public RunFromAlmBuilder( this.filterTestsModel = filterTestsModel; this.almServerSettingsModel = almServerSettingsModel; CredentialsScope almCredScope = StringUtils.isBlank(almCredentialsScope) ? - (((isSSOEnabled && isClientIdDefinedAtSystemLevel(almServerName, almClientID)) || (!isSSOEnabled && isUserNameDefinedAtSystemLevel(almServerName, almUserName))) ? CredentialsScope.SYSTEM : CredentialsScope.JOB) : - CredentialsScope.valueOf(almCredentialsScope); + findMostSuitableCredentialsScope(almServerName, almUserName, almClientID, isSSOEnabled) : + CredentialsScope.valueOf(almCredentialsScope); runFromAlmModel = new RunFromAlmModel( @@ -118,28 +118,35 @@ public RunFromAlmBuilder( almCredScope); } - private boolean isUserNameDefinedAtSystemLevel(String almServerName, String almUsername) { + private Optional findAlmServerSettingsModel(String serverName) { List models = Arrays.asList(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); - for (AlmServerSettingsModel model : models) { - if (model.getAlmServerName().equals(almServerName) && - model.getAlmCredentials().stream().anyMatch(c -> c.getAlmUsername().equals(almUsername))) { - return true; - } + return models.stream().filter(m -> m.getAlmServerName().equals(serverName)).findFirst(); + } + + private boolean isUserNameDefinedAtSystemLevel(String serverName, String userName) { + Optional model = findAlmServerSettingsModel(serverName); + if (model.isPresent()) { + return model.get().getAlmCredentials().stream().anyMatch(c -> c.getAlmUsername().equals(userName)); } return false; } - private boolean isClientIdDefinedAtSystemLevel(String almServerName, String almClientId) { - List models = Arrays.asList(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); - for (AlmServerSettingsModel model : models) { - if (model.getAlmServerName().equals(almServerName) && - model.getAlmSSOCredentials().stream().anyMatch(c -> c.getAlmClientID().equals(almClientId))) { - return true; - } + private boolean isClientIdDefinedAtSystemLevel(String serverName, String clientId) { + Optional model = findAlmServerSettingsModel(serverName); + if (model.isPresent()) { + return model.get().getAlmSSOCredentials().stream().anyMatch(c -> c.getAlmClientID().equals(clientId)); } return false; } + private CredentialsScope findMostSuitableCredentialsScope(String serverName, String userName, String clientId, boolean isSSOEnabled) { + if (isSSOEnabled) { + return isClientIdDefinedAtSystemLevel(serverName, clientId) ? CredentialsScope.SYSTEM : CredentialsScope.JOB; + } else { + return isUserNameDefinedAtSystemLevel(serverName, userName) ? CredentialsScope.SYSTEM : CredentialsScope.JOB; + } + } + public String getAlmServerName(){ return runFromAlmModel.getAlmServerName(); } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/help-almCredentialsScope.html b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/help-almCredentialsScope.html index 2f9ecc213f..acef73b0cf 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/help-almCredentialsScope.html +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/help-almCredentialsScope.html @@ -29,7 +29,7 @@
      Select the scope of the credentials used for connecting to the specified ALM Server:
        -
      • Use Job (local) credentials: This option implies to define the ALM credentials right here at job level.
      • -
      • Use System (global) credentials: This option allows the selection of system predefined ALM credentials.
      • +
      • Job (local) credentials: This option requires to provide the credentials right here at job level.
      • +
      • System (global) credentials: This option allows the selection of UserName or ClientID from a dropdown list with global credentials.
      \ No newline at end of file From 00c883dd69227b0daa196f7c496a64e25bd8cf52 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 5 Oct 2021 23:06:06 +0300 Subject: [PATCH 1900/2502] clean-up unused code / functions --- .../tools/run/RunFromAlmBuilder.java | 34 +++---------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index b97bb82dd1..7f6e338ac7 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -48,6 +48,7 @@ import java.text.Format; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Stream; import jenkins.tasks.SimpleBuildStep; import org.apache.commons.lang.StringUtils; @@ -119,8 +120,8 @@ public RunFromAlmBuilder( } private Optional findAlmServerSettingsModel(String serverName) { - List models = Arrays.asList(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); - return models.stream().filter(m -> m.getAlmServerName().equals(serverName)).findFirst(); + Stream models = Arrays.stream(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); + return models.filter(m -> m.getAlmServerName().equals(serverName)).findFirst(); } private boolean isUserNameDefinedAtSystemLevel(String serverName, String userName) { @@ -402,8 +403,8 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task public AlmServerSettingsModel getAlmServerSettingsModel() { for (AlmServerSettingsModel almServer : getDescriptor().getAlmServers()) { if (runFromAlmModel != null && runFromAlmModel.getAlmServerName().equals(almServer.getAlmServerName())) { - return almServer; - } + return almServer; + } } return null; @@ -457,31 +458,6 @@ public Set getAlmServerNames(){ return almServers; } - public List getAlmUsernames(String almServerName) { - List usernames = new ArrayList<>(); - Set serverList = getAlmServers(); - for (AlmServerSettingsModel model: serverList) { - if (model.getAlmCredentials().get(0).getAlmUsername() != null && model.getAlmCredentials().get(0).getAlmUsername() != "" && model.getAlmServerName().equals(almServerName)) { - usernames.add(model.getAlmCredentials().get(0).getAlmUsername()); - } - } - - return usernames; - } - public List getAlmClientIds(String almServerName) { - List clientIDList = new ArrayList<>(); - Set serverList = getAlmServers(); - for (AlmServerSettingsModel model: serverList) { - if(!model.getAlmCredentials().isEmpty() && model.getAlmServerName().equals(almServerName)){ - for(SSOCredentialsModel ssoCredentialsModel : model.getAlmSSOCredentials()) { - clientIDList.add(ssoCredentialsModel.getAlmClientID()); - } - } - } - - return clientIDList; - } - public ListBoxModel doFillAlmServerNameItems() { ListBoxModel m = new ListBoxModel(); Set serverList = getAlmServerNames(); From e92ddd95cb2d6f0090ba3e9083d5c5e980454fd1 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 6 Oct 2021 05:51:54 +0300 Subject: [PATCH 1901/2502] tech : small fixes in triggering suite runs from jenkins --- pom.xml | 2 +- .../ExecuteTestsInOctaneBuilder.java | 15 ++++++++++++--- .../ExecuteTestsInOctaneBuilder/config.jelly | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 5838a68508..658ecb0b09 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.21 + 2.7.1.22 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java index 4eb977a060..8b44ea6d76 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java @@ -57,6 +57,7 @@ import hudson.util.ListBoxModel; import jenkins.model.Jenkins; import jenkins.tasks.SimpleBuildStep; +import org.apache.commons.lang.StringUtils; import org.apache.http.HttpStatus; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; @@ -121,8 +122,16 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(myConfigurationId); TestExecutionService testExecutionService = octaneClient.getTestExecutionService(); - List suiteIds = Arrays.stream(myIds.split(",")).map(str -> Long.parseLong(str.trim())).collect(Collectors.toList()); - + List suiteIds = Arrays.stream(myIds.split(",")) + .map(str -> str.trim()).filter(str -> StringUtils.isNotEmpty(str) && StringUtils.isNumeric(str)) + .map(str -> Long.parseLong(str.trim())).distinct().collect(Collectors.toList()); + try { + testExecutionService.validateAllSuiteIdsExistAndReturnSuiteNames(myWorkspaceIdAsLong, suiteIds); + } catch (IllegalArgumentException e) { + listener.error(e.getMessage()); + build.setResult(Result.FAILURE); + return; + } ParametersAction parameterAction = build.getAction(ParametersAction.class); switch (ExecutionMode.fromValue(myExecutionMode)) { @@ -172,7 +181,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } //WAIT UNTIL ALL JOBS ARE FINISHED and set build result based on worse result - supportsConsoleLog.print("Waiting for test runners are finished ... "); + supportsConsoleLog.println("Waiting for test runners are finished ... "); Result buildResult = Result.SUCCESS; for (Map.Entry> entry : futures.entrySet()) { try { diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly index a366a5c194..401ba617b2 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder/config.jelly @@ -45,8 +45,8 @@ - + From 5a690cebed57a0216b2419c9370e8c9bc204461d Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 6 Oct 2021 09:15:42 +0300 Subject: [PATCH 1902/2502] tech : small fixes in triggering suite runs from jenkins --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 658ecb0b09..59cf4ebada 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.22 + 2.7.1.24 From c391d9b536f75724bc5e11ff425659899a9551a9 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 6 Oct 2021 13:28:41 +0300 Subject: [PATCH 1903/2502] tech : small fixes in string --- .../octane/octaneExecution/ExecuteTestsInOctaneBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java index 8b44ea6d76..079676ed69 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/octaneExecution/ExecuteTestsInOctaneBuilder.java @@ -181,7 +181,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath filePath, @Nonnu } //WAIT UNTIL ALL JOBS ARE FINISHED and set build result based on worse result - supportsConsoleLog.println("Waiting for test runners are finished ... "); + supportsConsoleLog.println("Waiting for test runners to finish ... "); Result buildResult = Result.SUCCESS; for (Map.Entry> entry : futures.entrySet()) { try { From ea73784c330f649743697abe8071148395e3a895 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 6 Oct 2021 14:14:23 +0300 Subject: [PATCH 1904/2502] improve / simplify complex functions --- .../tools/model/AlmServerSettingsModel.java | 7 +- .../tools/run/RunFromAlmBuilder.java | 270 ++++++++---------- 2 files changed, 124 insertions(+), 153 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/AlmServerSettingsModel.java b/src/main/java/com/microfocus/application/automation/tools/model/AlmServerSettingsModel.java index 3e2990a127..72017ef7ff 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/AlmServerSettingsModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/AlmServerSettingsModel.java @@ -42,7 +42,7 @@ import javax.annotation.Nonnull; -public class AlmServerSettingsModel extends AbstractDescribableImpl { +public class AlmServerSettingsModel extends AbstractDescribableImpl implements Comparable{ private final String _almServerName; private final String _almServerUrl; @@ -112,6 +112,11 @@ public Properties getProperties() { return prop; } + @Override + public int compareTo(AlmServerSettingsModel model) { + return _almServerName.compareTo(model._almServerName); + } + @Extension public static class DescriptorImpl extends Descriptor { diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index 7f6e338ac7..c2d6715557 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -92,14 +92,14 @@ public RunFromAlmBuilder( boolean isSSOEnabled, boolean isFilterTestsEnabled, FilterTestsModel filterTestsModel, - AlmServerSettingsModel almServerSettingsModel){ + AlmServerSettingsModel almServerSettingsModel) { this.isFilterTestsEnabled = isFilterTestsEnabled; this.filterTestsModel = filterTestsModel; this.almServerSettingsModel = almServerSettingsModel; CredentialsScope almCredScope = StringUtils.isBlank(almCredentialsScope) ? - findMostSuitableCredentialsScope(almServerName, almUserName, almClientID, isSSOEnabled) : - CredentialsScope.valueOf(almCredentialsScope); + findMostSuitableCredentialsScope(almServerName, almUserName, almClientID, isSSOEnabled) : + CredentialsScope.valueOf(almCredentialsScope.toUpperCase()); runFromAlmModel = new RunFromAlmModel( @@ -119,23 +119,23 @@ public RunFromAlmBuilder( almCredScope); } - private Optional findAlmServerSettingsModel(String serverName) { + private AlmServerSettingsModel findAlmServerSettingsModel(String serverName) { Stream models = Arrays.stream(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); - return models.filter(m -> m.getAlmServerName().equals(serverName)).findFirst(); + return models.filter(m -> m.getAlmServerName().equals(serverName)).findFirst().orElse(null); } private boolean isUserNameDefinedAtSystemLevel(String serverName, String userName) { - Optional model = findAlmServerSettingsModel(serverName); - if (model.isPresent()) { - return model.get().getAlmCredentials().stream().anyMatch(c -> c.getAlmUsername().equals(userName)); + AlmServerSettingsModel model = findAlmServerSettingsModel(serverName); + if (model != null) { + return model.getAlmCredentials().stream().anyMatch(c -> c.getAlmUsername().equals(userName)); } return false; } private boolean isClientIdDefinedAtSystemLevel(String serverName, String clientId) { - Optional model = findAlmServerSettingsModel(serverName); - if (model.isPresent()) { - return model.get().getAlmSSOCredentials().stream().anyMatch(c -> c.getAlmClientID().equals(clientId)); + AlmServerSettingsModel model = findAlmServerSettingsModel(serverName); + if (model != null) { + return model.getAlmSSOCredentials().stream().anyMatch(c -> c.getAlmClientID().equals(clientId)); } return false; } @@ -148,13 +148,17 @@ private CredentialsScope findMostSuitableCredentialsScope(String serverName, Str } } - public String getAlmServerName(){ + public String getAlmServerName() { return runFromAlmModel.getAlmServerName(); } - public boolean getIsSSOEnabled() { return runFromAlmModel.isSSOEnabled(); } + public boolean getIsSSOEnabled() { + return runFromAlmModel.isSSOEnabled(); + } - public void setIsSSOEnabled(Boolean isSSOEnabled) { runFromAlmModel.setIsSSOEnabled(isSSOEnabled);} + public void setIsSSOEnabled(Boolean isSSOEnabled) { + runFromAlmModel.setIsSSOEnabled(isSSOEnabled); + } /* This setter seems to be useless, it only seems to generate an unnecessary object in pipeline script, of type RunFromAlmModel Also, it is already set in the constructor above @@ -164,38 +168,56 @@ public void setRunFromAlmModel(RunFromAlmModel runFromAlmModel){ }*/ @DataBoundSetter - public void setAlmServerSettingsModel(AlmServerSettingsModel almServerSettingsModel) { this.almServerSettingsModel = almServerSettingsModel; } + public void setAlmServerSettingsModel(AlmServerSettingsModel almServerSettingsModel) { + this.almServerSettingsModel = almServerSettingsModel; + } //IMPORTANT: most properties are used by config.jelly and / or by pipeline-syntax generator - public String getAlmCredentialsScope() { return runFromAlmModel.getCredentialsScopeValue(); } - public String getAlmUserName() { return runFromAlmModel.getAlmUserName(); } - public String getAlmPassword() { return runFromAlmModel.getPasswordEncryptedValue(); } - public String getAlmClientID() { return runFromAlmModel.getAlmClientID(); } - public String getAlmApiKey() { return runFromAlmModel.getApiKeyEncryptedValue(); } + public String getAlmCredentialsScope() { + return runFromAlmModel.getCredentialsScopeValue(); + } + + public String getAlmUserName() { + return runFromAlmModel.getAlmUserName(); + } + + public String getAlmPassword() { + return runFromAlmModel.getPasswordEncryptedValue(); + } - public String getAlmDomain(){ + public String getAlmClientID() { + return runFromAlmModel.getAlmClientID(); + } + + public String getAlmApiKey() { + return runFromAlmModel.getApiKeyEncryptedValue(); + } + + public String getAlmDomain() { return runFromAlmModel.getAlmDomain(); } - public String getAlmProject(){ + public String getAlmProject() { return runFromAlmModel.getAlmProject(); } - public String getAlmTestSets(){ + public String getAlmTestSets() { return runFromAlmModel.getAlmTestSets(); } - public String getAlmRunResultsMode(){ + public String getAlmRunResultsMode() { return runFromAlmModel.getAlmRunResultsMode(); } - public String getAlmTimeout(){ + public String getAlmTimeout() { return runFromAlmModel.getAlmTimeout(); } - public String getAlmRunMode(){ return runFromAlmModel.getAlmRunMode(); } + public String getAlmRunMode() { + return runFromAlmModel.getAlmRunMode(); + } - public String getAlmRunHost(){ + public String getAlmRunHost() { return runFromAlmModel.getAlmRunHost(); } @@ -204,7 +226,9 @@ public boolean getIsFilterTestsEnabled() { } @DataBoundSetter - public void setIsFilterTestsEnabled(boolean isFilterTestsEnabled) { this.isFilterTestsEnabled = isFilterTestsEnabled; } + public void setIsFilterTestsEnabled(boolean isFilterTestsEnabled) { + this.isFilterTestsEnabled = isFilterTestsEnabled; + } public FilterTestsModel getFilterTestsModel() { return filterTestsModel; @@ -226,13 +250,13 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task // get the alm server settings AlmServerSettingsModel almServerSettingsModel = getAlmServerSettingsModel(); - + if (almServerSettingsModel == null) { listener.fatalError("An ALM server is not defined. Go to Manage Jenkins->Configure System and define your ALM server under Application Lifecycle Management"); - + // set pipeline stage as failure in case if ALM server was not configured build.setResult(Result.FAILURE); - + return; } @@ -244,7 +268,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task e2.printStackTrace(); } VariableResolver varResolver = new VariableResolver.ByMap(build.getEnvironment(listener)); - + // now merge them into one list Properties mergedProperties = new Properties(); @@ -262,7 +286,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task } } encAlmPass = EncryptionUtils.Encrypt(almPassword, EncryptionUtils.getSecretKey()); - + mergedProperties.remove(RunFromAlmModel.ALM_PASSWORD_KEY); mergedProperties.put(RunFromAlmModel.ALM_PASSWORD_KEY, encAlmPass); } catch (Exception e) { @@ -271,7 +295,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task } String encAlmApiKey = ""; - try{ + try { String almApiKeySecret = runFromAlmModel.getApiKeyPlainText(); if (scope == CredentialsScope.SYSTEM || (scope == null && isClientIdDefinedAtSystemLevel(getAlmServerName(), getAlmClientID()))) { Optional cred = almServerSettingsModel.getAlmSSOCredentials().stream().filter(c -> c.getAlmClientID().equals(runFromAlmModel.getAlmClientID())).findFirst(); @@ -284,21 +308,21 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task mergedProperties.remove(RunFromAlmModel.ALM_API_KEY_SECRET); mergedProperties.put(RunFromAlmModel.ALM_API_KEY_SECRET, encAlmApiKey); mergedProperties.put("almClientID", getAlmClientID()); - }catch (Exception e) { + } catch (Exception e) { build.setResult(Result.FAILURE); listener.fatalError("problem with apiKey encryption"); } - if(isFilterTestsEnabled){ + if (isFilterTestsEnabled) { filterTestsModel.addProperties(mergedProperties); } else { mergedProperties.put("FilterTests", "false"); } - + Date now = new Date(); Format formatter = new SimpleDateFormat("ddMMyyyyHHmmssSSS"); String time = formatter.format(now); - + // get a unique filename for the params file ParamFileName = "props" + time + ".txt"; ResultFilename = "Results" + time + ".xml"; @@ -313,7 +337,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task mergedProperties.put("runType", RunType.Alm.toString()); mergedProperties.put("resultsFilename", ResultFilename); - + // get properties serialized into a stream ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { @@ -325,10 +349,10 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task } String propsSerialization = stream.toString(); InputStream propsStream = IOUtils.toInputStream(propsSerialization); - + // get the remote workspace filesys FilePath projectWS = workspace; - + // Get the URL to the Script used to run the test, which is bundled // in the plugin @@ -381,32 +405,29 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task // TODO Auto-generated catch block e1.printStackTrace(); }*/ - - try { - AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); - } catch (IOException e1) { - Util.displayIOException(e1, listener); - build.setResult(Result.FAILURE); - return; - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - + + try { + AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); + } catch (IOException e1) { + Util.displayIOException(e1, listener); + build.setResult(Result.FAILURE); + return; + } catch (InterruptedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + out.println("Operation was aborted by user."); //build.setResult(Result.FAILURE); } return; - + } - + public AlmServerSettingsModel getAlmServerSettingsModel() { - for (AlmServerSettingsModel almServer : getDescriptor().getAlmServers()) { - if (runFromAlmModel != null && runFromAlmModel.getAlmServerName().equals(almServer.getAlmServerName())) { - return almServer; - } + if (runFromAlmModel != null) { + return findAlmServerSettingsModel(getAlmServerName()); } - return null; } @@ -420,17 +441,17 @@ public RunFromAlmModel getRunFromAlmModel() { // To expose this builder in the Snippet Generator. @Symbol("runFromAlmBuilder") public static final class DescriptorImpl extends BuildStepDescriptor { - + public DescriptorImpl() { load(); } - + @Override public boolean isApplicable( @SuppressWarnings("rawtypes") Class jobType) { return true; } - + @Override public String getDisplayName() { return RunFromAlmBuilderStepName(CompanyName()); @@ -439,62 +460,30 @@ public String getDisplayName() { public boolean hasAlmServers() { return AlmServerSettingsGlobalConfiguration.getInstance().hasAlmServers(); } - - public Set getAlmServers() { - Set almServers = new HashSet<>(); - for (AlmServerSettingsModel almServer : AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()) - { - almServers.add(almServer); - } - return almServers; + + public Stream getAlmServers() { + return Arrays.stream(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()).sorted(); } - public Set getAlmServerNames(){ - Set almServers = new HashSet<>(); - for (AlmServerSettingsModel almServer : AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()) - { - almServers.add(almServer.getAlmServerName()); - } - return almServers; + private AlmServerSettingsModel findAlmServer(String almServerName) { + return StringUtils.isBlank(almServerName) ? + getAlmServers().findFirst().orElse(null) : + getAlmServers().filter(s -> s.getAlmServerName().equals(almServerName)).findFirst().orElse(null); } public ListBoxModel doFillAlmServerNameItems() { ListBoxModel m = new ListBoxModel(); - Set serverList = getAlmServerNames(); - for(String server: serverList){ - m.add(server); - } + getAlmServers().forEachOrdered(s -> m.add(s.getAlmServerName())); return m; } public ListBoxModel doFillAlmUserNameItems(@QueryParameter String almServerName) { ListBoxModel m = new ListBoxModel(); - Set serverList = getAlmServers(); - for (AlmServerSettingsModel model: serverList) { - if (model.getAlmServerName().equals(almServerName)) { - if(!model.getAlmCredentials().isEmpty()) { - for (CredentialsModel credentialsModel : model.getAlmCredentials()) { - m.add(credentialsModel.getAlmUsername()); - } - } - } - } - if(m.size() == 0 && !StringUtils.isEmpty(almServerName)){ - m.add(UftConstants.NO_USERNAME_DEFINED); - } - - if (m.size() == 0 && StringUtils.isEmpty(almServerName)) {//new job - Set serverNames = getAlmServerNames(); - for (AlmServerSettingsModel model: serverList) { - for (String serverName : serverNames) { - if (model.getAlmServerName().equals(serverName)) { - for (CredentialsModel credentialsModel : model.getAlmCredentials()) { - m.add(credentialsModel.getAlmUsername()); - } - } - } - } - if (m.size() == 0) { + if (hasAlmServers()) { + AlmServerSettingsModel model = findAlmServer(almServerName); + if (model != null && !model.getAlmCredentials().isEmpty()) { + model.getAlmCredentials().forEach(cm -> m.add(cm.getAlmUsername())); + } else if (StringUtils.isNotBlank(almServerName)) { m.add(UftConstants.NO_USERNAME_DEFINED); } } @@ -502,39 +491,16 @@ public ListBoxModel doFillAlmUserNameItems(@QueryParameter String almServerName) return m; } - public ListBoxModel doFillAlmClientIDItems(@QueryParameter String almServerName){ + public ListBoxModel doFillAlmClientIDItems(@QueryParameter String almServerName) { ListBoxModel m = new ListBoxModel(); - Set serverList = getAlmServers(); - for (AlmServerSettingsModel model: serverList) { - if(model.getAlmServerName().equals(almServerName)){ - if(!model.getAlmSSOCredentials().isEmpty()) { - for (SSOCredentialsModel ssoCredentialsModel : model.getAlmSSOCredentials()) { - m.add(ssoCredentialsModel.getAlmClientID()); - } - } - } - } - - if(m.size() == 0 && !StringUtils.isEmpty(almServerName)){ - m.add(UftConstants.NO_CLIENT_ID_DEFINED); - } - - if (m.size() == 0 && StringUtils.isEmpty(almServerName)) {//new job - Set serverNames = getAlmServerNames(); - for (AlmServerSettingsModel model: serverList) { - for (String serverName : serverNames) { - if (model.getAlmServerName().equals(serverName)) { - for (SSOCredentialsModel ssoCredentialsModel : model.getAlmSSOCredentials()) { - m.add(ssoCredentialsModel.getAlmClientID()); - } - } - } - } - if(m.size() == 0){ + if (hasAlmServers()) { + AlmServerSettingsModel model = findAlmServer(almServerName); + if (model != null && !model.getAlmCredentials().isEmpty()) { + model.getAlmSSOCredentials().forEach(cm -> m.add(cm.getAlmClientID())); + } else { m.add(UftConstants.NO_CLIENT_ID_DEFINED); } } - return m; } @@ -543,12 +509,12 @@ public FormValidation doCheckAlmTimeout(@QueryParameter String value) { if (StringUtils.isEmpty(value)) { return FormValidation.ok(); } - + String val1 = value.trim(); - + if (val1.length() > 0 && val1.charAt(0) == '-') val1 = val1.substring(1); - + if (!StringUtils.isNumeric(val1) && !val1.equals("")) { return FormValidation.error("Timeout value must be a number"); } @@ -559,33 +525,33 @@ public FormValidation doCheckAlmDomain(@QueryParameter String value) { if (StringUtils.isBlank(value)) { return FormValidation.error("Domain must be set"); } - + return FormValidation.ok(); } - + public FormValidation doCheckAlmProject(@QueryParameter String value) { if (StringUtils.isBlank(value)) { return FormValidation.error("Project must be set"); } - + return FormValidation.ok(); } - + public FormValidation doCheckAlmTestSets(@QueryParameter String value) { if (StringUtils.isBlank(value)) { return FormValidation.error("Test sets are missing"); } - + String[] testSetsArr = value.replaceAll("\r", "").split("\n"); - for (int i=0; i < testSetsArr.length; i++) { - if (StringUtils.isBlank(testSetsArr[i])) { - return FormValidation.error("Test sets should not contains empty lines"); - } - } + for (int i = 0; i < testSetsArr.length; i++) { + if (StringUtils.isBlank(testSetsArr[i])) { + return FormValidation.error("Test sets should not contains empty lines"); + } + } return FormValidation.ok(); } - + public List getAlmRunModes() { return RunFromAlmModel.runModes; } @@ -594,7 +560,7 @@ public List getAlmCredentialScopes() { return Arrays.asList(CredentialsScope.values()); } } - + public String getRunResultsFileName() { return ResultFilename; } From 75b499d73b4aaf725e60240670416f88d021bc12 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 6 Oct 2021 17:51:39 +0300 Subject: [PATCH 1905/2502] defect #1385054 : [Testing Framework] When trigger test runner - need to pass runByuser to job --- pom.xml | 2 +- .../tools/octane/testrunner/TestsToRunConverterBuilder.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 59cf4ebada..aea4be9b27 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.24 + 2.7.1.25 diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java index 2f90efa300..ecacdbd94e 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder.java @@ -192,7 +192,9 @@ private Map getGlobalParameters(ParametersAction parameterAction SdkConstants.JobParameters.OCTANE_SPACE_PARAMETER_NAME, SdkConstants.JobParameters.OCTANE_WORKSPACE_PARAMETER_NAME, SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME, - SdkConstants.JobParameters.OCTANE_URL_PARAMETER_NAME)); + SdkConstants.JobParameters.OCTANE_URL_PARAMETER_NAME, + SdkConstants.JobParameters.OCTANE_RUN_BY_USERNAME + )); parameterAction.getAllParameters().stream() .filter(p->predefinedParams.contains(p.getName()) || p.getName().toLowerCase(Locale.ROOT).contains("octane")) From 3471a4310dc615595842a268347ff746daa910b5 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 6 Oct 2021 19:41:52 +0300 Subject: [PATCH 1906/2502] tech : update bdd test runner help --- .../octane/testrunner/TestsToRunConverterBuilder/help.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html index 5fca791d59..eecd4fd9e5 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/testrunner/TestsToRunConverterBuilder/help.html @@ -70,7 +70,7 @@ protractor conf.js --grep="$testsToRunConverted" - Cucumber-JVM over Maven + Cucumber-JVM over Maven/
      BDD Scenario mvn clean -Dcucumber.options="$testsToRunConverted" test @@ -105,7 +105,7 @@ protractor conf.js --grep="%testsToRunConverted%" - Cucumber-JVM over Maven + Cucumber-JVM over Maven/
      BDD Scenario mvn clean -Dcucumber.options="%testsToRunConverted%" test @@ -140,7 +140,7 @@ bat(/protractor conf.js --grep="${params.testsToRunConverted}"/) - Cucumber-JVM over Maven + Cucumber-JVM over Maven/
      BDD Scenario bat(/mvn clean -Dcucumber.options="${params.testsToRunConverted}" test/) From d7487f94b3d15b3fc9cf62ea4117cf6d76ba08db Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Thu, 7 Oct 2021 12:21:29 +0300 Subject: [PATCH 1907/2502] Moving final exit, else rerun tests won't be run --- HpToolsLauncher/Launcher.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index c66eda45e8..6adcc6983c 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -236,7 +236,6 @@ private static void WriteToConsole(string message) /// public void Run() { - _ciRun = true; if (_runType == TestStorageType.Unknown) Enum.TryParse(_ciParams["runType"], true, out _runType); @@ -315,6 +314,7 @@ public void Run() results.AppendResults(rerunResults); RunTests(runner, resultsFilename, results); + Environment.Exit((int)_exitCode); } } } @@ -982,9 +982,10 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul { Environment.Exit((int)_exitCode); } + } else + { + Environment.Exit((int)_exitCode); } - - Environment.Exit((int)_exitCode); } finally { From 00e681a208ed9fad26eb912e789e135874a775a3 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 7 Oct 2021 12:33:17 +0300 Subject: [PATCH 1908/2502] tech : add exception code to executeGetBulkBuildStatusRequest --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aea4be9b27..c539086d25 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.25 + 2.7.1.26 From 3a6f9e9dc47bb86db84209351d84ae197a9cfb8a Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 7 Oct 2021 13:23:47 +0300 Subject: [PATCH 1909/2502] tech : extend global parameter to global level parameter + adding custom parameters containing "octane" --- .../help-parameters.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html index a4f97e9747..1636d69ddd 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html +++ b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html @@ -108,7 +108,7 @@ ADD_GLOBAL_PARAMETERS_TO_TESTS true/false Used for UFT test runners. Use this parameter if you need to pass details of the Alm Octane to UFT tests, MTBX format will contain additional parameters, as following : - runId, suiteRunId, suiteId, octaneWorkspaceId, octaneSpaceId, octaneUrl, octaneConfigId. In addition, if your job contains other parameters that contains "octane"(case insensitive) in the name of parameter - they will be added. + runId, suiteRunId, suiteId, octaneWorkspaceId, octaneSpaceId, octaneRunByUsername, octaneUrl, octaneConfigId. In addition, if your job contains other parameters that contains "octane"(case insensitive) in the name of parameter - they will be added.
      Note : this parameter can be set also as job parameter. From 486b8695b0e01bbc5d60bc46148837acce132926 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 7 Oct 2021 16:59:29 +0300 Subject: [PATCH 1910/2502] defect #1384076 : [Execution] - Test not found should be terminate the execution process and not try to run it anyway --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c539086d25..badc49cd63 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.26 + 2.7.1.27 From 08a84ad43ec6e105d1125949e1abb0dc0f5e37b7 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Thu, 7 Oct 2021 16:59:52 +0300 Subject: [PATCH 1911/2502] tech : fix help message --- .../help-parameters.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html index 1636d69ddd..421681cb65 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html +++ b/src/main/resources/com/microfocus/application/automation/tools/settings/OctaneServerSettingsGlobalConfiguration/help-parameters.html @@ -107,11 +107,12 @@ ADD_GLOBAL_PARAMETERS_TO_TESTS true/false - Used for UFT test runners. Use this parameter if you need to pass details of the Alm Octane to UFT tests, MTBX format will contain additional parameters, as following : + Used for UFT test runners. Use this parameter if you need to pass ALM Octane details to UFT tests. These will then be used in future updates of ALM Octane entities by UFT tests (for example updating UDF fields). +
      The MTBX format will contain additional parameters, as follows: runId, suiteRunId, suiteId, octaneWorkspaceId, octaneSpaceId, octaneRunByUsername, octaneUrl, octaneConfigId. In addition, if your job contains other parameters that contains "octane"(case insensitive) in the name of parameter - they will be added.
      - Note : this parameter can be set also as job parameter. + Note that this parameter can also be set as a job parameter.
      Default is false. From b9d1cdca323a52634cf65a31b2acfc7a5a04f79c Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 11 Oct 2021 11:16:41 +0300 Subject: [PATCH 1912/2502] fix compile error --- .../automation/tools/run/RunFromAlmBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index da8fa5e7c9..d8261e1d7a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -400,13 +400,13 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task try { AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); - } catch (IOException e1) { - Util.displayIOException(e1, listener); + } catch (IOException ioe) { + Util.displayIOException(ioe, listener); build.setResult(Result.FAILURE); return; - } catch (InterruptedException e1) { + } catch (InterruptedException ie) { // TODO Auto-generated catch block - e1.printStackTrace(); + ie.printStackTrace(); } out.println("Operation was aborted by user."); From b60da63a23ccd543c37b28dac6a62260ea0cc045 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Mon, 11 Oct 2021 11:19:28 +0300 Subject: [PATCH 1913/2502] tech : update sdk , logs of MBT discovery --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index badc49cd63..80c4027fd6 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.27 + 2.7.1.28 From 4606246f07bd731e6fa42a2d649ebe6a4d849084 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 11 Oct 2021 11:28:45 +0300 Subject: [PATCH 1914/2502] revert / remove duplicate try/catch block --- .../automation/tools/run/RunFromAlmBuilder.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index d8261e1d7a..a41165873d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -397,20 +397,6 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task } catch (InterruptedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); - - try { - AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); - } catch (IOException ioe) { - Util.displayIOException(ioe, listener); - build.setResult(Result.FAILURE); - return; - } catch (InterruptedException ie) { - // TODO Auto-generated catch block - ie.printStackTrace(); - } - - out.println("Operation was aborted by user."); - //build.setResult(Result.FAILURE); } } From c969d3cc72c85a29662f3858f6c2a2ad82576dbd Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Mon, 11 Oct 2021 12:45:33 +0300 Subject: [PATCH 1915/2502] [maven-release-plugin] prepare release microfocus-application-automation-tools-plugin-7.0.7-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6f8e21ae3b..fdc90fb5e3 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.7-beta-SNAPSHOT + 7.0.7-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + microfocus-application-automation-tools-plugin-7.0.7-beta From 61632f83f0dfed5eff92e1b4ef35d223e7e2bc72 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Mon, 11 Oct 2021 12:45:46 +0300 Subject: [PATCH 1916/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fdc90fb5e3..cb7bf5b916 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.7-beta + 7.0.8-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - microfocus-application-automation-tools-plugin-7.0.7-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From b655d76bd5b1f2e852b67cfdd42b5c6ac65ea341 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 11 Oct 2021 14:27:50 +0300 Subject: [PATCH 1917/2502] DEF-643025 & DEF-522002 --- .../Properties/Resources.Designer.cs | 18 ++++ HpToolsLauncher/Properties/Resources.resx | 6 ++ HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 96 +++++++++++++++---- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 18 +--- 4 files changed, 104 insertions(+), 34 deletions(-) diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 3d2caa5b73..fd6a5bd8f5 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -150,6 +150,15 @@ internal static string AlmRunnerErrorGettingStat { } } + /// + /// Looks up a localized string similar to Invalid parameter format, check job configuration to re-configure parameter definitions for test: {0}.. + /// + internal static string AlmRunnerErrorParameterFormat { + get { + return ResourceManager.GetString("AlmRunnerErrorParameterFormat", resourceCulture); + } + } + /// /// Looks up a localized string similar to "Unable to login. Please check username and password.". /// @@ -1068,6 +1077,15 @@ internal static string MissingParameterValue { } } + /// + /// Looks up a localized string similar to Missing quotes for {0} in parameter definition.. + /// + internal static string MissingQuotesInParamFormat { + get { + return ResourceManager.GetString("MissingQuotesInParamFormat", resourceCulture); + } + } + /// /// Looks up a localized string similar to You are using an old version of QC. Please update ALM QC.. /// diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 5f66d83c61..4400407835 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -496,4 +496,10 @@ Save the test in QuickTest and then run it again. Test: {0} >> Previous state -> {1}; After update state -> {2} + + Invalid parameter format, check job configuration to re-configure parameter definitions for test: {0}. + + + Missing quotes for {0} in parameter definition. + \ No newline at end of file diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 4fe4736c61..a4790252ea 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -920,18 +920,32 @@ public bool ValidateListOfParams(string[] @params, out IList paramNames, { string[] pair = parameterPair.Split(':'); - string paramName = NormalizeParam(pair[0]); + string paramName = pair[0].Trim(); + if (!CheckParamFormat(paramName)) + { + ConsoleWriter.WriteLine(string.Format(Resources.MissingQuotesInParamFormat, "parameter name")); + return false; + } + + paramName = NormalizeParam(paramName); if (string.IsNullOrWhiteSpace(paramName)) { - Console.WriteLine(Resources.MissingParameterName); + ConsoleWriter.WriteLine(Resources.MissingParameterName); return false; } paramNames.Add(paramName); - string paramValue = NormalizeParam(pair[1]); + string paramValue = pair[1].Trim(); + if (!CheckParamFormat(paramValue)) + { + ConsoleWriter.WriteLine(string.Format(Resources.MissingQuotesInParamFormat, "parameter value")); + return false; + } + + paramValue = NormalizeParam(paramValue); if (paramValue == null) { - Console.WriteLine(Resources.MissingParameterValue); + ConsoleWriter.WriteLine(Resources.MissingParameterValue); return false; } paramValues.Add(paramValue); @@ -942,16 +956,31 @@ public bool ValidateListOfParams(string[] @params, out IList paramNames, return true; } + /// + /// + /// + /// + /// + private bool CheckParamFormat(string param) + { + // must be at least 2 characters wide, containing at least 2 double quotes + if (param.Length < 2) return false; + + // first and at last characters have to be double quotes + if (!param.StartsWith("\"") && !param.EndsWith("\"")) return false; + + return true; + } + /// - /// Normalizes test parameter + /// Normalizes test parameter, by removing the double quotes /// /// /// true if parameter is valid, false otherwise - public string NormalizeParam(string param) + private string NormalizeParam(string param) { if (!string.IsNullOrWhiteSpace(param)) { - param = param.Trim(); if (param.Length > 1) { return param.Substring(1, param.Length - 2); @@ -972,7 +1001,10 @@ private void SetApiTestParameters(ITSTest3 test, string paramsString) if (!string.IsNullOrEmpty(paramsString)) { string[] @params = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); - ValidateListOfParams(@params, out paramNames, out paramValues); + if (!ValidateListOfParams(@params, out paramNames, out paramValues)) + { + throw new ArgumentException(); + } ISupportParameterValues paramTestValues = (ISupportParameterValues)test; ParameterValueFactory parameterValueFactory = paramTestValues.ParameterValueFactory; @@ -1011,6 +1043,11 @@ private void SetGuiTestParameters(ITSTest3 test, string paramsString) } xmlParams.Append(XML_PARAMS_END_TAG); } + + if (!validParameters) + { + throw new ArgumentException(); + } } if (xmlParams.Length > 0) @@ -1152,7 +1189,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string if (testSetList == null) { ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); - UpdateTestResultsIfNonExistingTestSpecified(ref runDesc, ref activeTestDesc, initialFullTsPath); + UpdateTestResultsIfTestErrorAppearedBeforeRun(ref runDesc, ref activeTestDesc, initialFullTsPath, string.Format(Resources.AlmRunnerCantFindTest, activeTestDesc.TestPath)); return runDesc; } @@ -1171,7 +1208,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string if (targetTestSet == null) { ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); - UpdateTestResultsIfNonExistingTestSpecified(ref runDesc, ref activeTestDesc, initialFullTsPath); + UpdateTestResultsIfTestErrorAppearedBeforeRun(ref runDesc, ref activeTestDesc, initialFullTsPath, string.Format(Resources.AlmRunnerCantFindTest, activeTestDesc.TestPath)); return runDesc; } @@ -1233,8 +1270,20 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //set test parameters if (filteredTestList.Count > 0) - { - SetTestParameters(filteredTestList, testParameters, runHost, runMode, runDesc, scheduler); + { + try + { + SetTestParameters(filteredTestList, testParameters, runHost, runMode, runDesc, scheduler); + } catch (ArgumentException) + { + string message = string.Format(Resources.AlmRunnerErrorParameterFormat, initialFullTsPath); + ConsoleWriter.WriteErrLine(message); + + // this means that the user configured parameters are invalid, we should set the testset status to failed and interrupt the execution + UpdateTestResultsIfTestErrorAppearedBeforeRun(ref runDesc, ref activeTestDesc, initialFullTsPath, message); + + return runDesc; + } } // isTestPath is only true, if a specific test was given by the user @@ -1245,7 +1294,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //this will make sure run will fail at the end. (since there was an error) ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerCantFindTest, initialFullTsPath)); - UpdateTestResultsIfNonExistingTestSpecified(ref runDesc, ref activeTestDesc, initialFullTsPath); + UpdateTestResultsIfTestErrorAppearedBeforeRun(ref runDesc, ref activeTestDesc, initialFullTsPath, string.Format(Resources.AlmRunnerCantFindTest, activeTestDesc.TestPath)); return runDesc; } else if (filteredTestList.Count == 0) { @@ -1284,10 +1333,10 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string UpdateTestsResultsDescription(ref activeTestDesc, runDesc, scheduler, targetTestSet, currentTestSetInstances, timeout, executionStatus, swForTimeout, ref prevTest, ref currentTest, abortFilename); //done with all tests, stop collecting output in the testRun object. - ConsoleWriter.ActiveTestRun = null; - - string testPath; - if (isTestPath) + ConsoleWriter.ActiveTestRun = null; + + string testPath; + if (isTestPath) { testPath = string.Format(@"Root\{0}\", tsFolderName); } else @@ -1410,9 +1459,9 @@ private void updateTestResultsAfterAbort(IExecutionStatus executionStatus, ITest /// /// run results to be updated /// the non-existing test's description - /// test's folder - /// test's name - private void UpdateTestResultsIfNonExistingTestSpecified(ref TestSuiteRunResults runDesc, ref TestRunResults activeTestDesc, string tsPath) + /// + /// + private void UpdateTestResultsIfTestErrorAppearedBeforeRun(ref TestSuiteRunResults runDesc, ref TestRunResults activeTestDesc, string tsPath, string errMessage) { runDesc.NumTests++; runDesc.TotalRunTime = System.TimeSpan.Zero; @@ -1422,10 +1471,15 @@ private void UpdateTestResultsIfNonExistingTestSpecified(ref TestSuiteRunResults activeTestDesc.TestPath = tsPath; int pos = tsPath.LastIndexOf("\\", StringComparison.Ordinal) + 1; activeTestDesc.TestName = tsPath.Substring(pos); - activeTestDesc.ErrorDesc = string.Format(Resources.AlmRunnerCantFindTest, activeTestDesc.TestPath); + activeTestDesc.ErrorDesc = errMessage; activeTestDesc.FatalErrors = 1; activeTestDesc.Runtime = System.TimeSpan.Zero; + if (activeTestDesc.TestGroup == null) + { + activeTestDesc.TestGroup = tsPath; + } + runDesc.TestRuns.Add(activeTestDesc); } diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 9d5e06ad24..23b5a40737 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -747,21 +747,13 @@ private void QTPTestCleanup() var qtpTest = _qtpApplication.Test; if (qtpTest != null) { - if (_qtpApplication.GetStatus().Equals("Running") || _qtpApplication.GetStatus().Equals("Busy")) + try { - try - { - _qtpApplication.Test.Stop(); - _qtpApplication.Test.Close(); - } - catch (Exception) - { - } - finally - { - - } + _qtpApplication.Test.Stop(); + _qtpApplication.Test.Close(); } + catch (Exception) + {} } } } From 896dfdeb8947e40a04ee103ee09d35819af5ae72 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 12 Oct 2021 22:25:17 +0300 Subject: [PATCH 1918/2502] US #687022 [Jenkins][Job Level Credentials] When changing to a new ALM Server the "Username" field should be empty --- .../tools/run/RunFromAlmBuilder/config.jelly | 4 +- src/main/webapp/js/almUtils.js | 119 +++++++++--------- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index ca01e3c4d3..2a1db74602 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -123,7 +123,7 @@ - + @@ -178,7 +178,7 @@
      - + diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index 8dbb43b76a..844c7da958 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -4,69 +4,74 @@ if (window.NodeList && !NodeList.prototype.forEach) { const CredScope = {JOB : "JOB", SYSTEM : "SYSTEM"}; function setupAlmCredentials() { - setTimeout(function() { - prepareTask()}, 200); + let divMain = null; + const selector = 'div[name="builder"][descriptorid="com.microfocus.application.automation.tools.run.RunFromAlmBuilder"]'; + if (document.currentScript) { + divMain = document.currentScript.parentElement.closest(selector); + } else { // IE does not support document.currentScript + let divs = document.querySelectorAll(selector); + divMain = divs[divs.length-1]; + } + setTimeout( function() { + prepareTask(divMain)}, 200); } -function prepareTask() { - const credentialsScopeNodes = document.querySelectorAll('select[name="almCredentialsScope"]'); - const isSSOEnabledNodes = document.querySelectorAll('input[type="checkbox"][name="runfromalm.isSSOEnabled"]'); - const sysAlmUsernameNodes = document.querySelectorAll('div.sys-alm-username'); - const sysAlmClientIdNodes = document.querySelectorAll('div.sys-alm-client-id'); - const jobAlmUsernameNodes = document.querySelectorAll('div.job-alm-username'); - const jobAlmPwdNodes = document.querySelectorAll('div.job-alm-password'); - const jobAlmCIDNodes = document.querySelectorAll('div.job-alm-client-id'); - const jobAlmApiKeyNodes = document.querySelectorAll('div.job-alm-secret'); +function prepareTask(divMain) { + const lstServerName = divMain.querySelector('select.alm-server-name'); + const lstCredentialsScope = divMain.querySelector('select[name="almCredentialsScope"]'); + const chkSsoEnabled = divMain.querySelector('input[type="checkbox"][name="runfromalm.isSSOEnabled"]'); + const divSysAlmUsername = divMain.querySelector('div.sys-alm-username'); + const divSysAlmClientId = divMain.querySelector('div.sys-alm-client-id'); + const divJobAlmUsername = divMain.querySelector('div.job-alm-username'); + const divJobAlmPwd = divMain.querySelector('div.job-alm-password'); + const divJobAlmClientId = divMain.querySelector('div.job-alm-client-id'); + const divJobAlmSecret = divMain.querySelector('div.job-alm-secret'); - isSSOEnabledNodes.forEach(function(checkbox, index) { - selectCredentialsType(checkbox.checked, index, credentialsScopeNodes[index].value); - if (typeof checkbox.onclick !== "function") { - checkbox.onclick = function() { - selectCredentialsType(this.checked, index, credentialsScopeNodes[index].value); - } - } - }); - credentialsScopeNodes.forEach(function(dropdown, idx) { - credentialsScopeChanged(dropdown.value, idx); - if (typeof dropdown.onchange !== "function") { - dropdown.onchange = function() { - credentialsScopeChanged(this.value, idx); - } - } - }); + selectCredentialsType(); + if (typeof chkSsoEnabled.onclick !== "function") { + chkSsoEnabled.onclick = selectCredentialsType; + } + if (typeof lstCredentialsScope.onchange !== "function") { + lstCredentialsScope.onchange = selectCredentialsType; + } + if (typeof lstServerName.onchange !== "function") { + lstServerName.onchange = resetCredentials; + } + function selectCredentialsType() { + const isJobScope = lstCredentialsScope.value === CredScope.JOB; + const isSSO = chkSsoEnabled.checked; - function selectCredentialsType(isSSO, idx, scope) { - const isJobScope = scope === CredScope.JOB; - const jobAlmUserNode = jobAlmUsernameNodes[idx]; - const jobAlmPwdNode = jobAlmPwdNodes[idx]; - const jobAlmCIDNode = jobAlmCIDNodes[idx]; - const jobAlmApiKeyNode = jobAlmApiKeyNodes[idx]; - const sysAlmUserNode = sysAlmUsernameNodes[idx]; - const sysAlmCIDNode = sysAlmClientIdNodes[idx]; if (isJobScope) { - sysAlmUserNode.querySelector("select").name += "_x"; - sysAlmCIDNode.querySelector("select").name += "_x"; - sysAlmUsernameNodes[idx].style.display = sysAlmClientIdNodes[idx].style.display = "none"; - jobAlmUserNode.querySelector("input").name = "almUserName"; - jobAlmPwdNode.querySelector("input").name = "almPassword"; - jobAlmCIDNode.querySelector("input").name = "almClientID"; - jobAlmApiKeyNode.querySelector("input").name = "almApiKey"; - jobAlmUsernameNodes[idx].style.display = jobAlmPwdNodes[idx].style.display = isSSO ? "none" : "block"; - jobAlmCIDNodes[idx].style.display = jobAlmApiKeyNodes[idx].style.display = isSSO ? "block" : "none"; + [divSysAlmUsername, divSysAlmClientId].forEach(function(div) { div.querySelector("select").name += "_x"; div.style.display = "none"; }); + divJobAlmUsername.querySelector("input").name = "almUserName"; + divJobAlmPwd.querySelector("input").name = "almPassword"; + divJobAlmClientId.querySelector("input").name = "almClientID"; + divJobAlmSecret.querySelector("input").name = "almApiKey"; + divJobAlmUsername.style.display = divJobAlmPwd.style.display = isSSO ? "none" : "block"; + divJobAlmClientId.style.display = divJobAlmSecret.style.display = isSSO ? "block" : "none"; } else { - sysAlmUserNode.querySelector("select").name = "almUserName"; - sysAlmCIDNode.querySelector("select").name = "almClientID"; - jobAlmUserNode.querySelector("input").name += "_x"; - jobAlmCIDNode.querySelector("input").name += "_x"; - jobAlmPwdNode.querySelector("input").name += "_x"; - jobAlmApiKeyNode.querySelector("input").name += "_x"; - jobAlmUsernameNodes[idx].style.display = jobAlmPwdNodes[idx].style.display = jobAlmCIDNodes[idx].style.display = jobAlmApiKeyNodes[idx].style.display = "none"; - sysAlmUsernameNodes[idx].style.display = isSSO ? "none" : "block"; - sysAlmClientIdNodes[idx].style.display = isSSO ? "block" : "none"; + divSysAlmUsername.querySelector("select").name = "almUserName"; + divSysAlmClientId.querySelector("select").name = "almClientID"; + [divJobAlmUsername, divJobAlmPwd, divJobAlmClientId, divJobAlmSecret].forEach(function(div) { div.querySelector("input").name += "_x"; div.style.display = "none"; }); + divSysAlmUsername.style.display = isSSO ? "none" : "block"; + divSysAlmClientId.style.display = isSSO ? "block" : "none"; } } - - function credentialsScopeChanged(scope, idx) { - const isSSO = isSSOEnabledNodes[idx].checked; - selectCredentialsType(isSSO, idx, scope); + function resetCredentials() { + let evt; + try { + evt = new UIEvent("change", { "view": window, "bubbles": false, "cancelable": true }); + } catch(e) { // IE does not support UIEvent constructor + evt = document.createEvent("UIEvent"); + evt.initUIEvent("change", false, true, window, 1); + } + [divJobAlmSecret, divJobAlmPwd].forEach(function(div) { + const btnUpdate = div.querySelector("input.hidden-password-update-btn"); + btnUpdate && btnUpdate.click(); + }); + [divJobAlmClientId, divJobAlmUsername, divJobAlmSecret, divJobAlmPwd].forEach(function(div) { + const input = div.querySelector("input"); + input.value = ""; + input.dispatchEvent(evt); + }); } } From dadfd46b35da99368cf3594e1c833bc84c028545 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 12 Oct 2021 23:39:59 +0300 Subject: [PATCH 1919/2502] fix the case when add more than one ALM build step --- src/main/webapp/js/almUtils.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index 844c7da958..196ccba7be 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -1,21 +1,26 @@ if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = Array.prototype.forEach; } -const CredScope = {JOB : "JOB", SYSTEM : "SYSTEM"}; - +if (typeof CredScope == "undefined") { + CredScope = {JOB : "JOB", SYSTEM : "SYSTEM"}; +} +if (typeof RUN_FROM_ALM_BUILDER_SELECTOR == "undefined") { + RUN_FROM_ALM_BUILDER_SELECTOR = 'div[name="builder"][descriptorid="com.microfocus.application.automation.tools.run.RunFromAlmBuilder"]'; +} function setupAlmCredentials() { let divMain = null; - const selector = 'div[name="builder"][descriptorid="com.microfocus.application.automation.tools.run.RunFromAlmBuilder"]'; - if (document.currentScript) { - divMain = document.currentScript.parentElement.closest(selector); - } else { // IE does not support document.currentScript - let divs = document.querySelectorAll(selector); - divMain = divs[divs.length-1]; + if (document.currentScript) { // this block is used for non-IE browsers, for the first ALM build step only, it finds very fast the parent DIV (containing all ALM controls) + divMain = document.currentScript.parentElement.closest(RUN_FROM_ALM_BUILDER_SELECTOR); } setTimeout( function() { prepareTask(divMain)}, 200); } function prepareTask(divMain) { + if (divMain == null) { // this block is needed for IE, but also for non-IE browsers when adding more than one ALM build step + let divs = document.querySelectorAll(RUN_FROM_ALM_BUILDER_SELECTOR); + divMain = divs[divs.length-1]; + } + const lstServerName = divMain.querySelector('select.alm-server-name'); const lstCredentialsScope = divMain.querySelector('select[name="almCredentialsScope"]'); const chkSsoEnabled = divMain.querySelector('input[type="checkbox"][name="runfromalm.isSSOEnabled"]'); From ae31530a58da73e4846886920aa35558b1b9f39c Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 13 Oct 2021 11:26:53 +0300 Subject: [PATCH 1920/2502] DEF-688030 [Jenkins][Credentials] Change the information regarding the Credentials storage in Jenkins for ALM --- .../automation/tools/run/RunFromAlmBuilder/config.jelly | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 2a1db74602..4ba649c206 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -113,9 +113,7 @@
      - The credentials for "Run from ALM" tasks have been moved to Jenkins Configure System page. In order to update them please create a new project, add as a - "Post build action" in the configuration page the action called "Migrate ALM Credentials" and run the job. - In case migration process was accomplished, please add/edit credentials in global configuration page. + The credentials for "Run from ALM" can be configured at global level from Jenkins Configure System page, or at job level for each job.
      From 9eed76d95eff0e72211974d52eda2754a518fc78 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 13 Oct 2021 11:47:31 +0300 Subject: [PATCH 1921/2502] tech : shortening enricher error message --- .../tools/octane/model/processors/scm/GitSCMProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java index 5875bf7e87..87681ca829 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/model/processors/scm/GitSCMProcessor.java @@ -111,7 +111,7 @@ private SCMData enrichLinesOnSCMData(SCMData scmData, AbstractBuild build) { logger.warn("Line enricher: workspace is null"); } } catch (Exception e1) { - logger.error("Line enricher: FAILED. could not enrich lines on SCM Data ", e1); + logger.error("Line enricher: FAILED. could not enrich lines on SCM Data : " + e1.getMessage()); } return scmData; } From 16f3a3d7b02fddffd6374b2ad0e6bb8cd63a5b74 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Wed, 13 Oct 2021 11:47:57 +0300 Subject: [PATCH 1922/2502] small fix for MBT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 80c4027fd6..4a7f86b61f 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.28 + 2.7.1.29 From ca956354a25c7ccb234e8a3e25926e587b0228fb Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 13 Oct 2021 13:25:20 +0300 Subject: [PATCH 1923/2502] DEF-687031 [Jenkins][Credentials] Message that the credentials for ALM are not defined in System Config is not required --- .../AlmServerSettingsGlobalConfiguration.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java b/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java index e29ae2edc4..66ab551ade 100644 --- a/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java +++ b/src/main/java/com/microfocus/application/automation/tools/settings/AlmServerSettingsGlobalConfiguration.java @@ -89,7 +89,6 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc jsonArray.addAll((JSONArray) data); } - for (Object jsonObject : jsonArray) { JSONObject json = (JSONObject) jsonObject; Object credentialsObj = json.get("credentials"); @@ -149,13 +148,6 @@ public FormValidation doCheckAlmServerName(@QueryParameter String value) { return FormValidation.error("ALM server name cannot be empty"); } - List models = Arrays.asList(getInstallations()); - for (AlmServerSettingsModel model : models) { - if (model.getAlmServerName().equals(value) && model.getAlmCredentials().isEmpty() && model.getAlmSSOCredentials().isEmpty()) { - return FormValidation.error("Alm server does not have credentials defined"); - } - } - return FormValidation.ok(); } @@ -201,7 +193,6 @@ private FormValidation checkQcServerURL(String value, Boolean acceptEmpty) { return FormValidation.ok(); } - public FormValidation doCheckAlmUsername(@QueryParameter String value) { if (StringUtils.isBlank(value)) { return FormValidation.error("Username must be set"); @@ -218,16 +209,7 @@ public FormValidation doCheckAlmClientID(@QueryParameter String value) { return FormValidation.ok(); } - @SuppressWarnings("unused") - private FormValidation doCheckAlmCredentials(@QueryParameter List almCredentials) { - if (almCredentials.isEmpty()) { - return FormValidation.error("Am server does not have credentials defined"); - } - return FormValidation.ok(); - } - public Boolean hasAlmServers() { return installations.length > 0; } - } From c86c38efc38cc743a46d95e498960e3ab1226c2c Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 13 Oct 2021 17:34:38 +0300 Subject: [PATCH 1924/2502] DEF-687031 get rid of Jenkins warnings related to password textboxes by using a backed field of type hudson.util.Secret instead of String --- .../automation/tools/model/CredentialsModel.java | 6 ++++-- .../automation/tools/model/SSOCredentialsModel.java | 7 +++++-- .../automation/tools/run/RunFromAlmBuilder.java | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/model/CredentialsModel.java b/src/main/java/com/microfocus/application/automation/tools/model/CredentialsModel.java index 7d76b93164..063cc9cc68 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/CredentialsModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/CredentialsModel.java @@ -52,10 +52,12 @@ public String getAlmUsername(){ return almUsername; } - public String getAlmPassword(){ + public Secret getAlmPassword(){ + return almPassword; + } + public String getAlmPasswordPlainText(){ return almPassword.getPlainText(); } - @Extension public static class DescriptorImpl extends Descriptor { @Nonnull diff --git a/src/main/java/com/microfocus/application/automation/tools/model/SSOCredentialsModel.java b/src/main/java/com/microfocus/application/automation/tools/model/SSOCredentialsModel.java index 5db0f7834f..8fa665df19 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/SSOCredentialsModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/SSOCredentialsModel.java @@ -51,10 +51,13 @@ public String getAlmClientID(){ return almClientID; } - public String getAlmApiKeySecret(){ - return almApiKeySecret.getPlainText(); + public Secret getAlmApiKeySecret(){ + return almApiKeySecret; } + public String getAlmApiKeySecretPlainText(){ + return almApiKeySecret.getPlainText(); + } @Extension public static class DescriptorImpl extends Descriptor { @Nonnull diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index a41165873d..a9c9c91a42 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -282,7 +282,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task if (scope == CredentialsScope.SYSTEM || (scope == null && isUserNameDefinedAtSystemLevel(getAlmServerName(), getAlmUserName()))) { Optional cred = almServerSettingsModel.getAlmCredentials().stream().filter(c -> c.getAlmUsername().equals(runFromAlmModel.getAlmUserName())).findFirst(); if (cred.isPresent()) { - almPassword = cred.get().getAlmPassword(); + almPassword = cred.get().getAlmPasswordPlainText(); } } encAlmPass = EncryptionUtils.Encrypt(almPassword, EncryptionUtils.getSecretKey()); @@ -300,7 +300,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task if (scope == CredentialsScope.SYSTEM || (scope == null && isClientIdDefinedAtSystemLevel(getAlmServerName(), getAlmClientID()))) { Optional cred = almServerSettingsModel.getAlmSSOCredentials().stream().filter(c -> c.getAlmClientID().equals(runFromAlmModel.getAlmClientID())).findFirst(); if (cred.isPresent()) { - almApiKeySecret = cred.get().getAlmApiKeySecret(); + almApiKeySecret = cred.get().getAlmApiKeySecretPlainText(); } } From da6706b89cc1079a53bcc780103b816279af8406 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 17 Oct 2021 16:22:35 +0300 Subject: [PATCH 1925/2502] tech : adding additional log for outdated gherkin file --- .../actions/cucumber/CucumberTestResultsAction.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java index 6dabc8b849..e654b84480 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java @@ -36,6 +36,8 @@ import hudson.model.TaskListener; import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; /** * Created by franksha on 07/12/2016. @@ -61,7 +63,12 @@ public boolean copyResultsToBuildFolder(Run run, FilePath workspace) { if (run.getStartTimeInMillis() < resultFile.lastModified()) { CucumberResultsService.copyResultFile(resultFile, build.getRootDir(), workspace); } else { - CucumberResultsService.log("Found outdated file %s", resultFile.getPath()); + String pattern = "yyyy-MM-dd HH:mm:ss"; + SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); + + CucumberResultsService.log("Found outdated file %s, build started at %s (%s), while file last update time is %s (%s) ", + resultFile.getPath(), dateFormat.format(new Date(run.getStartTimeInMillis())), String.valueOf(run.getStartTimeInMillis()), + dateFormat.format(new Date(resultFile.lastModified())), String.valueOf(resultFile.lastModified())); } } From 69c03fcb40e1001bf58b2afa5c647a1799261b6f Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Sun, 17 Oct 2021 16:23:08 +0300 Subject: [PATCH 1926/2502] tech : fix sdk , related to Fortify feature --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a7f86b61f..32414ed3a4 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.1.29 + 2.7.1.30 From 3b7171dc15406bdbb3c9289d3fa6428727a37611 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 18 Oct 2021 13:52:30 +0300 Subject: [PATCH 1927/2502] DEF 693015 - [Jenkins][Credentials][Pipeline] All the fields are displayed and they are not changing accordingly (global/job) --- src/main/webapp/js/almUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/js/almUtils.js b/src/main/webapp/js/almUtils.js index 196ccba7be..f9fe6dcb67 100644 --- a/src/main/webapp/js/almUtils.js +++ b/src/main/webapp/js/almUtils.js @@ -9,7 +9,9 @@ if (typeof RUN_FROM_ALM_BUILDER_SELECTOR == "undefined") { } function setupAlmCredentials() { let divMain = null; - if (document.currentScript) { // this block is used for non-IE browsers, for the first ALM build step only, it finds very fast the parent DIV (containing all ALM controls) + if (document.location.href.indexOf("pipeline-syntax")>0) { // we are on pipeline-syntax page, where runFromAlmBuilder step can be selected only once, so it's ok to use document + divMain = document; + } else if (document.currentScript) { // this block is used for non-IE browsers, for the first ALM build step only, it finds very fast the parent DIV (containing all ALM controls) divMain = document.currentScript.parentElement.closest(RUN_FROM_ALM_BUILDER_SELECTOR); } setTimeout( function() { From 40651c37764141e78c14c26baaf58d37c009b4de Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 18 Oct 2021 16:11:20 +0300 Subject: [PATCH 1928/2502] DEF 694020 [Jenkins][Global] CliendID won't be displayed in the drop down list --- .../application/automation/tools/run/RunFromAlmBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index a9c9c91a42..e1bac4f315 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -474,7 +474,7 @@ public ListBoxModel doFillAlmClientIDItems(@QueryParameter String almServerName) ListBoxModel m = new ListBoxModel(); if (hasAlmServers()) { AlmServerSettingsModel model = findAlmServer(almServerName); - if (model != null && !model.getAlmCredentials().isEmpty()) { + if (model != null && !model.getAlmSSOCredentials().isEmpty()) { model.getAlmSSOCredentials().forEach(cm -> m.add(cm.getAlmClientID())); } else { m.add(UftConstants.NO_CLIENT_ID_DEFINED); From 8c78cce94a0e7ce4dc06266bbe04b560b5c2b6f7 Mon Sep 17 00:00:00 2001 From: Radislav Berkovich Date: Tue, 19 Oct 2021 06:52:57 +0300 Subject: [PATCH 1929/2502] tech : for some reason , on some linux machines last modified time for newly create gherkin result file is 0 - lets consider it as valid --- .../octane/actions/cucumber/CucumberTestResultsAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java index e654b84480..2bcbf3eff5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/actions/cucumber/CucumberTestResultsAction.java @@ -60,7 +60,8 @@ public boolean copyResultsToBuildFolder(Run run, FilePath workspace) { for (String fileName : files) { File resultFile = new File(workspace.child(fileName).toURI()); - if (run.getStartTimeInMillis() < resultFile.lastModified()) { + if (resultFile.lastModified() == 0 || run.getStartTimeInMillis() < resultFile.lastModified()) { + // for some reason , on some linux machines last modified time for newly create gherkin result file is 0 - lets consider it as valid CucumberResultsService.copyResultFile(resultFile, build.getRootDir(), workspace); } else { String pattern = "yyyy-MM-dd HH:mm:ss"; From 6348c17d3e67168394c4e81fc1ffed0a884c99a3 Mon Sep 17 00:00:00 2001 From: _alm_tc_auto <_alm_tc_auto@swinfra.net> Date: Tue, 19 Oct 2021 11:36:50 +0300 Subject: [PATCH 1930/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.0.8-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dae73ce043..f60f013643 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.8-beta-SNAPSHOT + 7.0.8-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.0.8-beta From 81dcebf6af967bb377b670fcde2050e89af40806 Mon Sep 17 00:00:00 2001 From: _alm_tc_auto <_alm_tc_auto@swinfra.net> Date: Tue, 19 Oct 2021 11:36:59 +0300 Subject: [PATCH 1931/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f60f013643..cabeb47b4d 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.0.8-beta + 7.0.9-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.0.8-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From e8ed8226f190ce8bb3ca6408ad76ac029664c929 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 19 Oct 2021 15:18:52 +0300 Subject: [PATCH 1932/2502] 693027 [Jenkins][Credentials][Upgrade] After the upgrade to the latest plugin the Credential Scope is changed to Job credentials --- .../automation/tools/run/RunFromAlmBuilder.java | 13 ++++++++++--- .../tools/run/RunFromAlmBuilder/config.jelly | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index e1bac4f315..6238cdb2c7 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -119,6 +119,13 @@ public RunFromAlmBuilder( almCredScope); } + public CredentialsScope getCredentialsScopeOrDefault() { + CredentialsScope scope = runFromAlmModel.getCredentialsScope(); + return scope == null ? + findMostSuitableCredentialsScope(getAlmServerName(), getAlmUserName(), getAlmClientID(), getIsSSOEnabled()) : + scope; + } + private AlmServerSettingsModel findAlmServerSettingsModel(String serverName) { Stream models = Arrays.stream(AlmServerSettingsGlobalConfiguration.getInstance().getInstallations()); return models.filter(m -> m.getAlmServerName().equals(serverName)).findFirst().orElse(null); @@ -275,11 +282,11 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task mergedProperties.putAll(almServerSettingsModel.getProperties()); mergedProperties.putAll(runFromAlmModel.getProperties(env, varResolver)); - CredentialsScope scope = runFromAlmModel.getCredentialsScope(); + CredentialsScope scope = getCredentialsScopeOrDefault(); String encAlmPass = ""; try { String almPassword = runFromAlmModel.getPasswordPlainText(); - if (scope == CredentialsScope.SYSTEM || (scope == null && isUserNameDefinedAtSystemLevel(getAlmServerName(), getAlmUserName()))) { + if (scope == CredentialsScope.SYSTEM) { Optional cred = almServerSettingsModel.getAlmCredentials().stream().filter(c -> c.getAlmUsername().equals(runFromAlmModel.getAlmUserName())).findFirst(); if (cred.isPresent()) { almPassword = cred.get().getAlmPasswordPlainText(); @@ -297,7 +304,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task String encAlmApiKey = ""; try { String almApiKeySecret = runFromAlmModel.getApiKeyPlainText(); - if (scope == CredentialsScope.SYSTEM || (scope == null && isClientIdDefinedAtSystemLevel(getAlmServerName(), getAlmClientID()))) { + if (scope == CredentialsScope.SYSTEM) { Optional cred = almServerSettingsModel.getAlmSSOCredentials().stream().filter(c -> c.getAlmClientID().equals(runFromAlmModel.getAlmClientID())).findFirst(); if (cred.isPresent()) { almApiKeySecret = cred.get().getAlmApiKeySecretPlainText(); diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index 4ba649c206..c50cdc7ce8 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -124,12 +124,13 @@ + -
      -
      - -
      -
      - -
      -
      - -
      - - - - - -
    • - `; - - parametersContainer.insertAdjacentHTML("beforeend", elem); - - const typeField = document.querySelector(`#parameterInputType${nextIdx}`); - const valueField = document.querySelector(`#parameterInputValue${nextIdx}`); - - typeField.addEventListener("change", () => { - valueField.value = ""; - valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); - }); - - startListenersForParameterInputs(); - } - - function deleteParameter(e) { - this.parentNode.remove(); - startListenersForParameterInputs(); - generateAndPutJSONResult(); - } - - const mapForTypeAssociations = { - String: 'text', - Number: 'number', - Boolean: 'checkbox', - Password: 'password', - Date: 'date', - Any: 'text' - }; - - function loadParameterInputs() { - const parameterResultStr = document.getElementsByName("fsParameterJson")[0]; - - if (parameterResultStr.value === "") return; - - const json = JSON.parse(parameterResultStr.value); - - for (let i = 0; i < json.length; ++i) addNewParameter(); - - const parameters = document.getElementsByName("fsTestParameter"); - - for (let i = 0; i < json.length; ++i) { - const currElem = parameters[i]; - const currElemVal = json[i]; - - currElem.querySelector(`#parameterInputRow${currElem.dataset.index}`).value = currElemVal["index"] || 1; - currElem.querySelector(`#parameterInputName${currElem.dataset.index}`).value = currElemVal["name"] || ""; - const valueField = currElem.querySelector(`#parameterInputValue${currElem.dataset.index}`) - const typeField = currElem.querySelector(`#parameterInputType${currElem.dataset.index}`); - typeField.value = currElemVal["type"] || "String"; - - valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); - if (typeField.value === "Boolean") { - valueField.checked = currElemVal["value"] || false; - } else if (typeField.value === "Date") { - const date = new Date(currElemVal["value"].split("/").reverse().join("-")) || Date.now(); - valueField.value = `${date.getFullYear()}-${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)}-${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}`; - } else { - valueField.value = currElemVal["value"] || ""; - } - } - } - - function addToSelectableTypeList(type) { - selectableTypeList += ``; } \ No newline at end of file diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js new file mode 100644 index 0000000000..247446b84d --- /dev/null +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -0,0 +1,207 @@ +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ___________________________________________________________________ + */ + +// holder, which contain all the valid parameter input types +let selectableTypeList = ''; + +function startListenersForParameterInputs() { + const inputs = document.getElementsByName("testParameter"); + if (inputs) { + inputs.forEach(elem => elem.addEventListener("change", generateAndPutJSONResult)); + } else { + console.warn("Test parameter input fields are missing."); + } + + const delBtns = document.getElementsByName("delParameter"); + if (delBtns) { + delBtns.forEach(elem => elem.addEventListener("click", deleteParameter)); + } else { + console.warn("Delete buttons for input fields are missing."); + } + + let testInput = document.getElementsByName("runfromfs.fsTests")[0] || document.getElementsByName("runfromalm.almTestSets")[0]; + if (testInput) { + const rowInputs = document.querySelectorAll(".testParameter > div > input[type='number']"); + rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); + + testInput.addEventListener("change", () => { + const rowInputs = document.querySelectorAll(".testParameter > div > input[type='number']"); + rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); + }); + } else { + console.warn("Test input text area is missing."); + } +} + +function startListenerForParameterBlock() { + let specifyParametersCheckbox = document.getElementsByName("areParametersEnabled"); + + if (specifyParametersCheckbox) { + specifyParametersCheckbox = specifyParametersCheckbox[0]; + specifyParametersCheckbox.addEventListener("click", cleanParameterInput); + } +} + +function generateAndPutJSONResult() { + const inputs = document.getElementsByName("testParameter"); + let inputJSON = []; + const parameterResultStr = document.getElementsByName("parameterJson")[0]; + + if (parameterResultStr.length === 0) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + + inputs.forEach(elem => { + let curr = {}; + const testIdx = curr["index"] = elem.querySelector(`#parameterInputRow${elem.dataset.index}`).value; + const name = curr["name"] = elem.querySelector(`#parameterInputName${elem.dataset.index}`).value; + + if (name !== "") { + curr["type"] = elem.querySelector(`#parameterInputType${elem.dataset.index}`).value; + + const val = elem.querySelector(`#parameterInputValue${elem.dataset.index}`); + if (curr["type"] === "Boolean") { + curr["value"] = val.checked; + } else if (curr["type"] === "Date") { + const date = new Date(val.value); + curr["value"] = `${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}/${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth()}/${date.getFullYear()}`; + } else { + curr["value"] = val.value; + } + + inputJSON.push(curr); + } + }); + + parameterResultStr.value = JSON.stringify(inputJSON); +} + +function cleanParameterInput() { + if (this.checked) { + loadParameterInputs(); + } else { + const parameterResultStr = document.getElementsByName("parameterJson")[0]; + parameterResultStr.value = JSON.stringify([]); + } +} + +function addNewParameter() { + const parametersContainer = document.querySelector("ul[name='testParameters']"); + const parameters = document.getElementsByName("testParameter") || []; + const nextIdx = parameters.length !== 0 ? parseInt(Array.from(parameters).reduce((prev, curr) => { + if (parseInt(prev.dataset.index) > parseInt(curr.dataset.index)) return prev; + + return curr; + }).dataset.index) + 1 : 1; + + const elem = ` +
    • +
      + +
      +
      + +
      +
      + +
      +
      + +
      + + + + + +
    • + `; + + parametersContainer.insertAdjacentHTML("beforeend", elem); + + const typeField = document.querySelector(`#parameterInputType${nextIdx}`); + const valueField = document.querySelector(`#parameterInputValue${nextIdx}`); + + typeField.addEventListener("change", () => { + valueField.value = ""; + valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); + }); + + startListenersForParameterInputs(); +} + +function deleteParameter(e) { + this.parentNode.remove(); + startListenersForParameterInputs(); + generateAndPutJSONResult(); +} + +const mapForTypeAssociations = { + String: 'text', + Number: 'number', + Boolean: 'checkbox', + Password: 'password', + Date: 'date', + Any: 'text' +}; + +function loadParameterInputs() { + const parameterResultStr = document.getElementsByName("parameterJson")[0]; + + if (parameterResultStr.value === "") return; + + const json = JSON.parse(parameterResultStr.value); + + for (let i = 0; i < json.length; ++i) addNewParameter(); + + const parameters = document.getElementsByName("testParameter"); + + for (let i = 0; i < json.length; ++i) { + const currElem = parameters[i]; + const currElemVal = json[i]; + + currElem.querySelector(`#parameterInputRow${currElem.dataset.index}`).value = currElemVal["index"] || 1; + currElem.querySelector(`#parameterInputName${currElem.dataset.index}`).value = currElemVal["name"] || ""; + const valueField = currElem.querySelector(`#parameterInputValue${currElem.dataset.index}`) + const typeField = currElem.querySelector(`#parameterInputType${currElem.dataset.index}`); + typeField.value = currElemVal["type"] || "String"; + + valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); + if (typeField.value === "Boolean") { + valueField.checked = currElemVal["value"] || false; + } else if (typeField.value === "Date") { + const date = new Date(currElemVal["value"].split("/").reverse().join("-")) || Date.now(); + valueField.value = `${date.getFullYear()}-${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)}-${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}`; + } else { + valueField.value = currElemVal["value"] || ""; + } + } +} + +function addToSelectableTypeList(type) { + selectableTypeList += ``; +} \ No newline at end of file diff --git a/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java b/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java index 32b9d77098..03e3bc9fa3 100644 --- a/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java +++ b/src/test/java/com/microfocus/application/automation/tools/octane/tests/detection/UFTExtensionTest.java @@ -35,6 +35,7 @@ import com.microfocus.application.automation.tools.octane.tests.detection.ResultFieldsXmlReader.TestResultContainer; import com.microfocus.application.automation.tools.run.RunFromAlmBuilder; import com.microfocus.application.automation.tools.run.RunFromFileBuilder; +import com.microfocus.application.automation.tools.uft.model.SpecifyParametersModel; import hudson.model.AbstractBuild; import hudson.model.FreeStyleProject; import hudson.scm.SubversionSCM; @@ -83,10 +84,11 @@ public void testMockMoreBuilders() throws Exception { String projectName = "root-job-" + UUID.randomUUID().toString(); FreeStyleProject project = rule.createFreeStyleProject(projectName); FilterTestsModel filterTestsModel = new FilterTestsModel("testName", false, false, false, false, false); + SpecifyParametersModel parametersModel = new SpecifyParametersModel("[]"); AlmServerSettingsModel almServerSettingsModel = new AlmServerSettingsModel("server2", "serverURL", new ArrayList<>(), new ArrayList<>()); project.getBuildersList().add(new Maven(String.format("--settings \"%s\\conf\\settings.xml\" test -Dmaven.repo.local=%s\\m2-temp", TestUtils.getMavenHome(),System.getenv("TEMP")), ToolInstallations.configureMaven3().getName(), null, null, "-Dmaven.test.failure.ignore=true")); - project.getBuildersList().add(new RunFromAlmBuilder("notExistingServer", "JOB", "sa", "", "domain", "project", "notExistingTests", "", "", "", "", "","", false, false, filterTestsModel, almServerSettingsModel)); + project.getBuildersList().add(new RunFromAlmBuilder("notExistingServer", "JOB", "sa", "", "domain", "project", "notExistingTests", "", "", "", "", "","", false, false, false, filterTestsModel, parametersModel, almServerSettingsModel)); AbstractBuild buildMock = Mockito.mock(AbstractBuild.class); Mockito.when(buildMock.getProject()).thenReturn(project); From 44c1fafae0dfd9fde539c6e2d57129d50d95ef28 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 31 Jan 2022 15:07:27 +0200 Subject: [PATCH 2031/2502] optimizations --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 29 ++++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index ed21fa27fb..755ff9fb46 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -863,7 +863,7 @@ public int GetIndexOfTestIdentifiedByName(string strName, TestSuiteRunResults re /// /// /// - public void SetInlineTestParameters(IList tList, string testParameters, TestSuiteRunResults runDesc, ITSScheduler scheduler, String initialFullTsPath) + public void SetInlineTestParameters(IList tList, string testParameters, TestSuiteRunResults runDesc, string initialFullTsPath) { foreach (ITSTest3 test in tList) { @@ -883,27 +883,20 @@ public void SetInlineTestParameters(IList tList, string testParameters, TestSuit } } - public void SetPropsTestParameters(IList filteredTestList, TestSuiteRunResults runDesc, ITSScheduler scheduler, string initialFullTsPath) + public void SetPropsTestParameters(IList filteredTestList, TestSuiteRunResults runDesc) { int i = 1; foreach (ITSTest3 test in filteredTestList) { - try - { - switch (test.Type) - { - case "SERVICE-TEST": - SetPropsApiTestParameters(test, i); - break; - case "QUICKTEST_TEST": - SetPropsGuiTestParameters(test, i); - break; - } - } - catch (ArgumentException) + switch (test.Type) { - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerErrorParameterFormat, initialFullTsPath)); + case "SERVICE-TEST": + SetPropsApiTestParameters(test, i); + break; + case "QUICKTEST_TEST": + SetPropsGuiTestParameters(test, i); + break; } ++i; @@ -1267,8 +1260,8 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //set test parameters if (filteredTestList.Count > 0) { - SetInlineTestParameters(filteredTestList, inlineTestParameters, runDesc, scheduler, initialFullTsPath); - SetPropsTestParameters(filteredTestList, runDesc, scheduler, initialFullTsPath); + SetInlineTestParameters(filteredTestList, inlineTestParameters, runDesc, initialFullTsPath); + SetPropsTestParameters(filteredTestList, runDesc); int index = 1; foreach (ITSTest3 test in filteredTestList) From 02b52f4eac8c434067acbd40efdbf97ad3b8976d Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 31 Jan 2022 15:51:09 +0200 Subject: [PATCH 2032/2502] add TestParameter class to compile target --- HpToolsLauncher/HpToolsLauncher.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/HpToolsLauncher/HpToolsLauncher.csproj b/HpToolsLauncher/HpToolsLauncher.csproj index 88217d2a3a..4452f382c3 100644 --- a/HpToolsLauncher/HpToolsLauncher.csproj +++ b/HpToolsLauncher/HpToolsLauncher.csproj @@ -121,6 +121,7 @@ + From 1a8b01c861d17d6f381cd250e0d19ae9699f2f5c Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 31 Jan 2022 16:06:33 +0200 Subject: [PATCH 2033/2502] refactor and fixed incorrect selector --- src/main/webapp/js/specifyParametersUtils.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 247446b84d..ed61944797 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -46,13 +46,13 @@ function startListenersForParameterInputs() { let testInput = document.getElementsByName("runfromfs.fsTests")[0] || document.getElementsByName("runfromalm.almTestSets")[0]; if (testInput) { - const rowInputs = document.querySelectorAll(".testParameter > div > input[type='number']"); - rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); - - testInput.addEventListener("change", () => { - const rowInputs = document.querySelectorAll(".testParameter > div > input[type='number']"); + const updateMaxNumberForSpinner = () => { + const rowInputs = document.querySelectorAll(".testParameter + div > input[type='number']"); rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); - }); + } + + updateMaxNumberForSpinner(); + testInput.addEventListener("change", updateMaxNumberForSpinner); } else { console.warn("Test input text area is missing."); } From fe1b8ea3a32af3affd3b3d35ef822a31f3e6ecba Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 31 Jan 2022 16:34:21 +0200 Subject: [PATCH 2034/2502] updated error handling in js --- src/main/webapp/js/specifyParametersUtils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index ed61944797..57c9076170 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -59,10 +59,9 @@ function startListenersForParameterInputs() { } function startListenerForParameterBlock() { - let specifyParametersCheckbox = document.getElementsByName("areParametersEnabled"); + let specifyParametersCheckbox = document.getElementsByName("areParametersEnabled")[0]; if (specifyParametersCheckbox) { - specifyParametersCheckbox = specifyParametersCheckbox[0]; specifyParametersCheckbox.addEventListener("click", cleanParameterInput); } } @@ -72,7 +71,7 @@ function generateAndPutJSONResult() { let inputJSON = []; const parameterResultStr = document.getElementsByName("parameterJson")[0]; - if (parameterResultStr.length === 0) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + if (!parameterResultStr) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); inputs.forEach(elem => { let curr = {}; @@ -104,6 +103,9 @@ function cleanParameterInput() { loadParameterInputs(); } else { const parameterResultStr = document.getElementsByName("parameterJson")[0]; + + if (!parameterResultStr) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + parameterResultStr.value = JSON.stringify([]); } } From 0f38d76e0c8edf6d26c5eb5df4a3c09102eebab7 Mon Sep 17 00:00:00 2001 From: EPlesca Date: Mon, 31 Jan 2022 17:43:41 +0200 Subject: [PATCH 2035/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.2.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 19f59fdac1..2f53c52528 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.3-SNAPSHOT + 7.2.1-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.2.1-beta From 0f85bb043587c9a0281882ec109f6f86934259ae Mon Sep 17 00:00:00 2001 From: EPlesca Date: Mon, 31 Jan 2022 17:43:50 +0200 Subject: [PATCH 2036/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2f53c52528..78cb44d65a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.2.1-beta + 7.2.1-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.2.1-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From d0835d1d406e87562949645302e972802233ad7c Mon Sep 17 00:00:00 2001 From: EPlesca Date: Mon, 31 Jan 2022 17:56:26 +0200 Subject: [PATCH 2037/2502] [maven-release-plugin] rollback the release of micro-focus-application-automation-tools-plugin-7.2.1-beta --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 78cb44d65a..19f59fdac1 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.2.1-beta-SNAPSHOT + 7.3-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, From 734759c6801f8681207090dd1b71c70b458e9686 Mon Sep 17 00:00:00 2001 From: EPlesca Date: Mon, 31 Jan 2022 17:59:34 +0200 Subject: [PATCH 2038/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.2.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 19f59fdac1..2f53c52528 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.3-SNAPSHOT + 7.2.1-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.2.1-beta From 7b7382488346e9fa3f298dbb5639c867440818d8 Mon Sep 17 00:00:00 2001 From: EPlesca Date: Mon, 31 Jan 2022 17:59:44 +0200 Subject: [PATCH 2039/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2f53c52528..78cb44d65a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.2.1-beta + 7.2.1-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.2.1-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 4fbf4c3b2f5a8d1774f141cfd9d8b55d2fb1b12b Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 9 Feb 2022 13:32:18 +0200 Subject: [PATCH 2040/2502] fixed bugs with front-end, jobs with multiple steps can work with parameter specification, switch to querySelectors, --- .../model/SpecifyParametersModel/config.jelly | 12 +- src/main/webapp/js/specifyParametersUtils.js | 167 ++++++++++++------ 2 files changed, 116 insertions(+), 63 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly index d6526f8627..ac5f402f58 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly @@ -75,8 +75,6 @@ } - \ No newline at end of file diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 57c9076170..2e5c04cef2 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -26,50 +26,85 @@ * ___________________________________________________________________ */ +// has to be declared like this, because it has to be globally accessible and multiple steps can be added in a single job, which would throw duplicate exception // holder, which contain all the valid parameter input types -let selectableTypeList = ''; +if (typeof selectableTypeList === "undefined") { + selectableTypeList = ''; +} -function startListenersForParameterInputs() { - const inputs = document.getElementsByName("testParameter"); - if (inputs) { - inputs.forEach(elem => elem.addEventListener("change", generateAndPutJSONResult)); - } else { - console.warn("Test parameter input fields are missing."); +if (typeof BUILDER_SELECTOR === "undefined") { + BUILDER_SELECTOR = "div[name='builder'][descriptorid*='com.microfocus.application.automation.tools.run.RunFrom']"; +} + +function setupParameterSpecification() { + let main = null; + if (document.location.href.indexOf("pipeline-syntax") > 0) { + main = document; + } else if (document.currentScript) { + main = document.currentScript.parentElement.closest(BUILDER_SELECTOR); + } + + setTimeout(() => { + startListeningForParameters(main); + }, 200); +} + +function startListeningForParameters(mainContainer) { + let main = mainContainer; + if (mainContainer == null) { + let divs = document.querySelectorAll(BUILDER_SELECTOR); + main = divs[divs.length - 1]; } - const delBtns = document.getElementsByName("delParameter"); - if (delBtns) { - delBtns.forEach(elem => elem.addEventListener("click", deleteParameter)); + loadParameterInputs(main); + + const addNewParameterBtn = main.querySelector("button[name='addNewParameterBtn']"); + if (addNewParameterBtn) { + addNewParameterBtn.addEventListener('click', () => { + addNewParameter(main); + }); } else { - console.warn("Delete buttons for input fields are missing."); + console.warn("Add parameter button is missing."); } - let testInput = document.getElementsByName("runfromfs.fsTests")[0] || document.getElementsByName("runfromalm.almTestSets")[0]; - if (testInput) { - const updateMaxNumberForSpinner = () => { - const rowInputs = document.querySelectorAll(".testParameter + div > input[type='number']"); - rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); - } + const updateMaxNumberForSpinner = () => { + const rowInputs = main.querySelectorAll(".testParameter > div > .numOfTestSpinner"); + rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); + } + const queryTestInput = () => main.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests']") || main.querySelector("textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); + let testInput = queryTestInput(); + if (testInput) { updateMaxNumberForSpinner(); testInput.addEventListener("change", updateMaxNumberForSpinner); } else { console.warn("Test input text area is missing."); } -} -function startListenerForParameterBlock() { - let specifyParametersCheckbox = document.getElementsByName("areParametersEnabled")[0]; - - if (specifyParametersCheckbox) { - specifyParametersCheckbox.addEventListener("click", cleanParameterInput); + const areParametersEnabledCheckbox = main.querySelector("input[name='areParametersEnabled']"); + if (areParametersEnabledCheckbox) { + areParametersEnabledCheckbox.addEventListener("click", () => cleanParameterInput(main)); } + + const expandTestsFieldButton = main.querySelector(".expanding-input__button input[type='button']"); + expandTestsFieldButton && expandTestsFieldButton.addEventListener("click", () => { + testInput = queryTestInput(); + + if (testInput) { + testInput.addEventListener("change", updateMaxNumberForSpinner); + } else { + console.warn("Test input text area is missing."); + } + }) } -function generateAndPutJSONResult() { - const inputs = document.getElementsByName("testParameter"); +function generateAndPutJSONResult(container) { + const parametersContainer = container.querySelector("ul[name='testParameters']"); + + const inputs = parametersContainer.querySelectorAll("li[name='testParameter']"); let inputJSON = []; - const parameterResultStr = document.getElementsByName("parameterJson")[0]; + + const parameterResultStr = parametersContainer.parentElement.querySelector("input[name='parameterJson']"); if (!parameterResultStr) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); @@ -98,11 +133,11 @@ function generateAndPutJSONResult() { parameterResultStr.value = JSON.stringify(inputJSON); } -function cleanParameterInput() { +function cleanParameterInput(container) { if (this.checked) { - loadParameterInputs(); + loadParameterInputs(container); } else { - const parameterResultStr = document.getElementsByName("parameterJson")[0]; + const parameterResultStr = container.querySelector("input[name='parameterJson']"); if (!parameterResultStr) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); @@ -110,19 +145,27 @@ function cleanParameterInput() { } } -function addNewParameter() { - const parametersContainer = document.querySelector("ul[name='testParameters']"); - const parameters = document.getElementsByName("testParameter") || []; +function addNewParameter(container) { + const parameterContainer = container.querySelector("ul[name='testParameters']"); + const parameters = parameterContainer.querySelectorAll("li[name='testParameter']") || []; const nextIdx = parameters.length !== 0 ? parseInt(Array.from(parameters).reduce((prev, curr) => { if (parseInt(prev.dataset.index) > parseInt(curr.dataset.index)) return prev; return curr; }).dataset.index) + 1 : 1; + let maxNumOfTests = 1; + const testInput = container.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests']") || container.querySelector("textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); + if (testInput) { + maxNumOfTests = testInput.value.split("\n").filter(row => row !== "").length.toString(); + } else { + console.warn("Test input field is missing."); + } + const elem = `
    • - +
      @@ -137,50 +180,58 @@ function addNewParameter() {
      - +
    • `; - parametersContainer.insertAdjacentHTML("beforeend", elem); + parameterContainer.insertAdjacentHTML("beforeend", elem); - const typeField = document.querySelector(`#parameterInputType${nextIdx}`); - const valueField = document.querySelector(`#parameterInputValue${nextIdx}`); + const rowNumber = parameterContainer.querySelector(`#parameterInputRow${nextIdx}`); + rowNumber.addEventListener("change", () => generateAndPutJSONResult(container)); + const nameField = parameterContainer.querySelector(`#parameterInputName${nextIdx}`); + nameField.addEventListener("change", () => generateAndPutJSONResult(container)); + const typeField = parameterContainer.querySelector(`#parameterInputType${nextIdx}`); + typeField.addEventListener("change", () => generateAndPutJSONResult(container)); + const valueField = parameterContainer.querySelector(`#parameterInputValue${nextIdx}`); + valueField.addEventListener("change", () => generateAndPutJSONResult(container)); + const delButton = parameterContainer.querySelector(`#delParameterInput${nextIdx} > span > button`); + delButton.addEventListener("click", () => deleteParameter(delButton, container)); typeField.addEventListener("change", () => { valueField.value = ""; valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); }); - - startListenersForParameterInputs(); } -function deleteParameter(e) { - this.parentNode.remove(); - startListenersForParameterInputs(); - generateAndPutJSONResult(); +function deleteParameter(elem, container) { + elem.parentNode.parentNode.parentNode.remove(); + generateAndPutJSONResult(container); } -const mapForTypeAssociations = { - String: 'text', - Number: 'number', - Boolean: 'checkbox', - Password: 'password', - Date: 'date', - Any: 'text' -}; +// has to be declared like this, because it has to be globally accessible and multiple steps can be added in a single job, which would throw duplicate exception +if (typeof mapForTypeAssociations === "undefined") { + mapForTypeAssociations = { + String: 'text', + Number: 'number', + Boolean: 'checkbox', + Password: 'password', + Date: 'date', + Any: 'text' + }; +} -function loadParameterInputs() { - const parameterResultStr = document.getElementsByName("parameterJson")[0]; +function loadParameterInputs(container) { + const parameterResultStr = container.querySelector("input[name='parameterJson']"); if (parameterResultStr.value === "") return; const json = JSON.parse(parameterResultStr.value); - for (let i = 0; i < json.length; ++i) addNewParameter(); + for (let i = 0; i < json.length; ++i) addNewParameter(container); - const parameters = document.getElementsByName("testParameter"); + const parameters = container.querySelectorAll("li[name='testParameter']"); for (let i = 0; i < json.length; ++i) { const currElem = parameters[i]; @@ -204,6 +255,10 @@ function loadParameterInputs() { } } -function addToSelectableTypeList(type) { +function addToSelectableTypeList(type, typeListLength) { + // if there are more build steps than one, do not populate the dropdown + // if the dropdown is already populated, do not populate it again + if (selectableTypeList.split("").length - 1 >= typeListLength) return; + selectableTypeList += ``; } \ No newline at end of file From b0b9a8c9716815cade745fe8a4ba70a2144d9541 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 9 Feb 2022 14:05:02 +0200 Subject: [PATCH 2041/2502] rename variables --- src/main/webapp/js/specifyParametersUtils.js | 46 ++++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 2e5c04cef2..51ad7da8f8 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -58,9 +58,9 @@ function startListeningForParameters(mainContainer) { loadParameterInputs(main); - const addNewParameterBtn = main.querySelector("button[name='addNewParameterBtn']"); - if (addNewParameterBtn) { - addNewParameterBtn.addEventListener('click', () => { + const btnAddNewParam = main.querySelector("button[name='addNewParameterBtn']"); + if (btnAddNewParam) { + btnAddNewParam.addEventListener('click', () => { addNewParameter(main); }); } else { @@ -81,9 +81,9 @@ function startListeningForParameters(mainContainer) { console.warn("Test input text area is missing."); } - const areParametersEnabledCheckbox = main.querySelector("input[name='areParametersEnabled']"); - if (areParametersEnabledCheckbox) { - areParametersEnabledCheckbox.addEventListener("click", () => cleanParameterInput(main)); + const chkAreParametersEnabled = main.querySelector("input[name='areParametersEnabled']"); + if (chkAreParametersEnabled) { + chkAreParametersEnabled.addEventListener("click", () => cleanParameterInput(main)); } const expandTestsFieldButton = main.querySelector(".expanding-input__button input[type='button']"); @@ -99,14 +99,14 @@ function startListeningForParameters(mainContainer) { } function generateAndPutJSONResult(container) { - const parametersContainer = container.querySelector("ul[name='testParameters']"); + const paramsContainer = container.querySelector("ul[name='testParameters']"); - const inputs = parametersContainer.querySelectorAll("li[name='testParameter']"); + const inputs = paramsContainer.querySelectorAll("li[name='testParameter']"); let inputJSON = []; - const parameterResultStr = parametersContainer.parentElement.querySelector("input[name='parameterJson']"); + const strParamRes = paramsContainer.parentElement.querySelector("input[name='parameterJson']"); - if (!parameterResultStr) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); inputs.forEach(elem => { let curr = {}; @@ -130,25 +130,25 @@ function generateAndPutJSONResult(container) { } }); - parameterResultStr.value = JSON.stringify(inputJSON); + strParamRes.value = JSON.stringify(inputJSON); } function cleanParameterInput(container) { if (this.checked) { loadParameterInputs(container); } else { - const parameterResultStr = container.querySelector("input[name='parameterJson']"); + const strParamRes = container.querySelector("input[name='parameterJson']"); - if (!parameterResultStr) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); - parameterResultStr.value = JSON.stringify([]); + strParamRes.value = JSON.stringify([]); } } function addNewParameter(container) { - const parameterContainer = container.querySelector("ul[name='testParameters']"); - const parameters = parameterContainer.querySelectorAll("li[name='testParameter']") || []; - const nextIdx = parameters.length !== 0 ? parseInt(Array.from(parameters).reduce((prev, curr) => { + const paramContainer = container.querySelector("ul[name='testParameters']"); + const params = paramContainer.querySelectorAll("li[name='testParameter']") || []; + const nextIdx = params.length !== 0 ? parseInt(Array.from(params).reduce((prev, curr) => { if (parseInt(prev.dataset.index) > parseInt(curr.dataset.index)) return prev; return curr; @@ -186,17 +186,17 @@ function addNewParameter(container) { `; - parameterContainer.insertAdjacentHTML("beforeend", elem); + paramContainer.insertAdjacentHTML("beforeend", elem); - const rowNumber = parameterContainer.querySelector(`#parameterInputRow${nextIdx}`); + const rowNumber = paramContainer.querySelector(`#parameterInputRow${nextIdx}`); rowNumber.addEventListener("change", () => generateAndPutJSONResult(container)); - const nameField = parameterContainer.querySelector(`#parameterInputName${nextIdx}`); + const nameField = paramContainer.querySelector(`#parameterInputName${nextIdx}`); nameField.addEventListener("change", () => generateAndPutJSONResult(container)); - const typeField = parameterContainer.querySelector(`#parameterInputType${nextIdx}`); + const typeField = paramContainer.querySelector(`#parameterInputType${nextIdx}`); typeField.addEventListener("change", () => generateAndPutJSONResult(container)); - const valueField = parameterContainer.querySelector(`#parameterInputValue${nextIdx}`); + const valueField = paramContainer.querySelector(`#parameterInputValue${nextIdx}`); valueField.addEventListener("change", () => generateAndPutJSONResult(container)); - const delButton = parameterContainer.querySelector(`#delParameterInput${nextIdx} > span > button`); + const delButton = paramContainer.querySelector(`#delParameterInput${nextIdx} > span > button`); delButton.addEventListener("click", () => deleteParameter(delButton, container)); typeField.addEventListener("change", () => { From 6908b473e737e3a45c27640aa50cb93b1fd4c289 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Thu, 10 Feb 2022 13:12:30 +0200 Subject: [PATCH 2042/2502] refactor and added help --- .../model/SpecifyParametersModel/config.jelly | 1 + .../help-__emptyForHelp.html | 29 +++++++++++++ src/main/webapp/js/specifyParametersUtils.js | 41 +++++++++---------- 3 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/help-__emptyForHelp.html diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly index ac5f402f58..0443adf988 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly @@ -84,6 +84,7 @@
    + diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/help-__emptyForHelp.html b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/help-__emptyForHelp.html new file mode 100644 index 0000000000..e6afcf4add --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/help-__emptyForHelp.html @@ -0,0 +1,29 @@ + + +
    Select to which test in the test input field the parameter should be applied, counted from top to bottom and then specify all of its properties.
    \ No newline at end of file diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 51ad7da8f8..370aeedf4e 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -56,12 +56,12 @@ function startListeningForParameters(mainContainer) { main = divs[divs.length - 1]; } - loadParameterInputs(main); + loadParamInputs(main); const btnAddNewParam = main.querySelector("button[name='addNewParameterBtn']"); if (btnAddNewParam) { btnAddNewParam.addEventListener('click', () => { - addNewParameter(main); + addNewParam(main); }); } else { console.warn("Add parameter button is missing."); @@ -81,13 +81,13 @@ function startListeningForParameters(mainContainer) { console.warn("Test input text area is missing."); } - const chkAreParametersEnabled = main.querySelector("input[name='areParametersEnabled']"); - if (chkAreParametersEnabled) { - chkAreParametersEnabled.addEventListener("click", () => cleanParameterInput(main)); + const chkAreParamsEnabled = main.querySelector("input[name='areParametersEnabled']"); + if (chkAreParamsEnabled) { + chkAreParamsEnabled.addEventListener("click", () => cleanParamInput(main)); } - const expandTestsFieldButton = main.querySelector(".expanding-input__button input[type='button']"); - expandTestsFieldButton && expandTestsFieldButton.addEventListener("click", () => { + const expandTestsFieldBtn = main.querySelector(".expanding-input__button input[type='button']"); + expandTestsFieldBtn && expandTestsFieldBtn.addEventListener("click", () => { testInput = queryTestInput(); if (testInput) { @@ -133,9 +133,9 @@ function generateAndPutJSONResult(container) { strParamRes.value = JSON.stringify(inputJSON); } -function cleanParameterInput(container) { +function cleanParamInput(container) { if (this.checked) { - loadParameterInputs(container); + loadParamInputs(container); } else { const strParamRes = container.querySelector("input[name='parameterJson']"); @@ -145,7 +145,7 @@ function cleanParameterInput(container) { } } -function addNewParameter(container) { +function addNewParam(container) { const paramContainer = container.querySelector("ul[name='testParameters']"); const params = paramContainer.querySelectorAll("li[name='testParameter']") || []; const nextIdx = params.length !== 0 ? parseInt(Array.from(params).reduce((prev, curr) => { @@ -188,24 +188,21 @@ function addNewParameter(container) { paramContainer.insertAdjacentHTML("beforeend", elem); - const rowNumber = paramContainer.querySelector(`#parameterInputRow${nextIdx}`); - rowNumber.addEventListener("change", () => generateAndPutJSONResult(container)); - const nameField = paramContainer.querySelector(`#parameterInputName${nextIdx}`); - nameField.addEventListener("change", () => generateAndPutJSONResult(container)); - const typeField = paramContainer.querySelector(`#parameterInputType${nextIdx}`); - typeField.addEventListener("change", () => generateAndPutJSONResult(container)); - const valueField = paramContainer.querySelector(`#parameterInputValue${nextIdx}`); - valueField.addEventListener("change", () => generateAndPutJSONResult(container)); + Array.from(paramContainer.querySelectorAll(`[name='parameterInput']`)).filter(input => input.getAttribute("id").includes(nextIdx.toString())) + .forEach(input => input.addEventListener("change", () => generateAndPutJSONResult(container))); + const delButton = paramContainer.querySelector(`#delParameterInput${nextIdx} > span > button`); - delButton.addEventListener("click", () => deleteParameter(delButton, container)); + delButton.addEventListener("click", () => deleteParam(delButton, container)); + const typeField = paramContainer.querySelector(`#parameterInputType${nextIdx}`); + const valueField = paramContainer.querySelector(`#parameterInputValue${nextIdx}`); typeField.addEventListener("change", () => { valueField.value = ""; valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); }); } -function deleteParameter(elem, container) { +function deleteParam(elem, container) { elem.parentNode.parentNode.parentNode.remove(); generateAndPutJSONResult(container); } @@ -222,14 +219,14 @@ if (typeof mapForTypeAssociations === "undefined") { }; } -function loadParameterInputs(container) { +function loadParamInputs(container) { const parameterResultStr = container.querySelector("input[name='parameterJson']"); if (parameterResultStr.value === "") return; const json = JSON.parse(parameterResultStr.value); - for (let i = 0; i < json.length; ++i) addNewParameter(container); + for (let i = 0; i < json.length; ++i) addNewParam(container); const parameters = container.querySelectorAll("li[name='testParameter']"); From 1c76bdd80143c166efa552c62d5f2621b6b40ba3 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Thu, 10 Feb 2022 15:47:54 +0200 Subject: [PATCH 2043/2502] fixed bugged selector and refactor --- src/main/webapp/js/specifyParametersUtils.js | 38 ++++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 370aeedf4e..af1908599e 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -71,7 +71,7 @@ function startListeningForParameters(mainContainer) { const rowInputs = main.querySelectorAll(".testParameter > div > .numOfTestSpinner"); rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); } - const queryTestInput = () => main.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests']") || main.querySelector("textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); + const queryTestInput = () => main.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests'], textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); let testInput = queryTestInput(); if (testInput) { @@ -110,13 +110,13 @@ function generateAndPutJSONResult(container) { inputs.forEach(elem => { let curr = {}; - const testIdx = curr["index"] = elem.querySelector(`#parameterInputRow${elem.dataset.index}`).value; - const name = curr["name"] = elem.querySelector(`#parameterInputName${elem.dataset.index}`).value; + const testIdx = curr["index"] = elem.querySelector(`#parameterInputRow_${elem.dataset.index}`).value; + const name = curr["name"] = elem.querySelector(`#parameterInputName_${elem.dataset.index}`).value; if (name !== "") { - curr["type"] = elem.querySelector(`#parameterInputType${elem.dataset.index}`).value; + curr["type"] = elem.querySelector(`#parameterInputType_${elem.dataset.index}`).value; - const val = elem.querySelector(`#parameterInputValue${elem.dataset.index}`); + const val = elem.querySelector(`#parameterInputValue_${elem.dataset.index}`); if (curr["type"] === "Boolean") { curr["value"] = val.checked; } else if (curr["type"] === "Date") { @@ -155,7 +155,7 @@ function addNewParam(container) { }).dataset.index) + 1 : 1; let maxNumOfTests = 1; - const testInput = container.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests']") || container.querySelector("textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); + const testInput = container.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests'], textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); if (testInput) { maxNumOfTests = testInput.value.split("\n").filter(row => row !== "").length.toString(); } else { @@ -165,20 +165,20 @@ function addNewParam(container) { const elem = `
  • - +
    - +
    - +
    - ${selectableTypeList}
    - + @@ -188,14 +188,14 @@ function addNewParam(container) { paramContainer.insertAdjacentHTML("beforeend", elem); - Array.from(paramContainer.querySelectorAll(`[name='parameterInput']`)).filter(input => input.getAttribute("id").includes(nextIdx.toString())) + Array.from(paramContainer.querySelectorAll(`[name='parameterInput']`)).filter(input => input.getAttribute("id").endsWith("_" + nextIdx.toString())) .forEach(input => input.addEventListener("change", () => generateAndPutJSONResult(container))); - const delButton = paramContainer.querySelector(`#delParameterInput${nextIdx} > span > button`); + const delButton = paramContainer.querySelector(`#delParameterInput_${nextIdx} > span > button`); delButton.addEventListener("click", () => deleteParam(delButton, container)); - const typeField = paramContainer.querySelector(`#parameterInputType${nextIdx}`); - const valueField = paramContainer.querySelector(`#parameterInputValue${nextIdx}`); + const typeField = paramContainer.querySelector(`#parameterInputType_${nextIdx}`); + const valueField = paramContainer.querySelector(`#parameterInputValue_${nextIdx}`); typeField.addEventListener("change", () => { valueField.value = ""; valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); @@ -234,10 +234,10 @@ function loadParamInputs(container) { const currElem = parameters[i]; const currElemVal = json[i]; - currElem.querySelector(`#parameterInputRow${currElem.dataset.index}`).value = currElemVal["index"] || 1; - currElem.querySelector(`#parameterInputName${currElem.dataset.index}`).value = currElemVal["name"] || ""; - const valueField = currElem.querySelector(`#parameterInputValue${currElem.dataset.index}`) - const typeField = currElem.querySelector(`#parameterInputType${currElem.dataset.index}`); + currElem.querySelector(`#parameterInputRow_${currElem.dataset.index}`).value = currElemVal["index"] || 1; + currElem.querySelector(`#parameterInputName_${currElem.dataset.index}`).value = currElemVal["name"] || ""; + const valueField = currElem.querySelector(`#parameterInputValue_${currElem.dataset.index}`) + const typeField = currElem.querySelector(`#parameterInputType_${currElem.dataset.index}`); typeField.value = currElemVal["type"] || "String"; valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); From 75fcbde7ae51ba0a87ac0588137afa5225195cb8 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 14 Feb 2022 12:43:31 +0200 Subject: [PATCH 2044/2502] added docs, refactor for ALMRunner in parameter specification, separating test parameter specifications --- HpToolsLauncher/Launcher.cs | 5 + .../Properties/Resources.Designer.cs | 9 + HpToolsLauncher/Properties/Resources.resx | 3 + HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 265 +++++++++++------- .../Runners/FileSystemTestsRunner.cs | 14 +- 5 files changed, 188 insertions(+), 108 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 83f8e7126f..349cd0ca45 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -1110,6 +1110,11 @@ private List GetValidTests(string propertiesParameter, string errorNoT return new List(); } + + /// + /// Returns all the valid parameters from the props file (CI args). + /// + /// private List GetValidParams() { List parameters = new List(); diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 476a99e75e..0c46553dfa 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Duplicate parameter name entry found, please check the parameters' specification, falling back to default parameters for {0}. test or testset.. + /// + internal static string AlmDuplicateParameter { + get { + return ResourceManager.GetString("AlmDuplicateParameter", resourceCulture); + } + } + /// /// Looks up a localized string similar to Could not find Test {0}. /// diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 26f2642f02..26f0520f82 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -511,4 +511,7 @@ Save the test in QuickTest and then run it again. Duplicate parameter name entry found, please check the parameters' specification. + + Duplicate parameter name entry found, please check the parameters' specification, falling back to default parameters for {0}. test or testset. + \ No newline at end of file diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 755ff9fb46..0a86a47dcf 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -36,7 +36,7 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using System.Text.RegularExpressions; +using System.Text.RegularExpressions; using System.Threading; using System.Security; @@ -54,7 +54,9 @@ public class AlmTestSetsRunner : RunnerBase, IDisposable private const string XML_PARAM_NAME_VALUE_TYPE = ""; private const string XML_PARAMS_END_TAG = ""; private readonly char[] COMMA = new char[] { ',' }; - + private const string API_TEST = "SERVICE-TEST"; + private const string GUI_TEST = "QUICKTEST_TEST"; + public ITDConnection13 TdConnection { get @@ -857,96 +859,61 @@ public int GetIndexOfTestIdentifiedByName(string strName, TestSuiteRunResults re //------------------------------- Identify and set test parameters -------------------------- /// - /// Set the parameters for a list of tests + /// Collect the inline parameters for the tests. /// /// /// /// - /// - public void SetInlineTestParameters(IList tList, string testParameters, TestSuiteRunResults runDesc, string initialFullTsPath) + /// + /// + public void CollectInlineTestParameters(IList tList, string testParameters, TestSuiteRunResults runDesc, string initialFullTsPath, List parametersPlaceholder) { + int idx = 1; + foreach (ITSTest3 test in tList) { try { - if (test.Type.Equals("SERVICE-TEST") && !string.IsNullOrEmpty(testParameters)) //API test + if (test.Type.Equals(API_TEST) && !string.IsNullOrEmpty(testParameters)) //API test { - SetInlineApiTestParameters(test, testParameters); - } else if (test.Type.Equals("QUICKTEST_TEST") && !string.IsNullOrEmpty(testParameters)) //GUI test + CollectInlineApiTestParameters(test, testParameters, parametersPlaceholder, idx); + } else if (test.Type.Equals(GUI_TEST) && !string.IsNullOrEmpty(testParameters)) //GUI test { - SetInlineGuiTestParameters(test, testParameters); + CollectInlineGuiTestParameters(test, testParameters, parametersPlaceholder, idx); } } catch (ArgumentException) { ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerErrorParameterFormat, initialFullTsPath)); } + + ++idx; } } - public void SetPropsTestParameters(IList filteredTestList, TestSuiteRunResults runDesc) + /// + /// Collect the parameters for the tests from the props (CI args). + /// + /// + /// + /// + public void CollectPropsTestParameters(IList filteredTestList, TestSuiteRunResults runDesc, List parametersPlaceholder) { int i = 1; - foreach (ITSTest3 test in filteredTestList) { - switch (test.Type) - { - case "SERVICE-TEST": - SetPropsApiTestParameters(test, i); - break; - case "QUICKTEST_TEST": - SetPropsGuiTestParameters(test, i); - break; - } - + List relevant = TestParameters.FindAll(elem => elem.TestIdx.Equals(i)); + parametersPlaceholder.AddRange(relevant); ++i; } } - private void SetPropsApiTestParameters(ITSTest3 test, int idx) - { - // all the parameters that belong to this test - List relevant = TestParameters.FindAll(elem => elem.TestIdx.Equals(idx)); - ISupportParameterValues paramTestValues = (ISupportParameterValues)test; - ParameterValueFactory parameterValueFactory = paramTestValues.ParameterValueFactory; - List listOfParameters = parameterValueFactory.NewList(string.Empty); - - int index = 0; - foreach (ParameterValue parameter in listOfParameters) - { - if (index >= relevant.Count) break; - - parameter.ActualValue = relevant.ElementAt(index++).ParamVal; - parameter.Post(); - } - } - - private void SetPropsGuiTestParameters(ITSTest3 test, int idx) - { - // all the parameters that belong to this test - List relevant = TestParameters.FindAll(elem => elem.TestIdx.Equals(idx)); - var xmlParams = new StringBuilder(); - - if (relevant.Count > 0) - { - xmlParams.Append(XML_PARAMS_START_TAG); - - foreach (var parameter in relevant) - { - xmlParams.AppendFormat(XML_PARAM_NAME_VALUE_TYPE, SecurityElement.Escape(parameter.ParamName), SecurityElement.Escape(parameter.ParamVal), parameter.ParamType); - } - - xmlParams.Append(XML_PARAMS_END_TAG); - } - - - if (xmlParams.Length > 0) - { - test["TC_EPARAMS"] = xmlParams.ToString(); - test.Post(); - } - } - + /// + /// Schedule test instances to run. + /// + /// + /// + /// + /// private void ScheduleTest(TestSuiteRunResults runDesc, ITSScheduler scheduler, ITSTest3 test, int idx) { var runOnHost = RunHost; @@ -976,31 +943,23 @@ private void ScheduleTest(TestSuiteRunResults runDesc, ITSScheduler scheduler, I /// /// /// - private void SetInlineApiTestParameters(ITSTest3 test, string paramsString) + /// + /// + private void CollectInlineApiTestParameters(ITSTest3 test, string paramsString, IList parametersPlaceholder, int idx) { - IList paramNames, paramValues; - if (!string.IsNullOrEmpty(paramsString)) { string[] @params = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); - if (!Helper.ValidateListOfParamsForInline(@params, out paramNames, out paramValues)) - { - throw new ArgumentException(); - } - - ISupportParameterValues paramTestValues = (ISupportParameterValues)test; - ParameterValueFactory parameterValueFactory = paramTestValues.ParameterValueFactory; - List listOfParameters = parameterValueFactory.NewList(string.Empty); - var index = 0; + IList paramNames, paramValues; - if (paramValues.Count <= 0) return; + if (!Helper.ValidateListOfParamsForInline(@params, out paramNames, out paramValues)) + { + throw new ArgumentException(); + } - foreach (ParameterValue parameter in listOfParameters) + for (int i = 0; i < @params.Length; ++i) { - if (index >= paramValues.Count()) break; - - parameter.ActualValue = paramValues.ElementAt(index++); - parameter.Post(); + parametersPlaceholder.Add(new TestParameter(idx, paramNames[i], paramValues[i], null)); } } } @@ -1010,36 +969,26 @@ private void SetInlineApiTestParameters(ITSTest3 test, string paramsString) /// /// /// - private void SetInlineGuiTestParameters(ITSTest3 test, string paramsString) + /// + /// + private void CollectInlineGuiTestParameters(ITSTest3 test, string paramsString, IList parametersPlaceholder, int idx) { var xmlParams = new StringBuilder(); - IList paramNames, paramValues; if (!string.IsNullOrWhiteSpace(paramsString)) { string[] @params = paramsString.Split(COMMA, StringSplitOptions.RemoveEmptyEntries); - bool validParameters = Helper.ValidateListOfParamsForInline(@params, out paramNames, out paramValues); + IList paramNames, paramValues; - if (validParameters && @params.Any()) + if (!Helper.ValidateListOfParamsForInline(@params, out paramNames, out paramValues)) { - xmlParams.Append(XML_PARAMS_START_TAG); - for (int i = 0; i < @params.Length; i++) - { - xmlParams.AppendFormat(XML_PARAM_NAME_VALUE, SecurityElement.Escape(paramNames[i]), SecurityElement.Escape(paramValues[i])); - } - xmlParams.Append(XML_PARAMS_END_TAG); + throw new ArgumentException(); } - if (!validParameters) - { - throw new ArgumentException(); - } - } - - if (xmlParams.Length > 0) - { - test["TC_EPARAMS"] = xmlParams.ToString(); - test.Post(); + for (int i = 0; i < @params.Length; ++i) + { + parametersPlaceholder.Add(new TestParameter(idx, paramNames[i], paramValues[i], null)); + } } } @@ -1052,7 +1001,7 @@ private string GetTestType(dynamic currentTest) { string testType = currentTest.Test.Type; - testType = testType.ToUpper() == "SERVICE-TEST" ? TestType.ST.ToString() : TestType.QTP.ToString(); + testType = testType.ToUpper() == API_TEST ? TestType.ST.ToString() : TestType.QTP.ToString(); return testType; } @@ -1260,12 +1209,35 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string //set test parameters if (filteredTestList.Count > 0) { - SetInlineTestParameters(filteredTestList, inlineTestParameters, runDesc, initialFullTsPath); - SetPropsTestParameters(filteredTestList, runDesc); + // placeholder list for test parameters + List testParameters = new List(); + + CollectInlineTestParameters(filteredTestList, inlineTestParameters, runDesc, initialFullTsPath, testParameters); + CollectPropsTestParameters(filteredTestList, runDesc, testParameters); + + // we prepare individual lists for the tests + // while we check for duplicates + // and then we set the test parameters int index = 1; foreach (ITSTest3 test in filteredTestList) { + List relevant = testParameters.FindAll(elem => elem.TestIdx.Equals(index)); + + try + { + CheckForDuplicateParametersForTest(relevant); + + relevant.ForEach(elem => ConsoleWriter.WriteLine(string.Format("Using parameter {0}={1}", elem.ParamName, elem.ParamVal))); + + SetParameters(test, relevant); + } + catch (ArgumentException) + { + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmDuplicateParameter, index)); + } + + ScheduleTest(runDesc, scheduler, test, index); ++index; } @@ -1369,6 +1341,87 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string return runDesc; } + /// + /// Sets the Test's parameters. + /// + /// + /// + private static void SetParameters(ITSTest3 test, List relevant) + { + switch (test.Type) + { + case API_TEST: + SetAPITestParameters(test, relevant); + break; + case GUI_TEST: + SetGUITestParameters(test, relevant); + break; + } + } + + /// + /// Sets the GUI Test's parameters. + /// + /// + /// + private static void SetGUITestParameters(ITSTest3 test, List relevant) + { + var xmlParams = new StringBuilder(); + + if (relevant.Count > 0) + { + xmlParams.Append(XML_PARAMS_START_TAG); + + foreach (var parameter in relevant) + { + xmlParams.AppendFormat(XML_PARAM_NAME_VALUE_TYPE, SecurityElement.Escape(parameter.ParamName), SecurityElement.Escape(parameter.ParamVal), parameter.ParamType); + } + + xmlParams.Append(XML_PARAMS_END_TAG); + } + + if (xmlParams.Length <= 0) return; + + test["TC_EPARAMS"] = xmlParams.ToString(); + test.Post(); + } + + /// + /// Sets the API Test's parameters. + /// + /// + /// + private static void SetAPITestParameters(ITSTest3 test, List relevant) + { + ISupportParameterValues paramTestValues = (ISupportParameterValues) test; + ParameterValueFactory parameterValueFactory = paramTestValues.ParameterValueFactory; + List listOfParameters = parameterValueFactory.NewList(string.Empty); + + foreach (ParameterValue parameter in listOfParameters) + { + // we search for the paramter by name in the relevant list, if found we set it, otherwise skip this parameter from the factory + + string name = parameter.Name; + TestParameter tmpParam = relevant.Find(elem => elem.ParamName.Equals(name)); + + if (tmpParam == null) continue; + + parameter.ActualValue = tmpParam.ParamVal; + parameter.Post(); + } + } + + /// + /// Checks if the parameter list contains duplicates, throws ArgumentException because uses a Dictionary internally. + /// + /// + private static void CheckForDuplicateParametersForTest(List relevant) + { + // throws argumentexception if duplicate found + Dictionary tmpParams = new Dictionary(); + relevant.ForEach(param => tmpParams.Add(param.ParamName, param.ParamVal)); + } + /// /// Terminates wexectrl process which belongs to the current HpToolsLauncher process /// diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index 325a4f651b..ed76c90179 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -458,6 +458,12 @@ private Dictionary createDictionary(List validTests) return rerunList; } + /// + /// Sets the test's inline parameters. + /// + /// + /// + /// private void SetInlineParams(string testPath, ref TestInfo test) { // the inline test path does not contain any parameter specification @@ -495,6 +501,11 @@ private void SetInlineParams(string testPath, ref TestInfo test) } } + /// + /// Sets the test's parameters from the props (CI args). + /// + /// + /// private void SetPropsParams(int idx, ref TestInfo test) { // all the parameters that belong to this test @@ -502,8 +513,7 @@ private void SetPropsParams(int idx, ref TestInfo test) foreach (TestParameter param in relevant) { - TestParameterInfo placeholderParam; - placeholderParam = new TestParameterInfo() { Name = param.ParamName, Type = param.ParamType, Value = param.ParamVal }; + TestParameterInfo placeholderParam = new TestParameterInfo() { Name = param.ParamName, Type = param.ParamType, Value = param.ParamVal }; test.ParameterList.Add(placeholderParam); } From 197dc922f11f89d54db0415ed0a6d270ae06caff Mon Sep 17 00:00:00 2001 From: NShitrit Date: Tue, 15 Feb 2022 10:29:47 +0200 Subject: [PATCH 2045/2502] defect #1567019:set XML parser to parse test results and prevent corrupted results --- .../tools/octane/tests/xml/AbstractXmlIterator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java index d597e3bda7..60146b0901 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/xml/AbstractXmlIterator.java @@ -28,6 +28,7 @@ package com.microfocus.application.automation.tools.octane.tests.xml; +import com.ctc.wstx.stax.WstxInputFactory; import hudson.util.IOUtils; import javax.xml.stream.XMLEventReader; @@ -108,7 +109,8 @@ protected String peekNextValue() throws XMLStreamException { } private static XMLInputFactory createXmlInputFactory() { - XMLInputFactory xmlFactory = XMLInputFactory.newInstance(); + //up to Jenkins version 2.319.2 this was the XML Input Factory implementation used, new Factory cause test result corruption + XMLInputFactory xmlFactory = new WstxInputFactory(); xmlFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); xmlFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); return xmlFactory; From d09858304336f41c74c9b4b1273e88c37c83e1c3 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 16 Feb 2022 13:05:02 +0200 Subject: [PATCH 2046/2502] Fixing "Error occurred while parsing parameter input" from the table of parameters --- src/main/webapp/js/specifyParametersUtils.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index af1908599e..a71c11adf6 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -220,11 +220,16 @@ if (typeof mapForTypeAssociations === "undefined") { } function loadParamInputs(container) { - const parameterResultStr = container.querySelector("input[name='parameterJson']"); + const paramResultStr = container.querySelector("input[name='parameterJson']"); - if (parameterResultStr.value === "") return; + // one some browsers the value attribute may return with extraneous quotes + let params = paramResultStr.value; - const json = JSON.parse(parameterResultStr.value); + if (params === "" || params === "[]" || params === "\"[]\"") return; + + if (params.endsWith("\"")) params = params.substring(1, params.length - 1).replace(/\\"/g, '"'); + + const json = JSON.parse(params); for (let i = 0; i < json.length; ++i) addNewParam(container); From 658c807500ed316ceb1f82192a4eb02337d037de Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 16 Feb 2022 14:27:39 +0200 Subject: [PATCH 2047/2502] fix JSON formatting issues for input and output as well --- src/main/webapp/js/specifyParametersUtils.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index a71c11adf6..97b4108469 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -130,7 +130,7 @@ function generateAndPutJSONResult(container) { } }); - strParamRes.value = JSON.stringify(inputJSON); + strParamRes.value = verifyJsonFormat(JSON.stringify(inputJSON)); } function cleanParamInput(container) { @@ -141,7 +141,7 @@ function cleanParamInput(container) { if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); - strParamRes.value = JSON.stringify([]); + strParamRes.value = verifyJsonFormat(JSON.stringify([])); } } @@ -227,9 +227,7 @@ function loadParamInputs(container) { if (params === "" || params === "[]" || params === "\"[]\"") return; - if (params.endsWith("\"")) params = params.substring(1, params.length - 1).replace(/\\"/g, '"'); - - const json = JSON.parse(params); + const json = JSON.parse(verifyJsonFormat(params)); for (let i = 0; i < json.length; ++i) addNewParam(container); @@ -263,4 +261,10 @@ function addToSelectableTypeList(type, typeListLength) { if (selectableTypeList.split("").length - 1 >= typeListLength) return; selectableTypeList += ``; +} + +function verifyJsonFormat(str) { + let ret = str; + if (str.endsWith("\"")) ret = ret.substring(1, ret.length - 1).replace(/\\"/g, '"'); + return ret; } \ No newline at end of file From 845806b04f8ab151b9bed448599d5e7f914368ec Mon Sep 17 00:00:00 2001 From: EPlesca Date: Wed, 16 Feb 2022 15:29:31 +0200 Subject: [PATCH 2048/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.2.2-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 78cb44d65a..8350554426 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.2.1-beta-SNAPSHOT + 7.2.2-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + micro-focus-application-automation-tools-plugin-7.2.2-beta From 215af4ba87e886ee2a9e3a4204f64f05c7c51a4d Mon Sep 17 00:00:00 2001 From: EPlesca Date: Wed, 16 Feb 2022 15:29:40 +0200 Subject: [PATCH 2049/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8350554426..b534ccafd6 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.2.2-beta + 7.2.2-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-7.2.2-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From ec48a063ae2f0930c7e6166a085e1034c15e17f7 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 16 Feb 2022 17:08:09 +0200 Subject: [PATCH 2050/2502] fix JSON formatting issue caused by security policy, adjustments for UI --- .../model/SpecifyParametersModel/config.jelly | 13 +++- src/main/webapp/js/specifyParametersUtils.js | 67 ++++++++++++++++--- 2 files changed, 68 insertions(+), 12 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly index 0443adf988..ae57450dc1 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly @@ -46,7 +46,7 @@ .testParameter, .testParameter--heading { display: grid; - grid-template-columns: repeat(3, 1fr) .5fr 10%; + grid-template-columns: 7.5% repeat(3, 1fr) .25fr 10%; align-items: center; justify-items: center; grid-gap: .5rem; @@ -58,6 +58,10 @@ width: 100%; } + .testParameter > div > input { + box-shadow: none !important; + } + .testParameter > div > select { height: 100%; } @@ -73,12 +77,17 @@ font-weight: 500; margin: 0; } + + .testLabel { + color: #999; + }
    • # of test

      -

      Name

      +

      Test name

      +

      Parameter name

      Value

      Type

      diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 97b4108469..8a886ff7d6 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -72,15 +72,35 @@ function startListeningForParameters(mainContainer) { rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); } const queryTestInput = () => main.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests'], textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); + const updateTest = (container, spinner) => { + const testLabel = spinner.parentElement.nextElementSibling.querySelector(".testLabel"); + if (spinner.value === '') { + testLabel.value = ""; + return; + } + testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1]; + } + + const rowInputs = main.querySelectorAll(".testParameter > div > .numOfTestSpinner"); let testInput = queryTestInput(); if (testInput) { - updateMaxNumberForSpinner(); - testInput.addEventListener("change", updateMaxNumberForSpinner); + testInput.addEventListener("change", () => { + updateMaxNumberForSpinner(); + + rowInputs.forEach((rowInput) => { + updateTest(main, rowInput); + }); + }); + testInput.dispatchEvent(new Event("change")); } else { console.warn("Test input text area is missing."); } + rowInputs.forEach(rowInput => rowInput.addEventListener("change", () => { + updateTest(main, rowInput); + })); + const chkAreParamsEnabled = main.querySelector("input[name='areParametersEnabled']"); if (chkAreParamsEnabled) { chkAreParamsEnabled.addEventListener("click", () => cleanParamInput(main)); @@ -91,11 +111,17 @@ function startListeningForParameters(mainContainer) { testInput = queryTestInput(); if (testInput) { - testInput.addEventListener("change", updateMaxNumberForSpinner); + testInput.addEventListener("change", () => { + updateMaxNumberForSpinner(); + + rowInputs.forEach((rowInput) => { + updateTest(main, rowInput); + }); + }); } else { console.warn("Test input text area is missing."); } - }) + }); } function generateAndPutJSONResult(container) { @@ -130,7 +156,7 @@ function generateAndPutJSONResult(container) { } }); - strParamRes.value = verifyJsonFormat(JSON.stringify(inputJSON)); + strParamRes.value = normalizeJsonFormat(JSON.stringify(inputJSON)); } function cleanParamInput(container) { @@ -141,7 +167,7 @@ function cleanParamInput(container) { if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); - strParamRes.value = verifyJsonFormat(JSON.stringify([])); + strParamRes.value = normalizeJsonFormat(JSON.stringify([])); } } @@ -156,8 +182,9 @@ function addNewParam(container) { let maxNumOfTests = 1; const testInput = container.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests'], textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); + const testInputVal = testInput.value if (testInput) { - maxNumOfTests = testInput.value.split("\n").filter(row => row !== "").length.toString(); + maxNumOfTests = testInputVal.split("\n").filter(row => row !== "").length.toString(); } else { console.warn("Test input field is missing."); } @@ -167,6 +194,9 @@ function addNewParam(container) {
      +
      + +
      @@ -188,6 +218,17 @@ function addNewParam(container) { paramContainer.insertAdjacentHTML("beforeend", elem); + const testLabel = paramContainer.querySelector(`#parameterInputTest_${nextIdx}`); + const spinner = paramContainer.querySelector(`#parameterInputRow_${nextIdx}`); + spinner.addEventListener("change", () => { + if (spinner.value === '') { + testLabel.value = ""; + return; + } + testLabel.value = testInputVal.split("\n")[parseInt(spinner.value) - 1]; + }); + spinner.dispatchEvent(new Event("change")); + Array.from(paramContainer.querySelectorAll(`[name='parameterInput']`)).filter(input => input.getAttribute("id").endsWith("_" + nextIdx.toString())) .forEach(input => input.addEventListener("change", () => generateAndPutJSONResult(container))); @@ -227,7 +268,12 @@ function loadParamInputs(container) { if (params === "" || params === "[]" || params === "\"[]\"") return; - const json = JSON.parse(verifyJsonFormat(params)); + let json; + try { + json = JSON.parse(normalizeJsonFormat(params)); + } catch (e) { + json = JSON.parse("[]"); + } for (let i = 0; i < json.length; ++i) addNewParam(container); @@ -263,8 +309,9 @@ function addToSelectableTypeList(type, typeListLength) { selectableTypeList += ``; } -function verifyJsonFormat(str) { +function normalizeJsonFormat(str) { + // because of certain security policies, on some servers the special characters could be escaped twice, we need to parse them twice let ret = str; - if (str.endsWith("\"")) ret = ret.substring(1, ret.length - 1).replace(/\\"/g, '"'); + if (str.endsWith("\"")) ret = JSON.parse(ret); return ret; } \ No newline at end of file From f28c5ef09ec520781a54465fb5a955d855fca8f0 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 16 Feb 2022 17:57:32 +0200 Subject: [PATCH 2051/2502] refactor, changed class names, added additional check for parsed JSON --- .../model/SpecifyParametersModel/config.jelly | 28 +++---- src/main/webapp/js/specifyParametersUtils.js | 76 +++++++++---------- 2 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly index ae57450dc1..5716cf94fa 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly @@ -35,16 +35,16 @@ display: none; } - .testParameters { + .test-params { list-style-type: none; } - .testParameter:not(:last-of-type) { + .test-parameter:not(:last-of-type) { margin-bottom: .5rem; } - .testParameter, - .testParameter--heading { + .test-param, + .test-param--heading { display: grid; grid-template-columns: 7.5% repeat(3, 1fr) .25fr 10%; align-items: center; @@ -52,39 +52,39 @@ grid-gap: .5rem; } - .testParameter, - .testParameter > div, - .testParameter > div > select { + .test-param, + .test-param > div, + .test-param > div > select { width: 100%; } - .testParameter > div > input { + .test-param > div > input { box-shadow: none !important; } - .testParameter > div > select { + .test-param > div > select { height: 100%; } - .testParameter--heading { + .test-param--heading { border-bottom: solid 1px var(--medium-grey); margin-bottom: .5rem; height: 40px; } - .testParameter--heading p { + .test-param--heading p { text-align: center; font-weight: 500; margin: 0; } - .testLabel { + .test-label { color: #999; } -
        -
      • +
          +
        • # of test

          Test name

          Parameter name

          diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 8a886ff7d6..c5d71c3584 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -67,13 +67,12 @@ function startListeningForParameters(mainContainer) { console.warn("Add parameter button is missing."); } - const updateMaxNumberForSpinner = () => { - const rowInputs = main.querySelectorAll(".testParameter > div > .numOfTestSpinner"); + const updateMaxNumberForSpinner = (testInput) => { + const rowInputs = main.querySelectorAll(".test-param > div > .num-of-test-spinner"); rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); } - const queryTestInput = () => main.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests'], textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); - const updateTest = (container, spinner) => { - const testLabel = spinner.parentElement.nextElementSibling.querySelector(".testLabel"); + const updateTest = (container, spinner, testInput) => { + const testLabel = spinner.parentElement.nextElementSibling.querySelector(".test-label"); if (spinner.value === '') { testLabel.value = ""; return; @@ -81,24 +80,28 @@ function startListeningForParameters(mainContainer) { testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1]; } - const rowInputs = main.querySelectorAll(".testParameter > div > .numOfTestSpinner"); + let testInput; - let testInput = queryTestInput(); - if (testInput) { - testInput.addEventListener("change", () => { - updateMaxNumberForSpinner(); + const prepareTestInput = () => { + testInput = queryTestInput(main); + if (testInput) { + testInput.addEventListener("change", () => { + updateMaxNumberForSpinner(testInput); - rowInputs.forEach((rowInput) => { - updateTest(main, rowInput); + rowInputs.forEach((rowInput) => { + updateTest(main, rowInput, testInput); + }); }); - }); - testInput.dispatchEvent(new Event("change")); - } else { - console.warn("Test input text area is missing."); + testInput.dispatchEvent(new Event("change")); + } else { + console.warn("Test input text area is missing."); + } } + const rowInputs = main.querySelectorAll(".test-param > div > .num-of-test-spinner"); + prepareTestInput(); rowInputs.forEach(rowInput => rowInput.addEventListener("change", () => { - updateTest(main, rowInput); + updateTest(main, rowInput, testInput); })); const chkAreParamsEnabled = main.querySelector("input[name='areParametersEnabled']"); @@ -108,22 +111,14 @@ function startListeningForParameters(mainContainer) { const expandTestsFieldBtn = main.querySelector(".expanding-input__button input[type='button']"); expandTestsFieldBtn && expandTestsFieldBtn.addEventListener("click", () => { - testInput = queryTestInput(); - - if (testInput) { - testInput.addEventListener("change", () => { - updateMaxNumberForSpinner(); - - rowInputs.forEach((rowInput) => { - updateTest(main, rowInput); - }); - }); - } else { - console.warn("Test input text area is missing."); - } + prepareTestInput(); }); } +function queryTestInput(container) { + return container.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests'], textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); +} + function generateAndPutJSONResult(container) { const paramsContainer = container.querySelector("ul[name='testParameters']"); @@ -164,9 +159,7 @@ function cleanParamInput(container) { loadParamInputs(container); } else { const strParamRes = container.querySelector("input[name='parameterJson']"); - if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); - strParamRes.value = normalizeJsonFormat(JSON.stringify([])); } } @@ -181,21 +174,20 @@ function addNewParam(container) { }).dataset.index) + 1 : 1; let maxNumOfTests = 1; - const testInput = container.querySelector("textarea[name='runfromfs.fsTests'], input[name='runfromfs.fsTests'], textarea[name='runfromalm.almTestSets'], input[name='runfromalm.almTestSets']"); - const testInputVal = testInput.value + let testInput = queryTestInput(container); if (testInput) { - maxNumOfTests = testInputVal.split("\n").filter(row => row !== "").length.toString(); + maxNumOfTests = testInput.value.split("\n").filter(row => row !== "").length.toString(); } else { console.warn("Test input field is missing."); } const elem = ` -
        • +
        • - +
          - +
          @@ -221,11 +213,14 @@ function addNewParam(container) { const testLabel = paramContainer.querySelector(`#parameterInputTest_${nextIdx}`); const spinner = paramContainer.querySelector(`#parameterInputRow_${nextIdx}`); spinner.addEventListener("change", () => { + if (!testInput) testInput = queryTestInput(container); + if (spinner.value === '') { testLabel.value = ""; return; } - testLabel.value = testInputVal.split("\n")[parseInt(spinner.value) - 1]; + + testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1]; }); spinner.dispatchEvent(new Event("change")); @@ -275,6 +270,9 @@ function loadParamInputs(container) { json = JSON.parse("[]"); } + // has to be an object to be valid JSON input, otherwise because of security policies the JSON was altered + if (typeof(json) === "string") json = JSON.parse("[]"); + for (let i = 0; i < json.length; ++i) addNewParam(container); const parameters = container.querySelectorAll("li[name='testParameter']"); From 10071b79b33d9991f55c7157444477d197615691 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 16 Feb 2022 18:11:05 +0200 Subject: [PATCH 2052/2502] bugfix, testinput has to be queried each time, because if textarea is expanded, the previous input is hided, not removed --- src/main/webapp/js/specifyParametersUtils.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index c5d71c3584..ad3d559017 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -213,14 +213,12 @@ function addNewParam(container) { const testLabel = paramContainer.querySelector(`#parameterInputTest_${nextIdx}`); const spinner = paramContainer.querySelector(`#parameterInputRow_${nextIdx}`); spinner.addEventListener("change", () => { - if (!testInput) testInput = queryTestInput(container); - if (spinner.value === '') { testLabel.value = ""; return; } - testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1]; + testLabel.value = queryTestInput(container).value.split("\n")[parseInt(spinner.value) - 1]; }); spinner.dispatchEvent(new Event("change")); From b5afaad01b5d58b74a0ac429d98ba9d48e421e88 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 21 Feb 2022 11:39:59 +0200 Subject: [PATCH 2053/2502] fixing undefined label for test if test input is empty --- src/main/webapp/js/specifyParametersUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index ad3d559017..410ab459f5 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -77,7 +77,7 @@ function startListeningForParameters(mainContainer) { testLabel.value = ""; return; } - testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1]; + testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1] || ""; } let testInput; @@ -218,7 +218,7 @@ function addNewParam(container) { return; } - testLabel.value = queryTestInput(container).value.split("\n")[parseInt(spinner.value) - 1]; + testLabel.value = queryTestInput(container).value.split("\n")[parseInt(spinner.value) - 1] || ""; }); spinner.dispatchEvent(new Event("change")); From f50482c51e4461d1b5d712d7779efb7b457fd5c1 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 21 Feb 2022 12:34:32 +0200 Subject: [PATCH 2054/2502] more descriptive message if no tests are specified --- src/main/webapp/js/specifyParametersUtils.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 410ab459f5..0fcfd7ba27 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -69,7 +69,8 @@ function startListeningForParameters(mainContainer) { const updateMaxNumberForSpinner = (testInput) => { const rowInputs = main.querySelectorAll(".test-param > div > .num-of-test-spinner"); - rowInputs.forEach(rowInput => rowInput.setAttribute("max", testInput.value.split("\n").filter(row => row !== "").length.toString())); + const newMax = testInput.value.split("\n").filter(row => row !== "").length; + rowInputs.forEach(rowInput => rowInput.setAttribute("max", newMax === 0 ? 1 : newMax.toString())); } const updateTest = (container, spinner, testInput) => { const testLabel = spinner.parentElement.nextElementSibling.querySelector(".test-label"); @@ -77,7 +78,7 @@ function startListeningForParameters(mainContainer) { testLabel.value = ""; return; } - testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1] || ""; + testLabel.value = testInput.value.split("\n")[parseInt(spinner.value) - 1] || "Please, specify tests first"; } let testInput; @@ -100,7 +101,7 @@ function startListeningForParameters(mainContainer) { const rowInputs = main.querySelectorAll(".test-param > div > .num-of-test-spinner"); prepareTestInput(); - rowInputs.forEach(rowInput => rowInput.addEventListener("change", () => { + rowInputs.forEach(rowInput => rowInput.addEventListener("click", () => { updateTest(main, rowInput, testInput); })); @@ -184,7 +185,7 @@ function addNewParam(container) { const elem = `
        • - +
          @@ -212,13 +213,13 @@ function addNewParam(container) { const testLabel = paramContainer.querySelector(`#parameterInputTest_${nextIdx}`); const spinner = paramContainer.querySelector(`#parameterInputRow_${nextIdx}`); - spinner.addEventListener("change", () => { + spinner.addEventListener("click", () => { if (spinner.value === '') { testLabel.value = ""; return; } - testLabel.value = queryTestInput(container).value.split("\n")[parseInt(spinner.value) - 1] || ""; + testLabel.value = queryTestInput(container).value.split("\n")[parseInt(spinner.value) - 1] || "Please, specify tests first"; }); spinner.dispatchEvent(new Event("change")); From c3ecaa3dadd0c7e2cc2971f1d01721993e82ee7f Mon Sep 17 00:00:00 2001 From: Shmuel Berezin Date: Tue, 22 Feb 2022 12:30:21 +0200 Subject: [PATCH 2055/2502] Defect #1586005: MBT Execution Report no data on the suite run report when we execute mbt test with param on CIServer Jenkins that installed on Linux Docker --- .../automation/tools/octane/tests/junit/JUnitXmlIterator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java index 43a1591951..1b1f3a9528 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/tests/junit/JUnitXmlIterator.java @@ -267,7 +267,8 @@ private void handleUftTest(XMLEvent event) throws XMLStreamException, IOExceptio //workspace.createTextTempFile("build" + buildId + "." + cleanTestName(testName) + ".", "", "Created " + testReportCreated); if (testReportCreated) { - uftResultFilePath = ((List) additionalContext).get(0) +"\\archive\\UFTReport\\" + cleanedTestName + "\\run_results.xml"; + final String basePath = ((List) additionalContext).get(0); + uftResultFilePath = Paths.get(basePath, "archive", "UFTReport", cleanedTestName, "run_results.xml").toFile().getCanonicalPath(); externalURL = jenkinsRootUrl + "job/" + jobName + "/" + buildId + "/artifact/UFTReport/" + cleanedTestName + "/run_results.html"; } else { //if UFT didn't created test results page - add reference to Jenkins test results page From a030e1d8cad096da5855af69000470bc2573556e Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 22 Feb 2022 12:46:48 +0200 Subject: [PATCH 2056/2502] Fixed "illegal input parameter type" defect with Any param type, for Date type only Date portion is printed, fixed issue with ALM jobs, where only first param would be used, introduced type verification for API tests --- .../HpToolsLauncherTests/UnitTest1.cs | 2 +- .../Properties/Resources.Designer.cs | 33 ++++++- HpToolsLauncher/Properties/Resources.resx | 15 +++- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 90 ++++++++----------- HpToolsLauncher/TestInfo.cs | 84 +++++++++++------ HpToolsLauncher/TestParameterInfo.cs | 7 +- HpToolsLauncher/TestRunners/ApiTestRunner.cs | 56 +++++++++++- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 22 +++-- .../uft/model/SpecifyParametersModel.java | 22 ++++- .../model/SpecifyParametersModel/config.jelly | 19 +++- src/main/webapp/js/specifyParametersUtils.js | 40 +++++++-- 11 files changed, 273 insertions(+), 117 deletions(-) diff --git a/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs b/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs index 57052e83d6..7c4f3696fd 100644 --- a/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs +++ b/HpToolsLauncher/HpToolsLauncherTests/UnitTest1.cs @@ -88,7 +88,7 @@ public void TestGenerateApiXmlFile() { string content = " "; List tests = MtbxManager.LoadMtbx(content, "dunno"); - string xmlContent = tests[0].GenerateAPITestXmlForTest(); + string xmlContent = tests[0].GenerateAPITestXmlForTest(new Dictionary()); //XDocument doc = XDocument.Parse(xmlContent); Assert.IsTrue(xmlContent.Contains("abc")); Assert.IsTrue(xmlContent.Contains("name=\"mee\" type=\"xs:int\"")); diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 0c46553dfa..3a86b6b852 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -172,7 +172,7 @@ internal static string AlmRunnerErrorParameterFormat { } /// - /// Looks up a localized string similar to "Unable to login. Please check username and password.". + /// Looks up a localized string similar to Unable to login. Please check username and password.. /// internal static string AlmRunnerIncorectCredentials { get { @@ -226,7 +226,7 @@ internal static string AlmRunnerRunIdCaption { } /// - /// Looks up a localized string similar to "Scheduler started at:. + /// Looks up a localized string similar to Scheduler started at:. /// internal static string AlmRunnerSchedStarted { get { @@ -235,7 +235,7 @@ internal static string AlmRunnerSchedStarted { } /// - /// Looks up a localized string similar to "ALM server {0} unreachable, check that server Url is correct". + /// Looks up a localized string similar to ALM server {0} unreachable, check that server Url is correct. /// internal static string AlmRunnerServerUnreachable { get { @@ -513,6 +513,33 @@ internal static string GeneralFileNotFound { } } + /// + /// Looks up a localized string similar to Input parameter type mismatch (skipped), check your test configuration in UFT. param: '{0}'. + /// + internal static string GeneralParameterTypeMismatchWith1Type { + get { + return ResourceManager.GetString("GeneralParameterTypeMismatchWith1Type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal input parameter type (skipped). param: '{0}'. expected type: '{1}'. actual type: '{2}'. + /// + internal static string GeneralParameterTypeMismatchWith2Types { + get { + return ResourceManager.GetString("GeneralParameterTypeMismatchWith2Types", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Using parameter {0} = {1}. + /// + internal static string GeneralParameterUsage { + get { + return ResourceManager.GetString("GeneralParameterUsage", resourceCulture); + } + } + /// /// Looks up a localized string similar to QTP is not installed on {0}.. /// diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 26f0520f82..2d689cabbc 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -203,13 +203,13 @@ Save the test in QuickTest and then run it again. Run ID: - "Scheduler started at: + Scheduler started at: - "ALM server {0} unreachable, check that server Url is correct" + ALM server {0} unreachable, check that server Url is correct - "Unable to login. Please check username and password." + Unable to login. Please check username and password. Starting test set execution @@ -514,4 +514,13 @@ Save the test in QuickTest and then run it again. Duplicate parameter name entry found, please check the parameters' specification, falling back to default parameters for {0}. test or testset. + + Input parameter type mismatch (skipped), check your test configuration in UFT. param: '{0}' + + + Illegal input parameter type (skipped). param: '{0}'. expected type: '{1}'. actual type: '{2}' + + + Using parameter {0} = {1} + \ No newline at end of file diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 0a86a47dcf..53b7669693 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -896,15 +896,11 @@ public void CollectInlineTestParameters(IList tList, string testParameters, Test /// /// /// - public void CollectPropsTestParameters(IList filteredTestList, TestSuiteRunResults runDesc, List parametersPlaceholder) + /// + public void CollectPropsTestParameters(IList filteredTestList, TestSuiteRunResults runDesc, List parametersPlaceholder, int testIdx) { - int i = 1; - foreach (ITSTest3 test in filteredTestList) - { - List relevant = TestParameters.FindAll(elem => elem.TestIdx.Equals(i)); - parametersPlaceholder.AddRange(relevant); - ++i; - } + List relevant = TestParameters.FindAll(elem => elem.TestIdx.Equals(testIdx)); + parametersPlaceholder.AddRange(relevant); } /// @@ -1071,7 +1067,7 @@ public override TestSuiteRunResults Run() } } - TestSuiteRunResults runResults = RunTestSet(testSetDir, tsName, inlineTestParameters, swForTimeout); + TestSuiteRunResults runResults = RunTestSet(testSetDir, tsName, inlineTestParameters, swForTimeout, idx); if (runResults != null) activeRunDescription.AppendResults(runResults); @@ -1090,15 +1086,10 @@ public override TestSuiteRunResults Run() /// testSet folder name /// testSet name /// - /// -1 for unlimited, or number of milliseconds - /// run on LocalMachine or remote - /// if run on remote machine - remote machine name - /// - /// - /// - /// + /// + /// /// - public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string inlineTestParameters, Stopwatch swForTimeout) + public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string inlineTestParameters, Stopwatch swForTimeout, int testIdx) { string testSuiteName = tsName.TrimEnd(); ITestSetFolder tsFolder = null; @@ -1213,7 +1204,17 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string List testParameters = new List(); CollectInlineTestParameters(filteredTestList, inlineTestParameters, runDesc, initialFullTsPath, testParameters); - CollectPropsTestParameters(filteredTestList, runDesc, testParameters); + CollectPropsTestParameters(filteredTestList, runDesc, testParameters, testIdx); + + try + { + CheckForDuplicateParametersForTest(testParameters); + } + catch (ArgumentException) + { + ConsoleWriter.WriteErrLine(Resources.AlmDuplicateParameter); + throw; + } // we prepare individual lists for the tests // while we check for duplicates @@ -1222,21 +1223,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string int index = 1; foreach (ITSTest3 test in filteredTestList) { - List relevant = testParameters.FindAll(elem => elem.TestIdx.Equals(index)); - - try - { - CheckForDuplicateParametersForTest(relevant); - - relevant.ForEach(elem => ConsoleWriter.WriteLine(string.Format("Using parameter {0}={1}", elem.ParamName, elem.ParamVal))); - - SetParameters(test, relevant); - } - catch (ArgumentException) - { - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmDuplicateParameter, index)); - } - + SetParameters(test, testParameters); ScheduleTest(runDesc, scheduler, test, index); ++index; @@ -1331,7 +1318,7 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string UpdateTestResultsAfterAbort(executionStatus, targetTestSet, runDesc, testPath); // scheduler process may not be terminated - this process is not terminated by the aborter - terminateSchedulerIfNecessary(); + TerminateSchedulerIfNecessary(); Launcher.ExitCode = Launcher.ExitCodeEnum.Aborted; @@ -1341,10 +1328,10 @@ public TestSuiteRunResults RunTestSet(string tsFolderName, string tsName, string return runDesc; } - /// - /// Sets the Test's parameters. - /// - /// + /// + /// Sets the Test's parameters. + /// + /// /// private static void SetParameters(ITSTest3 test, List relevant) { @@ -1359,10 +1346,10 @@ private static void SetParameters(ITSTest3 test, List relevant) } } - /// - /// Sets the GUI Test's parameters. - /// - /// + /// + /// Sets the GUI Test's parameters. + /// + /// /// private static void SetGUITestParameters(ITSTest3 test, List relevant) { @@ -1371,36 +1358,35 @@ private static void SetGUITestParameters(ITSTest3 test, List rele if (relevant.Count > 0) { xmlParams.Append(XML_PARAMS_START_TAG); - foreach (var parameter in relevant) { xmlParams.AppendFormat(XML_PARAM_NAME_VALUE_TYPE, SecurityElement.Escape(parameter.ParamName), SecurityElement.Escape(parameter.ParamVal), parameter.ParamType); } - xmlParams.Append(XML_PARAMS_END_TAG); } if (xmlParams.Length <= 0) return; + relevant.ForEach(elem => ConsoleWriter.WriteLine(string.Format(Resources.GeneralParameterUsage, elem.ParamName, elem.ParamVal))); + test["TC_EPARAMS"] = xmlParams.ToString(); test.Post(); } - /// - /// Sets the API Test's parameters. - /// - /// + /// + /// Sets the API Test's parameters. + /// + /// /// private static void SetAPITestParameters(ITSTest3 test, List relevant) { - ISupportParameterValues paramTestValues = (ISupportParameterValues) test; + ISupportParameterValues paramTestValues = (ISupportParameterValues)test; ParameterValueFactory parameterValueFactory = paramTestValues.ParameterValueFactory; List listOfParameters = parameterValueFactory.NewList(string.Empty); foreach (ParameterValue parameter in listOfParameters) { // we search for the paramter by name in the relevant list, if found we set it, otherwise skip this parameter from the factory - string name = parameter.Name; TestParameter tmpParam = relevant.Find(elem => elem.ParamName.Equals(name)); @@ -1408,6 +1394,8 @@ private static void SetAPITestParameters(ITSTest3 test, List rele parameter.ActualValue = tmpParam.ParamVal; parameter.Post(); + + ConsoleWriter.WriteLine(string.Format(Resources.GeneralParameterUsage, tmpParam.ParamName, tmpParam.ParamVal)); } } @@ -1425,7 +1413,7 @@ private static void CheckForDuplicateParametersForTest(List relev /// /// Terminates wexectrl process which belongs to the current HpToolsLauncher process /// - private void terminateSchedulerIfNecessary() + private void TerminateSchedulerIfNecessary() { Process exeCtrl = Process.GetProcessesByName("wexectrl").Where(p => p.SessionId == Process.GetCurrentProcess().SessionId).FirstOrDefault(); diff --git a/HpToolsLauncher/TestInfo.cs b/HpToolsLauncher/TestInfo.cs index d792d631b8..6f23b492bd 100644 --- a/HpToolsLauncher/TestInfo.cs +++ b/HpToolsLauncher/TestInfo.cs @@ -44,37 +44,64 @@ public TestInfo(string testPath) { TestPath = testPath; } - public string GenerateAPITestXmlForTest() - { - Dictionary paramDict = new Dictionary(); - - foreach (var param in ParameterList) - { - try - { - paramDict.Add(param.Name.ToLower(), param); - } - catch (ArgumentException e) - { - ConsoleWriter.WriteErrLine(string.Format(Resources.FsDuplicateParamNames)); - throw e; - } - } + public string GenerateAPITestXmlForTest(Dictionary paramDict) + { string paramXmlFileName = Path.Combine(TestPath, "TestInputParameters.xml"); XDocument doc = XDocument.Load(paramXmlFileName); - string schemaStr = doc.Descendants("Schema").First().Elements().First().ToString(); + var schemaTmp = doc.Descendants("Schema").First().Elements().First(); + var paramNs = schemaTmp.GetNamespaceOfPrefix("xs"); + string schemaStr = schemaTmp.ToString(); XElement xArgs = doc.Descendants("Arguments").FirstOrDefault(); - if (xArgs != null) + + // parameter specifications according to schema + var xParams = doc.Descendants(paramNs + "element") + .Where(node => "Arguments" == (string)node.Attribute("name")) + .Descendants(paramNs + "element").ToList(); + + if (xArgs != null && xParams.Count != 0) foreach (XElement arg in xArgs.Elements()) { - string paramName = arg.Name.ToString().ToLower(); - if (paramDict.ContainsKey(paramName)) + string paramName = arg.Name.ToString(); + + if (!paramDict.ContainsKey(paramName)) { - var param = paramDict[paramName]; - arg.Value = NormalizeParamValue(param); + continue; + } + + var param = paramDict[paramName]; + + // spec belonging to this parameter + var paramSpec = xParams.Find(elem => paramName == (string)elem.Attribute("name")); + // its type + string paramType; + if (paramSpec != null) + { + var typeSpec = paramSpec.Attribute("type"); + + if (typeSpec != null) + { + var tmpVal = typeSpec.Value; + var startIdx = tmpVal.IndexOf(":", StringComparison.Ordinal); + paramType = typeSpec.Value.Substring(startIdx != 0 ? startIdx + 1 : startIdx); + } + else continue; + } + else continue; // no spec found for given parameter, skipping + + // verify its type according to the spec + if (!ApiTestRunner.VerifyParameterValueType(param, paramType)) + { + ConsoleWriter.WriteErrLine(string.Format(Resources.GeneralParameterTypeMismatchWith2Types, + paramName, paramType, param.GetType())); + } + else + { + arg.Value = NormalizeParamValue(paramName, param, paramType); + ConsoleWriter.WriteLine(string.Format(Resources.GeneralParameterUsage, paramName, paramType.ToLower() != "datetime" && paramType.ToLower() != "date" ? param : ((DateTime)param).ToShortDateString())); } } + string argumentSectionStr = doc.Descendants("Values").First().Elements().First().ToString(); try { @@ -104,25 +131,26 @@ public string GenerateAPITestXmlForTest() return doc.ToString(); } - - private string NormalizeParamValue(TestParameterInfo param) + private string NormalizeParamValue(string name, object param, string type) { - switch (param.Type.ToLower()) + switch (type.ToLower()) { case "datetime": case "date": string retStr = ""; try { - retStr = ((DateTime)param.ParseValue()).ToString("yyyy-MM-ddTHH:mm:ss"); + retStr = ((DateTime)param).ToString("yyyy-MM-ddTHH:mm:ss"); } catch { - ConsoleWriter.WriteErrLine("incorrect dateTime value format in parameter: " + param.Name); + ConsoleWriter.WriteErrLine("Incorrect dateTime value format in parameter: " + name); } return retStr; + case "boolean": + return param.ToString().ToLower(); default: - return param.Value; + return param.ToString(); } } diff --git a/HpToolsLauncher/TestParameterInfo.cs b/HpToolsLauncher/TestParameterInfo.cs index 72e744849e..5a56cf290f 100644 --- a/HpToolsLauncher/TestParameterInfo.cs +++ b/HpToolsLauncher/TestParameterInfo.cs @@ -65,8 +65,7 @@ public object ParseValue() bool ok = false; switch (this.Type.ToLower()) { - case "int": - + case "int": int v; ok = int.TryParse(this.Value, out v); if (ok) @@ -74,7 +73,6 @@ public object ParseValue() val = v; } break; - case "number": case "password": case "string": case "any": @@ -101,7 +99,7 @@ public object ParseValue() case "date": DateTime v3; ok = DateTime.TryParseExact(this.Value, - new string[] { + new string[] { "yyyy-MM-ddTHH:mm:ss", "dd/MM/yyyy HH:mm:ss.fff", "dd/M/yyyy HH:mm:ss.fff", @@ -170,6 +168,7 @@ public object ParseValue() val = v5; } break; + case "number": case "decimal": decimal v6; ok = decimal.TryParse(this.Value, out v6); diff --git a/HpToolsLauncher/TestRunners/ApiTestRunner.cs b/HpToolsLauncher/TestRunners/ApiTestRunner.cs index 7c269d3b4a..d0782bdc7f 100644 --- a/HpToolsLauncher/TestRunners/ApiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ApiTestRunner.cs @@ -28,6 +28,7 @@ using HpToolsLauncher.Properties; using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; @@ -142,17 +143,29 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance string tempPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestParams"); Directory.CreateDirectory(tempPath); string paramsFilePath = Path.Combine(tempPath, "params" + paramFileName + ".xml"); - string paramFileContent = testinf.GenerateAPITestXmlForTest(); + + Dictionary paramDict; + try + { + paramDict = testinf.GetParameterDictionaryForQTP(); + } + catch (ArgumentException) + { + ConsoleWriter.WriteErrLine(string.Format(Resources.FsDuplicateParamNames)); + throw; + } + + string paramFileContent = testinf.GenerateAPITestXmlForTest(paramDict); string argumentString = ""; if (!string.IsNullOrWhiteSpace(paramFileContent)) { File.WriteAllText(paramsFilePath, paramFileContent); - argumentString = String.Format("{0} \"{1}\" {2} \"{3}\" {4} \"{5}\"", STRunnerTestArg, testinf.TestPath, STRunnerReportArg, runDesc.ReportLocation, STRunnerInputParamsArg, paramsFilePath); + argumentString = string.Format("{0} \"{1}\" {2} \"{3}\" {4} \"{5}\"", STRunnerTestArg, testinf.TestPath, STRunnerReportArg, runDesc.ReportLocation, STRunnerInputParamsArg, paramsFilePath); } else { - argumentString = String.Format("{0} \"{1}\" {2} \"{3}\"", STRunnerTestArg, testinf.TestPath, STRunnerReportArg, runDesc.ReportLocation); + argumentString = string.Format("{0} \"{1}\" {2} \"{3}\"", STRunnerTestArg, testinf.TestPath, STRunnerReportArg, runDesc.ReportLocation); } Stopwatch s = Stopwatch.StartNew(); @@ -340,5 +353,42 @@ private void OnOutputDataReceived(object sender, DataReceivedEventArgs e) #endregion + public static bool VerifyParameterValueType(object paramValue, string type) + { + bool legal = false; + + switch (type) + { + case "boolean": + legal = paramValue is bool; + break; + + case "dateTime": + legal = paramValue is DateTime; + break; + + case "int": + case "long": + legal = ((paramValue is int) || (paramValue is long)); + break; + + case "float": + case "double": + case "decimal": + legal = ((paramValue is decimal) || (paramValue is float) || (paramValue is double)); + break; + + case "string": + legal = paramValue is string; + break; + + default: + legal = false; + break; + } + + return legal; + } + } } \ No newline at end of file diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index de9d0e5f11..d8f457139d 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -273,17 +273,17 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance ? tagUnifiedLicenseType.qtUnifiedFunctionalTesting : tagUnifiedLicenseType.qtNonUnified); - Dictionary paramList; + Dictionary paramDict; try { - paramList = testinf.GetParameterDictionaryForQTP(); - } catch (ArgumentException e) + paramDict = testinf.GetParameterDictionaryForQTP(); + } catch (ArgumentException) { ConsoleWriter.WriteErrLine(string.Format(Resources.FsDuplicateParamNames)); - throw e; + throw; } - if (!HandleInputParameters(testPath, ref errorReason, paramList, testinf)) + if (!HandleInputParameters(testPath, ref errorReason, paramDict, testinf)) { runDesc.TestState = TestState.Error; runDesc.ErrorDesc = errorReason; @@ -630,10 +630,8 @@ private bool VerifyParameterValueType(object paramValue, qtParameterType type) break; case qtParameterType.qtParamTypePassword: - legal = paramValue is string; - break; - case qtParameterType.qtParamTypeString: + case qtParameterType.qtParamTypeAny: legal = paramValue is string; break; @@ -680,11 +678,11 @@ private bool HandleInputParameters(string fileName, ref string errorReason, Dict { try { - ConsoleWriter.WriteErrLine(string.Format("Illegal input parameter type (skipped). param: '{0}'. expected type: '{1}'. actual type: '{2}'", paramName, Enum.GetName(typeof(qtParameterType), type), paramValue.GetType())); + ConsoleWriter.WriteErrLine(string.Format(Resources.GeneralParameterTypeMismatchWith2Types, paramName, Enum.GetName(typeof(qtParameterType), type), paramValue.GetType())); } catch (Exception) { - ConsoleWriter.WriteErrLine(string.Format("Illegal input parameter type (skipped). param: '{0}'. expected type: '{1}'. actual type: 'null'", paramName, Enum.GetName(typeof(qtParameterType), type))); + ConsoleWriter.WriteErrLine(string.Format(Resources.GeneralParameterTypeMismatchWith2Types, paramName, Enum.GetName(typeof(qtParameterType), type), null)); } } else @@ -693,10 +691,10 @@ private bool HandleInputParameters(string fileName, ref string errorReason, Dict try { _qtpParameters[paramName].Value = paramValue; - ConsoleWriter.WriteLine(string.Format("Using parameter {0}={1} ", paramName, paramValue)); + ConsoleWriter.WriteLine(string.Format(Resources.GeneralParameterUsage, paramName, type != qtParameterType.qtParamTypeDate ? paramValue : ((DateTime) paramValue).ToShortDateString())); } catch (Exception) { - ConsoleWriter.WriteErrLine(string.Format("Input parameter type mismatch (skipped), check your test configuration in UFT. param: '{0}'", paramName)); + ConsoleWriter.WriteErrLine(string.Format(Resources.GeneralParameterTypeMismatchWith1Type, paramName)); } } } diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index 46b7e51863..baa58f8aa0 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -46,12 +46,24 @@ public class SpecifyParametersModel extends AbstractDescribableImpl { + // FOR GUI private final static EnumDescription STRING_TYPE = new EnumDescription("String", "String"); private final static EnumDescription NUMBER_TYPE = new EnumDescription("Number", "Number"); private final static EnumDescription DATE_TYPE = new EnumDescription("Date", "Date"); private final static EnumDescription BOOL_TYPE = new EnumDescription("Boolean", "Boolean"); private final static EnumDescription ANY_TYPE = new EnumDescription("Any", "Any"); - public final static List paramTypes = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE); + + public final static List paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE); + + // FOR API + private final static EnumDescription INT_TYPE = new EnumDescription("Int", "Int"); + private final static EnumDescription FLOAT_TYPE = new EnumDescription("Float", "Float"); + private final static EnumDescription DATETIME_TYPE = new EnumDescription("DateTime", "DateTime"); + private final static EnumDescription LONG_TYPE = new EnumDescription("Long", "Long"); + private final static EnumDescription DOUBLE_TYPE = new EnumDescription("Double", "Double"); + private final static EnumDescription DECIMAL_TYPE = new EnumDescription("Decimal", "Decimal"); + + public final static List paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE); private String parameterJson; @@ -96,8 +108,12 @@ public String getDisplayName() { return "Specify test parameters model"; } - public List getParamTypes() { - return paramTypes; + public List getParamTypesGUI() { + return paramTypesGUI; + } + + public List getParamTypesAPI() { + return paramTypesAPI; } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly index 5716cf94fa..cfb09e8ce5 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly @@ -105,11 +105,26 @@ + + + + + + + + + diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 0fcfd7ba27..75d4d72019 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -101,9 +101,14 @@ function startListeningForParameters(mainContainer) { const rowInputs = main.querySelectorAll(".test-param > div > .num-of-test-spinner"); prepareTestInput(); - rowInputs.forEach(rowInput => rowInput.addEventListener("click", () => { - updateTest(main, rowInput, testInput); - })); + rowInputs.forEach(rowInput => { + rowInput.addEventListener("click", () => { + updateTest(main, rowInput, testInput); + }); + rowInput.addEventListener("change", () => { + updateTest(main, rowInput, testInput); + }) + }); const chkAreParamsEnabled = main.querySelector("input[name='areParametersEnabled']"); if (chkAreParamsEnabled) { @@ -141,7 +146,7 @@ function generateAndPutJSONResult(container) { const val = elem.querySelector(`#parameterInputValue_${elem.dataset.index}`); if (curr["type"] === "Boolean") { curr["value"] = val.checked; - } else if (curr["type"] === "Date") { + } else if (curr["type"] === "Date" || curr["type"] === "DateTime") { const date = new Date(val.value); curr["value"] = `${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}/${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth()}/${date.getFullYear()}`; } else { @@ -213,14 +218,22 @@ function addNewParam(container) { const testLabel = paramContainer.querySelector(`#parameterInputTest_${nextIdx}`); const spinner = paramContainer.querySelector(`#parameterInputRow_${nextIdx}`); - spinner.addEventListener("click", () => { + + const handleSpinner = () => { if (spinner.value === '') { testLabel.value = ""; return; } testLabel.value = queryTestInput(container).value.split("\n")[parseInt(spinner.value) - 1] || "Please, specify tests first"; + }; + spinner.addEventListener("click", () => { + handleSpinner(); }); + spinner.addEventListener("change", () => { + handleSpinner(); + }); + spinner.dispatchEvent(new Event("change")); Array.from(paramContainer.querySelectorAll(`[name='parameterInput']`)).filter(input => input.getAttribute("id").endsWith("_" + nextIdx.toString())) @@ -250,7 +263,13 @@ if (typeof mapForTypeAssociations === "undefined") { Boolean: 'checkbox', Password: 'password', Date: 'date', - Any: 'text' + Any: 'text', + Float: 'number', + Double: 'number', + Decimal: 'number', + Long: 'number', + DateTime: 'date', + Int: 'number' }; } @@ -289,7 +308,7 @@ function loadParamInputs(container) { valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); if (typeField.value === "Boolean") { valueField.checked = currElemVal["value"] || false; - } else if (typeField.value === "Date") { + } else if (typeField.value === "Date" || typeField.value === "DateTime") { const date = new Date(currElemVal["value"].split("/").reverse().join("-")) || Date.now(); valueField.value = `${date.getFullYear()}-${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)}-${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}`; } else { @@ -306,6 +325,13 @@ function addToSelectableTypeList(type, typeListLength) { selectableTypeList += ``; } +function addSeparatorToTypeList(group, idx) { + if (idx > 1) { + selectableTypeList += ''; + } + selectableTypeList += ``; +} + function normalizeJsonFormat(str) { // because of certain security policies, on some servers the special characters could be escaped twice, we need to parse them twice let ret = str; From 768ccfd8f67b1ae1f2b82adc278d61c9a310676a Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 22 Feb 2022 16:53:06 +0200 Subject: [PATCH 2057/2502] refactor for type dropdown --- .../uft/model/SpecifyParametersModel.java | 20 ++++++++++++++++--- .../model/SpecifyParametersModel/config.jelly | 20 ++++++++----------- src/main/webapp/js/specifyParametersUtils.js | 11 ++++++++-- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index baa58f8aa0..8274a8918b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -39,9 +39,7 @@ import net.minidev.json.parser.ParseException; import javax.annotation.Nonnull; -import java.util.Arrays; -import java.util.List; -import java.util.Properties; +import java.util.*; import java.util.stream.Collectors; public class SpecifyParametersModel extends AbstractDescribableImpl { @@ -65,6 +63,14 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE); + public final static Map> mapping = new HashMap<>(); + public final static int numOfTypes = paramTypesAPI.size() + paramTypesGUI.size(); + + static { + mapping.put("GUI", paramTypesGUI); + mapping.put("API", paramTypesAPI); + } + private String parameterJson; @DataBoundConstructor @@ -115,6 +121,14 @@ public List getParamTypesGUI() { public List getParamTypesAPI() { return paramTypesAPI; } + + public Map> getMapping() { + return mapping; + } + + public int getNumOfTypes() { + return numOfTypes; + } } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly index cfb09e8ce5..2f889dfdc3 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly @@ -105,23 +105,19 @@ - - + - - + + + - diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 75d4d72019..f752eafa3d 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -325,10 +325,17 @@ function addToSelectableTypeList(type, typeListLength) { selectableTypeList += ``; } -function addSeparatorToTypeList(group, idx) { - if (idx > 1) { +function addSeparatorToTypeList(group, idx, groupsLength) { + // do not populate the list again, if already populated + // happens when multiple jobs with parameters table is added to the base job + if (selectableTypeList.split("").length - 1 >= groupsLength) return; + + // special command, called with idx of -1 and group of null if separator needed + if (idx === -1 && group === null) { selectableTypeList += ''; + return; } + selectableTypeList += ``; } From 64e3c88fcb4eebe0a9056473994ee6088ca4200b Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 22 Feb 2022 17:23:29 +0200 Subject: [PATCH 2058/2502] refactor, changed variable name, fixed defect, in case of the Number type error was thrown for non-corresponding type --- HpToolsLauncher/TestParameterInfo.cs | 2 +- .../automation/tools/uft/model/SpecifyParametersModel.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HpToolsLauncher/TestParameterInfo.cs b/HpToolsLauncher/TestParameterInfo.cs index 5a56cf290f..ffd7755b3a 100644 --- a/HpToolsLauncher/TestParameterInfo.cs +++ b/HpToolsLauncher/TestParameterInfo.cs @@ -73,6 +73,7 @@ public object ParseValue() val = v; } break; + case "number": case "password": case "string": case "any": @@ -168,7 +169,6 @@ public object ParseValue() val = v5; } break; - case "number": case "decimal": decimal v6; ok = decimal.TryParse(this.Value, out v6); diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index 8274a8918b..a066884695 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -64,7 +64,7 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE); public final static Map> mapping = new HashMap<>(); - public final static int numOfTypes = paramTypesAPI.size() + paramTypesGUI.size(); + public final static int NUM_OF_TYPES = paramTypesAPI.size() + paramTypesGUI.size(); static { mapping.put("GUI", paramTypesGUI); @@ -127,7 +127,7 @@ public Map> getMapping() { } public int getNumOfTypes() { - return numOfTypes; + return NUM_OF_TYPES; } } From 05589fe516c561a8f2ac412a232bfd64699ca5c4 Mon Sep 17 00:00:00 2001 From: EPlesca Date: Wed, 23 Feb 2022 19:50:53 +0200 Subject: [PATCH 2059/2502] [maven-release-plugin] prepare release hp-application-automation-tools-plugin-7.2.3-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b534ccafd6..b618053531 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.2.2-beta-SNAPSHOT + 7.2.3-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - micro-focus-application-automation-tools-plugin-5.5.4-beta + hp-application-automation-tools-plugin-7.2.3-beta From a6cf8fd91c0eeba8866d2d0e6f6d7851b4453c32 Mon Sep 17 00:00:00 2001 From: EPlesca Date: Wed, 23 Feb 2022 19:51:02 +0200 Subject: [PATCH 2060/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b618053531..89156b6903 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ hp-application-automation-tools-plugin - 7.2.3-beta + 7.2.3-beta-SNAPSHOT hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -81,7 +81,7 @@ scm:git:ssh://git@github.com/jenkinsci/hpe-application-automation-tools-plugin.git https://github.com/jenkinsci/hpe-application-automation-tools-plugin - hp-application-automation-tools-plugin-7.2.3-beta + micro-focus-application-automation-tools-plugin-5.5.4-beta From 47289f827646554ade6b2a4a4889ebbd602d678d Mon Sep 17 00:00:00 2001 From: karoi Date: Sun, 27 Feb 2022 13:52:09 +0200 Subject: [PATCH 2061/2502] tech- advance sdk version for UFT actions parsing fix --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19f59fdac1..e5335cdba9 100644 --- a/pom.xml +++ b/pom.xml @@ -508,7 +508,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.7.3.6 + 2.7.3.7 From 023e8a2b9390f692b48d847e2b0f9a0d0767ada1 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 17 Feb 2022 11:14:03 +0200 Subject: [PATCH 2062/2502] DEF-735118 [Jenkins][ALM] All Test Sets are run if "\" is used as path --- HpToolsLauncher/Launcher.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 6adcc6983c..bf3a3339c4 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -362,7 +362,7 @@ private IAssetRunner CreateRunner(TestStorageType runType, bool initialTestRun, ConsoleWriter.WriteLine(string.Format(Resources.LauncherDisplayRunmode, enmQcRunMode.ToString())); //go over test sets in the parameters, and collect them - List sets = GetParamsWithPrefix("TestSet"); + List sets = GetParamsWithPrefix("TestSet", true); if (sets.Count == 0) { @@ -817,7 +817,7 @@ private void CheckAndSetMobileProxySettings(ref McConnectionInfo mcConnectionInf } } - private List GetParamsWithPrefix(string prefix) + private List GetParamsWithPrefix(string prefix, bool skipEmptyEntries = false) { int idx = 1; List parameters = new List(); @@ -826,8 +826,11 @@ private List GetParamsWithPrefix(string prefix) string set = _ciParams[prefix + idx]; if (set.StartsWith("Root\\")) set = set.Substring(5); - set = set.TrimEnd("\\".ToCharArray()); - parameters.Add(set.TrimEnd()); + set = set.TrimEnd(" \\".ToCharArray()); + if (!(skipEmptyEntries && string.IsNullOrWhiteSpace(set))) + { + parameters.Add(set); + } ++idx; } return parameters; @@ -844,9 +847,9 @@ private Dictionary GetKeyValuesWithPrefix(string prefix) string set = _ciParams[prefix + idx]; if (set.StartsWith("Root\\")) set = set.Substring(5); - set = set.TrimEnd("\\".ToCharArray()); + set = set.TrimEnd(" \\".ToCharArray()); string key = prefix + idx; - dict[key] = set.TrimEnd(); + dict[key] = set; ++idx; } From 3e2efc7c3e01968e157eea4fab26c1384550a410 Mon Sep 17 00:00:00 2001 From: motteww Date: Wed, 2 Mar 2022 13:43:49 -0800 Subject: [PATCH 2063/2502] Us321046:As a user, in the Jenkins plugin, I can use the execution token instead of username-password for authentication in existing build steps --- .../automation/tools/mc/Constants.java | 3 + .../automation/tools/mc/HttpUtils.java | 7 +- .../tools/mc/JobConfigurationProxy.java | 222 ++++++++++------- .../automation/tools/mc/Oauth2TokenUtil.java | 71 ++++++ .../automation/tools/model/AuthModel.java | 87 +++++++ .../automation/tools/model/ProxySettings.java | 13 +- .../tools/model/RunFromFileSystemModel.java | 174 ++++++------- .../tools/model/UploadAppModel.java | 31 +-- .../tools/run/RunFromFileBuilder.java | 124 ++++------ .../tools/run/UploadAppBuilder.java | 86 +++---- .../tools/run/RunFromFileBuilder/config.jelly | 31 ++- .../tools/run/UploadAppBuilder/config.jelly | 29 ++- src/main/webapp/configure.js | 231 +++++++++--------- src/main/webapp/parallelRunnerEnvironment.js | 18 +- 14 files changed, 654 insertions(+), 473 deletions(-) create mode 100644 src/main/java/com/microfocus/application/automation/tools/mc/Oauth2TokenUtil.java create mode 100644 src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java index d59636d60d..9ac2b99d14 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java @@ -44,12 +44,15 @@ public class Constants { public static final String LOGIN_SECRET = "x-hp4msecret"; public static final String SPLIT_COMMA = ";"; public static final String JSESSIONID = "JSESSIONID"; + public static final String LWSSO_COOKIE_KEY = "LWSSO_COOKIE_KEY"; + public static final String OAUTH2_COOKIE_KEY = "OAUTH2_COOKIE_KEY"; public static final String ACCEPT = "Accept"; public static final String CONTENT_TYPE = "Content-Type"; public static final String COOKIE = "Cookie"; public static final String SET_COOKIE = "Set-Cookie"; public static final String EQUAL = "="; public static final String LOGIN_URL = "/rest/client/login"; + public static final String LOGIN_URL_OAUTH = "/rest/client/v2/oauth2/login"; public static final String CREATE_JOB_URL = "/rest/job/createTempJob"; public static final String GET_JOB_UEL = "/rest/job/"; public final static String ICON = "icon"; diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java index 39a8fd9c84..e5324c82bc 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java @@ -100,17 +100,20 @@ private static HttpResponse doHttp(ProxyInfo proxyInfo, String requestMethod, St connection.connect(); - int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { InputStream inputStream = connection.getInputStream(); JSONObject jsonObject = convertStreamToJSONObject(inputStream); + if (null == jsonObject) { + System.out.println(requestMethod + " " + connectionUrl + " return is null."); + } Map> headerFields = connection.getHeaderFields(); response.setHeaders(headerFields); response.setJsonObject(jsonObject); + } else { + System.out.println(requestMethod + " " + connectionUrl + " failed with response code:" + responseCode); } - connection.disconnect(); return response; diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 4a5658650d..8e1d518f6b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -28,6 +28,8 @@ package com.microfocus.application.automation.tools.mc; +import com.microfocus.application.automation.tools.model.AuthModel; +import com.microfocus.application.automation.tools.model.ProxySettings; import com.microfocus.application.automation.tools.sse.common.StringUtils; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; @@ -51,75 +53,100 @@ public class JobConfigurationProxy { private JobConfigurationProxy() { } - public static JobConfigurationProxy getInstance(){ - if(instance == null){ + public static JobConfigurationProxy getInstance() { + if (instance == null) { instance = new JobConfigurationProxy(); } return instance; } //Login to MC - public JSONObject loginToMC(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, - String proxyAddress, String proxyUsername, String proxyPassword) { + public JSONObject loginToMC(String mcUrl, AuthModel authModel, ProxySettings proxy) { JSONObject returnObject = new JSONObject(); try { Map headers = new HashMap(); headers.put(Constants.ACCEPT, "application/json"); headers.put(Constants.CONTENT_TYPE, "application/json;charset=UTF-8"); -// headers.put("TENANT_ID_COOKIE", mcTenantId); JSONObject sendObject = new JSONObject(); - if(!StringUtils.isNullOrEmpty(mcTenantId)){ - mcUserName = mcUserName + "#" + mcTenantId; + if (null == proxy) { + proxy = new ProxySettings(); } - sendObject.put("name", mcUserName); - sendObject.put("password", mcPassword); - sendObject.put("accountName", "default"); - HttpResponse response = HttpUtils.post(HttpUtils.setProxyCfg(proxyAddress, proxyUsername, proxyPassword), mcUrl + Constants.LOGIN_URL, headers, sendObject.toJSONString().getBytes()); - - if (response != null && response.getHeaders() != null) { - Map> headerFields = response.getHeaders(); - List hp4mSecretList = headerFields.get(Constants.LOGIN_SECRET); - String hp4mSecret = null; - if (hp4mSecretList != null && hp4mSecretList.size() != 0) { - hp4mSecret = hp4mSecretList.get(0); + HttpResponse response; + if ("base".equals(authModel.getValue())) { + if (!StringUtils.isNullOrEmpty(authModel.getMcTenantId())) { + authModel.setMcUserName(authModel.getMcUserName() + "#" + authModel.getMcTenantId()); } - List setCookieList = headerFields.get(Constants.SET_COOKIE); - String setCookie = null; - String tenantCookie = null; - if (setCookieList != null && setCookieList.size() != 0) { - setCookie = setCookieList.get(0); - for(String str : setCookieList){ - if(str.contains(Constants.JSESSIONID) && str.startsWith(Constants.JSESSIONID)){ - setCookie = str; - continue; - }else if(str.contains(Constants.TENANT_COOKIE) && str.startsWith(Constants.TENANT_COOKIE)){ - tenantCookie = str; - continue; - } - } - } - String jsessionId = getCookieValue(setCookie, Constants.JSESSIONID); - String tenantId = getCookieValue(tenantCookie, Constants.TENANT_COOKIE); - returnObject.put(Constants.JSESSIONID, jsessionId); - returnObject.put(Constants.TENANT_COOKIE, tenantId); - returnObject.put(Constants.LOGIN_SECRET, hp4mSecret); - String cookies = Constants.JESEEIONEQ + jsessionId; - if(!StringUtils.isNullOrEmpty(tenantId)){ - cookies = cookies + Constants.TENANT_EQ + tenantId; - } - returnObject.put(Constants.COOKIE, cookies); + sendObject.put("name", authModel.getMcUserName()); + sendObject.put("password", authModel.getMcPassword()); + sendObject.put("accountName", "default"); + response = HttpUtils.post(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL, headers, sendObject.toJSONString().getBytes()); + } else { + headers.put(Constants.ACCEPT, "application/json"); + headers.put(Constants.CONTENT_TYPE, "application/json;charset=UTF-8"); + Oauth2TokenUtil.validate(authModel.getMcExecToken()); + sendObject.put("client", Oauth2TokenUtil.getClient()); + sendObject.put("secret", Oauth2TokenUtil.getSecret()); + sendObject.put("tenant", Oauth2TokenUtil.getTenant()); + response = HttpUtils.post(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL_OAUTH, headers, sendObject.toJSONString().getBytes()); } - + return parseLoginResponse(response); } catch (Exception e) { e.printStackTrace(); } return returnObject; } + private JSONObject parseLoginResponse(HttpResponse response) { + if (response != null && response.getHeaders() != null) { + Map> headerFields = response.getHeaders(); + List hp4mSecretList = headerFields.get(Constants.LOGIN_SECRET); + String hp4mSecret = null; + if (hp4mSecretList != null && hp4mSecretList.size() != 0) { + hp4mSecret = hp4mSecretList.get(0); + } + List setCookieList = headerFields.get(Constants.SET_COOKIE); + String cookies = null; + String setCookie = null; + String tenantCookie = null; + String oauth2Cookie = null; + if (setCookieList != null && setCookieList.size() != 0) { + setCookie = setCookieList.get(0); + for (String str : setCookieList) { + if (str.contains(Constants.JSESSIONID) && str.startsWith(Constants.JSESSIONID)) { + setCookie = str; + cookies += (str + ';'); + continue; + } else if (str.contains(Constants.TENANT_COOKIE) && str.startsWith(Constants.TENANT_COOKIE)) { + tenantCookie = str; + cookies += (str + ';'); + continue; + } else if (str.contains(Constants.OAUTH2_COOKIE_KEY) && str.startsWith(Constants.OAUTH2_COOKIE_KEY)) { + oauth2Cookie = str; + continue; + } + } + } + JSONObject returnObject = new JSONObject(); + String jsessionId = getCookieValue(setCookie, Constants.JSESSIONID); + String tenantId = getCookieValue(tenantCookie, Constants.TENANT_COOKIE); + if (!StringUtils.isNullOrEmpty(oauth2Cookie)) { + String oauth = getCookieValue(oauth2Cookie, Constants.OAUTH2_COOKIE_KEY); + returnObject.put(Constants.OAUTH2_COOKIE_KEY, oauth); + } + + returnObject.put(Constants.JSESSIONID, jsessionId); + returnObject.put(Constants.TENANT_COOKIE, tenantId); + + returnObject.put(Constants.LOGIN_SECRET, hp4mSecret); + returnObject.put(Constants.COOKIE, cookies); + return returnObject; + } + return null; + } + //upload app to MC - public JSONObject upload(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, - String proxyAddress, String proxyUsername, String proxyPassword, String appPath) throws Exception { + public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, String appPath) throws Exception { JSONObject json = null; String hp4mSecret = null; @@ -138,33 +165,44 @@ public JSONObject upload(String mcUrl, String mcUserName, String mcPassword, Str outputStream.write(content.toString().getBytes()); - FileInputStream in = new FileInputStream(appFile); - byte[] b = new byte[1024]; - int i = 0; - while ((i = in.read(b)) != -1) { - outputStream.write(b, 0, i); + try (FileInputStream in = new FileInputStream(appFile)) { + byte[] b = new byte[1024]; + int i = 0; + while ((i = in.read(b)) != -1) { + outputStream.write(b, 0, i); + } } - in.close(); outputStream.write(("\r\n------" + Constants.BOUNDARYSTR + "--\r\n").getBytes()); byte[] bytes = outputStream.toByteArray(); outputStream.close(); - - JSONObject loginJson = loginToMC(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUsername, proxyPassword); - + if (null == proxy) { + proxy = new ProxySettings(); + } + Map headers = new HashMap(); + JSONObject loginJson = loginToMC(mcUrl, authModel, proxy); if (loginJson != null) { hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); jsessionId = (String) loginJson.get(Constants.JSESSIONID); + headers.put(Constants.LOGIN_SECRET, hp4mSecret); + String cookies = Constants.JESEEIONEQ + jsessionId; + if ("token".equals(authModel.getValue())) { + String oauth=(String) loginJson.get(Constants.OAUTH2_COOKIE_KEY); + if(!StringUtils.isNullOrEmpty(oauth)) { + cookies += (";" + Constants.OAUTH2_COOKIE_KEY + "=" + (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY)); + }else { + System.out.println("ERROR:: loginToMC failed with null oauth cookie."); + } + } + headers.put(Constants.COOKIE, cookies); } - Map headers = new HashMap(); - headers.put(Constants.LOGIN_SECRET, hp4mSecret); - headers.put(Constants.COOKIE, Constants.JESEEIONEQ + jsessionId); + headers.put(Constants.CONTENT_TYPE, Constants.CONTENT_TYPE_DOWNLOAD_VALUE + Constants.BOUNDARYSTR); headers.put(Constants.FILENAME, appFile.getName()); - HttpUtils.ProxyInfo proxyInfo = HttpUtils.setProxyCfg(proxyAddress, proxyUsername, proxyPassword); + HttpUtils.ProxyInfo proxyInfo = HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); HttpResponse response = HttpUtils.post(proxyInfo, uploadUrl, headers, bytes); if (response != null && response.getJsonObject() != null) { @@ -174,18 +212,19 @@ public JSONObject upload(String mcUrl, String mcUserName, String mcPassword, Str } //create one temp job - public String createTempJob(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, String proxyAddress, String proxyUserName, String proxyPassword) { + public String createTempJob(String mcUrl, AuthModel authModel, ProxySettings proxy) { JSONObject job = null; String jobId = null; String hp4mSecret = null; String jsessionId = null; - - String loginJson = loginToMC(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword).toJSONString(); + if (null == proxy) { + proxy = new ProxySettings(); + } + JSONObject loginJson = loginToMC(mcUrl, authModel, proxy); try { if (loginJson != null) { - JSONObject jsonObject = (JSONObject) JSONValue.parseStrict(loginJson); - hp4mSecret = (String) jsonObject.get(Constants.LOGIN_SECRET); - jsessionId = (String) jsonObject.get(Constants.JSESSIONID); + hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); + jsessionId = (String) loginJson.get(Constants.JSESSIONID); } } catch (Exception e) { e.printStackTrace(); @@ -197,13 +236,19 @@ public String createTempJob(String mcUrl, String mcUserName, String mcPassword, try { Map headers = new HashMap(); headers.put(Constants.LOGIN_SECRET, hp4mSecret); - headers.put(Constants.COOKIE, Constants.JESEEIONEQ + jsessionId); - HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxyAddress,proxyUserName,proxyPassword), mcUrl + Constants.CREATE_JOB_URL, headers, null); + if (loginJson != null) { + String cookies = Constants.JESEEIONEQ + jsessionId; + if ("token".equals(authModel.getValue())) { + cookies += (";" + Constants.OAUTH2_COOKIE_KEY + "=" + (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY)); + } + headers.put(Constants.COOKIE, cookies); + } + HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.CREATE_JOB_URL, headers, null); if (response != null && response.getJsonObject() != null) { job = response.getJsonObject(); - if(job != null && job.get("data") != null){ - JSONObject data = (JSONObject)job.get("data"); + if (job != null && job.get("data") != null) { + JSONObject data = (JSONObject) job.get("data"); jobId = data.getAsString("id"); } } @@ -215,17 +260,18 @@ public String createTempJob(String mcUrl, String mcUserName, String mcPassword, } //get one job by id - public JSONObject getJobById(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, String proxyAddress, String proxyUsername, String proxyPassword, String jobUUID) { + public JSONObject getJobById(String mcUrl, AuthModel authModel, ProxySettings proxy, String jobUUID) { JSONObject jobJsonObject = null; String hp4mSecret = null; String jsessionId = null; - - String loginJson = loginToMC(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUsername, proxyPassword).toJSONString(); + if (null == proxy) { + proxy = new ProxySettings(); + } + JSONObject loginJson = loginToMC(mcUrl, authModel, proxy); try { if (loginJson != null) { - JSONObject jsonObject = (JSONObject) JSONValue.parseStrict(loginJson); - hp4mSecret = (String) jsonObject.get(Constants.LOGIN_SECRET); - jsessionId = (String) jsonObject.get(Constants.JSESSIONID); + hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); + jsessionId = (String) loginJson.get(Constants.JSESSIONID); } } catch (Exception e) { e.printStackTrace(); @@ -237,14 +283,20 @@ public JSONObject getJobById(String mcUrl, String mcUserName, String mcPassword, try { Map headers = new HashMap(); headers.put(Constants.LOGIN_SECRET, hp4mSecret); - headers.put(Constants.COOKIE, Constants.JESEEIONEQ + jsessionId); - HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxyAddress, proxyUsername, proxyPassword), mcUrl + Constants.GET_JOB_UEL + jobUUID, headers, null); + if (loginJson != null) { + String cookies = Constants.JESEEIONEQ + jsessionId; + if ("token".equals(authModel.getValue())) { + cookies += (";" + Constants.OAUTH2_COOKIE_KEY + "=" + (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY)); + } + headers.put(Constants.COOKIE, cookies); + } + HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.GET_JOB_UEL + jobUUID, headers, null); if (response != null && response.getJsonObject() != null) { jobJsonObject = response.getJsonObject(); } - if(jobJsonObject != null){ - jobJsonObject = (JSONObject)jobJsonObject.get(Constants.DATA); + if (jobJsonObject != null) { + jobJsonObject = (JSONObject) jobJsonObject.get(Constants.DATA); } } catch (Exception e) { e.printStackTrace(); @@ -254,8 +306,8 @@ public JSONObject getJobById(String mcUrl, String mcUserName, String mcPassword, } //parse one job.and get the data we want - public JSONObject getJobJSONData(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, String proxyAddress, String proxyUserName, String proxyPassword, String jobUUID) { - JSONObject jobJSON = getJobById(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, jobUUID); + public JSONObject getJobJSONData(String mcUrl, AuthModel authModel, ProxySettings proxy, String jobUUID) { + JSONObject jobJSON = getJobById(mcUrl, authModel, proxy, jobUUID); JSONObject returnJSON = new JSONObject(); @@ -310,7 +362,7 @@ public JSONObject getJobJSONData(String mcUrl, String mcUserName, String mcPassw extraAPPJSON.put("extraAppName", extraAppName); extraAPPJSON.put("instrumented", instrumented ? "Packaged" : "Not Packaged"); - if(extraApps.length() > 1){ + if (extraApps.length() > 1) { extraApps.append(";\n"); } extraApps.append(extraAppName).append("\t\t").append(instrumented ? "Packaged" : "Not Packaged"); @@ -400,7 +452,7 @@ private JSONObject parseJSONString(String jsonString) { } private String getCookieValue(String setCookie, String cookieName) { - if(StringUtils.isNullOrEmpty(setCookie)){ + if (StringUtils.isNullOrEmpty(setCookie)) { return null; } String id = null; @@ -428,13 +480,13 @@ private boolean argumentsCheck(String... args) { private String removeLastSemicolon(StringBuffer sb) { String result = sb.toString(); int indexOf = result.lastIndexOf(";"); - if(indexOf > 0){ + if (indexOf > 0) { result = result.substring(0, indexOf); } return result; } - private JSONObject removeIcon(JSONObject jobJSON){ + private JSONObject removeIcon(JSONObject jobJSON) { JSONArray extArr = null; if (jobJSON != null) { if (jobJSON != null) { diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/Oauth2TokenUtil.java b/src/main/java/com/microfocus/application/automation/tools/mc/Oauth2TokenUtil.java new file mode 100644 index 0000000000..caafd6361b --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/mc/Oauth2TokenUtil.java @@ -0,0 +1,71 @@ +package com.microfocus.application.automation.tools.mc; + +import java.util.regex.Pattern; + +public class Oauth2TokenUtil { + + private static String client; + private static String secret; + private static String tenant; + + public static boolean validate(String auth2) { + String strCleaned = removeQuotes(auth2.trim()); + String[] a = strCleaned.split(Pattern.quote(";")); + for (String s : a) { + if (s == null) { + return false; + } + if (s.trim().isEmpty()) { + continue; + } + if (!extractField(s.trim())) { + return false; + } + } + + return true; + } + + private static String removeQuotes(final String str) { + if (str.endsWith("\"") && str.startsWith("\"") && str.length() > 1) { + return str.substring(1, str.length() - 1); + } + return str; + } + + private static boolean extractField(String str) { + int pos = str.indexOf("="); + if (pos < 0) { + return false; + } + + String key = str.substring(0, pos).trim(); + String value = str.substring(pos + 1).trim(); + + if ("client".equalsIgnoreCase(key)) { + client = value; + return true; + } else if ("secret".equalsIgnoreCase(key)) { + secret = value; + return true; + } else if ("tenant".equalsIgnoreCase(key)) { + tenant = value; + return true; + } + + return false; + } + + public static String getClient() { + return client; + } + + public static String getSecret() { + return secret; + } + + public static String getTenant() { + return tenant; + } + +} diff --git a/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java b/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java new file mode 100644 index 0000000000..4ef5071c56 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java @@ -0,0 +1,87 @@ +package com.microfocus.application.automation.tools.model; + +import hudson.util.Secret; +import org.kohsuke.stapler.DataBoundConstructor; + +import java.io.Serializable; + +public class AuthModel implements Serializable { + private String mcUserName; + private Secret mcPassword; + private String mcTenantId; + private Secret mcExecToken; + private String value; + + @DataBoundConstructor + public AuthModel(String mcUserName, String mcPassword, String mcTenantId, String mcExecToken, String value) { + this.mcUserName = mcUserName; + this.mcPassword = Secret.fromString(mcPassword); + this.mcTenantId = mcTenantId; + this.mcExecToken = Secret.fromString(mcExecToken); + this.value = value; + } + + public String getMcUserName() { + return mcUserName; + } + + public String getMcPassword() { + if (null != mcPassword) { + return mcPassword.getPlainText(); + } else { + return null; + } + } + + public String getMcTenantId() { + return mcTenantId; + } + + public String getMcExecToken() { + if (null != mcExecToken) { + return mcExecToken.getPlainText(); + } else { + return null; + } + } + + public void setMcUserName(String mcUserName) { + this.mcUserName = mcUserName; + } + + public void setMcPassword(String mcPassword) { + this.mcPassword = Secret.fromString(mcPassword); + } + + public void setMcTenantId(String mcTenantId) { + this.mcTenantId = mcTenantId; + } + + public void setMcExecToken(String mcExecToken) { + this.mcExecToken = Secret.fromString(mcExecToken); + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getMcEncryptedExecToken() { + if (null != mcExecToken) { + return mcExecToken.getEncryptedValue(); + } else { + return null; + } + } + + public String getMcEncryptedPassword() { + if (null != mcPassword) { + return mcPassword.getEncryptedValue(); + } else { + return null; + } + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/model/ProxySettings.java b/src/main/java/com/microfocus/application/automation/tools/model/ProxySettings.java index 4203e83cd7..c703fa7249 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/ProxySettings.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/ProxySettings.java @@ -44,12 +44,15 @@ public class ProxySettings { private String fsProxyUserName; private Secret fsProxyPassword; + public ProxySettings() { + } + @DataBoundConstructor - public ProxySettings(boolean fsUseAuthentication, String fsProxyAddress, String fsProxyUserName, Secret fsProxyPassword) { + public ProxySettings(boolean fsUseAuthentication, String fsProxyAddress, String fsProxyUserName, String fsProxyPassword) { this.fsUseAuthentication = fsUseAuthentication; this.fsProxyAddress = fsProxyAddress; this.fsProxyUserName = fsProxyUserName; - this.fsProxyPassword = fsProxyPassword; + this.fsProxyPassword = Secret.fromString(fsProxyPassword); } public boolean isFsUseAuthentication() { @@ -65,6 +68,10 @@ public String getFsProxyUserName() { } public String getFsProxyPassword() { - return fsProxyPassword.getPlainText(); + if (null != fsProxyPassword) { + return fsProxyPassword.getPlainText(); + } else { + return null; + } } } diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java index 83b1ac2f47..5e6630fbc9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java @@ -29,24 +29,21 @@ package com.microfocus.application.automation.tools.model; import com.microfocus.application.automation.tools.EncryptionUtils; -import com.microfocus.application.automation.tools.uft.model.UftSettingsModel; -import com.microfocus.application.automation.tools.uft.utils.UftToolUtils; import com.microfocus.application.automation.tools.mc.JobConfigurationProxy; +import com.microfocus.application.automation.tools.uft.utils.UftToolUtils; import hudson.EnvVars; import hudson.Extension; import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; -import hudson.model.TaskListener; -import hudson.util.Secret; -import hudson.util.VariableResolver; import net.minidev.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.io.File; -import java.util.*; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; /** * Holds the data for RunFromFile build type. @@ -73,9 +70,6 @@ public class RunFromFileSystemModel extends AbstractDescribableImpl getFsUftRunModes() { return fsUftRunModes; } + public List getFsUftRunModes() { + return fsUftRunModes; + } /** * Gets mc server name. @@ -386,41 +362,26 @@ public String getMcServerName() { } /** - * Gets fs user name. - * - * @return the fs user name + * Sets the report path for the given tests. */ - public String getFsUserName() { - return fsUserName; + public void setFsReportPath(String fsReportPath) { + this.fsReportPath = fsReportPath; } - /** - * Gets fs password. - * - * @return the fs password - */ - public String getFsPassword() { + public String getMcPassword() { //Temp fix till supported in pipeline module in LR - if(fsPassword == null) - { + if (authModel.getMcPassword() == null) { return null; } - return fsPassword.getEncryptedValue(); - } - - public String getMcTenantId() { - return mcTenantId; + return authModel.getMcEncryptedPassword(); } - public void setMcTenantId(String mcTenantId) { - this.mcTenantId = mcTenantId; - } - - /** - * Sets the report path for the given tests. - */ - public void setFsReportPath(String fsReportPath) { - this.fsReportPath = fsReportPath; + public String getMcExecToken() { + //Temp fix till supported in pipeline module in LR + if (authModel.getMcExecToken() == null) { + return null; + } + return authModel.getMcEncryptedExecToken(); } /** @@ -649,14 +610,24 @@ public void setPerScenarioTimeOut(String perScenarioTimeOut) { this.perScenarioTimeOut = perScenarioTimeOut; } + public AuthModel getAuthModel() { + return authModel; + } + + public void setAuthModel(AuthModel authModel) { + this.authModel = authModel; + } + public String getAuthType() { + return authModel == null ? "base" : authModel.getValue(); + } /** * Gets properties. * * @param envVars the env vars * @return the properties */ - @Nullable - public Properties getProperties(EnvVars envVars) { + @Nullable + public Properties getProperties(EnvVars envVars) { return createProperties(envVars); } @@ -701,80 +672,73 @@ private Properties createProperties(EnvVars envVars) { String perScenarioTimeOutVal = StringUtils.isEmpty(perScenarioTimeOut) ? "10" : envVars.expand(perScenarioTimeOut); props.put("PerScenarioTimeOut", perScenarioTimeOutVal); - if (!StringUtils.isEmpty(ignoreErrorStrings.replaceAll("\\r|\\n", ""))){ - props.put("ignoreErrorStrings", ""+ignoreErrorStrings.replaceAll("\r", "")); + if (!StringUtils.isEmpty(ignoreErrorStrings.replaceAll("\\r|\\n", ""))) { + props.put("ignoreErrorStrings", "" + ignoreErrorStrings.replaceAll("\r", "")); } - if (StringUtils.isNotBlank(fsUserName)){ - props.put("MobileUserName", fsUserName); - } - if (StringUtils.isNotBlank(mcTenantId)){ - props.put("MobileTenantId", mcTenantId); - } - - if(StringUtils.isNotBlank(fsReportPath)) { + if (StringUtils.isNotBlank(fsReportPath)) { props.put("fsReportPath", fsReportPath); } - if(isUseProxy()){ + if (isUseProxy()) { props.put("MobileUseProxy", "1"); - props.put("MobileProxyType","2"); + props.put("MobileProxyType", "2"); props.put("MobileProxySetting_Address", proxySettings.getFsProxyAddress()); - if(isUseAuthentication()){ - props.put(MOBILE_PROXY_SETTING_AUTHENTICATION,"1"); - props.put(MOBILE_PROXY_SETTING_USER_NAME,proxySettings.getFsProxyUserName()); + if (isUseAuthentication()) { + props.put(MOBILE_PROXY_SETTING_AUTHENTICATION, "1"); + props.put(MOBILE_PROXY_SETTING_USER_NAME, proxySettings.getFsProxyUserName()); String encryptedPassword; try { encryptedPassword = EncryptionUtils.Encrypt(proxySettings.getFsProxyPassword(), EncryptionUtils.getSecretKey()); - }catch (Exception ex) { + } catch (Exception ex) { return null; // cannot continue without proper config } props.put(MOBILE_PROXY_SETTING_PASSWORD_FIELD, encryptedPassword); - }else{ - props.put(MOBILE_PROXY_SETTING_AUTHENTICATION,"0"); - props.put(MOBILE_PROXY_SETTING_USER_NAME,""); - props.put(MOBILE_PROXY_SETTING_PASSWORD_FIELD,""); + } else { + props.put(MOBILE_PROXY_SETTING_AUTHENTICATION, "0"); + props.put(MOBILE_PROXY_SETTING_USER_NAME, ""); + props.put(MOBILE_PROXY_SETTING_PASSWORD_FIELD, ""); } - }else{ + } else { props.put("MobileUseProxy", "0"); - props.put("MobileProxyType","0"); - props.put(MOBILE_PROXY_SETTING_AUTHENTICATION,"0"); + props.put("MobileProxyType", "0"); + props.put(MOBILE_PROXY_SETTING_AUTHENTICATION, "0"); props.put("MobileProxySetting_Address", ""); - props.put(MOBILE_PROXY_SETTING_USER_NAME,""); - props.put(MOBILE_PROXY_SETTING_PASSWORD_FIELD,""); + props.put(MOBILE_PROXY_SETTING_USER_NAME, ""); + props.put(MOBILE_PROXY_SETTING_PASSWORD_FIELD, ""); } - if(useSSL){ - props.put(MOBILE_USE_SSL,"1"); - }else{ - props.put(MOBILE_USE_SSL,"0"); + if (useSSL) { + props.put(MOBILE_USE_SSL, "1"); + } else { + props.put(MOBILE_USE_SSL, "0"); } + if (authModel.getValue().equals("base")) { + if (StringUtils.isNotBlank(authModel.getMcUserName())) { + props.put("MobileUserName", authModel.getMcUserName()); + } + if (StringUtils.isNotBlank(authModel.getMcTenantId())) { + props.put("MobileTenantId", authModel.getMcTenantId()); + } + } return props; } /** * Get proxy details json object. * - * @param mcUrl the mc url - * @param proxyAddress the proxy address - * @param proxyUserName the proxy user name - * @param proxyPassword the proxy password + * @param mcUrl the mc url * @return the json object */ - public JSONObject getJobDetails(String mcUrl, String proxyAddress, String proxyUserName, String proxyPassword){ - if(StringUtils.isBlank(fsUserName) || StringUtils.isBlank(fsPassword.getPlainText())){ - return null; - } - return JobConfigurationProxy - .getInstance().getJobById(mcUrl, fsUserName, fsPassword.getPlainText(), mcTenantId, proxyAddress, proxyUserName, proxyPassword, fsJobId); + public JSONObject getJobDetails(String mcUrl, ProxySettings proxy) { + return JobConfigurationProxy.getInstance().getJobById(mcUrl, authModel, proxy, fsJobId); } - @Extension public static class DescriptorImpl extends Descriptor { @Nonnull diff --git a/src/main/java/com/microfocus/application/automation/tools/model/UploadAppModel.java b/src/main/java/com/microfocus/application/automation/tools/model/UploadAppModel.java index 4f810f1771..77fedba84f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/UploadAppModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/UploadAppModel.java @@ -28,7 +28,6 @@ package com.microfocus.application.automation.tools.model; -import hudson.util.Secret; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; @@ -43,18 +42,14 @@ */ public class UploadAppModel { private String mcServerName; - private String mcUserName; - private Secret mcPassword; - private String mcTenantId; + private AuthModel authModel; private ProxySettings proxySettings; private List applicationPaths; @DataBoundConstructor - public UploadAppModel(String mcServerName, String mcUserName, String mcPassword, String mcTenantId, ProxySettings proxySettings, List applicationPaths) { + public UploadAppModel(String mcServerName, AuthModel authModel, ProxySettings proxySettings, List applicationPaths) { this.mcServerName = mcServerName; - this.mcUserName = mcUserName; - this.mcPassword = Secret.fromString(mcPassword); - this.mcTenantId = mcTenantId; + this.authModel = authModel; this.proxySettings = proxySettings; this.applicationPaths = applicationPaths; } @@ -63,18 +58,6 @@ public String getMcServerName() { return mcServerName; } - public String getMcUserName() { - return mcUserName; - } - - public String getMcPassword() { - return mcPassword.getPlainText(); - } - - public String getMcTenantId() { - return mcTenantId; - } - public ProxySettings getProxySettings() { return proxySettings; } @@ -90,4 +73,12 @@ public boolean isUseAuthentication() { public List getApplicationPaths() { return applicationPaths; } + + public AuthModel getAuthModel() { + return authModel; + } + + public String getAuthType() { + return authModel == null ? "base" : authModel.getValue(); + } } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index e1dab59bc1..bc5bb159e9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -145,8 +145,6 @@ public RunFromFileBuilder(RunFromFileSystemModel runFromFileModel) { * @param analysisTemplate the analysis template * @param displayController the display controller * @param mcServerName the mc server name - * @param fsUserName the fs user name - * @param fsPassword the fs password * @param fsDeviceId the fs device id * @param fsTargetLab the fs target lab * @param fsManufacturerAndModel the fs manufacturer and model @@ -165,15 +163,14 @@ public RunFromFileBuilder(RunFromFileSystemModel runFromFileModel) { @Deprecated public RunFromFileBuilder(String fsTests, String fsTimeout, String fsUftRunMode, String controllerPollingInterval, String perScenarioTimeOut, String ignoreErrorStrings, String displayController, - String analysisTemplate, String mcServerName, String fsUserName, String fsPassword, - String mcTenantId, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, + String analysisTemplate, String mcServerName, AuthModel authModel, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, String fsExtraApps, String fsJobId, ProxySettings proxySettings, boolean useSSL, boolean isParallelRunnerEnabled, String fsReportPath) { this.isParallelRunnerEnabled = isParallelRunnerEnabled; runFromFileModel = new RunFromFileSystemModel(fsTests, fsTimeout, fsUftRunMode, controllerPollingInterval, perScenarioTimeOut, ignoreErrorStrings, displayController, analysisTemplate, mcServerName, - fsUserName, fsPassword, mcTenantId, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, + authModel, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, fsAutActions, fsLaunchAppName, fsDevicesMetrics, fsInstrumented, fsExtraApps, fsJobId, proxySettings, useSSL, fsReportPath); } @@ -551,45 +548,17 @@ public void setProxySettings(ProxySettings proxySettings) { runFromFileModel.setProxySettings(proxySettings); } - public String getMcTenantId() { - return runFromFileModel.getMcTenantId(); - } - - @DataBoundSetter - public void setMcTenantId(String mcTenantId) { - runFromFileModel.setMcTenantId(mcTenantId); - } - - public String getFsPassword() { - return runFromFileModel.getFsPassword(); - } - - /** - * Sets fs password. - * - * @param fsPassword the fs password - */ - @DataBoundSetter - public void setFsPassword(String fsPassword) { - runFromFileModel.setFsPassword(fsPassword); + public String getFsTargetLab() { + return runFromFileModel.getFsTargetLab(); } - public String getFsUserName() { - return runFromFileModel.getFsUserName(); + public AuthModel getAuthModel() { + return runFromFileModel.getAuthModel(); } - /** - * Sets fs user name. - * - * @param fsUserName the fs user name - */ @DataBoundSetter - public void setFsUserName(String fsUserName) { - runFromFileModel.setFsUserName(fsUserName); - } - - public String getFsTargetLab() { - return runFromFileModel.getFsTargetLab(); + public void setAuthModel(AuthModel authModel) { + runFromFileModel.setAuthModel(authModel); } /** @@ -649,7 +618,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn @Nonnull TaskListener listener) throws IOException { //synchronized (this) { - + PrintStream out = listener.getLogger(); UftOctaneUtils.setUFTRunnerTypeAsParameter(build, listener); // get the mc server settings @@ -668,8 +637,8 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn ParameterValue octaneFrameworkParam = parameterAction != null ? parameterAction.getParameter("octaneTestRunnerFramework") : null; if (octaneFrameworkParam != null && octaneFrameworkParam.getValue().equals("MBT")) { String testsToRunConverted = env == null ? null : env.get(TestsToRunConverter.DEFAULT_TESTS_TO_RUN_CONVERTED_PARAMETER); - if(StringUtils.isEmpty(testsToRunConverted)) { - listener.getLogger().println(RunFromFileBuilder.class.getSimpleName() + " : No UFT tests were found"); + if (StringUtils.isEmpty(testsToRunConverted)) { + out.println(RunFromFileBuilder.class.getSimpleName() + " : No UFT tests were found"); return; } } @@ -684,27 +653,32 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn Properties mergedProperties = new Properties(); if (mcServerSettingsModel != null) { mcServerUrl = mcServerSettingsModel.getProperties().getProperty("MobileHostAddress"); - if (runFromFileModel.getProxySettings() == null) { - jobDetails = runFromFileModel.getJobDetails(mcServerUrl, null, null, null); - } else { - jobDetails = runFromFileModel.getJobDetails(mcServerUrl, - runFromFileModel.getProxySettings().getFsProxyAddress(), - runFromFileModel.getProxySettings().getFsProxyUserName(), - runFromFileModel.getProxySettings().getFsProxyPassword()); - } + jobDetails = runFromFileModel.getJobDetails(mcServerUrl, runFromFileModel.getProxySettings()); mergedProperties.setProperty("mobileinfo", jobDetails != null ? jobDetails.toJSONString() : ""); mergedProperties.setProperty("MobileHostAddress", mcServerUrl); } - if (runFromFileModel != null && StringUtils.isNotBlank(runFromFileModel.getFsPassword())) { - try { - String encPassword = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getFsPassword()).getPlainText(), - EncryptionUtils.getSecretKey()); - mergedProperties.put("MobilePassword", encPassword); - } catch (Exception e) { - build.setResult(Result.FAILURE); - listener.fatalError("problem in UFT Mobile password encryption" + e); + if (runFromFileModel != null && null != runFromFileModel.getAuthModel()) { + if (StringUtils.isNotBlank(runFromFileModel.getMcPassword())) { + try { + String encPassword = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getMcPassword()).getPlainText(), + EncryptionUtils.getSecretKey()); + mergedProperties.put("MobilePassword", encPassword); + } catch (Exception e) { + build.setResult(Result.FAILURE); + listener.fatalError("problem in UFT Mobile password encryption" + e); + } + } + if (StringUtils.isNotBlank(runFromFileModel.getMcExecToken())) { + try { + String encPassword = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getMcExecToken()).getPlainText(), + EncryptionUtils.getSecretKey()); + mergedProperties.put("MobileExecToken", encPassword); + } catch (Exception e) { + build.setResult(Result.FAILURE); + listener.fatalError("problem in UFT Mobile password encryption" + e); + } } } @@ -878,7 +852,6 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn listener.error("Failed running HpToolsLauncher " + ioe); } catch (InterruptedException e) { build.setResult(Result.ABORTED); - PrintStream out = listener.getLogger(); listener.error("Failed running HpToolsLauncher - build aborted " + e); try { AlmToolsUtils.runHpToolsAborterOnBuildEnv(build, launcher, listener, ParamFileName, workspace); @@ -976,40 +949,35 @@ public boolean isApplicable( * @return the job id */ @JavaScriptMethod - public String getJobId(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, - String proxyAddress, String proxyUserName, String proxyPassword, String previousJobId) { + public String getJobId(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, String mcExecToken, String authType, + boolean fsUseAuthentication, String proxyAddress, String proxyUserName, String proxyPassword, String previousJobId) { + AuthModel authModel = new AuthModel(mcUserName, mcPassword, mcTenantId, mcExecToken, authType); + ProxySettings proxy = new ProxySettings(fsUseAuthentication, proxyAddress, proxyUserName, proxyPassword); if (null != previousJobId && !previousJobId.isEmpty()) { - JSONObject jobJSON = instance.getJobById(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, - proxyUserName, proxyPassword, previousJobId); + JSONObject jobJSON = instance.getJobById(mcUrl, authModel, proxy, previousJobId); if (jobJSON != null && previousJobId.equals(jobJSON.getAsString("id"))) { return previousJobId; } else { - return instance.createTempJob(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, - proxyUserName, proxyPassword); + return instance.createTempJob(mcUrl, authModel, proxy); } } - return instance.createTempJob(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, - proxyPassword); + return instance.createTempJob(mcUrl, authModel, proxy); } /** * Populate app and device json object. * - * @param mcUrl the mc url - * @param mcUserName the mc user name - * @param mcPassword the mc password - * @param proxyAddress the proxy address - * @param proxyUserName the proxy user name - * @param proxyPassword the proxy password - * @param jobId the job id + * @param mcUrl the mc url + * @param jobId the job id * @return the json object */ @JavaScriptMethod - public JSONObject populateAppAndDevice(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, - String proxyAddress, String proxyUserName, String proxyPassword, + public JSONObject populateAppAndDevice(String mcUrl, String mcUserName, String mcPassword, String mcTenantId, String mcExecToken, String authType, + boolean fsUseAuthentication, String proxyAddress, String proxyUserName, String proxyPassword, String jobId) { - return instance.getJobJSONData(mcUrl, mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, - proxyPassword, jobId); + AuthModel authModel = new AuthModel(mcUserName, mcPassword, mcTenantId, mcExecToken, authType); + ProxySettings proxy = new ProxySettings(fsUseAuthentication, proxyAddress, proxyUserName, proxyPassword); + return instance.getJobJSONData(mcUrl, authModel, proxy, jobId); } /** diff --git a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java index c44fe95d9a..d260e2b976 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java @@ -29,10 +29,7 @@ package com.microfocus.application.automation.tools.run; import com.microfocus.application.automation.tools.mc.JobConfigurationProxy; -import com.microfocus.application.automation.tools.model.MCServerSettingsModel; -import com.microfocus.application.automation.tools.model.ProxySettings; -import com.microfocus.application.automation.tools.model.UploadAppModel; -import com.microfocus.application.automation.tools.model.UploadAppPathModel; +import com.microfocus.application.automation.tools.model.*; import com.microfocus.application.automation.tools.settings.MCServerSettingsGlobalConfiguration; import com.microfocus.application.automation.tools.sse.common.StringUtils; import hudson.Extension; @@ -69,13 +66,12 @@ public class UploadAppBuilder extends Builder { private final UploadAppModel uploadAppModel; @DataBoundConstructor - public UploadAppBuilder(String mcServerName, String mcUserName, String mcPassword, String mcTenantId, ProxySettings proxySettings, List applicationPaths) { - uploadAppModel = new UploadAppModel(mcServerName, mcUserName, mcPassword, mcTenantId, proxySettings, applicationPaths); + public UploadAppBuilder(String mcServerName, AuthModel authModel, ProxySettings proxySettings, List applicationPaths) { + uploadAppModel = new UploadAppModel(mcServerName, authModel, proxySettings, applicationPaths); } @Override public DescriptorImpl getDescriptor() { - return (DescriptorImpl) super.getDescriptor(); } @@ -89,29 +85,29 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen String mcServerUrl = ""; PrintStream out = listener.getLogger(); List paths = null; - if(uploadAppModel != null){ + if (uploadAppModel != null) { paths = uploadAppModel.getApplicationPaths(); } boolean allSuccess = true; - if(mcServerSettingsModel == null){ - out.println("Failed to upload app to UFT Mobile server. Cause: UFT Mobile url didn't be configured." ); + if (mcServerSettingsModel == null) { + out.println("Failed to upload app to UFT Mobile server. Cause: UFT Mobile url didn't be configured."); return false; - }else{ + } else { mcServerUrl = mcServerSettingsModel.getProperties().getProperty("MobileHostAddress"); out.println(String.format("There are %d apps to be uploaded.", paths.size())); String workspace = build.getWorkspace() == null ? "" : build.getWorkspace().toURI().getPath(); - for(int i=1; i<=paths.size(); i++){ - String path = paths.get(i-1).getMcAppPath(); + for (int i = 1; i <= paths.size(); i++) { + String path = paths.get(i - 1).getMcAppPath(); String originPath = path; - if(StringUtils.isNullOrEmpty(path)){ + if (StringUtils.isNullOrEmpty(path)) { out.println(String.format("ignore the empty app %d upload", i)); continue; } //case insensitive replace of workspace to its real path - if (path.toUpperCase(Locale.ENGLISH).startsWith("${WORKSPACE}")){ - path = path.replaceAll("(?i)"+ Pattern.quote("${WORKSPACE}"), Matcher.quoteReplacement(workspace)); - if (!FilenameUtils.normalize(path).startsWith(FilenameUtils.normalize(workspace))){ + if (path.toUpperCase(Locale.ENGLISH).startsWith("${WORKSPACE}")) { + path = path.replaceAll("(?i)" + Pattern.quote("${WORKSPACE}"), Matcher.quoteReplacement(workspace)); + if (!FilenameUtils.normalize(path).startsWith(FilenameUtils.normalize(workspace))) { out.println(String.format("Failed to upload app, Cause invalid application file: %s", path)); build.setResult(Result.FAILURE); allSuccess = false; @@ -120,17 +116,17 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen } FilePath filePath = new FilePath(build.getWorkspace().getChannel(), path); File tempFile = null; - if (filePath.isRemote()){ + if (filePath.isRemote()) { tempFile = File.createTempFile("uftm", "." + FilenameUtils.getExtension(path)); try (OutputStream outputStream = new FileOutputStream(tempFile)) { filePath.copyTo(outputStream); path = tempFile.getCanonicalPath(); - } catch (NoSuchFileException noSuchFileException){ + } catch (NoSuchFileException noSuchFileException) { out.println(String.format("Failed to upload app, Cause cannot find application file: %s", path)); build.setResult(Result.FAILURE); allSuccess = false; continue; - } catch (Exception e){ + } catch (Exception e) { out.println(String.format("Failed to upload app, Cause failed to copy application file: %s", path)); build.setResult(Result.FAILURE); allSuccess = false; @@ -138,34 +134,29 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen } } - try{ + try { out.println(String.format("starting to upload app %d %s", i, originPath)); - if(uploadAppModel.getProxySettings() == null){ - app = job.upload(mcServerUrl, uploadAppModel.getMcUserName(),uploadAppModel.getMcPassword(), uploadAppModel.getMcTenantId(), null, null, null, path); - }else{ - app = job.upload(mcServerUrl, uploadAppModel.getMcUserName(),uploadAppModel.getMcPassword(), uploadAppModel.getMcTenantId(), uploadAppModel.getProxySettings().getFsProxyAddress(),uploadAppModel.getProxySettings().getFsProxyUserName(), uploadAppModel.getProxySettings().getFsProxyPassword(),path); - } - if(app == null){ - if(uploadAppModel.isUseProxy()){ - out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, username:%s, Proxy url:%s", - mcServerUrl, uploadAppModel.getMcUserName(), uploadAppModel.getProxySettings().getFsProxyAddress())); - }else if(uploadAppModel.isUseAuthentication()){ - out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, username:%s, Proxy url:%s, proxy userName:%s", - mcServerUrl, uploadAppModel.getMcUserName(), uploadAppModel.getProxySettings().getFsProxyAddress(), uploadAppModel.getProxySettings().getFsProxyUserName())); - }else{ - out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, username:%s,", - mcServerUrl, uploadAppModel.getMcUserName())); + app = job.upload(mcServerUrl, uploadAppModel.getAuthModel(), uploadAppModel.getProxySettings(), path); + if (app == null) { + if (uploadAppModel.isUseProxy()) { + out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, Proxy url:%s", + mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress())); + } else if (uploadAppModel.isUseAuthentication()) { + out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, Proxy url:%s, proxy userName:%s", + mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress(), uploadAppModel.getProxySettings().getFsProxyUserName())); + } else { + out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s.", mcServerUrl)); } build.setResult(Result.FAILURE); return false; } - if((Boolean)app.get("error")){ + if ((Boolean) app.get("error")) { out.println("Job failed because got error message during the application uploading. " + app.toJSONString()); allSuccess = false; build.setResult(Result.FAILURE); } out.println("uploaded app info: " + app.toJSONString()); - } catch(FileNotFoundException fnf){ + } catch (FileNotFoundException fnf) { out.println(String.format("Failed to upload app to UFT Mobile server. Cause: File: %s is not found.", path)); build.setResult(Result.FAILURE); allSuccess = false; @@ -178,16 +169,15 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen } catch (InterruptedException e) { build.setResult(Result.ABORTED); return false; - } catch (Exception e){ - if(uploadAppModel.isUseProxy()){ - out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, username:%s, Proxy url:%s", - mcServerUrl, uploadAppModel.getMcUserName(), uploadAppModel.getProxySettings().getFsProxyAddress())); - }else if(uploadAppModel.isUseAuthentication()){ - out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, username:%s, Proxy url:%s, proxy userName:%s", - mcServerUrl, uploadAppModel.getMcUserName(), uploadAppModel.getProxySettings().getFsProxyAddress(), uploadAppModel.getProxySettings().getFsProxyUserName())); - }else{ - out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, username:%s,", - mcServerUrl, uploadAppModel.getMcUserName())); + } catch (Exception e) { + if (uploadAppModel.isUseProxy()) { + out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, Proxy url:%s", + mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress())); + } else if (uploadAppModel.isUseAuthentication()) { + out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s, Proxy url:%s, proxy userName:%s", + mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress(), uploadAppModel.getProxySettings().getFsProxyUserName())); + } else { + out.println(String.format("Failed to upload app, Cause UFT Mobile connection info is incorrect. url:%s", mcServerUrl)); } build.setResult(Result.FAILURE); return false; diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index ec1e95e373..063c08e935 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -251,15 +251,28 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index 0876a0946a..435358df06 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -63,14 +63,27 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index d3faed6c4a..9ef755d64d 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -26,120 +26,131 @@ * ___________________________________________________________________ */ -function loadMobileInfo(a){ - var buttonStatus = false; - if(buttonStatus) return; - buttonStatus = true; - var recreatJob = document.getElementsByName("runfromfs.recreateJob")[0].checked; - var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; - var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; - var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; - var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; - var useProxy = document.getElementsByName("proxySettings")[0].checked; - var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; - var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; - var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; - var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; - var baseUrl = ""; - const isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; - const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; - const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); - if(isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing){ - document.getElementById("errorMessage").style.display = "block"; - buttonStatus = false; - return; - } - var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; - //recreate job if checked - if (recreatJob){ - previousJobId = ""; - } +function loadMobileInfo(a) { + var buttonStatus = false; + if (buttonStatus) return; + buttonStatus = true; + var recreatJob = document.getElementsByName("runfromfs.recreateJob")[0].checked; + var mcUserName = document.getElementsByName("runfromfs.mcUserName")[0].value; + var mcPassword = document.getElementsByName("runfromfs.mcPassword")[0].value; + var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; + var mcExecToken = document.getElementsByName("runfromfs.mcExecToken")[0].value; + var authType = document.querySelector('input[name$="authModel"]:checked').value; + var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; + var useProxy = document.getElementsByName("proxySettings")[0].checked; + var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; + var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; + var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; + var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; + var baseUrl = ""; + var isMcCredentialMissing; + if ('base' == authType) { + isMcCredentialMissing = (mcUserName.trim() == "" || mcPassword.trim() == ""); + } else { + isMcCredentialMissing = mcExecToken.trim() == ""; + } - if (!useProxy){ - proxyAddress = proxyUserName = proxyPassword = ""; - } + const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; + const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); + if (isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing) { + document.getElementById("errorMessage").style.display = "block"; + buttonStatus = false; + return; + } + var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; + //recreate job if checked + if (recreatJob) { + previousJobId = ""; + } - a.getMcServerUrl(mcUrl, function(r){ - baseUrl = r.responseObject(); - if(baseUrl){ - baseUrl = baseUrl.trim().replace(/[\/]+$/, ""); - } else { - ParallelRunnerEnvironment.setEnvironmentError(button,true); - buttonStatus = false; - return; - } - a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { - var jobId = response.responseObject(); - if(jobId == null){ - document.getElementById("errorMessage").style.display = "block"; - buttonStatus = false; - return; - } - //hide the error message after success login - document.getElementById("errorMessage").style.display = "none"; - var openedWindow = window.open('/','test parameters','height=820,width=1130'); - openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true"; - var messageCallBack = function (event) { - if (event && event.data && event.data=="mcCloseWizard") { - a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId, proxyAddress, proxyUserName, proxyPassword,jobId, function (app) { - var jobInfo = app.responseObject(); - let deviceId = "", OS = "", manufacturerAndModel = "", targetLab = ""; - if(jobInfo['deviceJSON']){ - if(jobInfo['deviceJSON']['deviceId']){ - deviceId = jobInfo['deviceJSON']['deviceId']; - } - if(jobInfo['deviceJSON']['OS']){ - OS = jobInfo['deviceJSON']['OS']; - } - if(jobInfo['deviceJSON']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; - } - } - if(jobInfo['deviceCapability']){ - if(jobInfo['deviceCapability']['OS']){ - OS = jobInfo['deviceCapability']['OS']; - } - if(jobInfo['deviceCapability']['manufacturerAndModel']){ - manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; - } - if(jobInfo['deviceCapability']['targetLab']){ - targetLab = jobInfo['deviceCapability']['targetLab']; - } - } - document.getElementsByName("runfromfs.fsDeviceId")[0].value = deviceId; - document.getElementsByName("runfromfs.fsOs")[0].value = OS; - document.getElementsByName("runfromfs.fsManufacturerAndModel")[0].value = manufacturerAndModel; - document.getElementsByName("runfromfs.fsTargetLab")[0].value = targetLab; - document.getElementsByName("runfromfs.fsLaunchAppName")[0].value = jobInfo['definitions']['launchApplicationName']; - document.getElementsByName("runfromfs.fsInstrumented")[0].value = jobInfo['definitions']['instrumented']; - document.getElementsByName("runfromfs.fsAutActions")[0].value = jobInfo['definitions']['autActions']; - document.getElementsByName("runfromfs.fsDevicesMetrics")[0].value = jobInfo['definitions']['deviceMetrics']; - document.getElementsByName("runfromfs.fsExtraApps")[0].value = jobInfo['extraApps']; - document.getElementsByName("runfromfs.fsJobId")[0].value = jobInfo['jobUUID']; - buttonStatus = false; - document.getElementById("errorMessage").style.display = "none"; - window.removeEventListener("message",messageCallBack, false); - openedWindow.close(); - }); - } - }; - window.addEventListener("message", messageCallBack ,false); - function checkChild() { - if (openedWindow && openedWindow.closed) { - clearInterval(timer); - buttonStatus = false; - } - } - var timer = setInterval(checkChild, 500); - }); - }); + if (!useProxy) { + proxyAddress = proxyUserName = proxyPassword = ""; + } + + a.getMcServerUrl(mcUrl, function (r) { + baseUrl = r.responseObject(); + if (baseUrl) { + baseUrl = baseUrl.trim().replace(/[\/]+$/, ""); + } else { + ParallelRunnerEnvironment.setEnvironmentError(button, true); + buttonStatus = false; + return; + } + a.getJobId(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, authType, + useAuthentication, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { + var jobId = response.responseObject(); + if (jobId == null) { + document.getElementById("errorMessage").style.display = "block"; + buttonStatus = false; + return; + } + //hide the error message after success login + document.getElementById("errorMessage").style.display = "none"; + var openedWindow = window.open('/', 'test parameters', 'height=820,width=1130'); + openedWindow.location.href = 'about:blank'; + openedWindow.location.href = baseUrl + "/integration/#/login?jobId=" + jobId + "&displayUFTMode=true"; + var messageCallBack = function (event) { + if (event && event.data && event.data == "mcCloseWizard") { + a.populateAppAndDevice(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, authType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, jobId, function (app) { + var jobInfo = app.responseObject(); + let deviceId = "", OS = "", manufacturerAndModel = "", targetLab = ""; + if (jobInfo['deviceJSON']) { + if (jobInfo['deviceJSON']['deviceId']) { + deviceId = jobInfo['deviceJSON']['deviceId']; + } + if (jobInfo['deviceJSON']['OS']) { + OS = jobInfo['deviceJSON']['OS']; + } + if (jobInfo['deviceJSON']['manufacturerAndModel']) { + manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; + } + } + if (jobInfo['deviceCapability']) { + if (jobInfo['deviceCapability']['OS']) { + OS = jobInfo['deviceCapability']['OS']; + } + if (jobInfo['deviceCapability']['manufacturerAndModel']) { + manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; + } + if (jobInfo['deviceCapability']['targetLab']) { + targetLab = jobInfo['deviceCapability']['targetLab']; + } + } + document.getElementsByName("runfromfs.fsDeviceId")[0].value = deviceId; + document.getElementsByName("runfromfs.fsOs")[0].value = OS; + document.getElementsByName("runfromfs.fsManufacturerAndModel")[0].value = manufacturerAndModel; + document.getElementsByName("runfromfs.fsTargetLab")[0].value = targetLab; + document.getElementsByName("runfromfs.fsLaunchAppName")[0].value = jobInfo['definitions']['launchApplicationName']; + document.getElementsByName("runfromfs.fsInstrumented")[0].value = jobInfo['definitions']['instrumented']; + document.getElementsByName("runfromfs.fsAutActions")[0].value = jobInfo['definitions']['autActions']; + document.getElementsByName("runfromfs.fsDevicesMetrics")[0].value = jobInfo['definitions']['deviceMetrics']; + document.getElementsByName("runfromfs.fsExtraApps")[0].value = jobInfo['extraApps']; + document.getElementsByName("runfromfs.fsJobId")[0].value = jobInfo['jobUUID']; + buttonStatus = false; + document.getElementById("errorMessage").style.display = "none"; + window.removeEventListener("message", messageCallBack, false); + openedWindow.close(); + }); + } + }; + window.addEventListener("message", messageCallBack, false); + + function checkChild() { + if (openedWindow && openedWindow.closed) { + clearInterval(timer); + buttonStatus = false; + } + } + + var timer = setInterval(checkChild, 500); + }); + }); } function hideAndMoveAdvancedBody(_id) { - const tBody = document.querySelector("#" + _id).parentNode; // initial advanced block content - const initialAdvancedBlock = tBody.previousSibling; // advanced link button block and here was hidden the initial advanced block content - initialAdvancedBlock.querySelector(".advancedBody").appendChild(tBody); // moves the initial advanced block content back to the hidden block - initialAdvancedBlock.querySelector(".advancedLink").style = ""; // enables once again the advanced link + const tBody = document.querySelector("#" + _id).parentNode; // initial advanced block content + const initialAdvancedBlock = tBody.previousSibling; // advanced link button block and here was hidden the initial advanced block content + initialAdvancedBlock.querySelector(".advancedBody").appendChild(tBody); // moves the initial advanced block content back to the hidden block + initialAdvancedBlock.querySelector(".advancedLink").style = ""; // enables once again the advanced link } \ No newline at end of file diff --git a/src/main/webapp/parallelRunnerEnvironment.js b/src/main/webapp/parallelRunnerEnvironment.js index 9cafa11079..d1acadef24 100644 --- a/src/main/webapp/parallelRunnerEnvironment.js +++ b/src/main/webapp/parallelRunnerEnvironment.js @@ -318,9 +318,11 @@ Utils.loadMC = function(a,button){ var buttonStatus = false; if(buttonStatus) return; buttonStatus = true; - var mcUserName = document.getElementsByName("runfromfs.fsUserName")[0].value; - var mcPassword = document.getElementsByName("runfromfs.fsPassword")[0].value; + var mcUserName = document.getElementsByName("runfromfs.mcUserName")[0].value; + var mcPassword = document.getElementsByName("runfromfs.mcPassword")[0].value; var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; + var mcExecToken = document.getElementsByName("runfromfs.mcExecToken")[0].value; + var mcAuthType = document.querySelector('input[name$="authModel"]:checked').value; var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; var useProxy = document.getElementsByName("proxySettings")[0].checked; var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; @@ -328,7 +330,13 @@ Utils.loadMC = function(a,button){ var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; var baseUrl = ""; - const isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; + var isMcCredentialMissing; + if ('base' == mcAuthType) { + isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; + } else { + isMcCredentialMissing = mcExecToken.trim() == ""; + } + const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); if(isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing){ @@ -346,7 +354,7 @@ Utils.loadMC = function(a,button){ buttonStatus = false; return; } - a.getJobId(baseUrl,mcUserName, mcPassword, mcTenantId, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { + a.getJobId(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, mcAuthType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { var jobId = response.responseObject(); if(jobId == null) { ParallelRunnerEnvironment.setEnvironmentError(button,true); @@ -358,7 +366,7 @@ Utils.loadMC = function(a,button){ openedWindow.location.href = baseUrl+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true&deviceOnly=true"; var messageCallBack = function (event) { if (event && event.data && event.data=="mcCloseWizard") { - a.populateAppAndDevice(baseUrl,mcUserName,mcPassword,mcTenantId,proxyAddress,proxyUserName,proxyPassword,jobId,function (app) { + a.populateAppAndDevice(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, mcAuthType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, jobId, function (app) { var jobInfo = app.responseObject(); let deviceId = "", OS = "", manufacturerAndModel = ""; if(jobInfo['deviceJSON']){ From 4b22d727f6bfac4a79e2fef5e426729ce4eb08a3 Mon Sep 17 00:00:00 2001 From: motteww Date: Thu, 3 Mar 2022 12:40:48 -0800 Subject: [PATCH 2064/2502] US#321046:for code review. --- .../automation/tools/mc/HttpUtils.java | 68 ++++++++++--------- .../tools/mc/JobConfigurationProxy.java | 22 +++--- .../tools/run/RunFromFileBuilder.java | 36 ++++------ 3 files changed, 64 insertions(+), 62 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java index e5324c82bc..a81655e905 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java @@ -30,11 +30,11 @@ import net.minidev.json.JSONObject; import net.minidev.json.JSONValue; +import org.parboiled.common.StringUtils; import java.io.*; import java.net.*; import java.util.Iterator; -import java.util.List; import java.util.Map; public class HttpUtils { @@ -46,10 +46,9 @@ private HttpUtils() { } - public static HttpResponse post(ProxyInfo proxyInfo, String url, Map headers, byte[] data) { + public static HttpResponse doPost(ProxyInfo proxyInfo, String url, Map headers, byte[] data) { HttpResponse response = null; - try { response = doHttp(proxyInfo, POST, url, null, headers, data); } catch (Exception e) { @@ -58,7 +57,7 @@ public static HttpResponse post(ProxyInfo proxyInfo, String url, Map headers, String queryString) { + public static HttpResponse doGet(ProxyInfo proxyInfo, String url, Map headers, String queryString) { HttpResponse response = null; try { @@ -105,12 +104,12 @@ private static HttpResponse doHttp(ProxyInfo proxyInfo, String requestMethod, St if (responseCode == HttpURLConnection.HTTP_OK) { InputStream inputStream = connection.getInputStream(); JSONObject jsonObject = convertStreamToJSONObject(inputStream); + response.setHeaders(connection.getHeaderFields()); if (null == jsonObject) { System.out.println(requestMethod + " " + connectionUrl + " return is null."); + } else { + response.setJsonObject(jsonObject); } - Map> headerFields = connection.getHeaderFields(); - response.setHeaders(headerFields); - response.setJsonObject(jsonObject); } else { System.out.println(requestMethod + " " + connectionUrl + " failed with response code:" + responseCode); } @@ -123,27 +122,24 @@ private static URLConnection openConnection(final ProxyInfo proxyInfo, URL _url) Proxy proxy = null; - if (proxyInfo != null && proxyInfo._host != null && proxyInfo._port != null && !proxyInfo._host.isEmpty() && !proxyInfo._port.isEmpty()) { - + if (proxyInfo != null && !proxyInfo.isEmpty()) { try { - int port = Integer.parseInt(proxyInfo._port.trim()); - proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo._host, port)); - + int port = Integer.parseInt(proxyInfo.port.trim()); + proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, port)); } catch (Exception e) { e.printStackTrace(); } } - if (proxy != null && proxyInfo._userName != null && proxyInfo._password != null && !proxyInfo._password.isEmpty() && !proxyInfo._password.isEmpty()) { + if (proxy != null && !proxyInfo.isEmpty()) { Authenticator authenticator = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(proxyInfo._userName, proxyInfo._password.toCharArray()); //To change body of overridden methods use File | Settings | File Templates. + return new PasswordAuthentication(proxyInfo.userName, proxyInfo.password.toCharArray()); //To change body of overridden methods use File | Settings | File Templates. } }; - Authenticator.setDefault(authenticator); } @@ -179,7 +175,11 @@ private static JSONObject convertStreamToJSONObject(InputStream inputStream) { while ((line = reader.readLine()) != null) { res.append(line); } - obj = (JSONObject) JSONValue.parseStrict(res.toString()); + if (JSONValue.isValidJson(res.toString())) { + obj = (JSONObject) JSONValue.parseStrict(res.toString()); + } else { + System.out.println("WARN::INVALIDE JSON Object" + res); + } } catch (Exception e) { e.printStackTrace(); } @@ -197,8 +197,8 @@ public static ProxyInfo setProxyCfg(String host, String port) { ProxyInfo proxyInfo = new ProxyInfo(); - proxyInfo._host = host; - proxyInfo._port = port; + proxyInfo.host = host; + proxyInfo.port = port; return proxyInfo; } @@ -214,34 +214,38 @@ public static ProxyInfo setProxyCfg(String address, String userName, String pass int index = address.lastIndexOf(':'); if (index > 0) { - proxyInfo._host = address.substring(0, index); - proxyInfo._port = address.substring(index + 1, address.length()); + proxyInfo.host = address.substring(0, index); + proxyInfo.port = address.substring(index + 1, address.length()); } else { - proxyInfo._host = address; - proxyInfo._port = "80"; + proxyInfo.host = address; + proxyInfo.port = "80"; } } - proxyInfo._userName = userName; - proxyInfo._password = password; + proxyInfo.userName = userName; + proxyInfo.password = password; return proxyInfo; } static class ProxyInfo { - String _host; - String _port; - String _userName; - String _password; + String host; + String port; + String userName; + String password; public ProxyInfo() { } public ProxyInfo(String host, String port, String userName, String password) { - _host = host; - _port = port; - _userName = userName; - _password = password; + this.host = host; + this.port = port; + this.userName = userName; + this.password = password; + } + + public boolean isEmpty() { + return StringUtils.isEmpty(host) || StringUtils.isEmpty(port) || StringUtils.isEmpty(userName) || StringUtils.isEmpty(password); } } diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 8e1d518f6b..5f42c36d54 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -80,15 +80,19 @@ public JSONObject loginToMC(String mcUrl, AuthModel authModel, ProxySettings pro sendObject.put("name", authModel.getMcUserName()); sendObject.put("password", authModel.getMcPassword()); sendObject.put("accountName", "default"); - response = HttpUtils.post(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL, headers, sendObject.toJSONString().getBytes()); + response = HttpUtils.doPost(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL, headers, sendObject.toJSONString().getBytes()); } else { headers.put(Constants.ACCEPT, "application/json"); headers.put(Constants.CONTENT_TYPE, "application/json;charset=UTF-8"); - Oauth2TokenUtil.validate(authModel.getMcExecToken()); - sendObject.put("client", Oauth2TokenUtil.getClient()); - sendObject.put("secret", Oauth2TokenUtil.getSecret()); - sendObject.put("tenant", Oauth2TokenUtil.getTenant()); - response = HttpUtils.post(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL_OAUTH, headers, sendObject.toJSONString().getBytes()); + if(Oauth2TokenUtil.validate(authModel.getMcExecToken())) { + sendObject.put("client", Oauth2TokenUtil.getClient()); + sendObject.put("secret", Oauth2TokenUtil.getSecret()); + sendObject.put("tenant", Oauth2TokenUtil.getTenant()); + response = HttpUtils.doPost(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL_OAUTH, headers, sendObject.toJSONString().getBytes()); + }else { + System.out.println("ERROR:: oauth token is invalid."); + return returnObject; + } } return parseLoginResponse(response); } catch (Exception e) { @@ -203,7 +207,7 @@ public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, headers.put(Constants.FILENAME, appFile.getName()); HttpUtils.ProxyInfo proxyInfo = HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); - HttpResponse response = HttpUtils.post(proxyInfo, uploadUrl, headers, bytes); + HttpResponse response = HttpUtils.doPost(proxyInfo, uploadUrl, headers, bytes); if (response != null && response.getJsonObject() != null) { json = response.getJsonObject(); @@ -243,7 +247,7 @@ public String createTempJob(String mcUrl, AuthModel authModel, ProxySettings pro } headers.put(Constants.COOKIE, cookies); } - HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.CREATE_JOB_URL, headers, null); + HttpResponse response = HttpUtils.doGet(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.CREATE_JOB_URL, headers, null); if (response != null && response.getJsonObject() != null) { job = response.getJsonObject(); @@ -290,7 +294,7 @@ public JSONObject getJobById(String mcUrl, AuthModel authModel, ProxySettings pr } headers.put(Constants.COOKIE, cookies); } - HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.GET_JOB_UEL + jobUUID, headers, null); + HttpResponse response = HttpUtils.doGet(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.GET_JOB_UEL + jobUUID, headers, null); if (response != null && response.getJsonObject() != null) { jobJsonObject = response.getJsonObject(); diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index bc5bb159e9..66e849f0ae 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -659,27 +659,21 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn mergedProperties.setProperty("MobileHostAddress", mcServerUrl); } - if (runFromFileModel != null && null != runFromFileModel.getAuthModel()) { - if (StringUtils.isNotBlank(runFromFileModel.getMcPassword())) { - try { - String encPassword = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getMcPassword()).getPlainText(), - EncryptionUtils.getSecretKey()); - mergedProperties.put("MobilePassword", encPassword); - } catch (Exception e) { - build.setResult(Result.FAILURE); - listener.fatalError("problem in UFT Mobile password encryption" + e); - } - } - if (StringUtils.isNotBlank(runFromFileModel.getMcExecToken())) { - try { - String encPassword = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getMcExecToken()).getPlainText(), - EncryptionUtils.getSecretKey()); - mergedProperties.put("MobileExecToken", encPassword); - } catch (Exception e) { - build.setResult(Result.FAILURE); - listener.fatalError("problem in UFT Mobile password encryption" + e); - } - } + try { + String encPassword = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getMcPassword()).getPlainText(), + EncryptionUtils.getSecretKey()); + mergedProperties.put("MobilePassword", encPassword); + } catch (Exception e) { + build.setResult(Result.FAILURE); + listener.fatalError("problem in UFT Mobile password encryption" + e); + } + try { + String token = EncryptionUtils.Encrypt(Secret.fromString(runFromFileModel.getMcExecToken()).getPlainText(), + EncryptionUtils.getSecretKey()); + mergedProperties.put("MobileExecToken", token); + } catch (Exception e) { + build.setResult(Result.FAILURE); + listener.fatalError("problem in UFT Mobile password encryption" + e); } if (env == null) { From 10f29a862077046e7262e49453fb43840544973b Mon Sep 17 00:00:00 2001 From: Jakub Vondrak Date: Fri, 4 Mar 2022 08:34:34 +0100 Subject: [PATCH 2065/2502] US751005 - SV Integration: add OFFLINE mode to SV Change Mode build step --- pom.xml | 2 +- .../application/automation/tools/run/SvChangeModeBuilder.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89156b6903..fde2303581 100644 --- a/pom.xml +++ b/pom.xml @@ -484,7 +484,7 @@ com.microfocus.sv SVConfigurator - 5.4.1 + 5.5 commons-io diff --git a/src/main/java/com/microfocus/application/automation/tools/run/SvChangeModeBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/SvChangeModeBuilder.java index 964a276a79..10aa44c8da 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/SvChangeModeBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/SvChangeModeBuilder.java @@ -218,6 +218,7 @@ public ListBoxModel doFillModeItems() { items.add("Stand-By", ServiceRuntimeConfiguration.RuntimeMode.STAND_BY.toString()); items.add("Simulate", ServiceRuntimeConfiguration.RuntimeMode.SIMULATING.toString()); items.add("Learn", ServiceRuntimeConfiguration.RuntimeMode.LEARNING.toString()); + items.add("Offline", ServiceRuntimeConfiguration.RuntimeMode.OFFLINE.toString()); return items; } } From 895631e8f06cb648e21128febab3c45799d7b619 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Sat, 5 Mar 2022 17:14:50 +0200 Subject: [PATCH 2066/2502] US-740059 [Jenkins][FS Execution] Partial test results Reporting, for aborted Jenkins builds and unfinished tests execution --- HpToolsLauncher/JunitXml/JunitXmlBuilder.cs | 92 ++++++++++++------- HpToolsLauncher/JunitXml/junit.cs | 30 ++++-- HpToolsLauncher/Launcher.cs | 44 +++++---- .../Runners/FileSystemTestsRunner.cs | 56 ++++++----- HpToolsLauncher/Runners/RunnerBase.cs | 8 +- 5 files changed, 145 insertions(+), 85 deletions(-) diff --git a/HpToolsLauncher/JunitXml/JunitXmlBuilder.cs b/HpToolsLauncher/JunitXml/JunitXmlBuilder.cs index 3deadaf4ed..6a6c7dd78f 100644 --- a/HpToolsLauncher/JunitXml/JunitXmlBuilder.cs +++ b/HpToolsLauncher/JunitXml/JunitXmlBuilder.cs @@ -42,33 +42,41 @@ public string XmlName get { return _xmlName; } set { _xmlName = value; } } - //public const string ClassName = "uftRunner"; + public const string ClassName = "HPToolsFileSystemRunner"; public const string RootName = "uftRunnerRoot"; + private const string ALL_TESTS_FORMAT = "All-Tests.{0}"; + private const string DOT = "."; + private const string UNDERSCORE = "_"; + private const string PASS = "pass"; + private const string FAIL = "fail"; + private const string ERROR = "error"; + private const string WARNING = "warning"; - XmlSerializer _serializer = new XmlSerializer(typeof(testsuites)); - - testsuites _testSuites = new testsuites(); - + private readonly XmlSerializer _serializer = new XmlSerializer(typeof(testsuites)); + private readonly testsuites _testSuites = new testsuites(); public JunitXmlBuilder() { _testSuites.name = RootName; } + public testsuites TestSuites + { + get { return _testSuites; } + } + /// /// converts all data from the test results in to the Junit xml format and writes the xml file to disk. /// /// public void CreateXmlFromRunResults(TestSuiteRunResults results) { - _testSuites = new testsuites(); - testsuite uftts = new testsuite { - errors = results.NumErrors.ToString(), - tests = results.NumTests.ToString(), - failures = results.NumFailures.ToString(), + errors = results.NumErrors, + tests = results.NumTests, + failures = results.NumFailures, name = results.SuiteName, package = ClassName }; @@ -81,7 +89,7 @@ public void CreateXmlFromRunResults(TestSuiteRunResults results) } else { - testcase ufttc = CreateXmlFromUFTRunResults(testRes); + testcase ufttc = CovertUFTRunResultsToTestcase(testRes); uftts.AddTestCase(ufttc); } } @@ -90,19 +98,40 @@ public void CreateXmlFromRunResults(TestSuiteRunResults results) _testSuites.AddTestsuite(uftts); } - - if (File.Exists(XmlName)) - { - File.Delete(XmlName); + if (File.Exists(XmlName)) + { + File.Delete(XmlName); } - - + using (Stream s = File.OpenWrite(XmlName)) { _serializer.Serialize(s, _testSuites); } } + /// + /// Create or update the xml report. This function is called in a loop after each test execution in order to get the report built progressively + /// If the job is aborted by user we still can provide the (partial) report with completed tests results. + /// + /// reference to testsuite object, existing or going to be added to _testSuites collection + /// test run results to be converted + /// flag to indicate if the first param testsuite must be added to the collection + public void CreateOrUpdatePartialXmlReport(testsuite ts, TestRunResults testRes, bool addToTestSuites) + { + testcase tc = CovertUFTRunResultsToTestcase(testRes); + ts.AddTestCase(tc); + if (addToTestSuites) + { + _testSuites.AddTestsuite(ts); + } + + // NOTE: if the file already exists it will be overwritten / replaced, the entire _testSuites will be serialized every time + using (Stream s = File.Open(_xmlName, FileMode.Create, FileAccess.Write, FileShare.Read)) + { + _serializer.Serialize(s, _testSuites); + } + } + private testsuite CreateXmlFromLRRunResults(TestRunResults testRes) { testsuite lrts = new testsuite(); @@ -121,7 +150,7 @@ private testsuite CreateXmlFromLRRunResults(TestRunResults testRes) if (childNode.Attributes != null && childNode.Attributes["FullName"] != null) { testRes.TestGroup = testRes.TestPath; - testcase lrtc = CreateXmlFromUFTRunResults(testRes); + testcase lrtc = CovertUFTRunResultsToTestcase(testRes); lrtc.name = childNode.Attributes["FullName"].Value; if (childNode.InnerText.ToLowerInvariant().Contains("failed")) { @@ -139,29 +168,28 @@ private testsuite CreateXmlFromLRRunResults(TestRunResults testRes) } } } - catch (System.Xml.XmlException) + catch (XmlException) { } } lrts.name = testRes.TestPath; - lrts.tests = totalTests.ToString(); - lrts.errors = totalErrors.ToString(); - lrts.failures = totalFailures.ToString(); + lrts.tests = totalTests; + lrts.errors = totalErrors; + lrts.failures = totalFailures; lrts.time = testRes.Runtime.TotalSeconds.ToString(CultureInfo.InvariantCulture); return lrts; } - private testcase CreateXmlFromUFTRunResults(TestRunResults testRes) + private testcase CovertUFTRunResultsToTestcase(TestRunResults testRes) { - testcase tc = new testcase { systemout = testRes.ConsoleOut, systemerr = testRes.ConsoleErr, report = testRes.ReportLocation, - classname = "All-Tests." + ((testRes.TestGroup == null) ? "" : testRes.TestGroup.Replace(".", "_")), + classname = string.Format(ALL_TESTS_FORMAT, testRes.TestGroup == null ? string.Empty : testRes.TestGroup.Replace(DOT, UNDERSCORE)), name = testRes.TestPath, type = testRes.TestType, time = testRes.Runtime.TotalSeconds.ToString(CultureInfo.InvariantCulture) @@ -173,28 +201,24 @@ private testcase CreateXmlFromUFTRunResults(TestRunResults testRes) switch (testRes.TestState) { case TestState.Passed: - tc.status = "pass"; + tc.status = PASS; break; case TestState.Failed: - tc.status = "fail"; + tc.status = FAIL; break; case TestState.Error: - tc.status = "error"; + tc.status = ERROR; break; case TestState.Warning: - tc.status = "warning"; + tc.status = WARNING; break; default: - tc.status = "pass"; + tc.status = PASS; break; } if (!string.IsNullOrWhiteSpace(testRes.ErrorDesc)) tc.AddError(new error { message = testRes.ErrorDesc }); return tc; } - - - - } } diff --git a/HpToolsLauncher/JunitXml/junit.cs b/HpToolsLauncher/JunitXml/junit.cs index 2df6283412..437dd880c9 100644 --- a/HpToolsLauncher/JunitXml/junit.cs +++ b/HpToolsLauncher/JunitXml/junit.cs @@ -420,11 +420,11 @@ public partial class testsuite private string nameField; - private string testsField; + private int testsField; - private string failuresField; + private int failuresField; - private string errorsField; + private int errorsField; private string timeField; @@ -513,7 +513,7 @@ public string name /// [System.Xml.Serialization.XmlAttributeAttribute()] - public string tests + public int tests { get { @@ -527,7 +527,7 @@ public string tests /// [System.Xml.Serialization.XmlAttributeAttribute()] - public string failures + public int failures { get { @@ -541,7 +541,7 @@ public string failures /// [System.Xml.Serialization.XmlAttributeAttribute()] - public string errors + public int errors { get { @@ -798,4 +798,22 @@ internal void RemoveTestSuite(string name) if (foundSuite != null) testsuiteField.Remove(foundSuite); } + + internal testsuite GetTestSuiteOrDefault(string name, string package, out bool isNewTestSuite) + { + isNewTestSuite = false; + foreach (testsuite ts in testsuiteField) + if (ts.name == name && ts.package == package) + return ts; + + isNewTestSuite = true; + return new testsuite + { + name = name, + package = package, + tests = 0, + errors = 0, + failures = 0 + }; + } } diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index bf3a3339c4..134cb7c438 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -256,7 +256,6 @@ public void Run() List failedTests = new List(); - //run the entire set of test once //create the runner according to type IAssetRunner runner = CreateRunner(_runType, true, failedTests); @@ -271,9 +270,9 @@ public void Run() TestSuiteRunResults results = runner.Run(); - if (!_runType.Equals(TestStorageType.MBT)) + if (_runType != TestStorageType.MBT) { - RunTests(runner, resultsFilename, results); + RunSummary(runner, resultsFilename, results); } if (_runType.Equals(TestStorageType.FileSystem)) @@ -295,11 +294,12 @@ public void Run() if (item.TestState == TestState.Failed || item.TestState == TestState.Error) { index++; - failedTests.Add(new TestData(item.TestPath, "FailedTest" + index)); + failedTests.Add(new TestData(item.TestPath, string.Format("FailedTest{0}", index))); } } - + // save the initial XmlBuilder because it contains testcases already created, in order to speed up the report building + JunitXmlBuilder initialXmlBuilder = ((RunnerBase)runner).XmlBuilder; //create the runner according to type runner = CreateRunner(_runType, false, failedTests); @@ -310,10 +310,11 @@ public void Run() return; } + ((RunnerBase)runner).XmlBuilder = initialXmlBuilder; // reuse the populated initialXmlBuilder because it contains testcases already created, in order to speed up the report building TestSuiteRunResults rerunResults = runner.Run(); results.AppendResults(rerunResults); - RunTests(runner, resultsFilename, results); + RunSummary(runner, resultsFilename, results); Environment.Exit((int)_exitCode); } } @@ -757,15 +758,16 @@ private IAssetRunner CreateRunner(TestStorageType runType, bool initialTestRun, } SummaryDataLogger summaryDataLogger = GetSummaryDataLogger(); - List scriptRTSSet = GetScriptRtsSet(); + List scriptRTSSet = GetScriptRtsSet(); + string resultsFilename = _ciParams["resultsFilename"]; if (_ciParams.ContainsKey("fsUftRunMode")) { string uftRunMode = _ciParams["fsUftRunMode"]; - runner = new FileSystemTestsRunner(validTests, timeout, uftRunMode, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, parallelRunnerEnvironments, displayController, analysisTemplate, summaryDataLogger, scriptRTSSet, reportPath); + runner = new FileSystemTestsRunner(validTests, timeout, uftRunMode, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, parallelRunnerEnvironments, displayController, analysisTemplate, summaryDataLogger, scriptRTSSet, reportPath, resultsFilename); } else { - runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, parallelRunnerEnvironments, displayController, analysisTemplate, summaryDataLogger, scriptRTSSet, reportPath); + runner = new FileSystemTestsRunner(validTests, timeout, pollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnectionInfo, mobileinfo, parallelRunnerEnvironments, displayController, analysisTemplate, summaryDataLogger, scriptRTSSet, reportPath, resultsFilename); } break; @@ -862,23 +864,26 @@ private Dictionary GetKeyValuesWithPrefix(string prefix) /// /// /// - private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResults results) + private void RunSummary(IAssetRunner runner, string resultsFile, TestSuiteRunResults results) { try { - if (_ciRun) - { - _xmlBuilder = new JunitXmlBuilder(); - _xmlBuilder.XmlName = resultsFile; - } - if (results == null) { Environment.Exit((int)ExitCodeEnum.Failed); return; } - _xmlBuilder.CreateXmlFromRunResults(results); + if (_runType != TestStorageType.FileSystem) // for FileSystem the report is already generated inside FileSystemTestsRunner.Run() + { + if (_ciRun) + { + _xmlBuilder = new JunitXmlBuilder(); + _xmlBuilder.XmlName = resultsFile; + } + + _xmlBuilder.CreateXmlFromRunResults(results); + } if (results.TestRuns.Count == 0) { @@ -985,7 +990,8 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul { Environment.Exit((int)_exitCode); } - } else + } + else { Environment.Exit((int)_exitCode); } @@ -999,7 +1005,7 @@ private void RunTests(IAssetRunner runner, string resultsFile, TestSuiteRunResul catch (Exception ex) { ConsoleWriter.WriteLine(string.Format(Resources.LauncherRunnerDisposeError, ex.Message)); - }; + } } } diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index aed5011e38..4e5d6c2899 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -67,11 +67,9 @@ public class FileSystemTestsRunner : RunnerBase, IDisposable //saves runners for cleaning up at the end. private Dictionary _colRunnersForCleanup = new Dictionary(); - private McConnectionInfo _mcConnection; private string _mobileInfoForAllGuiTests; - #endregion /// @@ -108,9 +106,10 @@ public FileSystemTestsRunner(List sources, SummaryDataLogger summaryDataLogger, List scriptRtsSet, string reportPath, + string xmlResultsFullFileName, bool useUftLicense = false) - : this(sources, timeout, controllerPollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnection, mobileInfo, parallelRunnerEnvironments, displayController, analysisTemplate, summaryDataLogger, scriptRtsSet, reportPath, useUftLicense) + : this(sources, timeout, controllerPollingInterval, perScenarioTimeOutMinutes, ignoreErrorStrings, jenkinsEnvVariables, mcConnection, mobileInfo, parallelRunnerEnvironments, displayController, analysisTemplate, summaryDataLogger, scriptRtsSet, reportPath, xmlResultsFullFileName, useUftLicense) { _uftRunMode = uftRunMode; } @@ -147,13 +146,14 @@ public FileSystemTestsRunner(List sources, SummaryDataLogger summaryDataLogger, List scriptRtsSet, string reportPath, + string xmlResultsFullFileName, bool useUftLicense = false) { _jenkinsEnvVariables = jenkinsEnvVariables; //search if we have any testing tools installed if (!Helper.IsTestingToolsInstalled(TestStorageType.FileSystem)) { - ConsoleWriter.WriteErrLine(string.Format(Resources.FileSystemTestsRunner_No_HP_testing_tool_is_installed_on, System.Environment.MachineName)); + ConsoleWriter.WriteErrLine(string.Format(Resources.FileSystemTestsRunner_No_HP_testing_tool_is_installed_on, Environment.MachineName)); Environment.Exit((int)Launcher.ExitCodeEnum.Failed); } @@ -176,6 +176,7 @@ public FileSystemTestsRunner(List sources, _mobileInfoForAllGuiTests = mobileInfo; _parallelRunnerEnvironments = parallelRunnerEnvironments; + _xmlBuilder.XmlName = xmlResultsFullFileName; ConsoleWriter.WriteLine("UFT Mobile connection info is - " + _mcConnection.ToString()); @@ -292,12 +293,15 @@ public FileSystemTestsRunner(List sources, public override TestSuiteRunResults Run() { //create a new Run Results object - TestSuiteRunResults activeRunDesc = new TestSuiteRunResults(); + TestSuiteRunResults activeRunDesc = new TestSuiteRunResults(); + bool isNewTestSuite; + testsuite ts = _xmlBuilder.TestSuites.GetTestSuiteOrDefault(activeRunDesc.SuiteName, JunitXmlBuilder.ClassName, out isNewTestSuite); + ts.tests += _tests.Count; double totalTime = 0; try - { - var start = DateTime.Now; + { + var start = DateTime.Now; Dictionary indexList = new Dictionary(); foreach (var test in _tests) @@ -307,8 +311,9 @@ public override TestSuiteRunResults Run() Dictionary rerunList = createDictionary(_tests); - foreach (var test in _tests) + for (int x = 0; x < _tests.Count; x++) { + var test = _tests[x]; if (indexList[test.TestPath] == 0) { indexList[test.TestPath] = 1; @@ -316,8 +321,6 @@ public override TestSuiteRunResults Run() if (RunCancelled()) break; - var testStart = DateTime.Now; - string errorReason = string.Empty; TestRunResults runResult = null; try @@ -351,7 +354,7 @@ public override TestSuiteRunResults Run() { if (string.IsNullOrEmpty(runResult.ErrorDesc)) { - runResult.ErrorDesc = RunCancelled() ? HpToolsLauncher.Properties.Resources.ExceptionUserCancelled : HpToolsLauncher.Properties.Resources.ExceptionExternalProcess; + runResult.ErrorDesc = RunCancelled() ? Resources.ExceptionUserCancelled : Resources.ExceptionExternalProcess; } runResult.ReportLocation = null; runResult.TestState = TestState.Error; @@ -368,8 +371,7 @@ public override TestSuiteRunResults Run() ConsoleWriter.WriteLine(string.Format(Resources.FsRunnerTestDone, runResult.TestState)); } - UpdateCounters(runResult.TestState); - var testTotalTime = (DateTime.Now - testStart).TotalSeconds; + UpdateCounters(runResult.TestState, ts); //create test folders if (rerunList[test.TestPath] > 0) @@ -386,9 +388,9 @@ public override TestSuiteRunResults Run() } //update report folder - String uftReportDir = Path.Combine(test.TestPath, "Report"); - String uftReportDirNew = Path.Combine(test.TestPath, "Report" + indexList[test.TestPath]); - ConsoleWriter.WriteLine("uftReportDir is " + uftReportDirNew); + string uftReportDir = Path.Combine(test.TestPath, "Report"); + string uftReportDirNew = Path.Combine(test.TestPath, string.Format("Report{0}", indexList[test.TestPath])); + ConsoleWriter.WriteLine(string.Format("uftReportDir is {0}", uftReportDirNew)); try { if (Directory.Exists(uftReportDir)) @@ -401,16 +403,18 @@ public override TestSuiteRunResults Run() Directory.Move(uftReportDir, uftReportDirNew); } } - catch(Exception e) + catch(Exception) { System.Threading.Thread.Sleep(1000); Directory.Move(uftReportDir, uftReportDirNew); - } - + } + + // Create or update the xml report. This function is called after each test execution in order to have a report available in case of job interruption + _xmlBuilder.CreateOrUpdatePartialXmlReport(ts, runResult, isNewTestSuite && x==0); ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Test complete: " + runResult.TestPath + "\n-------------------------------------------------------------------------------------------------------"); } - - totalTime = (DateTime.Now - start).TotalSeconds; + + totalTime = (DateTime.Now - start).TotalSeconds; } finally { @@ -597,18 +601,20 @@ public bool RunCancelled() /// sums errors and failed tests /// /// - private void UpdateCounters(TestState testState) + private void UpdateCounters(TestState testState, testsuite ts) { switch (testState) { case TestState.Error: - _errors += 1; + _errors++; + ts.errors++; break; case TestState.Failed: - _fail += 1; + _fail++; + ts.failures++; break; case TestState.Warning: - _warnings += 1; + _warnings++; break; } } diff --git a/HpToolsLauncher/Runners/RunnerBase.cs b/HpToolsLauncher/Runners/RunnerBase.cs index 3a38d672b1..500bffe161 100644 --- a/HpToolsLauncher/Runners/RunnerBase.cs +++ b/HpToolsLauncher/Runners/RunnerBase.cs @@ -32,11 +32,11 @@ namespace HpToolsLauncher { public class RunnerBase : IAssetRunner { - public virtual void Dispose() { } protected bool _blnRunCancelled = false; + protected JunitXmlBuilder _xmlBuilder = new JunitXmlBuilder(); public bool RunWasCancelled { @@ -44,6 +44,12 @@ public bool RunWasCancelled set { _blnRunCancelled = value; } } + public JunitXmlBuilder XmlBuilder + { + get { return _xmlBuilder; } + set { _xmlBuilder = value; } + } + public virtual TestSuiteRunResults Run() { throw new NotImplementedException(); From 191bbe1c59708f03fa567bdaadf8252ffea318e1 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Mon, 7 Mar 2022 13:43:23 +0200 Subject: [PATCH 2067/2502] US-735131 | Add support for UFT Mobile authentication via Access Key --- HpToolsLauncher/Launcher.cs | 63 ++----- HpToolsLauncher/McConnection.cs | 178 ++++++++++++++++++ .../Properties/Resources.Designer.cs | 36 ++++ HpToolsLauncher/Properties/Resources.resx | 12 ++ HpToolsLauncher/TestRunners/GuiTestRunner.cs | 59 ++++-- 5 files changed, 283 insertions(+), 65 deletions(-) create mode 100644 HpToolsLauncher/McConnection.cs diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 6adcc6983c..0279253b04 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -46,51 +46,6 @@ public enum CiName CCNET } - public class McConnectionInfo - { - public string MobileUserName { get; set; } - public string MobilePassword { get; set; } - public string MobileHostAddress { get; set; } - public string MobileHostPort { get; set; } - public string MobileTenantId { get; set; } - public int MobileUseSSL { get; set; } - public int MobileUseProxy { get; set; } - public int MobileProxyType { get; set; } - public string MobileProxySetting_Address { get; set; } - public int MobileProxySetting_Port { get; set; } - public int MobileProxySetting_Authentication { get; set; } - public string MobileProxySetting_UserName { get; set; } - public string MobileProxySetting_Password { get; set; } - - - public McConnectionInfo() - { - MobileHostPort = "8080"; - MobileUserName = string.Empty; - MobilePassword = string.Empty; - MobileHostAddress = string.Empty; - MobileTenantId = string.Empty; - MobileUseSSL = 0; - - MobileUseProxy = 0; - MobileProxyType = 0; - MobileProxySetting_Address = string.Empty; - MobileProxySetting_Port = 0; - MobileProxySetting_Authentication = 0; - MobileProxySetting_UserName = string.Empty; - MobileProxySetting_Password = string.Empty; - } - - public override string ToString() - { - string McConnectionStr = - string.Format("UFT Mobile HostAddress: {0}, Port: {1}, Username: {2}, TenantId: {3}, UseSSL: {4}, UseProxy: {5}, ProxyType: {6}, ProxyAddress: {7}, ProxyPort: {8}, ProxyAuth: {9}, ProxyUser: {10}", - MobileHostAddress, MobileHostPort, MobileUserName, MobileTenantId, MobileUseSSL, MobileUseProxy, MobileProxyType, MobileProxySetting_Address, MobileProxySetting_Port, MobileProxySetting_Authentication, - MobileProxySetting_UserName); - return McConnectionStr; - } - } - public class Launcher { private IXmlBuilder _xmlBuilder; @@ -637,6 +592,24 @@ private IAssetRunner CreateRunner(TestStorageType runType, bool initialTestRun, } } + //mc exec token + if (_ciParams.ContainsKey("MobileExecToken")) + { + var mcExecToken = _ciParams["MobileExecToken"]; + if (!string.IsNullOrEmpty(mcExecToken)) + { + try + { + mcConnectionInfo.MobileExecToken = Decrypt(mcExecToken, _secretKey); + } + catch (ArgumentException e) + { + ConsoleWriter.WriteErrLine(e.Message); + Environment.Exit((int)ExitCodeEnum.Failed); + } + } + } + //ssl if (_ciParams.ContainsKey("MobileUseSSL")) { diff --git a/HpToolsLauncher/McConnection.cs b/HpToolsLauncher/McConnection.cs new file mode 100644 index 0000000000..644420e8a5 --- /dev/null +++ b/HpToolsLauncher/McConnection.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Compilation; +using HpToolsLauncher.Properties; + +namespace HpToolsLauncher +{ + public class McConnectionInfo + { + private const string PAIR_SEPARATOR = "="; + private const string TOKEN_SEPARATOR = ";"; + + // auth types for MC + public enum AuthType + { + UsernamePassword, + AuthToken + } + + public struct AuthTokenInfo + { + public string ClientId { get; set; } + public string SecretKey { get; set; } + } + + // if token auth was specified this is populated + private AuthTokenInfo _tokens; + private string _execToken; + private AuthType _authType = AuthType.UsernamePassword; + + public string MobileUserName { get; set; } + public string MobilePassword { get; set; } + + public string MobileExecToken + { + get + { + return _execToken; + } + set + { + _execToken = value; + _tokens = ParseExecToken(); + } + } + + public AuthType MobileAuthType + { + get + { + return _authType; + } + private set + { + _authType = value; + } + } + + public string MobileHostAddress { get; set; } + public string MobileHostPort { get; set; } + public string MobileTenantId { get; set; } + public int MobileUseSSL { get; set; } + public int MobileUseProxy { get; set; } + public int MobileProxyType { get; set; } + public string MobileProxySetting_Address { get; set; } + public int MobileProxySetting_Port { get; set; } + public int MobileProxySetting_Authentication { get; set; } + public string MobileProxySetting_UserName { get; set; } + public string MobileProxySetting_Password { get; set; } + + public McConnectionInfo() + { + MobileHostPort = "8080"; + MobileUserName = string.Empty; + MobileExecToken = string.Empty; + MobilePassword = string.Empty; + MobileHostAddress = string.Empty; + MobileTenantId = string.Empty; + MobileUseSSL = 0; + + MobileUseProxy = 0; + MobileProxyType = 0; + MobileProxySetting_Address = string.Empty; + MobileProxySetting_Port = 0; + MobileProxySetting_Authentication = 0; + MobileProxySetting_UserName = string.Empty; + MobileProxySetting_Password = string.Empty; + } + + /// + /// Parses the execution token and separates into three parts: clientId, secretKey and tenantId + /// + /// + /// + private AuthTokenInfo ParseExecToken() + { + // exec token consists of three parts: + // 1. client id + // 2. secret key + // 3. optionally tenant id + // separator is ; + // key-value pairs are separated with = + + // e.g., "client=oauth2-QHxvc8bOSz4lwgMqts2w@microfocus.com; secret=EHJp8ea6jnVNqoLN6HkD; tenant=999999999;" + // "client=oauth2-OuV8k3snnGp9vJugC1Zn@microfocus.com; secret=6XSquF1FUD4CyQM7fb0B; tenant=999999999;" + // "client=oauth2-OuV8k3snnGp9vJugC1Zn@microfocus.com; secret=6XSquF1FUD7CyQM7fb0B; tenant=999999999;" + var execToken = MobileExecToken.Trim(); + + var ret = new AuthTokenInfo(); + + // it may or may not contains surrounding quotes + if (execToken.StartsWith("\"") && execToken.EndsWith("\"") && execToken.Length > 1) + { + execToken = execToken.Substring(1, execToken.Length - 2); + } + + if (execToken.Length == 0) return ret; // empty string was given as token, may semnalize that it wasn't specified + + var tokens = execToken.Split(TOKEN_SEPARATOR.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + + if (tokens.Length != 3) throw new ArgumentException(Resources.McInvalidToken); + if (!tokens.All(token => token.Contains(PAIR_SEPARATOR))) + throw new ArgumentException(string.Format(Resources.McMalformedTokenInvalidKeyValueSeparator, PAIR_SEPARATOR)); + + // key-values are separated by =, we need its value, the key is known + foreach (var token in tokens) + { + var parts = token.Split(PAIR_SEPARATOR.ToCharArray()); + + if (parts.Length != 2) + throw new ArgumentException(Resources.McMalformedTokenMissingKeyValuePair); + + var key = parts[0].Trim(); + var value = parts[1].Trim(); + + if ("client".Equals(key, StringComparison.OrdinalIgnoreCase)) + { + ret.ClientId = value; + } else if ("secret".Equals(key, StringComparison.OrdinalIgnoreCase)) + { + ret.SecretKey = value; + } else if ("tenant".Equals(key, StringComparison.OrdinalIgnoreCase)) + { + MobileTenantId = value; + } + else + { + throw new ArgumentException(string.Format(Resources.McMalformedTokenInvalidKey, key)); + } + } + + _authType = AuthType.AuthToken; + return ret; + } + + /// + /// Returns the parsed tokens from the execution token. + /// + /// + public AuthTokenInfo GetAuthToken() + { + return _tokens; + } + + public override string ToString() + { + string McConnectionStr = + string.Format("UFT Mobile HostAddress: {0}, Port: {1}, Username: {2}, TenantId: {3}, UseSSL: {4}, UseProxy: {5}, ProxyType: {6}, ProxyAddress: {7}, ProxyPort: {8}, ProxyAuth: {9}, ProxyUser: {10}", + MobileHostAddress, MobileHostPort, MobileUserName, MobileTenantId, MobileUseSSL, MobileUseProxy, MobileProxyType, MobileProxySetting_Address, MobileProxySetting_Port, MobileProxySetting_Authentication, + MobileProxySetting_UserName); + return McConnectionStr; + } + } + +} diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index 0e4ab7f1f2..65736078ea 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -1071,6 +1071,42 @@ internal static string LuancherDisplayTimout { } } + /// + /// Looks up a localized string similar to Invalid execution token for Mobile, should contain ClientID, SecretKey and TenantID.. + /// + internal static string McInvalidToken { + get { + return ResourceManager.GetString("McInvalidToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malformed execution token for Mobile, invalid key value: {0}.. + /// + internal static string McMalformedTokenInvalidKey { + get { + return ResourceManager.GetString("McMalformedTokenInvalidKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malformed execution token for Mobile, key-value pairs are not separated by {0}.. + /// + internal static string McMalformedTokenInvalidKeyValueSeparator { + get { + return ResourceManager.GetString("McMalformedTokenInvalidKeyValueSeparator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malformed execution token for Mobile, token without key-value.. + /// + internal static string McMalformedTokenMissingKeyValuePair { + get { + return ResourceManager.GetString("McMalformedTokenMissingKeyValuePair", resourceCulture); + } + } + /// /// Looks up a localized string similar to Parameter name missing. Please specify the parameter name.. /// diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 1f32a61f10..133519cdc2 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -508,4 +508,16 @@ Save the test in QuickTest and then run it again. Invalid parameter format, check job configuration to re-configure parameter definitions for test: {0}. Falling back to default values, without skipping this test. + + Invalid execution token for Mobile, should contain ClientID, SecretKey and TenantID. + + + Malformed execution token for Mobile, invalid key value: {0}. + + + Malformed execution token for Mobile, key-value pairs are not separated by {0}. + + + Malformed execution token for Mobile, token without key-value. + \ No newline at end of file diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 27aecead93..8f9edad871 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -47,14 +47,17 @@ public class GuiTestRunner : IFileSysTestRunner private const string MOBILE_HOST_PORT = "ALM_MobileHostPort"; private const string MOBILE_USER = "ALM_MobileUserName"; private const string MOBILE_PASSWORD = "ALM_MobilePassword"; + private const string MOBILE_CLIENTID = "EXTERNAL_MobileClientID"; + private const string MOBILE_SECRET = "EXTERNAL_MobileSecretKey"; + private const string MOBILE_AUTH_TYPE = "EXTERNAL_MobileAuthType"; private const string MOBILE_TENANT = "EXTERNAL_MobileTenantId"; private const string MOBILE_USE_SSL = "ALM_MobileUseSSL"; - private const string MOBILE_USE_PROXY = "MobileProxySetting_UseProxy"; - private const string MOBILE_PROXY_SETTING_ADDRESS = "MobileProxySetting_Address"; - private const string MOBILE_PROXY_SETTING_PORT = "MobileProxySetting_Port"; - private const string MOBILE_PROXY_SETTING_AUTHENTICATION = "MobileProxySetting_Authentication"; - private const string MOBILE_PROXY_SETTING_USERNAME = "MobileProxySetting_UserName"; - private const string MOBILE_PROXY_SETTING_PASSWORD = "MobileProxySetting_Password"; + private const string MOBILE_USE_PROXY = "EXTERNAL_MobileProxySetting_UseProxy"; + private const string MOBILE_PROXY_SETTING_ADDRESS = "EXTERNAL_MobileProxySetting_Address"; + private const string MOBILE_PROXY_SETTING_PORT = "EXTERNAL_MobileProxySetting_Port"; + private const string MOBILE_PROXY_SETTING_AUTHENTICATION = "EXTERNAL_MobileProxySetting_Authentication"; + private const string MOBILE_PROXY_SETTING_USERNAME = "EXTERNAL_MobileProxySetting_UserName"; + private const string MOBILE_PROXY_SETTING_PASSWORD = "EXTERNAL_MobileProxySetting_Password"; private const string MOBILE_INFO = "mobileinfo"; private readonly IAssetRunner _runNotifier; @@ -187,27 +190,44 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance } } - if (!string.IsNullOrEmpty(_mcConnection.MobileUserName)) + var mcAuthType = _mcConnection.MobileAuthType; + switch (mcAuthType) { - _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_USER, _mcConnection.MobileUserName); + case McConnectionInfo.AuthType.AuthToken: + var token = _mcConnection.GetAuthToken(); + + _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_CLIENTID, token.ClientId); + _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_SECRET, token.SecretKey); + + break; + case McConnectionInfo.AuthType.UsernamePassword: + if (!string.IsNullOrEmpty(_mcConnection.MobileUserName)) + { + _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_USER, _mcConnection.MobileUserName); + } + + if (!string.IsNullOrEmpty(_mcConnection.MobilePassword)) + { + string encriptedMcPassword = WinUserNativeMethods.ProtectBSTRToBase64(_mcConnection.MobilePassword); + if (encriptedMcPassword == null) + { + ConsoleWriter.WriteLine("ProtectBSTRToBase64 fail for mcPassword"); + throw new Exception("ProtectBSTRToBase64 fail for mcPassword"); + } + _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_PASSWORD, encriptedMcPassword); + } + break; } + // set authentication type + _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_AUTH_TYPE, mcAuthType); + + // set tenantID if (!string.IsNullOrEmpty(_mcConnection.MobileTenantId)) { _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_TENANT, _mcConnection.MobileTenantId); } - if (!string.IsNullOrEmpty(_mcConnection.MobilePassword)) - { - string encriptedMcPassword = WinUserNativeMethods.ProtectBSTRToBase64(_mcConnection.MobilePassword); - if (encriptedMcPassword == null) - { - ConsoleWriter.WriteLine("ProtectBSTRToBase64 fail for mcPassword"); - throw new Exception("ProtectBSTRToBase64 fail for mcPassword"); - } - _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_PASSWORD, encriptedMcPassword); - } - // ssl and proxy info _qtpApplication.TDPierToTulip.SetTestOptionsVal(MOBILE_USE_SSL, _mcConnection.MobileUseSSL); @@ -235,7 +255,6 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance #endregion - if (!_qtpApplication.Launched) { if (_runCancelled()) From fe083920920b7e9e6443fe32e54f3fabde5989ce Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Tue, 8 Mar 2022 12:07:02 +0200 Subject: [PATCH 2068/2502] DEF-751052 | UFT Reports are missing for some UFT Tests, if tests are specified from different Folders --- .../tools/results/RunResultRecorder.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java index 8111d82d9e..865bb46522 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/RunResultRecorder.java @@ -436,7 +436,12 @@ private void archiveTestsReport(Run build, TaskListener listener, List fileNameCount = new HashMap<>(); + // to keep counting how many times this TestPath have appeared, used for accessing the correct Report dir + Map filePathCount = new HashMap<>(); + for (int i = 0; i < testCasesNodes.getLength(); i++) { Node nNode = testCasesNodes.item(i); @@ -455,22 +460,34 @@ private void archiveTestsReport(Run build, TaskListener listener, List build, TaskListener listener, List build, TaskListener listener, List Date: Tue, 8 Mar 2022 16:38:05 +0200 Subject: [PATCH 2069/2502] On failure scenario, the entire test set reruns, if the test has "Warning" status --- HpToolsLauncher/Launcher.cs | 7 +++++-- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index db6c00a65d..10b297edcd 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -282,7 +282,9 @@ public void Run() _rerunFailedTests = !string.IsNullOrEmpty(onCheckFailedTests) && Convert.ToBoolean(onCheckFailedTests.ToLower()); //the "On failure" option is selected and the run build contains failed tests - if (_rerunFailedTests && _exitCode != ExitCodeEnum.Passed) + // we need to check if there were any failed tests + + if (_rerunFailedTests && (_exitCode == ExitCodeEnum.Failed || results.NumFailures > 0)) { ConsoleWriter.WriteLine("There are failed tests."); @@ -315,8 +317,9 @@ public void Run() results.AppendResults(rerunResults); RunSummary(runner, resultsFilename, results); - Environment.Exit((int)_exitCode); } + + Environment.Exit((int)_exitCode); } } diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index d8f457139d..0234173696 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -521,7 +521,7 @@ private GuiTestRunResult ExecuteQTPRun(TestRunResults testResults) } else if (_qtpApplication.Test.LastRunResults.Status.Equals("Warning")) { - testResults.TestState = TestState.Passed; + testResults.TestState = TestState.Warning; testResults.HasWarnings = true; if (Launcher.ExitCode != Launcher.ExitCodeEnum.Failed && Launcher.ExitCode != Launcher.ExitCodeEnum.Aborted) From e1c66c363be6d843bcc13c3ac25b64ed5bc4dc69 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 9 Mar 2022 10:08:56 +0200 Subject: [PATCH 2070/2502] fixed broken resources file --- HpToolsLauncher/Properties/Resources.resx | 1 + 1 file changed, 1 insertion(+) diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 6a0d9f29f2..632097bb61 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -519,6 +519,7 @@ Save the test in QuickTest and then run it again. Malformed execution token for Mobile, token without key-value. + Duplicate parameter name entry found, please check the parameters' specification. From c722a0f5746bace60b698832da02089d9530d612 Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 9 Mar 2022 10:20:49 +0200 Subject: [PATCH 2071/2502] add McConnection to compile target --- HpToolsLauncher/HpToolsLauncher.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HpToolsLauncher/HpToolsLauncher.csproj b/HpToolsLauncher/HpToolsLauncher.csproj index 4452f382c3..3805cd79ca 100644 --- a/HpToolsLauncher/HpToolsLauncher.csproj +++ b/HpToolsLauncher/HpToolsLauncher.csproj @@ -104,6 +104,7 @@ junit.xsd code + @@ -121,7 +122,7 @@ - + From 566c012f9f92abc95602369f37c7c929a26d6454 Mon Sep 17 00:00:00 2001 From: motteww Date: Wed, 16 Mar 2022 18:35:30 +0800 Subject: [PATCH 2072/2502] US#321046:for code review. --- .../application/automation/tools/mc/HttpUtils.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java index a81655e905..405de7a183 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java @@ -175,11 +175,9 @@ private static JSONObject convertStreamToJSONObject(InputStream inputStream) { while ((line = reader.readLine()) != null) { res.append(line); } - if (JSONValue.isValidJson(res.toString())) { - obj = (JSONObject) JSONValue.parseStrict(res.toString()); - } else { - System.out.println("WARN::INVALIDE JSON Object" + res); - } + obj = (JSONObject) JSONValue.parseStrict(res.toString()); + } catch (ClassCastException e) { + System.out.println("WARN::INVALIDE JSON Object" + e.getMessage()); } catch (Exception e) { e.printStackTrace(); } From b3d31df85fff2b8d14d2c3d7c24ee4205dc3706e Mon Sep 17 00:00:00 2001 From: Zsolt Lukacs Date: Wed, 16 Mar 2022 12:55:21 +0200 Subject: [PATCH 2073/2502] Add formatting feature for Run Results --- HpToolsLauncher/ConsoleWriter.cs | 15 ++- HpToolsLauncher/Launcher.cs | 2 +- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 12 +- .../Runners/FileSystemTestsRunner.cs | 2 +- HpToolsLauncher/TestRunners/ApiTestRunner.cs | 2 +- HpToolsLauncher/TestRunners/GuiTestRunner.cs | 2 +- .../TestRunners/ParallelTestRunner.cs | 2 +- .../TestRunners/PerformanceTestRunner.cs | 2 +- .../tools/results/ReportMetaData.java | 31 ++++- ...RunnerMiscSettingsGlobalConfiguration.java | 122 ++++++++++++++++++ .../results/HtmlBuildReportAction/index.jelly | 33 ++--- .../config.jelly | 36 ++++++ .../help-dateFormat.html | 34 +++++ 13 files changed, 259 insertions(+), 36 deletions(-) create mode 100644 src/main/java/com/microfocus/application/automation/tools/settings/RunnerMiscSettingsGlobalConfiguration.java create mode 100644 src/main/resources/com/microfocus/application/automation/tools/settings/RunnerMiscSettingsGlobalConfiguration/config.jelly create mode 100644 src/main/resources/com/microfocus/application/automation/tools/settings/RunnerMiscSettingsGlobalConfiguration/help-dateFormat.html diff --git a/HpToolsLauncher/ConsoleWriter.cs b/HpToolsLauncher/ConsoleWriter.cs index 4c24e5318f..3a6241b70e 100644 --- a/HpToolsLauncher/ConsoleWriter.cs +++ b/HpToolsLauncher/ConsoleWriter.cs @@ -99,11 +99,22 @@ public static void WriteLine(string[] messages) public static void WriteLine(string message) { - message = FilterXmlProblematicChars(message); - //File.AppendAllText("c:\\stam11.stam", message); + message = FilterXmlProblematicChars(message); + Console.WriteLine(message); + if (activeTestRun != null) activeTestRun.ConsoleOut += message + "\n"; } + + public static void WriteLineWithTime(string message) + { + WriteLine(string.Format("{0} {1}", DateTime.Now.ToString(Launcher.DateFormat), message)); + } + + public static void WriteErrLineWithTime(string message) + { + WriteLine(string.Format("Error: {0} {1}", DateTime.Now.ToString(Launcher.DateFormat), message)); + } } } diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index 10b297edcd..06f2efd4e4 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -100,7 +100,7 @@ public class Launcher private TestStorageType _runType; private readonly string _failOnUftTestFailed; private static ExitCodeEnum _exitCode = ExitCodeEnum.Passed; - private const string _dateFormat = "dd/MM/yyyy HH:mm:ss"; + private const string _dateFormat = "dd'/'MM'/'yyyy HH':'mm':'ss"; private bool _rerunFailedTests = false; public const string ClassName = "HPToolsFileSystemRunner"; diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 53b7669693..1e216cca93 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -1708,10 +1708,10 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te ConsoleWriter.ActiveTestRun = runDesc.TestRuns[testIndex]; - ConsoleWriter.WriteLine(string.Format("{0} Running: {1}", DateTime.Now.ToString(Launcher.DateFormat), currentTest.Name)); + ConsoleWriter.WriteLineWithTime(string.Format("Running: {0}", currentTest.Name)); activeTestDesc.TestName = currentTest.Name; //tell user that the test is running - ConsoleWriter.WriteLine(string.Format("{0} Running test: {1}, Test id: {2}, Test instance id: {3}", DateTime.Now.ToString(Launcher.DateFormat), activeTestDesc.TestName, testExecStatusObj.TestId, testExecStatusObj.TSTestId)); + ConsoleWriter.WriteLineWithTime(string.Format("Running test: {0}, Test id: {1}, Test instance id: {2}", activeTestDesc.TestName, testExecStatusObj.TestId, testExecStatusObj.TSTestId)); //start timing the new test run string folderName = string.Empty; @@ -1878,10 +1878,10 @@ private void WriteTestRunSummary(ITSTest prevTest) { ConsoleWriter.WriteLine("\n" + string.Format(Resources.AlmRunnerDisplayLink, "\n" + linkStr + "\n")); } - - ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " " + Resources.AlmRunnerTestCompleteCaption + " " + prevTest.Name + - ", " + Resources.AlmRunnerRunIdCaption + " " + runId - + "\n-------------------------------------------------------------------------------------------------------"); + + ConsoleWriter.WriteLineWithTime(Resources.AlmRunnerTestCompleteCaption + " " + prevTest.Name + + ", " + Resources.AlmRunnerRunIdCaption + " " + runId + + "\n-------------------------------------------------------------------------------------------------------"); } /// diff --git a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs index f395ba3a9e..f39f3ea0b9 100644 --- a/HpToolsLauncher/Runners/FileSystemTestsRunner.cs +++ b/HpToolsLauncher/Runners/FileSystemTestsRunner.cs @@ -420,7 +420,7 @@ public override TestSuiteRunResults Run() // Create or update the xml report. This function is called after each test execution in order to have a report available in case of job interruption _xmlBuilder.CreateOrUpdatePartialXmlReport(ts, runResult, isNewTestSuite && x==0); - ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Test complete: " + runResult.TestPath + "\n-------------------------------------------------------------------------------------------------------"); + ConsoleWriter.WriteLineWithTime("Test complete: " + runResult.TestPath + "\n-------------------------------------------------------------------------------------------------------"); } totalTime = (DateTime.Now - start).TotalSeconds; diff --git a/HpToolsLauncher/TestRunners/ApiTestRunner.cs b/HpToolsLauncher/TestRunners/ApiTestRunner.cs index d0782bdc7f..b378edc86a 100644 --- a/HpToolsLauncher/TestRunners/ApiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ApiTestRunner.cs @@ -94,7 +94,7 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance TestRunResults runDesc = new TestRunResults(); ConsoleWriter.ActiveTestRun = runDesc; - ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testinf.TestPath); + ConsoleWriter.WriteLineWithTime("Running: " + testinf.TestPath); runDesc.TestPath = testinf.TestPath; diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 0234173696..e902af19da 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -100,7 +100,7 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance var testPath = testinf.TestPath; TestRunResults runDesc = new TestRunResults(); ConsoleWriter.ActiveTestRun = runDesc; - ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + testPath); + ConsoleWriter.WriteLineWithTime("Running: " + testPath); runDesc.TestPath = testPath; diff --git a/HpToolsLauncher/TestRunners/ParallelTestRunner.cs b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs index 830630fb2f..f33bdeb825 100644 --- a/HpToolsLauncher/TestRunners/ParallelTestRunner.cs +++ b/HpToolsLauncher/TestRunners/ParallelTestRunner.cs @@ -180,7 +180,7 @@ public TestRunResults RunTest(TestInfo testInfo, ref string errorReason, RunCanc return runResults; } - ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " => Using ParallelRunner to execute test: " + testInfo.TestPath); + ConsoleWriter.WriteLineWithTime("Using ParallelRunner to execute test: " + testInfo.TestPath); _runCancelled = runCancelled; diff --git a/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs b/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs index 1ba994485e..432fb7709f 100644 --- a/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs +++ b/HpToolsLauncher/TestRunners/PerformanceTestRunner.cs @@ -119,7 +119,7 @@ public TestRunResults RunTest(TestInfo scenarioInf, ref string errorReason, RunC TestRunResults runDesc = new TestRunResults(); ConsoleWriter.ActiveTestRun = runDesc; - ConsoleWriter.WriteLine(DateTime.Now.ToString(Launcher.DateFormat) + " Running: " + scenarioPath); + ConsoleWriter.WriteLineWithTime("Running: " + scenarioPath); runDesc.TestType = TestType.LoadRunner.ToString(); _resultsFolder = Helper.GetTempDir(); diff --git a/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java b/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java index 157a33071b..60fc3497f5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java +++ b/src/main/java/com/microfocus/application/automation/tools/results/ReportMetaData.java @@ -28,10 +28,15 @@ package com.microfocus.application.automation.tools.results; +import com.microfocus.application.automation.tools.settings.RunnerMiscSettingsGlobalConfiguration; -public class ReportMetaData { +import java.time.DateTimeException; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import static com.microfocus.application.automation.tools.settings.RunnerMiscSettingsGlobalConfiguration.*; +public class ReportMetaData { private String folderPath; //slave path of report folder(only for html report format) private String disPlayName; @@ -75,10 +80,33 @@ public void setResourceURL(String resourceURL) { this.resourceURL = resourceURL; } + private static LocalDateTime tryParseDate(String date) { + for (String pattern : DEFAULT_UFT_DATE_PATTERNS) { + try { + return LocalDateTime.parse(date, DateTimeFormatter.ofPattern(pattern)); + } catch (DateTimeException | IllegalArgumentException ignored) {} + } + + return null; + } + public String getDateTime() { return dateTime; } + public String getFormattedDateTime() { + // there is a global configuration option to set the date format for RunResults, we format the received date at the last second + // because this way we can keep the default UFT formatting, nonetheless how users specify their own format + LocalDateTime dateTime = tryParseDate(this.dateTime); + if (dateTime == null) return this.dateTime; + + try { + return dateTime.format(RunnerMiscSettingsGlobalConfiguration.getInstance().getDateFormatter()); + } catch (NullPointerException ignored) { + return this.dateTime; + } + } + public void setDateTime(String dateTime) { this.dateTime = dateTime; } @@ -116,4 +144,5 @@ public void setArchiveUrl(String archiveUrl) { public boolean hasArchiveUrl() { return archiveUrl != null && !archiveUrl.equals(""); } + } diff --git a/src/main/java/com/microfocus/application/automation/tools/settings/RunnerMiscSettingsGlobalConfiguration.java b/src/main/java/com/microfocus/application/automation/tools/settings/RunnerMiscSettingsGlobalConfiguration.java new file mode 100644 index 0000000000..efe0dbadcf --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/settings/RunnerMiscSettingsGlobalConfiguration.java @@ -0,0 +1,122 @@ +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ___________________________________________________________________ + */ + +package com.microfocus.application.automation.tools.settings; + +import edu.umd.cs.findbugs.annotations.NonNull; +import hudson.Extension; +import hudson.util.FormValidation; +import jenkins.model.GlobalConfiguration; +import com.microfocus.application.automation.tools.sse.common.StringUtils; +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; + +import java.io.Serializable; +import java.time.format.DateTimeFormatter; +import java.util.Arrays; +import java.util.List; + +@Extension(ordinal = 1, optional = true) +public class RunnerMiscSettingsGlobalConfiguration extends GlobalConfiguration implements Serializable { + + public static final String DEFAULT_UFT_DATE_PATTERN1 = "dd/MM/yyyy HH:mm:ss"; + // for backward compatibility only, after this it will be forced to use / as date separator + public static final String DEFAULT_UFT_DATE_PATTERN2 = "dd-MM-yyyy HH:mm:ss"; + public static final String DEFAULT_UFT_DATE_PATTERN3 = "dd.MM.yyyy HH:mm:ss"; + public static final List DEFAULT_UFT_DATE_PATTERNS = Arrays.asList(DEFAULT_UFT_DATE_PATTERN1, DEFAULT_UFT_DATE_PATTERN2, DEFAULT_UFT_DATE_PATTERN3); + + private static boolean LOADED = false; + + private String dateFormat; + + @DataBoundConstructor + public RunnerMiscSettingsGlobalConfiguration(String mfDateFormat) { + setDateFormat(mfDateFormat); + } + + public RunnerMiscSettingsGlobalConfiguration() { + load(); + LOADED = true; + } + + public static RunnerMiscSettingsGlobalConfiguration getInstance() throws NullPointerException { + RunnerMiscSettingsGlobalConfiguration config = GlobalConfiguration.all().get(RunnerMiscSettingsGlobalConfiguration.class); + + if (config == null) throw new NullPointerException(); + + if (!LOADED) { + config.load(); + } + + return config; + } + + @NonNull + @Override + public String getDisplayName() { + return "Miscellaneous Micro Focus Plugin settings"; + } + + public String getDateFormat() { + return dateFormat; + } + + public DateTimeFormatter getDateFormatter() { + return dateFormat != null ? DateTimeFormatter.ofPattern(dateFormat) : DateTimeFormatter.ofPattern(DEFAULT_UFT_DATE_PATTERN1); + } + + public void setDateFormat(String dateFormat) { + if (!StringUtils.isNullOrEmpty(dateFormat)) { + try { + DateTimeFormatter.ofPattern(dateFormat); + this.dateFormat = dateFormat; + } catch (IllegalArgumentException ignored) { + this.dateFormat = DEFAULT_UFT_DATE_PATTERN1; + } + } else { + this.dateFormat = DEFAULT_UFT_DATE_PATTERN1; + } + + save(); + } + + public FormValidation doCheckDateFormat(@QueryParameter String value) { + if (!StringUtils.isNullOrEmpty(value)) { + try { + DateTimeFormatter.ofPattern(value); + } catch (IllegalArgumentException ignored) { + return FormValidation.error("Invalid timestamp pattern specified."); + } + + return FormValidation.ok(); + } + + return FormValidation.warning("Will fallback to default pattern."); + } + +} diff --git a/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly b/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly index f3a41b38ea..cacb3e23e5 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/results/HtmlBuildReportAction/index.jelly @@ -31,10 +31,7 @@ From 9a0f698f7ffbce63768fbbd3a089dcd57e78d324 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Fri, 2 Sep 2022 23:18:41 +0300 Subject: [PATCH 2209/2502] update style --- .../automation/tools/run/RunFromFileBuilder/config.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 2f7c543be0..49ad3b6bfb 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -88,7 +88,7 @@ width: 100%; } div.setting-main div.jenkins-radio, div.setting-main select { - margin-right: 10px; + margin-right: 15px; } From 7ca7f84efdfd791d4a960e446fff7fd33766ec5f Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 6 Sep 2022 13:25:29 +0300 Subject: [PATCH 2210/2502] DEF-830051 [Jenkins][Layout] Our layout is affected in Jenkins 2.346.1 LTS latest version --- .../config.jelly | 3 --- .../tools/run/RunFromFileBuilder/config.jelly | 21 +++++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly index 6697d27a64..e780e354c4 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/model/ParallelRunnerEnvironmentModel/config.jelly @@ -35,9 +35,6 @@ div[name="parallelRunnerEnvironments"] { background-color: inherit !important; } - div.repeated-container { - width:100%; - } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 49ad3b6bfb..42d6b52a46 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -84,12 +84,15 @@ textarea.setting-input{ resize: vertical; } - div.setting-main { - width: 100%; - } - div.setting-main div.jenkins-radio, div.setting-main select { - margin-right: 15px; - } + div.setting-main { + width: 100%; + } + div.setting-main div.jenkins-radio, div.setting-main select { + margin-right: 15px; + } + div.repeated-container { + width:100%; + } @@ -144,7 +147,7 @@ - +
          @@ -187,7 +190,7 @@
          - +
          @@ -243,7 +246,7 @@ - +
          From b9dcb9cd24dc839cc2458cacb38028d7a34f8a3c Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 6 Sep 2022 14:15:23 +0300 Subject: [PATCH 2211/2502] fix style to preserve original attributes --- src/main/webapp/configure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index 9ef755d64d..ba08788146 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -152,5 +152,5 @@ function hideAndMoveAdvancedBody(_id) { const tBody = document.querySelector("#" + _id).parentNode; // initial advanced block content const initialAdvancedBlock = tBody.previousSibling; // advanced link button block and here was hidden the initial advanced block content initialAdvancedBlock.querySelector(".advancedBody").appendChild(tBody); // moves the initial advanced block content back to the hidden block - initialAdvancedBlock.querySelector(".advancedLink").style = ""; // enables once again the advanced link + initialAdvancedBlock.querySelector(".advancedLink").style.display = ""; // enables once again the advanced link } \ No newline at end of file From e000f9fdb6536d4effefe0b2aafd18fc2ccb3aa2 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 6 Sep 2022 14:16:54 +0300 Subject: [PATCH 2212/2502] missed style updated for ALM --- .../automation/tools/run/RunFromAlmBuilder/config.jelly | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly index abac59c933..229836fde5 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromAlmBuilder/config.jelly @@ -83,6 +83,10 @@ .info { margin-left: -15px; } + + div.setting-main { + width: 100%; + } diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationAction.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationAction.java index 86b61bef3a..5788d7465f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationAction.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationAction.java @@ -41,7 +41,7 @@ public class ConfigurationAction implements Action, StaplerProxy { public ConfigurationAction(Job job) { this.owner = job; - this.proxy = new JobConfigurationProxy(job); + this.proxy = new JobConfigurationProxy(job,null); } @Override diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch.java new file mode 100644 index 0000000000..add33c14f2 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch.java @@ -0,0 +1,68 @@ +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ___________________________________________________________________ + */ + +package com.microfocus.application.automation.tools.octane.configuration; + +import com.microfocus.application.automation.tools.octane.Messages; +import hudson.model.Action; +import hudson.model.Item; +import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject; +import org.kohsuke.stapler.StaplerProxy; + +public class ConfigurationActionMultibranch implements Action, StaplerProxy { + + final public WorkflowMultiBranchProject owner; + final public JobConfigurationProxy proxy; + + public ConfigurationActionMultibranch(WorkflowMultiBranchProject job) { + this.owner = job; + this.proxy = new JobConfigurationProxy(null,job); + } + + @Override + public String getIconFileName() { + return owner.getACL().hasPermission(Item.CONFIGURE)? "setting.png": null; + } + + @Override + public String getDisplayName() { + return Messages.ConfigurationLabel(); + } + + @Override + public String getUrlName() { + return "mqmConfigurationMultibranch"; + } + + @Override + public Object getTarget() { + owner.getACL().checkPermission(Item.CONFIGURE); + + return this; + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranchFactory.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranchFactory.java new file mode 100644 index 0000000000..224898d661 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranchFactory.java @@ -0,0 +1,57 @@ +/* + * Certain versions of software and/or documents ("Material") accessible here may contain branding from + * Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, + * the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP + * and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE + * marks are the property of their respective owners. + * __________________________________________________________________ + * MIT License + * + * (c) Copyright 2012-2021 Micro Focus or one of its affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ___________________________________________________________________ + */ + +package com.microfocus.application.automation.tools.octane.configuration; + +import hudson.Extension; +import hudson.model.Action; +import jenkins.model.TransientActionFactory; +import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject; + +import javax.annotation.Nonnull; +import java.util.Collection; +import java.util.Collections; + +@Extension +public class ConfigurationActionMultibranchFactory extends TransientActionFactory { + + @Override + public Class type() { + return WorkflowMultiBranchProject.class; + } + + @Nonnull + @Override + public Collection createFor(@Nonnull WorkflowMultiBranchProject job) { + // not sure if we need proper extensibility mechanism here: let's start small and extend if needed + if ("hudson.matrix.MatrixConfiguration".equals(job.getClass().getName())) { + return Collections.emptyList(); + } + return Collections.singleton(new ConfigurationActionMultibranch(job)); + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java index 209f536eed..b717aaeb0f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java @@ -37,7 +37,6 @@ import com.hp.octane.integrations.dto.general.CIServerInfo; import com.hp.octane.integrations.dto.general.ListItem; import com.hp.octane.integrations.dto.general.Taxonomy; -import com.hp.octane.integrations.dto.parameters.CIParameter; import com.hp.octane.integrations.dto.pipelines.PipelineContext; import com.hp.octane.integrations.dto.pipelines.PipelineContextList; import com.hp.octane.integrations.dto.pipelines.PipelineNode; @@ -47,13 +46,13 @@ import com.microfocus.application.automation.tools.octane.CIJenkinsServicesImpl; import com.microfocus.application.automation.tools.octane.Messages; import com.microfocus.application.automation.tools.octane.model.ModelFactory; -import com.microfocus.application.automation.tools.octane.model.processors.parameters.ParameterProcessors; import com.microfocus.application.automation.tools.octane.model.processors.projects.JobProcessorFactory; import hudson.model.Job; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.Logger; +import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject; import org.kohsuke.stapler.bind.JavaScriptMethod; import java.util.*; @@ -61,6 +60,7 @@ import java.util.function.Predicate; import java.util.regex.Pattern; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * This class is a proxy between JS UI code and server-side job configuration. @@ -78,17 +78,24 @@ public class JobConfigurationProxy { public static final String TEXT_FIELD = "text"; final private Job job; + final private WorkflowMultiBranchProject multibranch; private static final String NOT_SPECIFIED = "-- Not specified --"; - JobConfigurationProxy(Job job) { + JobConfigurationProxy(Job job,WorkflowMultiBranchProject multiBranchProject) { this.job = job; + this.multibranch = multiBranchProject; } + @JavaScriptMethod public JSONObject createPipelineOnServer(JSONObject pipelineObject) { JSONObject result = new JSONObject(); + if(multibranch != null){ + return createMultiBranchOnServer(pipelineObject); + } + PipelineNode pipelineNode = ModelFactory.createStructureItem(job); String instanceId = pipelineObject.getString(INSTANCE_ID_FIELD); CIServerInfo ciServerInfo = CIJenkinsServicesImpl.getJenkinsServerInfo(); @@ -139,6 +146,89 @@ public JSONObject createPipelineOnServer(JSONObject pipelineObject) { return result; } + public JSONObject createMultiBranchOnServer(JSONObject pipelineObject) { + + + JSONObject result = new JSONObject(); + + try { + String ciId = multibranch.getFullName(); + String name = pipelineObject.getString(NAME_FIELD); + Long workspaceId = pipelineObject.getLong(WORKSPACE_ID_FIELD); + long releaseId = pipelineObject.getLong(RELEASE_ID_FIELD); + long milestoneId = pipelineObject.getLong(MILESTONE_ID_FIELD); + String instanceId = pipelineObject.getString(INSTANCE_ID_FIELD); + OctaneClient octaneClient = OctaneSDK.getClientByInstanceId(instanceId); + + + String condition = QueryHelper.condition(EntityConstants.CIServer.INSTANCE_ID_FIELD, instanceId); + ResponseEntityList response = queryEntitiesByName(octaneClient, null, Collections.singletonList(condition), workspaceId, "ci_servers", 1); + + if (response != null && response.getTotalCount() == 0 && response.getData() != null) { + throw new ClientException(String.format("CI Server not exist on Octane please create it on workspace %s, Instance ID %s.", workspaceId, instanceId)); + } + + Entity CIServer = response.getData().get(0); + Entity release = releaseId > 0 ? dtoFactory.newDTO(Entity.class).setType(EntityConstants.Release.ENTITY_NAME).setId(Long.toString(releaseId)) : null; + Entity milestone = milestoneId > 0 ? dtoFactory.newDTO(Entity.class).setType(EntityConstants.Milestone.ENTITY_NAME).setId(Long.toString(milestoneId)) : null; + + Entity pipeline = dtoFactory.newDTO(Entity.class) + .setField(EntityConstants.Pipeline.CI_SERVER, CIServer) + .setField(EntityConstants.Pipeline.NAME_FIELD, name) + .setField(EntityConstants.Pipeline.ROOT_JOB_NAME, ciId); + if (release != null) { + pipeline.setField(EntityConstants.Pipeline.CURRENT_RELEASE, release); + } + if (milestone != null) { + pipeline.setField(EntityConstants.Pipeline.CURRENT_MILESTONE, milestone); + } + + EntitiesService entitiesService = octaneClient.getEntitiesService(); + List results = entitiesService.postEntities(workspaceId, EntityConstants.Pipeline.COLLECTION_NAME, Collections.singletonList(pipeline), + Stream.of(EntityConstants.Pipeline.NAME_FIELD, EntityConstants.Pipeline.CURRENT_RELEASE, EntityConstants.Pipeline.CURRENT_MILESTONE) + .collect(Collectors.toList())); + + if (results.size() != 1) { + throw new ClientException("Failed to create pipeline."); + } + + List workspaces = getWorkspacesById(octaneClient, Collections.singletonList(workspaceId)); + if (workspaces.size() != 1) { + throw new ClientException("WorkspaceName could not be retrieved for workspaceId: " + workspaceId); + } + + Entity pipelineCreated = results.get(0); + + JSONObject pipelineJSON = new JSONObject(); + pipelineJSON.put(ID_FIELD, pipelineCreated.getId()); + pipelineJSON.put(NAME_FIELD, pipelineCreated.getStringValue(EntityConstants.Pipeline.NAME_FIELD)); + pipelineJSON.put(RELEASE_ID_FIELD, pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_RELEASE) != null ? pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_RELEASE).getId() : -1); + pipelineJSON.put(MILESTONE_ID_FIELD, pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_MILESTONE) != null ? pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_MILESTONE).getId() : -1); + pipelineJSON.put("isRoot", true); + pipelineJSON.put(WORKSPACE_ID_FIELD, workspaceId); + pipelineJSON.put("workspaceName", workspaces.get(0).getName()); + pipelineJSON.put("ignoreTests", false); + pipelineJSON.put("fields", new JSONObject()); + pipelineJSON.put("taxonomyTags", new JSONArray()); + + + enrichPipelineInstanceId(pipelineJSON, instanceId); + //all metadata have to be loaded in separate REST calls for this pipeline: releaseName, taxonomyNames and listFieldNames are not returned from configuration API + enrichPipelineInternal(pipelineJSON,octaneClient); + result.put("pipeline", pipelineJSON); + + JSONArray fieldsMetadata = convertToJsonMetadata(getPipelineListNodeFieldsMetadata(octaneClient, workspaceId)); + result.put("fieldsMetadata", fieldsMetadata); + } catch (ClientException e) { + logger.warn("Failed to create pipeline", e); + return error(e.getMessage(), e.getLink()); + } catch (Exception e) { + logger.warn("Failed to create pipeline", e); + return error(e.getMessage()); + } + return result; + } + @JavaScriptMethod public JSONObject updatePipelineOnSever(JSONObject pipelineObject) { JSONObject result = new JSONObject(); @@ -179,7 +269,8 @@ public JSONObject updatePipelineOnSever(JSONObject pipelineObject) { fields.put(jsonObject.getString(NAME_FIELD), assignedValues); } - final String jobCiId = JobProcessorFactory.getFlowProcessor(job).getTranslatedJobName(); + final String jobCiId = job != null ? JobProcessorFactory.getFlowProcessor(job).getTranslatedJobName() : + multibranch.getFullName(); PipelineContext pipelineContext = dtoFactory.newDTO(PipelineContext.class) .setContextEntityId(pipelineId) @@ -259,7 +350,8 @@ public JSONObject loadJobConfigurationFromServer(String instanceId) { JSONObject workspaces = new JSONObject(); JSONArray fieldsMetadata = new JSONArray(); try { - final String jobCiId = JobProcessorFactory.getFlowProcessor(job).getTranslatedJobName(); + final String jobCiId = job != null ? JobProcessorFactory.getFlowProcessor(job).getTranslatedJobName() + : multibranch.getFullName(); PipelineContextList pipelineContextList = octaneClient.getPipelineContextService().getJobConfiguration(octaneClient.getInstanceId(), jobCiId); if (!pipelineContextList.getData().isEmpty()) { diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch/index.jelly b/src/main/resources/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch/index.jelly new file mode 100644 index 0000000000..90648424f0 --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch/index.jelly @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + +
          + + + + + diff --git a/src/main/resources/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch/index.properties b/src/main/resources/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch/index.properties new file mode 100644 index 0000000000..b5916cef9a --- /dev/null +++ b/src/main/resources/com/microfocus/application/automation/tools/octane/configuration/ConfigurationActionMultibranch/index.properties @@ -0,0 +1,29 @@ +# +# Certain versions of software and/or documents ("Material") accessible here may contain branding from +# Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, +# the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP +# and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE +# marks are the property of their respective owners. +# __________________________________________________________________ +# MIT License +# +# (c) Copyright 2012-2021 Micro Focus or one of its affiliates. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +# documentation files (the "Software"), to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +# THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# ___________________________________________________________________ +# + +mqm.configuration.multibranch.title=ALM Octane Pipelines \ No newline at end of file From 73407b1ac019aaaa16786d53f5d74c564c283936 Mon Sep 17 00:00:00 2001 From: NShitrit Date: Wed, 28 Sep 2022 14:18:10 +0300 Subject: [PATCH 2223/2502] defect #1943114: fix code climate issues --- .../configuration/JobConfigurationProxy.java | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java index b717aaeb0f..d3f48e175b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java @@ -76,6 +76,9 @@ public class JobConfigurationProxy { public static final String INSTANCE_ID_FIELD = "instanceId"; public static final String ID_FIELD = "id"; public static final String TEXT_FIELD = "text"; + private static final String IGNORE_TESTS = "ignoreTests"; + private static final String FIELDS = "fields"; + private static final String TAXONOMY_TAGS = "taxonomyTags"; final private Job job; final private WorkflowMultiBranchProject multibranch; @@ -118,13 +121,10 @@ public JSONObject createPipelineOnServer(JSONObject pipelineObject) { //WORKAROUND BEGIN //getting workspaceName - because the workspaceName is not returned from configuration API - List workspaces = getWorkspacesById(octaneClient, Collections.singletonList(pipelineContext.getWorkspaceId())); - if (workspaces.size() != 1) { - throw new ClientException("WorkspaceName could not be retrieved for workspaceId: " + pipelineContext.getWorkspaceId()); - } + Entity workspace = getWorkspace(octaneClient, pipelineContext.getWorkspaceId()); //WORKAROUND END - JSONObject pipelineJSON = fromPipeline(createdPipelineContext, workspaces.get(0)); + JSONObject pipelineJSON = fromPipeline(createdPipelineContext, workspace); enrichPipelineInstanceId(pipelineJSON, instanceId); //WORKAROUND BEGIN @@ -146,6 +146,14 @@ public JSONObject createPipelineOnServer(JSONObject pipelineObject) { return result; } + private Entity getWorkspace(OctaneClient octaneClient, Long workspaceId) throws ClientException { + List workspaces = getWorkspacesById(octaneClient, Collections.singletonList(workspaceId)); + if (workspaces.size() != 1) { + throw new ClientException("WorkspaceName could not be retrieved for workspaceId: " + workspaceId); + } + return workspaces.get(0); + } + public JSONObject createMultiBranchOnServer(JSONObject pipelineObject) { @@ -192,10 +200,7 @@ public JSONObject createMultiBranchOnServer(JSONObject pipelineObject) { throw new ClientException("Failed to create pipeline."); } - List workspaces = getWorkspacesById(octaneClient, Collections.singletonList(workspaceId)); - if (workspaces.size() != 1) { - throw new ClientException("WorkspaceName could not be retrieved for workspaceId: " + workspaceId); - } + Entity workspace = getWorkspace(octaneClient,workspaceId); Entity pipelineCreated = results.get(0); @@ -206,10 +211,10 @@ public JSONObject createMultiBranchOnServer(JSONObject pipelineObject) { pipelineJSON.put(MILESTONE_ID_FIELD, pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_MILESTONE) != null ? pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_MILESTONE).getId() : -1); pipelineJSON.put("isRoot", true); pipelineJSON.put(WORKSPACE_ID_FIELD, workspaceId); - pipelineJSON.put("workspaceName", workspaces.get(0).getName()); - pipelineJSON.put("ignoreTests", false); - pipelineJSON.put("fields", new JSONObject()); - pipelineJSON.put("taxonomyTags", new JSONArray()); + pipelineJSON.put("workspaceName", workspace.getName()); + pipelineJSON.put(IGNORE_TESTS, false); + pipelineJSON.put(FIELDS, new JSONObject()); + pipelineJSON.put(TAXONOMY_TAGS, new JSONArray()); enrichPipelineInstanceId(pipelineJSON, instanceId); @@ -241,7 +246,7 @@ public JSONObject updatePipelineOnSever(JSONObject pipelineObject) { //build taxonomies LinkedList taxonomies = new LinkedList<>(); - JSONArray taxonomyTags = pipelineObject.getJSONArray("taxonomyTags"); + JSONArray taxonomyTags = pipelineObject.getJSONArray(TAXONOMY_TAGS); for (JSONObject jsonObject : toCollection(taxonomyTags)) { taxonomies.add(dtoFactory.newDTO(Taxonomy.class) .setId(jsonObject.optLong("tagId")) @@ -278,7 +283,7 @@ public JSONObject updatePipelineOnSever(JSONObject pipelineObject) { .setWorkspace(pipelineObject.getLong(WORKSPACE_ID_FIELD)) .setReleaseId(pipelineObject.getLong(RELEASE_ID_FIELD)) .setMilestoneId(pipelineObject.getLong(MILESTONE_ID_FIELD)) - .setIgnoreTests(pipelineObject.getBoolean("ignoreTests")) + .setIgnoreTests(pipelineObject.getBoolean(IGNORE_TESTS)) .setTaxonomies(taxonomies) .setListFields(fields); @@ -286,14 +291,11 @@ public JSONObject updatePipelineOnSever(JSONObject pipelineObject) { //WORKAROUND BEGIN //getting workspaceName - because the workspaceName is not returned from configuration API - List workspaces = getWorkspacesById(octaneClient, Collections.singletonList(pipeline.getWorkspaceId())); - if (workspaces.size() != 1) { - throw new ClientException("WorkspaceName could not be retrieved for workspaceId: " + pipeline.getWorkspaceId()); - } + Entity workspace = getWorkspace(octaneClient, pipeline.getWorkspaceId()); //WORKAROUND END //TODO uncomment after getting pipelineContext - JSONObject pipelineJSON = fromPipeline(pipeline, workspaces.get(0)); + JSONObject pipelineJSON = fromPipeline(pipeline, workspace); enrichPipelineInstanceId(pipelineJSON, instanceId); //WORKAROUND BEGIN @@ -449,7 +451,7 @@ private static JSONObject fromPipeline(final PipelineContext pipeline, Entity re pipelineJSON.put("isRoot", pipeline.isPipelineRoot()); pipelineJSON.put(WORKSPACE_ID_FIELD, relatedWorkspace.getId()); pipelineJSON.put("workspaceName", relatedWorkspace.getName()); - pipelineJSON.put("ignoreTests", pipeline.getIgnoreTests()); + pipelineJSON.put(IGNORE_TESTS, pipeline.getIgnoreTests()); addTaxonomyTags(pipelineJSON, pipeline); addFields(pipelineJSON, pipeline); @@ -504,9 +506,9 @@ private static void enrichMilestone(JSONObject pipeline, OctaneClient octaneClie private static void enrichTaxonomies(JSONObject pipeline, OctaneClient octaneClient) { JSONArray ret = new JSONArray(); - if (pipeline.has("taxonomyTags")) { + if (pipeline.has(TAXONOMY_TAGS)) { - JSONArray taxonomyTags = pipeline.getJSONArray("taxonomyTags"); + JSONArray taxonomyTags = pipeline.getJSONArray(TAXONOMY_TAGS); List taxonomyIdsList = new LinkedList<>(); for (int i = 0; i < taxonomyTags.size(); i++) { JSONObject taxonomy = taxonomyTags.getJSONObject(i); @@ -519,15 +521,15 @@ private static void enrichTaxonomies(JSONObject pipeline, OctaneClient octaneCli ret.add(tag(tax)); } } - pipeline.put("taxonomyTags", ret); + pipeline.put(TAXONOMY_TAGS, ret); } private static void enrichFields(JSONObject pipeline, OctaneClient client) { JSONObject ret = new JSONObject(); - if (pipeline.has("fields")) { + if (pipeline.has(FIELDS)) { long workspaceId = pipeline.getLong(WORKSPACE_ID_FIELD); - JSONObject pipelineFields = pipeline.getJSONObject("fields"); + JSONObject pipelineFields = pipeline.getJSONObject(FIELDS); Iterator keys = pipelineFields.keys(); //iteration over listFields while (keys.hasNext()) { @@ -548,7 +550,7 @@ private static void enrichFields(JSONObject pipeline, OctaneClient client) { } } } - pipeline.put("fields", ret); + pipeline.put(FIELDS, ret); } @JavaScriptMethod @@ -877,7 +879,7 @@ private static void addTaxonomyTags(JSONObject result, PipelineContext pipeline) for (Taxonomy taxonomy : pipeline.getTaxonomies()) { pipelineTaxonomies.add(tag(taxonomy)); } - result.put("taxonomyTags", pipelineTaxonomies); + result.put(TAXONOMY_TAGS, pipelineTaxonomies); } private static void addFields(JSONObject result, PipelineContext pipeline) { @@ -887,7 +889,7 @@ private static void addFields(JSONObject result, PipelineContext pipeline) { JSONArray assignedValuesArray = listFieldValues(fieldEntry.getValue()); listFields.put(fieldEntry.getKey(), assignedValuesArray); } - result.put("fields", listFields); + result.put(FIELDS, listFields); } private static JSONArray listFieldValues(List listItems) { From 81c1c7c744cc815284a135b4a58a24f34b825bd6 Mon Sep 17 00:00:00 2001 From: NShitrit Date: Wed, 28 Sep 2022 16:25:43 +0300 Subject: [PATCH 2224/2502] defect #1943114: fix code climate issues --- .../configuration/JobConfigurationProxy.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java index d3f48e175b..d77b1577ea 100644 --- a/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/octane/configuration/JobConfigurationProxy.java @@ -79,6 +79,7 @@ public class JobConfigurationProxy { private static final String IGNORE_TESTS = "ignoreTests"; private static final String FIELDS = "fields"; private static final String TAXONOMY_TAGS = "taxonomyTags"; + private static final String FIELD_CREATE_MESSAGE = "Failed to create pipeline"; final private Job job; final private WorkflowMultiBranchProject multibranch; @@ -137,10 +138,10 @@ public JSONObject createPipelineOnServer(JSONObject pipelineObject) { result.put("fieldsMetadata", fieldsMetadata); } catch (ClientException e) { - logger.warn("Failed to create pipeline", e); + logger.warn(FIELD_CREATE_MESSAGE, e); return error(e.getMessage(), e.getLink()); } catch (Exception e) { - logger.warn("Failed to create pipeline", e); + logger.warn(FIELD_CREATE_MESSAGE, e); return error(e.getMessage()); } return result; @@ -197,7 +198,7 @@ public JSONObject createMultiBranchOnServer(JSONObject pipelineObject) { .collect(Collectors.toList())); if (results.size() != 1) { - throw new ClientException("Failed to create pipeline."); + throw new ClientException(FIELD_CREATE_MESSAGE); } Entity workspace = getWorkspace(octaneClient,workspaceId); @@ -207,8 +208,8 @@ public JSONObject createMultiBranchOnServer(JSONObject pipelineObject) { JSONObject pipelineJSON = new JSONObject(); pipelineJSON.put(ID_FIELD, pipelineCreated.getId()); pipelineJSON.put(NAME_FIELD, pipelineCreated.getStringValue(EntityConstants.Pipeline.NAME_FIELD)); - pipelineJSON.put(RELEASE_ID_FIELD, pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_RELEASE) != null ? pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_RELEASE).getId() : -1); - pipelineJSON.put(MILESTONE_ID_FIELD, pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_MILESTONE) != null ? pipelineCreated.getEntityValue(EntityConstants.Pipeline.CURRENT_MILESTONE).getId() : -1); + pipelineJSON.put(RELEASE_ID_FIELD, getReferenceFieldId(EntityConstants.Pipeline.CURRENT_RELEASE,pipelineCreated)); + pipelineJSON.put(MILESTONE_ID_FIELD, getReferenceFieldId(EntityConstants.Pipeline.CURRENT_MILESTONE,pipelineCreated)); pipelineJSON.put("isRoot", true); pipelineJSON.put(WORKSPACE_ID_FIELD, workspaceId); pipelineJSON.put("workspaceName", workspace.getName()); @@ -225,15 +226,19 @@ public JSONObject createMultiBranchOnServer(JSONObject pipelineObject) { JSONArray fieldsMetadata = convertToJsonMetadata(getPipelineListNodeFieldsMetadata(octaneClient, workspaceId)); result.put("fieldsMetadata", fieldsMetadata); } catch (ClientException e) { - logger.warn("Failed to create pipeline", e); + logger.warn(FIELD_CREATE_MESSAGE, e); return error(e.getMessage(), e.getLink()); } catch (Exception e) { - logger.warn("Failed to create pipeline", e); + logger.warn(FIELD_CREATE_MESSAGE, e); return error(e.getMessage()); } return result; } + private Object getReferenceFieldId(String fieldName,Entity entity){ + return entity.getEntityValue(fieldName) != null ? entity.getEntityValue(fieldName).getId() : -1; + } + @JavaScriptMethod public JSONObject updatePipelineOnSever(JSONObject pipelineObject) { JSONObject result = new JSONObject(); From 462c307a3a58af3cb1b2fb2d8adb8810acbb65cb Mon Sep 17 00:00:00 2001 From: EPlesca Date: Thu, 29 Sep 2022 13:28:25 +0300 Subject: [PATCH 2225/2502] [maven-release-plugin] prepare release micro-focus-application-automation-tools-plugin-7.5.1-beta --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0e8aed88dc..e6d6579b2a 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ hp-application-automation-tools-plugin - ${revision}${changelist} + 7.5.1-beta hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -82,7 +82,7 @@ scm:git:https://github.com/${gitHubRepo}.git scm:git:git@github.com:${gitHubRepo}.git https://github.com/${gitHubRepo} - ${scmTag} + micro-focus-application-automation-tools-plugin-7.5.1-beta From 9d8228ebfe6e0f7f0bc8cdb528af4e3ff9668074 Mon Sep 17 00:00:00 2001 From: EPlesca Date: Thu, 29 Sep 2022 13:28:40 +0300 Subject: [PATCH 2226/2502] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index e6d6579b2a..0702d780f2 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ hp-application-automation-tools-plugin - 7.5.1-beta + ${revision}${changelist} hpi Micro Focus Application Automation Tools The plugin integrates Jenkins with the following Micro Focus products - Service Virtualization, @@ -55,7 +55,7 @@ - 7.6 + 7.5.2-beta -SNAPSHOT jenkinsci/${project.artifactId} 1 @@ -82,7 +82,7 @@ scm:git:https://github.com/${gitHubRepo}.git scm:git:git@github.com:${gitHubRepo}.git https://github.com/${gitHubRepo} - micro-focus-application-automation-tools-plugin-7.5.1-beta + ${scmTag} From b2b04b9d84a915d778db01fea9e00392608c3148 Mon Sep 17 00:00:00 2001 From: jay-hershkowitz <58252707+jay-hershkowitz@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:01:51 +0300 Subject: [PATCH 2227/2502] Update README.md --- doc/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/README.md b/doc/README.md index de91d4d65c..d4cf54ffab 100644 --- a/doc/README.md +++ b/doc/README.md @@ -97,13 +97,14 @@ This plugin supports the following Micro Focus product versions: | ALM (Application Lifecycle Management) | 12.xx, 15.x | [ALM Integration page](https://admhelp.microfocus.com/alm/en/latest/online_help/Content/jenkins-integration.htm) | | ALM Lab Management | 12.xx, 15.x | [ALM Integration page](https://admhelp.microfocus.com/alm/en/latest/online_help/Content/jenkins-integration.htm#mt-item-3) | | ALM Octane | 12.53.20 and higher (12.55.4 or later required for direct UFT One integration and for LoadRunner Enterprise integration using pipelines) | [ALM Octane Help Center](https://admhelp.microfocus.com/octane/en/latest/Online/Content/AdminGuide/jenkins-integration.htm) | -| Model-based Testing | 16.0.300 and higher | [Model-Based Testing Help Center](https://admhelp.microfocus.com/mbt) | -| LoadRunner Professional | 12.xx, 2020 and higher | [LoadRunner Professional Integration page](https://admhelp.microfocus.com/lr/en/latest/help/WebHelp/Content/Controller/c_jenkins.htm) | -| UFT Mobile | 2.0 and higher | [UFT Mobile Integration page](https://admhelp.microfocus.com/lr/en/latest/help/WebHelp/Content/Controller/c_jenkins.htm) | | LoadRunner Enterprise | 12.xx (12.53 or higher required for trend reports), 2020 and higher | [LoadRunner Enterprise Help Center](https://admhelp.microfocus.com/lre/en/latest/online_help/Content/PC/Continuous-Integration-Jenkins.htm) | +| LoadRunner Professional | 12.xx, 2020 and higher | [LoadRunner Professional Integration page](https://admhelp.microfocus.com/lr/en/latest/help/WebHelp/Content/Controller/c_jenkins.htm) | +| Model-based Testing | 16.0.300 and higher | [Model-Based Testing Help Center](https://admhelp.microfocus.com/mbt) | | Service Virtualization | 3.80 and higher | [Service Virtualization Help Center](https://admhelp.microfocus.com/sv/en/latest/Help/Content/UG/c_continuous_integration.htm) | -| UFT One | 12.xx and 14.03 and higher | [UFT One Help Center](https://admhelp.microfocus.com/uft/en/latest/UFT_Help/Content/User_Guide/Jenkins.htm) | | UFT Developer | 14.03 and higher | [UFT Developer Help Center](https://admhelp.microfocus.com/uftdev/en/latest/HelpCenter/Content/HowTo/CI_Tools.htm)
          Blog: [Integrate LeanFT with Jenkins in just a few simple steps](https://community.microfocus.com/adtd/b/sws-alm/posts/integrating-leanft-with-jenkins-in-just-a-few-simple-steps) | +| UFT Mobile | 2.0 and higher | [UFT Mobile Integration page](https://admhelp.microfocus.com/lr/en/latest/help/WebHelp/Content/Controller/c_jenkins.htm) | +| UFT One | 12.xx and 14.03 and higher | [UFT One Help Center](https://admhelp.microfocus.com/uft/en/latest/UFT_Help/Content/User_Guide/Jenkins.htm) | +| ValueEdge | | [ValueEdge Help Center](https://admhelp.microfocus.com/valuedge) | ## Prerequisites From 7d2ab748c11cacfa469eb8ac813253c6b9e5d81d Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 17 Oct 2022 16:43:55 +0300 Subject: [PATCH 2228/2502] DEF-903042 [Jenkins]Typos in error message --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 514 +++++++++---------- 1 file changed, 257 insertions(+), 257 deletions(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index 1e216cca93..dc0d372cab 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -41,13 +41,13 @@ using System.Security; namespace HpToolsLauncher -{ +{ public class AlmTestSetsRunner : RunnerBase, IDisposable - { - private readonly char[] _backSlash = new char[] { '\\' }; + { + private readonly char[] _backSlash = new char[] { '\\' }; private ITDConnection13 _tdConnection; - private ITDConnection2 _tdConnectionOld; + private ITDConnection2 _tdConnectionOld; private const string TEST_DETAILS = "ID = {0}, TestSet = {1}, TestSetFolder = {2}"; private const string XML_PARAMS_START_TAG = ""; private const string XML_PARAM_NAME_VALUE = ""; @@ -57,7 +57,7 @@ public class AlmTestSetsRunner : RunnerBase, IDisposable private const string API_TEST = "SERVICE-TEST"; private const string GUI_TEST = "QUICKTEST_TEST"; - public ITDConnection13 TdConnection + public ITDConnection13 TdConnection { get { @@ -87,7 +87,7 @@ public ITDConnection2 TdConnectionOld public bool InitialTestRun { get; set; } public List FilterByStatuses { get; set; } public List TestSets { get; set; } - public QcRunMode RunMode { get; set; } + public QcRunMode RunMode { get; set; } public string RunHost { get; set; } public TestStorageType Storage { get; set; } public double Timeout { get; set; } @@ -128,12 +128,12 @@ public AlmTestSetsRunner(string qcServer, string filterByName, List filterByStatuses, bool initialTestRun, - TestStorageType testStorageType, + TestStorageType testStorageType, bool isSSOEnabled, string qcClientId, string qcApiKey) - { - + { + Timeout = intQcTimeout; RunMode = enmQcRunMode; RunHost = runHost; @@ -177,8 +177,8 @@ public AlmTestSetsRunner(string qcServer, ///
          private void CreateTdConnection() { - Type type = Type.GetTypeFromProgID("TDApiOle80.TDConnection"); - + Type type = Type.GetTypeFromProgID("TDApiOle80.TDConnection"); + if (type == null) { ConsoleWriter.WriteLine(GetAlmNotInstalledError()); @@ -187,9 +187,9 @@ private void CreateTdConnection() try { - object conn = Activator.CreateInstance(type); - _tdConnection = conn as ITDConnection13; - + object conn = Activator.CreateInstance(type); + _tdConnection = conn as ITDConnection13; + } catch (FileNotFoundException ex) { @@ -245,7 +245,7 @@ private bool CheckIsOldQc() if (TdConnection != null) { string ver, build; - TdConnection.GetTDVersion(out ver, out build); + TdConnection.GetTDVersion(out ver, out build); if (ver != null) { int intver; @@ -260,8 +260,8 @@ private bool CheckIsOldQc() } return oldQc; - } - + } + /// /// connects to QC and logs in /// @@ -278,7 +278,7 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, || (string.IsNullOrWhiteSpace(qcLogin) && !SSOEnabled) || string.IsNullOrWhiteSpace(qcDomain) || string.IsNullOrWhiteSpace(qcProject) - || (SSOEnabled && (string.IsNullOrWhiteSpace(qcClientID) + || (SSOEnabled && (string.IsNullOrWhiteSpace(qcClientID) || string.IsNullOrWhiteSpace(qcApiKey)))) { ConsoleWriter.WriteLine(Resources.AlmRunnerConnParamEmpty); @@ -339,7 +339,7 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, ConsoleWriter.WriteErrLine(Resources.AlmRunnerErrorAuthorization); } - } + } else { ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerServerUnreachable, qcServerUrl)); @@ -354,7 +354,7 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, TdConnectionOld.InitConnectionEx(qcServerUrl); } catch (Exception ex) - { + { ConsoleWriter.WriteLine(ex.Message); } @@ -399,15 +399,15 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, return false; } - } - + } + /// /// Returns error message for incorrect installation of Alm QC. /// /// private string GetAlmNotInstalledError() { - return "Could not create scheduler, please verify ALM client installation on run machine by downloading and in installing the add-in form: " + GetQcCommonInstallationUrl(MQcServer); + return "Could not create scheduler, please verify ALM client installation on run machine by downloading and in installing the add-in from: " + GetQcCommonInstallationUrl(MQcServer); } @@ -474,16 +474,16 @@ private ITestSetFolder GetFolder(string testSet) else { tsTreeManager = (ITestSetTreeManager)TdConnectionOld.TestSetTreeManager; - } - - + } + + ITestSetFolder tsFolder = null; try { tsFolder = (ITestSetFolder)tsTreeManager.get_NodeByPath(testSet); } catch (Exception ex) - { + { // if we are here, then most likely the current testSet is not a folder, so it's not necessary to print the error in release mode Debug.WriteLine("Unable to retrieve test set folder: " + ex.Message); } @@ -638,10 +638,10 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet //not found tsFolder = null; ConsoleWriter.WriteLine(ex.Message + " Trying to find specific test(s) with the given name(s) on the defined path, optionally applying the set filters"); - } - - // test set not found, try to find specific test by path - + } + + // test set not found, try to find specific test by path + if (tsFolder == null) { // if test set path was not found, the path may points to specific test @@ -666,15 +666,15 @@ public List GetTestListFromTestSet(TestStorageType testStorageType, ref ITestSet { List testList = tsFolder.FindTestSets(testSuiteName); - if (testList == null) - { - // this means, there was no test sets with the specified name, we treat it as a single test, as if a user specified it + if (testList == null) + { + // this means, there was no test sets with the specified name, we treat it as a single test, as if a user specified it return null; - } - + } + return testList; - } - + } + //node wasn't found, folder = null return null; @@ -750,9 +750,9 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam { testList.Remove(index); - if (isTestPath && testName.Equals(tListIndexTestName)) - { - testExisted = true; + if (isTestPath && testName.Equals(tListIndexTestName)) + { + testExisted = true; } } } @@ -764,9 +764,9 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam { testList.Remove(index); - if (isTestPath && testName.Equals(tListIndexTestName)) - { - testExisted = true; + if (isTestPath && testName.Equals(tListIndexTestName)) + { + testExisted = true; } } } @@ -777,9 +777,9 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam { testList.Remove(index); - if (isTestPath && testName.Equals(tListIndexTestName)) - { - testExisted = true; + if (isTestPath && testName.Equals(tListIndexTestName)) + { + testExisted = true; } } } @@ -801,9 +801,9 @@ public IList FilterTests(ITestSet targetTestSet, bool isTestPath, string testNam if (!string.IsNullOrEmpty(tListIndexName) && !string.IsNullOrEmpty(testName) && !testName.Equals(tListIndexTestName)) { testList.Remove(index); - } else if (testName.Equals(tListIndexTestName)) - { - testExisted = true; + } else if (testName.Equals(tListIndexTestName)) + { + testExisted = true; } } } @@ -890,11 +890,11 @@ public void CollectInlineTestParameters(IList tList, string testParameters, Test } } - /// - /// Collect the parameters for the tests from the props (CI args). - /// - /// - /// + /// + /// Collect the parameters for the tests from the props (CI args). + /// + /// + /// /// /// public void CollectPropsTestParameters(IList filteredTestList, TestSuiteRunResults runDesc, List parametersPlaceholder, int testIdx) @@ -903,12 +903,12 @@ public void CollectPropsTestParameters(IList filteredTestList, TestSuiteRunResul parametersPlaceholder.AddRange(relevant); } - /// - /// Schedule test instances to run. - /// - /// - /// - /// + /// + /// Schedule test instances to run. + /// + /// + /// + /// /// private void ScheduleTest(TestSuiteRunResults runDesc, ITSScheduler scheduler, ITSTest3 test, int idx) { @@ -1013,38 +1013,38 @@ public override TestSuiteRunResults Run() if (!Connected) return null; - TestSuiteRunResults activeRunDescription = new TestSuiteRunResults(); - - //find all the testSets under given folders - try - { - FindAllTestSetsUnderFolders(); - } - catch (Exception ex) - { - - ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerErrorBadQcInstallation, ex.Message, ex.StackTrace)); - return null; - } - - // we start the timer, it is important for the timeout + TestSuiteRunResults activeRunDescription = new TestSuiteRunResults(); + + //find all the testSets under given folders + try + { + FindAllTestSetsUnderFolders(); + } + catch (Exception ex) + { + + ConsoleWriter.WriteErrLine(string.Format(Resources.AlmRunnerErrorBadQcInstallation, ex.Message, ex.StackTrace)); + return null; + } + + // we start the timer, it is important for the timeout Stopwatch swForTimeout = Stopwatch.StartNew(); - int idx = 1; - //run all the TestSets - foreach (string testSetItem in TestSets) - { - string testSet = testSetItem.TrimEnd(_backSlash); - string tsName = testSet; - int pos = testSetItem.LastIndexOf('\\'); - - string testSetDir = string.Empty; + int idx = 1; + //run all the TestSets + foreach (string testSetItem in TestSets) + { + string testSet = testSetItem.TrimEnd(_backSlash); + string tsName = testSet; + int pos = testSetItem.LastIndexOf('\\'); + + string testSetDir = string.Empty; string inlineTestParameters = string.Empty; - if (pos != -1) - { - // check for inline params - testSetDir = testSet.Substring(0, pos).Trim(_backSlash); + if (pos != -1) + { + // check for inline params + testSetDir = testSet.Substring(0, pos).Trim(_backSlash); if (testSetItem.IndexOf(" ", StringComparison.Ordinal) != -1 && testSet.Count(x => x == ' ') >= 1) { if (!testSet.Contains(':'))//test has no parameters attached @@ -1065,13 +1065,13 @@ public override TestSuiteRunResults Run() { tsName = testSet.Substring(pos, testSet.Length - pos).Trim(_backSlash); } - } - - TestSuiteRunResults runResults = RunTestSet(testSetDir, tsName, inlineTestParameters, swForTimeout, idx); - if (runResults != null) - activeRunDescription.AppendResults(runResults); - - // if the run has cancelled, because of timeout, we should terminate the build + } + + TestSuiteRunResults runResults = RunTestSet(testSetDir, tsName, inlineTestParameters, swForTimeout, idx); + if (runResults != null) + activeRunDescription.AppendResults(runResults); + + // if the run has cancelled, because of timeout, we should terminate the build if (_blnRunCancelled) break; ++idx; @@ -1399,9 +1399,9 @@ private static void SetAPITestParameters(ITSTest3 test, List rele } } - /// - /// Checks if the parameter list contains duplicates, throws ArgumentException because uses a Dictionary internally. - /// + /// + /// Checks if the parameter list contains duplicates, throws ArgumentException because uses a Dictionary internally. + /// /// private static void CheckForDuplicateParametersForTest(List relevant) { @@ -1410,105 +1410,105 @@ private static void CheckForDuplicateParametersForTest(List relev relevant.ForEach(param => tmpParams.Add(param.ParamName, param.ParamVal)); } - /// - /// Terminates wexectrl process which belongs to the current HpToolsLauncher process - /// - private void TerminateSchedulerIfNecessary() - { - Process exeCtrl = Process.GetProcessesByName("wexectrl").Where(p => p.SessionId == Process.GetCurrentProcess().SessionId).FirstOrDefault(); - - if (exeCtrl != null) - { - exeCtrl.Kill(); - } - } - - /// - /// Iterates over the currently scheduled tests and updates their status according to their run status, if the test is already in a finished state, it won't update it, - /// if it is in a non-finished state it sets to 'Error' - /// - /// - /// - /// - private void UpdateTestResultsAfterAbort(IExecutionStatus executionStatus, ITestSet targetTestSet, TestSuiteRunResults runDesc, string testPath) - { - ITSTest currentTest; - TestRunResults testDesc; - TestState prevState; - - for (var k = 1; k <= executionStatus.Count; ++k) - { - TestExecStatus testExecStatusObj = executionStatus[k]; - currentTest = targetTestSet.TSTestFactory[testExecStatusObj.TSTestId]; - - if (currentTest == null) - { - continue; - } - - testDesc = UpdateTestStatus(runDesc, targetTestSet, testExecStatusObj, true); - - prevState = testDesc.TestState; - - // if the test hasn't finished running and the timeout has expired, we should set their state to 'Error' - if (testDesc.TestState != TestState.Passed && testDesc.TestState != TestState.Error - && testDesc.TestState != TestState.Failed && testDesc.TestState != TestState.Warning) - { - testDesc.TestState = TestState.Error; - testDesc.ErrorDesc = Resources.GeneralTimeoutExpired; - } - - // non-executed tests' group can be null, we should update it as well, otherwise in the report it won't be grouped accordingly - if (testDesc.TestGroup == null) - { - var currentFolder = targetTestSet.TestSetFolder as ITestSetFolder; - string folderName = ""; - - if (currentFolder != null) - { - folderName = currentFolder.Name.Replace(".", "_"); - } - - testDesc.TestGroup = string.Format(@"{0}\{1}", folderName, targetTestSet.Name).Replace(".", "_"); - } - - testDesc.TestPath = testPath + currentTest.TestName; - - ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerUpdateStateAfterAbort, testDesc.TestPath, prevState.ToString(), testDesc.TestState)); - - UpdateCounters(testDesc, runDesc); - } - } - - /// - /// Updates the runDesc run results by describing the non-existing test error as a testDesc - /// - /// run results to be updated - /// the non-existing test's description - /// - /// - private void UpdateTestResultsIfTestErrorAppearedBeforeRun(ref TestSuiteRunResults runDesc, ref TestRunResults activeTestDesc, string tsPath, string errMessage) - { - runDesc.NumTests++; - runDesc.TotalRunTime = System.TimeSpan.Zero; - runDesc.NumErrors++; - - activeTestDesc.TestState = TestState.Error; - activeTestDesc.TestPath = tsPath; - int pos = tsPath.LastIndexOf("\\", StringComparison.Ordinal) + 1; - activeTestDesc.TestName = tsPath.Substring(pos); - activeTestDesc.ErrorDesc = errMessage; - activeTestDesc.FatalErrors = 1; - activeTestDesc.Runtime = System.TimeSpan.Zero; - - if (activeTestDesc.TestGroup == null) - { - activeTestDesc.TestGroup = tsPath; - } - - runDesc.TestRuns.Add(activeTestDesc); - } - + /// + /// Terminates wexectrl process which belongs to the current HpToolsLauncher process + /// + private void TerminateSchedulerIfNecessary() + { + Process exeCtrl = Process.GetProcessesByName("wexectrl").Where(p => p.SessionId == Process.GetCurrentProcess().SessionId).FirstOrDefault(); + + if (exeCtrl != null) + { + exeCtrl.Kill(); + } + } + + /// + /// Iterates over the currently scheduled tests and updates their status according to their run status, if the test is already in a finished state, it won't update it, + /// if it is in a non-finished state it sets to 'Error' + /// + /// + /// + /// + private void UpdateTestResultsAfterAbort(IExecutionStatus executionStatus, ITestSet targetTestSet, TestSuiteRunResults runDesc, string testPath) + { + ITSTest currentTest; + TestRunResults testDesc; + TestState prevState; + + for (var k = 1; k <= executionStatus.Count; ++k) + { + TestExecStatus testExecStatusObj = executionStatus[k]; + currentTest = targetTestSet.TSTestFactory[testExecStatusObj.TSTestId]; + + if (currentTest == null) + { + continue; + } + + testDesc = UpdateTestStatus(runDesc, targetTestSet, testExecStatusObj, true); + + prevState = testDesc.TestState; + + // if the test hasn't finished running and the timeout has expired, we should set their state to 'Error' + if (testDesc.TestState != TestState.Passed && testDesc.TestState != TestState.Error + && testDesc.TestState != TestState.Failed && testDesc.TestState != TestState.Warning) + { + testDesc.TestState = TestState.Error; + testDesc.ErrorDesc = Resources.GeneralTimeoutExpired; + } + + // non-executed tests' group can be null, we should update it as well, otherwise in the report it won't be grouped accordingly + if (testDesc.TestGroup == null) + { + var currentFolder = targetTestSet.TestSetFolder as ITestSetFolder; + string folderName = ""; + + if (currentFolder != null) + { + folderName = currentFolder.Name.Replace(".", "_"); + } + + testDesc.TestGroup = string.Format(@"{0}\{1}", folderName, targetTestSet.Name).Replace(".", "_"); + } + + testDesc.TestPath = testPath + currentTest.TestName; + + ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerUpdateStateAfterAbort, testDesc.TestPath, prevState.ToString(), testDesc.TestState)); + + UpdateCounters(testDesc, runDesc); + } + } + + /// + /// Updates the runDesc run results by describing the non-existing test error as a testDesc + /// + /// run results to be updated + /// the non-existing test's description + /// + /// + private void UpdateTestResultsIfTestErrorAppearedBeforeRun(ref TestSuiteRunResults runDesc, ref TestRunResults activeTestDesc, string tsPath, string errMessage) + { + runDesc.NumTests++; + runDesc.TotalRunTime = System.TimeSpan.Zero; + runDesc.NumErrors++; + + activeTestDesc.TestState = TestState.Error; + activeTestDesc.TestPath = tsPath; + int pos = tsPath.LastIndexOf("\\", StringComparison.Ordinal) + 1; + activeTestDesc.TestName = tsPath.Substring(pos); + activeTestDesc.ErrorDesc = errMessage; + activeTestDesc.FatalErrors = 1; + activeTestDesc.Runtime = System.TimeSpan.Zero; + + if (activeTestDesc.TestGroup == null) + { + activeTestDesc.TestGroup = tsPath; + } + + runDesc.TestRuns.Add(activeTestDesc); + } + /// /// /// @@ -1523,20 +1523,20 @@ private void SetTestResults(ref ITSTest currentTest, IExecutionStatus executionS { if (currentTest == null) throw new ArgumentNullException("Current test set is null."); - if (activeTestDesc == null) throw new ArgumentNullException("The test run results are empty."); - + if (activeTestDesc == null) throw new ArgumentNullException("The test run results are empty."); + // write the status for each test for (var k = 1; k <= executionStatus.Count; ++k) - { - if (File.Exists(abortFilename)) - { - break; + { + if (File.Exists(abortFilename)) + { + break; } TestExecStatus testExecStatusObj = executionStatus[k]; currentTest = targetTestSet.TSTestFactory[testExecStatusObj.TSTestId]; if (currentTest == null) - { + { ConsoleWriter.WriteLine(string.Format("currentTest is null for test.{0} after whole execution", k)); continue; } @@ -1735,9 +1735,9 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te { ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerStatWithMessage, activeTestDesc.TestName, testExecStatusObj.TSTestId, statusString, testExecStatusObj.Message)); - if (IsInAFinishedState(statusString)) - { - WriteTestRunSummary(currentTest); + if (IsInAFinishedState(statusString)) + { + WriteTestRunSummary(currentTest); } } @@ -1779,10 +1779,10 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te Environment.Exit((int)Launcher.ExitCodeEnum.Aborted); } - if (sw.Elapsed.TotalSeconds >= timeout && timeout != -1) - { - // setting the flag ensures that we will recall later, that the currently scheduled tests are aborted because of the timeout - _blnRunCancelled = true; + if (sw.Elapsed.TotalSeconds >= timeout && timeout != -1) + { + // setting the flag ensures that we will recall later, that the currently scheduled tests are aborted because of the timeout + _blnRunCancelled = true; } } } @@ -1794,21 +1794,21 @@ private void UpdateTestsResultsDescription(ref TestRunResults activeTestDesc, Te /// private string GetTestRunLink(int runId) { - if (CheckIsOldQc()) - { - return string.Empty; - } - - var mQcServer = MQcServer.Trim(); - var prefix = mQcServer.StartsWith("https://", StringComparison.OrdinalIgnoreCase) ? "tds" : "td"; - mQcServer = Regex.Replace(mQcServer, "^http[s]?://", string.Empty, RegexOptions.IgnoreCase); - - if (!mQcServer.EndsWith("/")) - { - mQcServer += "/"; - } - - return string.Format("{0}://{1}.{2}.{3}TestRunsModule-00000000090859589?EntityType=IRun&EntityID={4}", prefix, MQcProject, MQcDomain, mQcServer, runId); + if (CheckIsOldQc()) + { + return string.Empty; + } + + var mQcServer = MQcServer.Trim(); + var prefix = mQcServer.StartsWith("https://", StringComparison.OrdinalIgnoreCase) ? "tds" : "td"; + mQcServer = Regex.Replace(mQcServer, "^http[s]?://", string.Empty, RegexOptions.IgnoreCase); + + if (!mQcServer.EndsWith("/")) + { + mQcServer += "/"; + } + + return string.Format("{0}://{1}.{2}.{3}TestRunsModule-00000000090859589?EntityType=IRun&EntityID={4}", prefix, MQcProject, MQcDomain, mQcServer, runId); } /// @@ -1831,16 +1831,16 @@ private static int GetTestRunId(ITSTest currentTest) return runId; } - /// - /// Returns if the specific test's status is a finished status, either Passed, Failed, Error or Warning - /// - /// + /// + /// Returns if the specific test's status is a finished status, either Passed, Failed, Error or Warning + /// + /// /// - private bool IsInAFinishedState(string testStatus) - { - return testStatus != TestState.Running.ToString() - && testStatus != TestState.Waiting.ToString() - && testStatus != TestState.Unknown.ToString(); + private bool IsInAFinishedState(string testStatus) + { + return testStatus != TestState.Running.ToString() + && testStatus != TestState.Waiting.ToString() + && testStatus != TestState.Unknown.ToString(); } /// @@ -1856,9 +1856,9 @@ private void WriteTestRunSummary(ITSTest prevTest) else { _tdConnectionOld.KeepConnection = true; - } - - int runId = GetTestRunId(prevTest); + } + + int runId = GetTestRunId(prevTest); string stepsString = GetTestStepsDescFromQc(prevTest); @@ -1960,14 +1960,14 @@ private TestState GetTsStateFromQcState(TestExecStatus qcTestStatus) return TestState.Running; case "Success": case "Finished": - case "FinishedPassed": - { - if (qcTestStatus.Message.Contains("warning")) - { - return TestState.Warning; - } - - return TestState.Passed; + case "FinishedPassed": + { + if (qcTestStatus.Message.Contains("warning")) + { + return TestState.Warning; + } + + return TestState.Passed; } case "FinishedFailed": return TestState.Failed; @@ -1987,11 +1987,11 @@ private string GenerateFailedLog(IRun pTest) { try { - var sf = pTest.StepFactory as StepFactory; + var sf = pTest.StepFactory as StepFactory; ; if (sf == null) - return string.Empty; - - var stepList = sf.NewList(string.Empty) as IList; + return string.Empty; + + var stepList = sf.NewList(string.Empty) as IList; if (stepList == null) return string.Empty; @@ -2010,9 +2010,9 @@ private string GenerateFailedLog(IRun pTest) Console.WriteLine(ex.Message); return string.Empty; } - } - - + } + + /// /// retrieves the run logs for the test when the steps are not reported to Qc (like in ST) /// @@ -2028,7 +2028,7 @@ private string GetTestRunLog(ITSTest currentTest) { try { - var storage = lastRun.ExtendedStorage as IExtendedStorage; + var storage = lastRun.ExtendedStorage as IExtendedStorage; if (storage != null) { bool wasFatalError; @@ -2050,8 +2050,8 @@ private string GetTestRunLog(ITSTest currentTest) } retVal = ConsoleWriter.FilterXmlProblematicChars(retVal); return retVal; - } - + } + public void Dispose(bool managed) { //Console.WriteLine("Dispose ALM connection"); From 67dc4531d97291fa295de8c4eabc91c92f20a1aa Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 19 Oct 2022 09:31:27 +0300 Subject: [PATCH 2229/2502] remove the extra-word "in" --- HpToolsLauncher/Runners/AlmTestSetsRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs index dc0d372cab..c07b1a70f4 100644 --- a/HpToolsLauncher/Runners/AlmTestSetsRunner.cs +++ b/HpToolsLauncher/Runners/AlmTestSetsRunner.cs @@ -407,7 +407,7 @@ public bool ConnectToProject(string qcServerUrl, string qcLogin, string qcPass, /// private string GetAlmNotInstalledError() { - return "Could not create scheduler, please verify ALM client installation on run machine by downloading and in installing the add-in from: " + GetQcCommonInstallationUrl(MQcServer); + return "Could not create scheduler, please verify ALM client installation on run machine by downloading and installing the add-in from: " + GetQcCommonInstallationUrl(MQcServer); } From 122a5634c60ddef3f138946d8cc89ab7236c2a92 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 19 Oct 2022 14:46:59 +0300 Subject: [PATCH 2230/2502] US-885047 [Jenkins] Implement Password type for Table of Parameters --- HpToolsLauncher/EncryptionUtils.cs | 1 - HpToolsLauncher/Launcher.cs | 7 +- .../Properties/Resources.Designer.cs | 2619 +++++++++-------- HpToolsLauncher/Properties/Resources.resx | 3 + HpToolsLauncher/TestRunners/GuiTestRunner.cs | 21 +- .../tools/run/RunFromAlmBuilder.java | 2 +- .../tools/run/RunFromFileBuilder.java | 2 +- .../uft/model/SpecifyParametersModel.java | 44 +- .../model/SpecifyParametersModel/config.jelly | 14 +- src/main/webapp/js/specifyParametersUtils.js | 97 +- 10 files changed, 1420 insertions(+), 1390 deletions(-) diff --git a/HpToolsLauncher/EncryptionUtils.cs b/HpToolsLauncher/EncryptionUtils.cs index b55df0bd77..543c990291 100644 --- a/HpToolsLauncher/EncryptionUtils.cs +++ b/HpToolsLauncher/EncryptionUtils.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Specialized; using System.IO; using System.Security; using System.Security.Cryptography; diff --git a/HpToolsLauncher/Launcher.cs b/HpToolsLauncher/Launcher.cs index f1134a2b44..d9f5d2be18 100644 --- a/HpToolsLauncher/Launcher.cs +++ b/HpToolsLauncher/Launcher.cs @@ -33,8 +33,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Security.Cryptography; -using System.Text; namespace HpToolsLauncher { @@ -58,6 +56,7 @@ public class Launcher private const string _dateFormat = "dd'/'MM'/'yyyy HH':'mm':'ss"; private bool _rerunFailedTests = false; private string _encoding; + private const string PASSWORD = "Password"; public const string ClassName = "HPToolsFileSystemRunner"; @@ -1069,6 +1068,10 @@ private List GetValidParams() ConsoleWriter.WriteLine(string.Format("Found no type associated with parameter {0}.", name)); continue; } + else if (type == PASSWORD && !string.IsNullOrWhiteSpace(val)) + { + val = EncryptionUtils.Decrypt(val); + } parameters.Add(new TestParameter(i, name, val, type.ToLower())); ++j; diff --git a/HpToolsLauncher/Properties/Resources.Designer.cs b/HpToolsLauncher/Properties/Resources.Designer.cs index c81b159da8..44511885c5 100644 --- a/HpToolsLauncher/Properties/Resources.Designer.cs +++ b/HpToolsLauncher/Properties/Resources.Designer.cs @@ -1,1309 +1,1318 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace HpToolsLauncher.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HpToolsLauncher.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Duplicate parameter name entry found, please check the parameters' specification, falling back to default parameters for {0}. test or testset.. - /// - internal static string AlmDuplicateParameter { - get { - return ResourceManager.GetString("AlmDuplicateParameter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not find Test {0}. - /// - internal static string AlmRunnerCantFindTest { - get { - return ResourceManager.GetString("AlmRunnerCantFindTest", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not find TestSet {0}. - /// - internal static string AlmRunnerCantFindTestSet { - get { - return ResourceManager.GetString("AlmRunnerCantFindTestSet", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to One or more of the required connection parameters is empty.. - /// - internal static string AlmRunnerConnParamEmpty { - get { - return ResourceManager.GetString("AlmRunnerConnParamEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Copy the following report link inside an IE browser to view the test run results: {0}. - /// - internal static string AlmRunnerDisplayLink { - get { - return ResourceManager.GetString("AlmRunnerDisplayLink", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test set name: {0}, Test set id: {1}. - /// - internal static string AlmRunnerDisplayTest { - get { - return ResourceManager.GetString("AlmRunnerDisplayTest", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test {0}: {1} will run on host: {2}. - /// - internal static string AlmRunnerDisplayTestRunOnHost { - get { - return ResourceManager.GetString("AlmRunnerDisplayTestRunOnHost", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot Login to QC: Authorization failed.. - /// - internal static string AlmRunnerErrorAuthorization { - get { - return ResourceManager.GetString("AlmRunnerErrorAuthorization", resourceCulture); - } - } - - /// +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HpToolsLauncher.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HpToolsLauncher.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Duplicate parameter name entry found, please check the parameters' specification, falling back to default parameters for {0}. test or testset.. + /// + internal static string AlmDuplicateParameter { + get { + return ResourceManager.GetString("AlmDuplicateParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find Test {0}. + /// + internal static string AlmRunnerCantFindTest { + get { + return ResourceManager.GetString("AlmRunnerCantFindTest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find TestSet {0}. + /// + internal static string AlmRunnerCantFindTestSet { + get { + return ResourceManager.GetString("AlmRunnerCantFindTestSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or more of the required connection parameters is empty.. + /// + internal static string AlmRunnerConnParamEmpty { + get { + return ResourceManager.GetString("AlmRunnerConnParamEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the following report link inside an IE browser to view the test run results: {0}. + /// + internal static string AlmRunnerDisplayLink { + get { + return ResourceManager.GetString("AlmRunnerDisplayLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test set name: {0}, Test set id: {1}. + /// + internal static string AlmRunnerDisplayTest { + get { + return ResourceManager.GetString("AlmRunnerDisplayTest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test {0}: {1} will run on host: {2}. + /// + internal static string AlmRunnerDisplayTestRunOnHost { + get { + return ResourceManager.GetString("AlmRunnerDisplayTestRunOnHost", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot Login to QC: Authorization failed.. + /// + internal static string AlmRunnerErrorAuthorization { + get { + return ResourceManager.GetString("AlmRunnerErrorAuthorization", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Check that your QC client is installed properly ///{0} - ///{1}.. - /// - internal static string AlmRunnerErrorBadQcInstallation { - get { - return ResourceManager.GetString("AlmRunnerErrorBadQcInstallation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot connect to QC: Project / Domain does not exist.. - /// - internal static string AlmRunnerErrorConnectToProj { - get { - return ResourceManager.GetString("AlmRunnerErrorConnectToProj", resourceCulture); - } - } - - /// + ///{1}.. + /// + internal static string AlmRunnerErrorBadQcInstallation { + get { + return ResourceManager.GetString("AlmRunnerErrorBadQcInstallation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot connect to QC: Project / Domain does not exist.. + /// + internal static string AlmRunnerErrorConnectToProj { + get { + return ResourceManager.GetString("AlmRunnerErrorConnectToProj", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Problem in updating tests status for test: {0} - ///{1}. - /// - internal static string AlmRunnerErrorGettingStat { - get { - return ResourceManager.GetString("AlmRunnerErrorGettingStat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid parameter format, check job configuration to re-configure parameter definitions for test: {0}. Falling back to default parameter definitions.. - /// - internal static string AlmRunnerErrorParameterFormat { - get { - return ResourceManager.GetString("AlmRunnerErrorParameterFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to login. Please check username and password.. - /// - internal static string AlmRunnerIncorectCredentials { - get { - return ResourceManager.GetString("AlmRunnerIncorectCredentials", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to folder {0} cannot be found in ALM. - /// - internal static string AlmRunnerNoSuchFolder { - get { - return ResourceManager.GetString("AlmRunnerNoSuchFolder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Number of tests in set:. - /// - internal static string AlmRunnerNumTests { - get { - return ResourceManager.GetString("AlmRunnerNumTests", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Problem while setting remote host: {0}. - /// - internal static string AlmRunnerProblemWithHost { - get { - return ResourceManager.GetString("AlmRunnerProblemWithHost", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Problem while running TestSet: . - /// - internal static string AlmRunnerRunError { - get { - return ResourceManager.GetString("AlmRunnerRunError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Run ID:. - /// - internal static string AlmRunnerRunIdCaption { - get { - return ResourceManager.GetString("AlmRunnerRunIdCaption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scheduler started at:. - /// - internal static string AlmRunnerSchedStarted { - get { - return ResourceManager.GetString("AlmRunnerSchedStarted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ALM server {0} unreachable, check that server Url is correct. - /// - internal static string AlmRunnerServerUnreachable { - get { - return ResourceManager.GetString("AlmRunnerServerUnreachable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Starting test set execution. - /// - internal static string AlmRunnerStartingExecution { - get { - return ResourceManager.GetString("AlmRunnerStartingExecution", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test: {0}, Id: {1}, Execution status: {2}. - /// - internal static string AlmRunnerStat { - get { - return ResourceManager.GetString("AlmRunnerStat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test: {0}, Id: {1}, Execution status: {2}, Message: {3}. - /// - internal static string AlmRunnerStatWithMessage { - get { - return ResourceManager.GetString("AlmRunnerStatWithMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test complete:. - /// - internal static string AlmRunnerTestCompleteCaption { - get { - return ResourceManager.GetString("AlmRunnerTestCompleteCaption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test set: {0}, aborted at {1}. - /// - internal static string AlmRunnerTestsetAborted { - get { - return ResourceManager.GetString("AlmRunnerTestsetAborted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test set: {0}, finished at {1}. - /// - internal static string AlmRunnerTestsetDone { - get { - return ResourceManager.GetString("AlmRunnerTestsetDone", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test: {0}, Status: {1}, Message: {2}, Link: {3}. - /// - internal static string AlmRunnerTestStat { - get { - return ResourceManager.GetString("AlmRunnerTestStat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test: {0} >> Previous state -> {1}; After update state -> {2}. - /// - internal static string AlmRunnerUpdateStateAfterAbort { - get { - return ResourceManager.GetString("AlmRunnerUpdateStateAfterAbort", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot find the test folder.. - /// - internal static string AlmTestSetsRunnerGetFolderError { - get { - return ResourceManager.GetString("AlmTestSetsRunnerGetFolderError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No test meets the filtering criteria. - /// - internal static string AlmTestSetsRunnerNoTestAfterApplyingFilters { - get { - return ResourceManager.GetString("AlmTestSetsRunnerNoTestAfterApplyingFilters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to delete report folder {0}.. - /// - internal static string CannotDeleteReportFolder { - get { - return ResourceManager.GetString("CannotDeleteReportFolder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CreateTDConnection. - /// - internal static string CreateTDConnection { - get { - return ResourceManager.GetString("CreateTDConnection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Untitled. - /// - internal static string DefaultName { - get { - return ResourceManager.GetString("DefaultName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Directory '{0}' doesn't exist.. - /// - internal static string DirectoryNotExistError { - get { - return ResourceManager.GetString("DirectoryNotExistError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Exception was thrown from external process.. - /// - internal static string ExceptionExternalProcess { - get { - return ResourceManager.GetString("ExceptionExternalProcess", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Run cancelled by user.. - /// - internal static string ExceptionUserCancelled { - get { - return ResourceManager.GetString("ExceptionUserCancelled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to create Temp Dir {0}.. - /// - internal static string FailedToCreateTempDirError { - get { - return ResourceManager.GetString("FailedToCreateTempDirError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No Micro Focus testing tool is installed on {0}. - /// - internal static string FileSystemTestsRunner_No_HP_testing_tool_is_installed_on { - get { - return ResourceManager.GetString("FileSystemTestsRunner_No_HP_testing_tool_is_installed_on", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Duplicate parameter name entry found, please check the parameters' specification.. - /// - internal static string FsDuplicateParamNames { - get { - return ResourceManager.GetString("FsDuplicateParamNames", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid parameter format, check job configuration to re-configure parameter definitions for test: {0}. Falling back to default values, without skipping this test.. - /// - internal static string FsRunnerErrorParameterFormat { - get { - return ResourceManager.GetString("FsRunnerErrorParameterFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to =============================== There are no valid tests to run! ===============================. - /// - internal static string FsRunnerNoValidTests { - get { - return ResourceManager.GetString("FsRunnerNoValidTests", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Running test: {0}. - /// - internal static string FsRunnerRunningTest { - get { - return ResourceManager.GetString("FsRunnerRunningTest", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test result: {0}. - /// - internal static string FsRunnerTestDone { - get { - return ResourceManager.GetString("FsRunnerTestDone", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test result: Succeeded with Warnings. - /// - internal static string FsRunnerTestDoneWarnings { - get { - return ResourceManager.GetString("FsRunnerTestDoneWarnings", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} tests found:. - /// - internal static string FsRunnerTestsFound { - get { - return ResourceManager.GetString("FsRunnerTestsFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ========================\nJob was aborted by user!\n========================. - /// - internal static string GeneralAbortedByUser { - get { - return ResourceManager.GetString("GeneralAbortedByUser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ============================================================================. - /// - internal static string GeneralDoubleSeperator { - get { - return ResourceManager.GetString("GeneralDoubleSeperator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The Parameter {0} of test: {1} is defined more than once. - /// - internal static string GeneralDuplicateParameterWarning { - get { - return ResourceManager.GetString("GeneralDuplicateParameterWarning", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error: {0}\n{1}. - /// - internal static string GeneralErrorWithStack { - get { - return ResourceManager.GetString("GeneralErrorWithStack", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to >>> File/Folder not found: {0}. - /// - internal static string GeneralFileNotFound { - get { - return ResourceManager.GetString("GeneralFileNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Input parameter type mismatch (skipped), check your test configuration in UFT. param: '{0}'. - /// - internal static string GeneralParameterTypeMismatchWith1Type { - get { - return ResourceManager.GetString("GeneralParameterTypeMismatchWith1Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Illegal input parameter type (skipped). param: '{0}'. expected type: '{1}'. actual type: '{2}'. - /// - internal static string GeneralParameterTypeMismatchWith2Types { - get { - return ResourceManager.GetString("GeneralParameterTypeMismatchWith2Types", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Using parameter {0} = {1}. - /// - internal static string GeneralParameterUsage { - get { - return ResourceManager.GetString("GeneralParameterUsage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to QTP is not installed on {0}.. - /// - internal static string GeneralQtpNotInstalled { - get { - return ResourceManager.GetString("GeneralQtpNotInstalled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to "Started...". - /// - internal static string GeneralStarted { - get { - return ResourceManager.GetString("GeneralStarted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test run was aborted by user. Stopping all tests.. - /// - internal static string GeneralStopAborted { - get { - return ResourceManager.GetString("GeneralStopAborted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test run was cancelled. - /// - internal static string GeneralTestCanceled { - get { - return ResourceManager.GetString("GeneralTestCanceled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ============== Job timed out! ==============. - /// - internal static string GeneralTimedOut { - get { - return ResourceManager.GetString("GeneralTimedOut", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Timeout has expired. - /// - internal static string GeneralTimeoutExpired { - get { - return ResourceManager.GetString("GeneralTimeoutExpired", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The LoadRunner version must be 11.52 or higher. Check that '{0}' has a compatible version of LoadRunner.. - /// - internal static string HPToolsAssemblyResolverWrongVersion { - get { - return ResourceManager.GetString("HPToolsAssemblyResolverWrongVersion", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid report path provided: '{0}'. - /// - internal static string InvalidReportPath { - get { - return ResourceManager.GetString("InvalidReportPath", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Run mode is set to: {0}. - /// - internal static string LauncherDisplayRunmode { - get { - return ResourceManager.GetString("LauncherDisplayRunmode", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Run status: {0}, total tests: {1}, succeeded: {2}, failures: {3}, errors: {4}, warnings: {5}. - /// - internal static string LauncherDisplayStatistics { - get { - return ResourceManager.GetString("LauncherDisplayStatistics", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ================================================. - /// - internal static string LauncherDoubleSeperator { - get { - return ResourceManager.GetString("LauncherDoubleSeperator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The parameter 'runMode' should be: RUN_LOCAL | RUN_REMOTE | RUN_PLANNED_HOST. - /// - internal static string LauncherIncorrectRunmode { - get { - return ResourceManager.GetString("LauncherIncorrectRunmode", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No cleanup tests were found. Add some cleanup tests.. - /// - internal static string LauncherNoCleanupTestsFound { - get { - return ResourceManager.GetString("LauncherNoCleanupTestsFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No tests were selected to rerun.. - /// - internal static string LauncherNoFailedTestsFound { - get { - return ResourceManager.GetString("LauncherNoFailedTestsFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results filename provided, please add one. - /// - internal static string LauncherNoResFilenameFound { - get { - return ResourceManager.GetString("LauncherNoResFilenameFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No runType parameter was provided. Enter a runType (Alm/FileSystem/LoadRunner).. - /// - internal static string LauncherNoRuntype { - get { - return ResourceManager.GetString("LauncherNoRuntype", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No test sets were found. Add some test sets or folders.. - /// - internal static string LauncherNoTests { - get { - return ResourceManager.GetString("LauncherNoTests", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No tests were found. Add tests or folders containing tests.. - /// - internal static string LauncherNoTestsFound { - get { - return ResourceManager.GetString("LauncherNoTestsFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No valid cleanup tests were found. Fix the test paths.. - /// - internal static string LauncherNoValidCleanupTests { - get { - return ResourceManager.GetString("LauncherNoValidCleanupTests", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No valid failed tests to rerun were found. Fix the test paths.. - /// - internal static string LauncherNoValidFailedTests { - get { - return ResourceManager.GetString("LauncherNoValidFailedTests", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No valid tests were found. Fix the test paths.. - /// - internal static string LauncherNoValidTests { - get { - return ResourceManager.GetString("LauncherNoValidTests", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The parameter '{0}' is required to run a test from QC.. - /// - internal static string LauncherParamRequired { - get { - return ResourceManager.GetString("LauncherParamRequired", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while disposing runner: {0}.. - /// - internal static string LauncherRunnerDisposeError { - get { - return ResourceManager.GetString("LauncherRunnerDisposeError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Service Test is not installed on {0}. - /// - internal static string LauncherStNotInstalled { - get { - return ResourceManager.GetString("LauncherStNotInstalled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to almTimeout should be an integer!. - /// - internal static string LauncherTimeoutNotNumeric { - get { - return ResourceManager.GetString("LauncherTimeoutNotNumeric", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LoadRunner is not installed on {0}.. - /// - internal static string LoadRunnerNotInstalled { - get { - return ResourceManager.GetString("LoadRunnerNotInstalled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Analyzing results.... - /// - internal static string LrAnalysingResults { - get { - return ResourceManager.GetString("LrAnalysingResults", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error during Analysis run. See output console for details. - /// - internal static string LrAnalysisRunTimeError { - get { - return ResourceManager.GetString("LrAnalysisRunTimeError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Timeout for Analysis passed.. - /// - internal static string LrAnalysisTimeOut { - get { - return ResourceManager.GetString("LrAnalysisTimeOut", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to initialize Analysis launcher.. - /// - internal static string LrAnlysisInitFail { - get { - return ResourceManager.GetString("LrAnlysisInitFail", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Analysis Results:. - /// - internal static string LrAnlysisResults { - get { - return ResourceManager.GetString("LrAnlysisResults", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cleaning up the environment.... - /// - internal static string LrCleanENV { - get { - return ResourceManager.GetString("LrCleanENV", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Controller failed to stop.. - /// - internal static string LrControllerFailedToStop { - get { - return ResourceManager.GetString("LrControllerFailedToStop", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Ignored error message : "{0}" contains ignored string "{1}".. - /// - internal static string LrErrorIgnored { - get { - return ResourceManager.GetString("LrErrorIgnored", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Errors during scenario run: \n. - /// - internal static string LRErrorReasonSummaryTitle { - get { - return ResourceManager.GetString("LRErrorReasonSummaryTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error(s) summary: . - /// - internal static string LRErrorsSummary { - get { - return ResourceManager.GetString("LRErrorsSummary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} ignored , {1} errors. - /// - internal static string LrErrorSummeryNum { - get { - return ResourceManager.GetString("LrErrorSummeryNum", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Exception while trying to analyze results:. - /// - internal static string LRExceptionInAnalysisRunner { - get { - return ResourceManager.GetString("LRExceptionInAnalysisRunner", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot open scenario {0} ret code = {1}.. - /// - internal static string LrFailedToOpenScenario { - get { - return ResourceManager.GetString("LrFailedToOpenScenario", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to start the LoadRunner Controller.. - /// - internal static string LrFailToOpenController { - get { - return ResourceManager.GetString("LrFailToOpenController", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot register the end scenario event. End scenario detection is based on Vuser status.. - /// - internal static string LrFailToRegisterEndScenarioEvent { - get { - return ResourceManager.GetString("LrFailToRegisterEndScenarioEvent", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Preparing scenario {0} for execution.. - /// - internal static string LrInitScenario { - get { - return ResourceManager.GetString("LrInitScenario", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occured during RTS in script {0}: {1}. - /// - internal static string LrRTSError { - get { - return ResourceManager.GetString("LrRTSError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot collate results ret code = {0}.. - /// - internal static string LrScenarioCollateFail { - get { - return ResourceManager.GetString("LrScenarioCollateFail", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scenario {0} ended after {1}:{2}:{3}.. - /// - internal static string LrScenarioEnded { - get { - return ResourceManager.GetString("LrScenarioEnded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Timeout passed. Stopping scenario by force.. - /// - internal static string LrScenarioEndedTimeOut { - get { - return ResourceManager.GetString("LrScenarioEndedTimeOut", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Errors occurred during scenario execution. Stopping the scenario run.. - /// - internal static string LrScenarioEndedWithErrors { - get { - return ResourceManager.GetString("LrScenarioEndedWithErrors", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scenario open process timed out.. - /// - internal static string LrScenarioOpenTimeOut { - get { - return ResourceManager.GetString("LrScenarioOpenTimeOut", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scenario Execution timeout {0} (d:h:m:s) passed.. - /// - internal static string LrScenarioTimeOut { - get { - return ResourceManager.GetString("LrScenarioTimeOut", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot connect to Load Generator {0}.. - /// - internal static string LrScenarioValidationCannotConnectLG { - get { - return ResourceManager.GetString("LrScenarioValidationCannotConnectLG", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot synchronize with Load Generator {0}.. - /// - internal static string LrScenarioValidationCannotSyncLG { - get { - return ResourceManager.GetString("LrScenarioValidationCannotSyncLG", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No Load Generators were configured for the scenario {0.}. - /// - internal static string LrScenarioValidationFailNoLGs { - get { - return ResourceManager.GetString("LrScenarioValidationFailNoLGs", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scenario {0} does not have an SLA configuration.. - /// - internal static string LrScenarioValidationFailNoSLA { - get { - return ResourceManager.GetString("LrScenarioValidationFailNoSLA", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Load Generator {0} connected. - /// - internal static string LrScenarioValidationLGConnected { - get { - return ResourceManager.GetString("LrScenarioValidationLGConnected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not connect to Load Generator {0}.. - /// - internal static string LrScenarioValidationLGNotReady { - get { - return ResourceManager.GetString("LrScenarioValidationLGNotReady", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SLA rule {0} failed: GoalValue = {1} ActualValue = {2}. - /// - internal static string LrSLARuleFailed { - get { - return ResourceManager.GetString("LrSLARuleFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Starting scenario.... - /// - internal static string LrStartScenario { - get { - return ResourceManager.GetString("LrStartScenario", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot start scenario {0}. Return Code = {1}.. - /// - internal static string LrStartScenarioFail { - get { - return ResourceManager.GetString("LrStartScenarioFail", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Stop scenario failed. Return code = {0}. - /// - internal static string LrStopScenarioEnded { - get { - return ResourceManager.GetString("LrStopScenarioEnded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occured during summary data logging: {0}. - /// - internal static string LrSummaryDataLoggingError { - get { - return ResourceManager.GetString("LrSummaryDataLoggingError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test FAILED. {0} errors occurred during scenario execution.. - /// - internal static string LRTestFailDueToFatalErrors { - get { - return ResourceManager.GetString("LRTestFailDueToFatalErrors", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Test PASSED. - /// - internal static string LRTestPassed { - get { - return ResourceManager.GetString("LRTestPassed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Setting test state to WARNING. {0} Ignored errors occurred during scenario execution.. - /// - internal static string LRTestWarningDueToIgnoredErrors { - get { - return ResourceManager.GetString("LRTestWarningDueToIgnoredErrors", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Timeout is set to: {0}. - /// - internal static string LuancherDisplayTimout { - get { - return ResourceManager.GetString("LuancherDisplayTimout", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid execution token for Mobile, should contain ClientID, SecretKey and TenantID.. - /// - internal static string McInvalidToken { - get { - return ResourceManager.GetString("McInvalidToken", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Malformed execution token for Mobile, invalid key value: {0}.. - /// - internal static string McMalformedTokenInvalidKey { - get { - return ResourceManager.GetString("McMalformedTokenInvalidKey", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Malformed execution token for Mobile, key-value pairs are not separated by {0}.. - /// - internal static string McMalformedTokenInvalidKeyValueSeparator { - get { - return ResourceManager.GetString("McMalformedTokenInvalidKeyValueSeparator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Malformed execution token for Mobile, token without key-value.. - /// - internal static string McMalformedTokenMissingKeyValuePair { - get { - return ResourceManager.GetString("McMalformedTokenMissingKeyValuePair", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Parameter name missing. Please specify the parameter name.. - /// - internal static string MissingParameterName { - get { - return ResourceManager.GetString("MissingParameterName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Parameter value is unspecified. Please provide a value or an empty string.. - /// - internal static string MissingParameterValue { - get { - return ResourceManager.GetString("MissingParameterValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Missing quotes for {0} in parameter definition.. - /// - internal static string MissingQuotesInParamFormat { - get { - return ResourceManager.GetString("MissingQuotesInParamFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You are using an old version of QC. Please update ALM QC.. - /// - internal static string OldVersionOfQC { - get { - return ResourceManager.GetString("OldVersionOfQC", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to . - /// - internal static string ParallelRunnerExecutableNotFound { - get { - return ResourceManager.GetString("ParallelRunnerExecutableNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to QTPActivity.TestCleanup - exception {0}. - /// - internal static string QtpCleanupError { - get { - return ResourceManager.GetString("QtpCleanupError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to QTP is not launched.. - /// - internal static string QtpNotLaunchedError { - get { - return ResourceManager.GetString("QtpNotLaunchedError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to QTP could not handle output arguments.. - /// - internal static string QtpOutputError { - get { - return ResourceManager.GetString("QtpOutputError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to QTP could not run.. - /// - internal static string QtpRunError { - get { - return ResourceManager.GetString("QtpRunError", resourceCulture); - } - } - - /// + ///{1}. + /// + internal static string AlmRunnerErrorGettingStat { + get { + return ResourceManager.GetString("AlmRunnerErrorGettingStat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid parameter format, check job configuration to re-configure parameter definitions for test: {0}. Falling back to default parameter definitions.. + /// + internal static string AlmRunnerErrorParameterFormat { + get { + return ResourceManager.GetString("AlmRunnerErrorParameterFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to login. Please check username and password.. + /// + internal static string AlmRunnerIncorectCredentials { + get { + return ResourceManager.GetString("AlmRunnerIncorectCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to folder {0} cannot be found in ALM. + /// + internal static string AlmRunnerNoSuchFolder { + get { + return ResourceManager.GetString("AlmRunnerNoSuchFolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Number of tests in set:. + /// + internal static string AlmRunnerNumTests { + get { + return ResourceManager.GetString("AlmRunnerNumTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Problem while setting remote host: {0}. + /// + internal static string AlmRunnerProblemWithHost { + get { + return ResourceManager.GetString("AlmRunnerProblemWithHost", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Problem while running TestSet: . + /// + internal static string AlmRunnerRunError { + get { + return ResourceManager.GetString("AlmRunnerRunError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run ID:. + /// + internal static string AlmRunnerRunIdCaption { + get { + return ResourceManager.GetString("AlmRunnerRunIdCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scheduler started at:. + /// + internal static string AlmRunnerSchedStarted { + get { + return ResourceManager.GetString("AlmRunnerSchedStarted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ALM server {0} unreachable, check that server Url is correct. + /// + internal static string AlmRunnerServerUnreachable { + get { + return ResourceManager.GetString("AlmRunnerServerUnreachable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting test set execution. + /// + internal static string AlmRunnerStartingExecution { + get { + return ResourceManager.GetString("AlmRunnerStartingExecution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test: {0}, Id: {1}, Execution status: {2}. + /// + internal static string AlmRunnerStat { + get { + return ResourceManager.GetString("AlmRunnerStat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test: {0}, Id: {1}, Execution status: {2}, Message: {3}. + /// + internal static string AlmRunnerStatWithMessage { + get { + return ResourceManager.GetString("AlmRunnerStatWithMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test complete:. + /// + internal static string AlmRunnerTestCompleteCaption { + get { + return ResourceManager.GetString("AlmRunnerTestCompleteCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test set: {0}, aborted at {1}. + /// + internal static string AlmRunnerTestsetAborted { + get { + return ResourceManager.GetString("AlmRunnerTestsetAborted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test set: {0}, finished at {1}. + /// + internal static string AlmRunnerTestsetDone { + get { + return ResourceManager.GetString("AlmRunnerTestsetDone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test: {0}, Status: {1}, Message: {2}, Link: {3}. + /// + internal static string AlmRunnerTestStat { + get { + return ResourceManager.GetString("AlmRunnerTestStat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test: {0} >> Previous state -> {1}; After update state -> {2}. + /// + internal static string AlmRunnerUpdateStateAfterAbort { + get { + return ResourceManager.GetString("AlmRunnerUpdateStateAfterAbort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the test folder.. + /// + internal static string AlmTestSetsRunnerGetFolderError { + get { + return ResourceManager.GetString("AlmTestSetsRunnerGetFolderError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No test meets the filtering criteria. + /// + internal static string AlmTestSetsRunnerNoTestAfterApplyingFilters { + get { + return ResourceManager.GetString("AlmTestSetsRunnerNoTestAfterApplyingFilters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to delete report folder {0}.. + /// + internal static string CannotDeleteReportFolder { + get { + return ResourceManager.GetString("CannotDeleteReportFolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CreateTDConnection. + /// + internal static string CreateTDConnection { + get { + return ResourceManager.GetString("CreateTDConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Untitled. + /// + internal static string DefaultName { + get { + return ResourceManager.GetString("DefaultName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Directory '{0}' doesn't exist.. + /// + internal static string DirectoryNotExistError { + get { + return ResourceManager.GetString("DirectoryNotExistError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exception was thrown from external process.. + /// + internal static string ExceptionExternalProcess { + get { + return ResourceManager.GetString("ExceptionExternalProcess", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run cancelled by user.. + /// + internal static string ExceptionUserCancelled { + get { + return ResourceManager.GetString("ExceptionUserCancelled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to create Temp Dir {0}.. + /// + internal static string FailedToCreateTempDirError { + get { + return ResourceManager.GetString("FailedToCreateTempDirError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No Micro Focus testing tool is installed on {0}. + /// + internal static string FileSystemTestsRunner_No_HP_testing_tool_is_installed_on { + get { + return ResourceManager.GetString("FileSystemTestsRunner_No_HP_testing_tool_is_installed_on", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duplicate parameter name entry found, please check the parameters' specification.. + /// + internal static string FsDuplicateParamNames { + get { + return ResourceManager.GetString("FsDuplicateParamNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid parameter format, check job configuration to re-configure parameter definitions for test: {0}. Falling back to default values, without skipping this test.. + /// + internal static string FsRunnerErrorParameterFormat { + get { + return ResourceManager.GetString("FsRunnerErrorParameterFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to =============================== There are no valid tests to run! ===============================. + /// + internal static string FsRunnerNoValidTests { + get { + return ResourceManager.GetString("FsRunnerNoValidTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Running test: {0}. + /// + internal static string FsRunnerRunningTest { + get { + return ResourceManager.GetString("FsRunnerRunningTest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test result: {0}. + /// + internal static string FsRunnerTestDone { + get { + return ResourceManager.GetString("FsRunnerTestDone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test result: Succeeded with Warnings. + /// + internal static string FsRunnerTestDoneWarnings { + get { + return ResourceManager.GetString("FsRunnerTestDoneWarnings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} tests found:. + /// + internal static string FsRunnerTestsFound { + get { + return ResourceManager.GetString("FsRunnerTestsFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ========================\nJob was aborted by user!\n========================. + /// + internal static string GeneralAbortedByUser { + get { + return ResourceManager.GetString("GeneralAbortedByUser", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ============================================================================. + /// + internal static string GeneralDoubleSeperator { + get { + return ResourceManager.GetString("GeneralDoubleSeperator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Parameter {0} of test: {1} is defined more than once. + /// + internal static string GeneralDuplicateParameterWarning { + get { + return ResourceManager.GetString("GeneralDuplicateParameterWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error: {0}\n{1}. + /// + internal static string GeneralErrorWithStack { + get { + return ResourceManager.GetString("GeneralErrorWithStack", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to >>> File/Folder not found: {0}. + /// + internal static string GeneralFileNotFound { + get { + return ResourceManager.GetString("GeneralFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Input parameter type mismatch (skipped), check your test configuration in UFT. param: '{0}'. + /// + internal static string GeneralParameterTypeMismatchWith1Type { + get { + return ResourceManager.GetString("GeneralParameterTypeMismatchWith1Type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal input parameter type (skipped). param: '{0}'. expected type: '{1}'. actual type: '{2}'. + /// + internal static string GeneralParameterTypeMismatchWith2Types { + get { + return ResourceManager.GetString("GeneralParameterTypeMismatchWith2Types", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Using parameter {0} = {1}. + /// + internal static string GeneralParameterUsage { + get { + return ResourceManager.GetString("GeneralParameterUsage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Using parameter {0} = **********. + /// + internal static string GeneralParameterUsageMask { + get { + return ResourceManager.GetString("GeneralParameterUsageMask", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to QTP is not installed on {0}.. + /// + internal static string GeneralQtpNotInstalled { + get { + return ResourceManager.GetString("GeneralQtpNotInstalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "Started...". + /// + internal static string GeneralStarted { + get { + return ResourceManager.GetString("GeneralStarted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test run was aborted by user. Stopping all tests.. + /// + internal static string GeneralStopAborted { + get { + return ResourceManager.GetString("GeneralStopAborted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test run was cancelled. + /// + internal static string GeneralTestCanceled { + get { + return ResourceManager.GetString("GeneralTestCanceled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ============== Job timed out! ==============. + /// + internal static string GeneralTimedOut { + get { + return ResourceManager.GetString("GeneralTimedOut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Timeout has expired. + /// + internal static string GeneralTimeoutExpired { + get { + return ResourceManager.GetString("GeneralTimeoutExpired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The LoadRunner version must be 11.52 or higher. Check that '{0}' has a compatible version of LoadRunner.. + /// + internal static string HPToolsAssemblyResolverWrongVersion { + get { + return ResourceManager.GetString("HPToolsAssemblyResolverWrongVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid report path provided: '{0}'. + /// + internal static string InvalidReportPath { + get { + return ResourceManager.GetString("InvalidReportPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run mode is set to: {0}. + /// + internal static string LauncherDisplayRunmode { + get { + return ResourceManager.GetString("LauncherDisplayRunmode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run status: {0}, total tests: {1}, succeeded: {2}, failures: {3}, errors: {4}, warnings: {5}. + /// + internal static string LauncherDisplayStatistics { + get { + return ResourceManager.GetString("LauncherDisplayStatistics", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ================================================. + /// + internal static string LauncherDoubleSeperator { + get { + return ResourceManager.GetString("LauncherDoubleSeperator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter 'runMode' should be: RUN_LOCAL | RUN_REMOTE | RUN_PLANNED_HOST. + /// + internal static string LauncherIncorrectRunmode { + get { + return ResourceManager.GetString("LauncherIncorrectRunmode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No cleanup tests were found. Add some cleanup tests.. + /// + internal static string LauncherNoCleanupTestsFound { + get { + return ResourceManager.GetString("LauncherNoCleanupTestsFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No tests were selected to rerun.. + /// + internal static string LauncherNoFailedTestsFound { + get { + return ResourceManager.GetString("LauncherNoFailedTestsFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No results filename provided, please add one. + /// + internal static string LauncherNoResFilenameFound { + get { + return ResourceManager.GetString("LauncherNoResFilenameFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No runType parameter was provided. Enter a runType (Alm/FileSystem/LoadRunner).. + /// + internal static string LauncherNoRuntype { + get { + return ResourceManager.GetString("LauncherNoRuntype", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No test sets were found. Add some test sets or folders.. + /// + internal static string LauncherNoTests { + get { + return ResourceManager.GetString("LauncherNoTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No tests were found. Add tests or folders containing tests.. + /// + internal static string LauncherNoTestsFound { + get { + return ResourceManager.GetString("LauncherNoTestsFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No valid cleanup tests were found. Fix the test paths.. + /// + internal static string LauncherNoValidCleanupTests { + get { + return ResourceManager.GetString("LauncherNoValidCleanupTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No valid failed tests to rerun were found. Fix the test paths.. + /// + internal static string LauncherNoValidFailedTests { + get { + return ResourceManager.GetString("LauncherNoValidFailedTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No valid tests were found. Fix the test paths.. + /// + internal static string LauncherNoValidTests { + get { + return ResourceManager.GetString("LauncherNoValidTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is required to run a test from QC.. + /// + internal static string LauncherParamRequired { + get { + return ResourceManager.GetString("LauncherParamRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred while disposing runner: {0}.. + /// + internal static string LauncherRunnerDisposeError { + get { + return ResourceManager.GetString("LauncherRunnerDisposeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service Test is not installed on {0}. + /// + internal static string LauncherStNotInstalled { + get { + return ResourceManager.GetString("LauncherStNotInstalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to almTimeout should be an integer!. + /// + internal static string LauncherTimeoutNotNumeric { + get { + return ResourceManager.GetString("LauncherTimeoutNotNumeric", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to LoadRunner is not installed on {0}.. + /// + internal static string LoadRunnerNotInstalled { + get { + return ResourceManager.GetString("LoadRunnerNotInstalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Analyzing results.... + /// + internal static string LrAnalysingResults { + get { + return ResourceManager.GetString("LrAnalysingResults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error during Analysis run. See output console for details. + /// + internal static string LrAnalysisRunTimeError { + get { + return ResourceManager.GetString("LrAnalysisRunTimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Timeout for Analysis passed.. + /// + internal static string LrAnalysisTimeOut { + get { + return ResourceManager.GetString("LrAnalysisTimeOut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to initialize Analysis launcher.. + /// + internal static string LrAnlysisInitFail { + get { + return ResourceManager.GetString("LrAnlysisInitFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Analysis Results:. + /// + internal static string LrAnlysisResults { + get { + return ResourceManager.GetString("LrAnlysisResults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleaning up the environment.... + /// + internal static string LrCleanENV { + get { + return ResourceManager.GetString("LrCleanENV", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Controller failed to stop.. + /// + internal static string LrControllerFailedToStop { + get { + return ResourceManager.GetString("LrControllerFailedToStop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ignored error message : "{0}" contains ignored string "{1}".. + /// + internal static string LrErrorIgnored { + get { + return ResourceManager.GetString("LrErrorIgnored", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Errors during scenario run: \n. + /// + internal static string LRErrorReasonSummaryTitle { + get { + return ResourceManager.GetString("LRErrorReasonSummaryTitle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error(s) summary: . + /// + internal static string LRErrorsSummary { + get { + return ResourceManager.GetString("LRErrorsSummary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} ignored , {1} errors. + /// + internal static string LrErrorSummeryNum { + get { + return ResourceManager.GetString("LrErrorSummeryNum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exception while trying to analyze results:. + /// + internal static string LRExceptionInAnalysisRunner { + get { + return ResourceManager.GetString("LRExceptionInAnalysisRunner", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot open scenario {0} ret code = {1}.. + /// + internal static string LrFailedToOpenScenario { + get { + return ResourceManager.GetString("LrFailedToOpenScenario", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to start the LoadRunner Controller.. + /// + internal static string LrFailToOpenController { + get { + return ResourceManager.GetString("LrFailToOpenController", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot register the end scenario event. End scenario detection is based on Vuser status.. + /// + internal static string LrFailToRegisterEndScenarioEvent { + get { + return ResourceManager.GetString("LrFailToRegisterEndScenarioEvent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing scenario {0} for execution.. + /// + internal static string LrInitScenario { + get { + return ResourceManager.GetString("LrInitScenario", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occured during RTS in script {0}: {1}. + /// + internal static string LrRTSError { + get { + return ResourceManager.GetString("LrRTSError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot collate results ret code = {0}.. + /// + internal static string LrScenarioCollateFail { + get { + return ResourceManager.GetString("LrScenarioCollateFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scenario {0} ended after {1}:{2}:{3}.. + /// + internal static string LrScenarioEnded { + get { + return ResourceManager.GetString("LrScenarioEnded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Timeout passed. Stopping scenario by force.. + /// + internal static string LrScenarioEndedTimeOut { + get { + return ResourceManager.GetString("LrScenarioEndedTimeOut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Errors occurred during scenario execution. Stopping the scenario run.. + /// + internal static string LrScenarioEndedWithErrors { + get { + return ResourceManager.GetString("LrScenarioEndedWithErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scenario open process timed out.. + /// + internal static string LrScenarioOpenTimeOut { + get { + return ResourceManager.GetString("LrScenarioOpenTimeOut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scenario Execution timeout {0} (d:h:m:s) passed.. + /// + internal static string LrScenarioTimeOut { + get { + return ResourceManager.GetString("LrScenarioTimeOut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot connect to Load Generator {0}.. + /// + internal static string LrScenarioValidationCannotConnectLG { + get { + return ResourceManager.GetString("LrScenarioValidationCannotConnectLG", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot synchronize with Load Generator {0}.. + /// + internal static string LrScenarioValidationCannotSyncLG { + get { + return ResourceManager.GetString("LrScenarioValidationCannotSyncLG", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No Load Generators were configured for the scenario {0.}. + /// + internal static string LrScenarioValidationFailNoLGs { + get { + return ResourceManager.GetString("LrScenarioValidationFailNoLGs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scenario {0} does not have an SLA configuration.. + /// + internal static string LrScenarioValidationFailNoSLA { + get { + return ResourceManager.GetString("LrScenarioValidationFailNoSLA", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Load Generator {0} connected. + /// + internal static string LrScenarioValidationLGConnected { + get { + return ResourceManager.GetString("LrScenarioValidationLGConnected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not connect to Load Generator {0}.. + /// + internal static string LrScenarioValidationLGNotReady { + get { + return ResourceManager.GetString("LrScenarioValidationLGNotReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SLA rule {0} failed: GoalValue = {1} ActualValue = {2}. + /// + internal static string LrSLARuleFailed { + get { + return ResourceManager.GetString("LrSLARuleFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting scenario.... + /// + internal static string LrStartScenario { + get { + return ResourceManager.GetString("LrStartScenario", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot start scenario {0}. Return Code = {1}.. + /// + internal static string LrStartScenarioFail { + get { + return ResourceManager.GetString("LrStartScenarioFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop scenario failed. Return code = {0}. + /// + internal static string LrStopScenarioEnded { + get { + return ResourceManager.GetString("LrStopScenarioEnded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occured during summary data logging: {0}. + /// + internal static string LrSummaryDataLoggingError { + get { + return ResourceManager.GetString("LrSummaryDataLoggingError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test FAILED. {0} errors occurred during scenario execution.. + /// + internal static string LRTestFailDueToFatalErrors { + get { + return ResourceManager.GetString("LRTestFailDueToFatalErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test PASSED. + /// + internal static string LRTestPassed { + get { + return ResourceManager.GetString("LRTestPassed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting test state to WARNING. {0} Ignored errors occurred during scenario execution.. + /// + internal static string LRTestWarningDueToIgnoredErrors { + get { + return ResourceManager.GetString("LRTestWarningDueToIgnoredErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Timeout is set to: {0}. + /// + internal static string LuancherDisplayTimout { + get { + return ResourceManager.GetString("LuancherDisplayTimout", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid execution token for Mobile, should contain ClientID, SecretKey and TenantID.. + /// + internal static string McInvalidToken { + get { + return ResourceManager.GetString("McInvalidToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malformed execution token for Mobile, invalid key value: {0}.. + /// + internal static string McMalformedTokenInvalidKey { + get { + return ResourceManager.GetString("McMalformedTokenInvalidKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malformed execution token for Mobile, key-value pairs are not separated by {0}.. + /// + internal static string McMalformedTokenInvalidKeyValueSeparator { + get { + return ResourceManager.GetString("McMalformedTokenInvalidKeyValueSeparator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malformed execution token for Mobile, token without key-value.. + /// + internal static string McMalformedTokenMissingKeyValuePair { + get { + return ResourceManager.GetString("McMalformedTokenMissingKeyValuePair", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter name missing. Please specify the parameter name.. + /// + internal static string MissingParameterName { + get { + return ResourceManager.GetString("MissingParameterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter value is unspecified. Please provide a value or an empty string.. + /// + internal static string MissingParameterValue { + get { + return ResourceManager.GetString("MissingParameterValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missing quotes for {0} in parameter definition.. + /// + internal static string MissingQuotesInParamFormat { + get { + return ResourceManager.GetString("MissingQuotesInParamFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You are using an old version of QC. Please update ALM QC.. + /// + internal static string OldVersionOfQC { + get { + return ResourceManager.GetString("OldVersionOfQC", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string ParallelRunnerExecutableNotFound { + get { + return ResourceManager.GetString("ParallelRunnerExecutableNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to QTPActivity.TestCleanup - exception {0}. + /// + internal static string QtpCleanupError { + get { + return ResourceManager.GetString("QtpCleanupError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to QTP is not launched.. + /// + internal static string QtpNotLaunchedError { + get { + return ResourceManager.GetString("QtpNotLaunchedError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to QTP could not handle output arguments.. + /// + internal static string QtpOutputError { + get { + return ResourceManager.GetString("QtpOutputError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to QTP could not run.. + /// + internal static string QtpRunError { + get { + return ResourceManager.GetString("QtpRunError", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Test execution stopped due to unsaved changes in QuickTest. - ///Save the test in QuickTest and then run it again.. - /// - internal static string QtpUnsavedError { - get { - return ResourceManager.GetString("QtpUnsavedError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not find results file '{0}'.. - /// - internal static string ResultFileNotExistError { - get { - return ResourceManager.GetString("ResultFileNotExistError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -------------------------------------------------------------------------------------------------------. - /// - internal static string SingleSeperator { - get { - return ResourceManager.GetString("SingleSeperator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ===========================. - /// - internal static string SmallDoubleSeparator { - get { - return ResourceManager.GetString("SmallDoubleSeparator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Micro Focus Testing Tool is missing : Micro Focus Service Test/Micro Focus Unified Function Testing. - /// - internal static string STExecuterNotFound { - get { - return ResourceManager.GetString("STExecuterNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UFT cannot start while the LeanFT engine is running.. - /// - internal static string UFT_LeanFT_Running { - get { - return ResourceManager.GetString("UFT_LeanFT_Running", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UFT cannot start while Micro Focus Sprinter is running.. - /// - internal static string UFT_Sprinter_Running { - get { - return ResourceManager.GetString("UFT_Sprinter_Running", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to XML node '{0}' could not be found.. - /// - internal static string XmlNodeNotExistError { - get { - return ResourceManager.GetString("XmlNodeNotExistError", resourceCulture); - } - } - } -} + ///Save the test in QuickTest and then run it again.. + /// + internal static string QtpUnsavedError { + get { + return ResourceManager.GetString("QtpUnsavedError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find results file '{0}'.. + /// + internal static string ResultFileNotExistError { + get { + return ResourceManager.GetString("ResultFileNotExistError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to -------------------------------------------------------------------------------------------------------. + /// + internal static string SingleSeperator { + get { + return ResourceManager.GetString("SingleSeperator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ===========================. + /// + internal static string SmallDoubleSeparator { + get { + return ResourceManager.GetString("SmallDoubleSeparator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Micro Focus Testing Tool is missing : Micro Focus Service Test/Micro Focus Unified Function Testing. + /// + internal static string STExecuterNotFound { + get { + return ResourceManager.GetString("STExecuterNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to UFT cannot start while the LeanFT engine is running.. + /// + internal static string UFT_LeanFT_Running { + get { + return ResourceManager.GetString("UFT_LeanFT_Running", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to UFT cannot start while Micro Focus Sprinter is running.. + /// + internal static string UFT_Sprinter_Running { + get { + return ResourceManager.GetString("UFT_Sprinter_Running", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to XML node '{0}' could not be found.. + /// + internal static string XmlNodeNotExistError { + get { + return ResourceManager.GetString("XmlNodeNotExistError", resourceCulture); + } + } + } +} diff --git a/HpToolsLauncher/Properties/Resources.resx b/HpToolsLauncher/Properties/Resources.resx index 632097bb61..1a2c5d2bcf 100644 --- a/HpToolsLauncher/Properties/Resources.resx +++ b/HpToolsLauncher/Properties/Resources.resx @@ -535,4 +535,7 @@ Save the test in QuickTest and then run it again. Using parameter {0} = {1} + + Using parameter {0} = ********** + \ No newline at end of file diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index 0a6521d0b5..a8aea8e1b9 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -293,13 +293,13 @@ public TestRunResults RunTest(TestInfo testinf, ref string errorReason, RunCance : tagUnifiedLicenseType.qtNonUnified); Dictionary paramDict; - try - { - paramDict = testinf.GetParameterDictionaryForQTP(); - } catch (ArgumentException) - { - ConsoleWriter.WriteErrLine(string.Format(Resources.FsDuplicateParamNames)); - throw; + try + { + paramDict = testinf.GetParameterDictionaryForQTP(); + } catch (ArgumentException) + { + ConsoleWriter.WriteErrLine(string.Format(Resources.FsDuplicateParamNames)); + throw; } if (!HandleInputParameters(testPath, ref errorReason, paramDict, testinf)) @@ -474,7 +474,7 @@ private GuiTestRunResult ExecuteQTPRun(TestRunResults testResults) //Check for cancel before executing if (_runCancelled()) { - QTPTestCleanup(); + QTPTestCleanup(); KillQtp(); testResults.TestState = TestState.Error; testResults.ErrorDesc = Resources.GeneralTestCanceled; @@ -710,7 +710,10 @@ private bool HandleInputParameters(string fileName, ref string errorReason, Dict try { _qtpParameters[paramName].Value = paramValue; - ConsoleWriter.WriteLine(string.Format(Resources.GeneralParameterUsage, paramName, type != qtParameterType.qtParamTypeDate ? paramValue : ((DateTime) paramValue).ToShortDateString())); + if (type == qtParameterType.qtParamTypePassword) + ConsoleWriter.WriteLine(string.Format(Resources.GeneralParameterUsageMask, paramName)); + else + ConsoleWriter.WriteLine(string.Format(Resources.GeneralParameterUsage, paramName, type != qtParameterType.qtParamTypeDate ? paramValue : ((DateTime) paramValue).ToShortDateString())); } catch (Exception) { ConsoleWriter.WriteErrLine(string.Format(Resources.GeneralParameterTypeMismatchWith1Type, paramName)); diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java index ac9ac251cc..02cb99ebf4 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromAlmBuilder.java @@ -361,7 +361,7 @@ public void perform(Run build, FilePath workspace, Launcher launcher, Task if (areParametersEnabled) { try { - specifyParametersModel.addProperties(mergedProperties, "TestSet"); + specifyParametersModel.addProperties(mergedProperties, "TestSet", currNode); } catch (Exception e) { listener.error("Error occurred while parsing parameter input, reverting back to empty array."); } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index a1d1d57836..600e4d9f10 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -711,7 +711,7 @@ public void perform(@Nonnull Run build, @Nonnull FilePath workspace, @Nonn if (areParametersEnabled) { try { - specifyParametersModel.addProperties(mergedProperties, "Test"); + specifyParametersModel.addProperties(mergedProperties, "Test", currNode); } catch (Exception e) { listener.error("Error occurred while parsing parameter input, reverting back to empty array."); } diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index a066884695..ca382814d9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -28,13 +28,17 @@ package com.microfocus.application.automation.tools.uft.model; +import com.microfocus.application.automation.tools.EncryptionUtils; import com.microfocus.application.automation.tools.model.EnumDescription; import hudson.Extension; import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; +import hudson.model.Node; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; import net.minidev.json.JSONValue; + +import org.apache.commons.lang3.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import net.minidev.json.parser.ParseException; @@ -50,8 +54,9 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE); + public final static List paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE, PASSWORD_TYPE); // FOR API private final static EnumDescription INT_TYPE = new EnumDescription("Int", "Int"); @@ -61,7 +66,7 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE); + public final static List paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, PASSWORD_TYPE); public final static Map> mapping = new HashMap<>(); public final static int NUM_OF_TYPES = paramTypesAPI.size() + paramTypesGUI.size(); @@ -71,36 +76,43 @@ public class SpecifyParametersModel extends AbstractDescribableImpl relevant = testParameters.stream().filter(elem -> Integer.parseInt((String) (((JSONObject) elem).get("index"))) == currPidx).collect(Collectors.toList()); + List relevant = testParams.stream().filter(elem -> Integer.parseInt((String) (((JSONObject) elem).get("index"))) == currPidx).collect(Collectors.toList()); for (int i = 0; i < relevant.size(); ++i) { JSONObject curr = ((JSONObject) relevant.get(i)); - - props.setProperty(String.format("Param%d_Name_%d", currPidx, i + 1), curr.get("name").toString()); - props.setProperty(String.format("Param%d_Value_%d", currPidx, i + 1), curr.get("value").toString()); - props.setProperty(String.format("Param%d_Type_%d", currPidx, i + 1), curr.get("type").toString()); + String name = curr.get("name").toString(); + String type = curr.get("type").toString(); + String val = curr.get("value").toString(); + if (type.equals("Password") && StringUtils.isNotBlank(val)) + { + val = EncryptionUtils.encrypt(val, node); + } + + props.setProperty(String.format("Param%d_Name_%d", currPidx, i + 1), name); + props.setProperty(String.format("Param%d_Value_%d", currPidx, i + 1), val); + props.setProperty(String.format("Param%d_Type_%d", currPidx, i + 1), type); } ++pidx; diff --git a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly index 2f889dfdc3..bca0d479dd 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel/config.jelly @@ -31,7 +31,7 @@ xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:cv="/lib/custom"> -
            +
            • # of test

              Test name

              @@ -96,11 +96,11 @@ - + - - + + \ No newline at end of file diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 39a694bd2f..d6f67ba65f 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -36,7 +36,7 @@ if (typeof BUILDER_SELECTOR === "undefined") { BUILDER_SELECTOR = "div[name='builder'][descriptorid*='com.microfocus.application.automation.tools.run.RunFrom']"; } -function setupParameterSpecification() { +function setupParamSpecification() { let main = null; if (document.location.href.indexOf("pipeline-syntax") > 0) { main = document; @@ -45,11 +45,11 @@ function setupParameterSpecification() { } setTimeout(() => { - startListeningForParameters(main); + startListening4Params(main); }, 200); } -function startListeningForParameters(mainContainer) { +function startListening4Params(mainContainer) { let main = mainContainer; if (mainContainer == null) { let divs = document.querySelectorAll(BUILDER_SELECTOR); @@ -58,7 +58,7 @@ function startListeningForParameters(mainContainer) { loadParamInputs(main); - const btnAddNewParam = main.querySelector("button[name='addNewParameterBtn']"); + const btnAddNewParam = main.querySelector("button[name='addNewParamBtn']"); if (btnAddNewParam) { btnAddNewParam.addEventListener('click', () => { addNewParam(main); @@ -67,7 +67,7 @@ function startListeningForParameters(mainContainer) { console.warn("Add parameter button is missing."); } - const updateMaxNumberForSpinner = (testInput) => { + const updateMaxNumber4Spinner = (testInput) => { const rowInputs = main.querySelectorAll(".test-param > div > .num-of-test-spinner"); const newMax = testInput.value.split("\n").filter(row => row !== "").length; rowInputs.forEach(rowInput => rowInput.setAttribute("max", newMax === 0 ? 1 : newMax.toString())); @@ -87,7 +87,7 @@ function startListeningForParameters(mainContainer) { testInput = queryTestInput(main); if (testInput) { testInput.addEventListener("change", () => { - updateMaxNumberForSpinner(testInput); + updateMaxNumber4Spinner(testInput); rowInputs.forEach((rowInput) => { updateTest(main, rowInput, testInput); @@ -110,7 +110,7 @@ function startListeningForParameters(mainContainer) { }) }); - const chkAreParamsEnabled = main.querySelector("input[name='areParametersEnabled']"); + const chkAreParamsEnabled = main.querySelector("input[name='areParamsEnabled']"); if (chkAreParamsEnabled) { chkAreParamsEnabled.addEventListener("click", () => cleanParamInput(main)); } @@ -126,31 +126,32 @@ function queryTestInput(container) { } function generateAndPutJSONResult(container) { - const paramsContainer = container.querySelector("ul[name='testParameters']"); + const paramsContainer = container.querySelector("ul[name='testParams']"); - const inputs = paramsContainer.querySelectorAll("li[name='testParameter']"); + const inputs = paramsContainer.querySelectorAll("li[name='testParam']"); let inputJSON = []; - const strParamRes = paramsContainer.parentElement.querySelector("input[name='parameterJson']"); + const strParamRes = paramsContainer.parentElement.querySelector("input[name='jsonParams']"); - if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + if (!strParamRes) return console.warn("Param input JSON result hidden field is missing, reload the page."); inputs.forEach(elem => { let curr = {}; - const testIdx = curr["index"] = elem.querySelector(`#parameterInputRow_${elem.dataset.index}`).value; - const name = curr["name"] = elem.querySelector(`#parameterInputName_${elem.dataset.index}`).value; + const idx = elem.dataset.index; + curr.index = elem.querySelector(`#paramInputRow_${idx}`).value; + const name = curr.name = elem.querySelector(`#paramInputName_${idx}`).value; if (name !== "") { - curr["type"] = elem.querySelector(`#parameterInputType_${elem.dataset.index}`).value; + curr.type = elem.querySelector(`#paramInputType_${elem.dataset.index}`).value; - const val = elem.querySelector(`#parameterInputValue_${elem.dataset.index}`); - if (curr["type"] === "Boolean") { - curr["value"] = val.checked; - } else if (curr["type"] === "Date" || curr["type"] === "DateTime") { + const val = elem.querySelector(`#paramInputValue_${elem.dataset.index}`); + if (curr.type === "Boolean") { + curr.value = val.checked; + } else if (curr.type === "Date" || curr.type === "DateTime") { const date = new Date(val.value); - curr["value"] = `${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}/${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth()}/${date.getFullYear()}`; + curr.value = `${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}/${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth()}/${date.getFullYear()}`; } else { - curr["value"] = val.value; + curr.value = val.value; } inputJSON.push(curr); @@ -164,15 +165,15 @@ function cleanParamInput(container) { if (this.checked) { loadParamInputs(container); } else { - const strParamRes = container.querySelector("input[name='parameterJson']"); - if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + const strParamRes = container.querySelector("input[name='jsonParams']"); + if (!strParamRes) return console.warn("Param input JSON result hidden field is missing, reload the page."); strParamRes.value = normalizeJsonFormat(JSON.stringify([])); } } function addNewParam(container) { - const paramContainer = container.querySelector("ul[name='testParameters']"); - const params = paramContainer.querySelectorAll("li[name='testParameter']") || []; + const paramContainer = container.querySelector("ul[name='testParams']"); + const params = paramContainer.querySelectorAll("li[name='testParam']") || []; const nextIdx = params.length !== 0 ? parseInt(Array.from(params).reduce((prev, curr) => { if (parseInt(prev.dataset.index) > parseInt(curr.dataset.index)) return prev; @@ -188,25 +189,25 @@ function addNewParam(container) { } const elem = ` -
            • +
            • - +
              - +
              - +
              - +
              - ${selectableTypeList}
              - + @@ -216,8 +217,8 @@ function addNewParam(container) { paramContainer.insertAdjacentHTML("beforeend", elem); - const testLabel = paramContainer.querySelector(`#parameterInputTest_${nextIdx}`); - const spinner = paramContainer.querySelector(`#parameterInputRow_${nextIdx}`); + const testLabel = paramContainer.querySelector(`#paramInputTest_${nextIdx}`); + const spinner = paramContainer.querySelector(`#paramInputRow_${nextIdx}`); const handleSpinner = () => { if (spinner.value === '') { @@ -236,17 +237,17 @@ function addNewParam(container) { spinner.dispatchEvent(new Event("change")); - Array.from(paramContainer.querySelectorAll(`[name='parameterInput']`)).filter(input => input.getAttribute("id").endsWith("_" + nextIdx.toString())) + Array.from(paramContainer.querySelectorAll(`[name='paramInput']`)).filter(input => input.getAttribute("id").endsWith("_" + nextIdx.toString())) .forEach(input => input.addEventListener("change", () => generateAndPutJSONResult(container))); - const delButton = paramContainer.querySelector(`#delParameterInput_${nextIdx} > span > button`); + const delButton = paramContainer.querySelector(`#delParamInput_${nextIdx} > span > button`); delButton.addEventListener("click", () => deleteParam(delButton, container)); - const typeField = paramContainer.querySelector(`#parameterInputType_${nextIdx}`); - const valueField = paramContainer.querySelector(`#parameterInputValue_${nextIdx}`); + const typeField = paramContainer.querySelector(`#paramInputType_${nextIdx}`); + const valueField = paramContainer.querySelector(`#paramInputValue_${nextIdx}`); typeField.addEventListener("change", () => { valueField.value = ""; - valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); + valueField.setAttribute("type", map4TypeAssociations[typeField.value] || "text"); }); } @@ -256,8 +257,8 @@ function deleteParam(elem, container) { } // has to be declared like this, because it has to be globally accessible and multiple steps can be added in a single job, which would throw duplicate exception -if (typeof mapForTypeAssociations === "undefined") { - mapForTypeAssociations = { +if (typeof map4TypeAssociations === "undefined") { + map4TypeAssociations = { String: 'text', Number: 'number', Boolean: 'checkbox', @@ -274,7 +275,7 @@ if (typeof mapForTypeAssociations === "undefined") { } function loadParamInputs(container) { - const paramResultStr = container.querySelector("input[name='parameterJson']"); + const paramResultStr = container.querySelector("input[name='jsonParams']"); // one some browsers the value attribute may return with extraneous quotes let params = paramResultStr.value; @@ -293,19 +294,19 @@ function loadParamInputs(container) { for (let i = 0; i < json.length; ++i) addNewParam(container); - const parameters = container.querySelectorAll("li[name='testParameter']"); + const testParams = container.querySelectorAll("li[name='testParam']"); for (let i = 0; i < json.length; ++i) { - const currElem = parameters[i]; + const currElem = testParams[i]; const currElemVal = json[i]; - currElem.querySelector(`#parameterInputRow_${currElem.dataset.index}`).value = currElemVal["index"] || 1; - currElem.querySelector(`#parameterInputName_${currElem.dataset.index}`).value = currElemVal["name"] || ""; - const valueField = currElem.querySelector(`#parameterInputValue_${currElem.dataset.index}`) - const typeField = currElem.querySelector(`#parameterInputType_${currElem.dataset.index}`); + currElem.querySelector(`#paramInputRow_${currElem.dataset.index}`).value = currElemVal["index"] || 1; + currElem.querySelector(`#paramInputName_${currElem.dataset.index}`).value = currElemVal["name"] || ""; + const valueField = currElem.querySelector(`#paramInputValue_${currElem.dataset.index}`) + const typeField = currElem.querySelector(`#paramInputType_${currElem.dataset.index}`); typeField.value = currElemVal["type"] || "String"; - valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); + valueField.setAttribute("type", map4TypeAssociations[typeField.value] || "text"); if (typeField.value === "Boolean") { valueField.checked = currElemVal["value"] || false; } else if (typeField.value === "Date" || typeField.value === "DateTime") { From f54b2c0dae18f57ca0fcf59a9087bd9fae422bcc Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 19 Oct 2022 15:21:43 +0300 Subject: [PATCH 2231/2502] small optimization --- .../automation/tools/uft/model/SpecifyParametersModel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index ca382814d9..ded3091d2a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -47,6 +47,7 @@ import java.util.stream.Collectors; public class SpecifyParametersModel extends AbstractDescribableImpl { + private final static String PASSWORD = "Password"; // FOR GUI private final static EnumDescription STRING_TYPE = new EnumDescription("String", "String"); @@ -54,7 +55,7 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE, PASSWORD_TYPE); @@ -105,7 +106,7 @@ public void addProperties(Properties props, String searchStr, Node node) throws String name = curr.get("name").toString(); String type = curr.get("type").toString(); String val = curr.get("value").toString(); - if (type.equals("Password") && StringUtils.isNotBlank(val)) + if (type.equals(PASSWORD) && StringUtils.isNotBlank(val)) { val = EncryptionUtils.encrypt(val, node); } From b51ed42198c9b74c2d9a7b1cc0055ba7b2fe67e6 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 19 Oct 2022 15:38:37 +0300 Subject: [PATCH 2232/2502] rename constant PASSWORD as PWD --- .../tools/uft/model/SpecifyParametersModel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index ded3091d2a..cef35f4ac5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -47,7 +47,7 @@ import java.util.stream.Collectors; public class SpecifyParametersModel extends AbstractDescribableImpl { - private final static String PASSWORD = "Password"; + private final static String PWD = "Password"; // FOR GUI private final static EnumDescription STRING_TYPE = new EnumDescription("String", "String"); @@ -55,9 +55,9 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE, PASSWORD_TYPE); + public final static List paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE, PWD_TYPE); // FOR API private final static EnumDescription INT_TYPE = new EnumDescription("Int", "Int"); @@ -67,7 +67,7 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, PASSWORD_TYPE); + public final static List paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, PWD_TYPE); public final static Map> mapping = new HashMap<>(); public final static int NUM_OF_TYPES = paramTypesAPI.size() + paramTypesGUI.size(); @@ -106,7 +106,7 @@ public void addProperties(Properties props, String searchStr, Node node) throws String name = curr.get("name").toString(); String type = curr.get("type").toString(); String val = curr.get("value").toString(); - if (type.equals(PASSWORD) && StringUtils.isNotBlank(val)) + if (type.equals(PWD) && StringUtils.isNotBlank(val)) { val = EncryptionUtils.encrypt(val, node); } From ce5d9811e6cc0d2d4639d1b104b10df1531b473b Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 20 Oct 2022 20:24:35 +0300 Subject: [PATCH 2233/2502] fixes and optimizations --- .../tools/uft/model/SpecifyParametersModel.java | 17 ++++++++--------- .../model/SpecifyParametersModel/config.jelly | 10 +++------- src/main/webapp/js/specifyParametersUtils.js | 8 ++++---- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index cef35f4ac5..a315513bd6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -40,7 +40,6 @@ import org.apache.commons.lang3.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; -import net.minidev.json.parser.ParseException; import javax.annotation.Nonnull; import java.util.*; @@ -77,23 +76,23 @@ public class SpecifyParametersModel extends AbstractDescribableImpl -
                +
                • # of test

                  Test name

                  @@ -96,11 +96,11 @@ - + - - + + \ No newline at end of file diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 39a694bd2f..d6f67ba65f 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -36,7 +36,7 @@ if (typeof BUILDER_SELECTOR === "undefined") { BUILDER_SELECTOR = "div[name='builder'][descriptorid*='com.microfocus.application.automation.tools.run.RunFrom']"; } -function setupParameterSpecification() { +function setupParamSpecification() { let main = null; if (document.location.href.indexOf("pipeline-syntax") > 0) { main = document; @@ -45,11 +45,11 @@ function setupParameterSpecification() { } setTimeout(() => { - startListeningForParameters(main); + startListening4Params(main); }, 200); } -function startListeningForParameters(mainContainer) { +function startListening4Params(mainContainer) { let main = mainContainer; if (mainContainer == null) { let divs = document.querySelectorAll(BUILDER_SELECTOR); @@ -58,7 +58,7 @@ function startListeningForParameters(mainContainer) { loadParamInputs(main); - const btnAddNewParam = main.querySelector("button[name='addNewParameterBtn']"); + const btnAddNewParam = main.querySelector("button[name='addNewParamBtn']"); if (btnAddNewParam) { btnAddNewParam.addEventListener('click', () => { addNewParam(main); @@ -67,7 +67,7 @@ function startListeningForParameters(mainContainer) { console.warn("Add parameter button is missing."); } - const updateMaxNumberForSpinner = (testInput) => { + const updateMaxNumber4Spinner = (testInput) => { const rowInputs = main.querySelectorAll(".test-param > div > .num-of-test-spinner"); const newMax = testInput.value.split("\n").filter(row => row !== "").length; rowInputs.forEach(rowInput => rowInput.setAttribute("max", newMax === 0 ? 1 : newMax.toString())); @@ -87,7 +87,7 @@ function startListeningForParameters(mainContainer) { testInput = queryTestInput(main); if (testInput) { testInput.addEventListener("change", () => { - updateMaxNumberForSpinner(testInput); + updateMaxNumber4Spinner(testInput); rowInputs.forEach((rowInput) => { updateTest(main, rowInput, testInput); @@ -110,7 +110,7 @@ function startListeningForParameters(mainContainer) { }) }); - const chkAreParamsEnabled = main.querySelector("input[name='areParametersEnabled']"); + const chkAreParamsEnabled = main.querySelector("input[name='areParamsEnabled']"); if (chkAreParamsEnabled) { chkAreParamsEnabled.addEventListener("click", () => cleanParamInput(main)); } @@ -126,31 +126,32 @@ function queryTestInput(container) { } function generateAndPutJSONResult(container) { - const paramsContainer = container.querySelector("ul[name='testParameters']"); + const paramsContainer = container.querySelector("ul[name='testParams']"); - const inputs = paramsContainer.querySelectorAll("li[name='testParameter']"); + const inputs = paramsContainer.querySelectorAll("li[name='testParam']"); let inputJSON = []; - const strParamRes = paramsContainer.parentElement.querySelector("input[name='parameterJson']"); + const strParamRes = paramsContainer.parentElement.querySelector("input[name='jsonParams']"); - if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + if (!strParamRes) return console.warn("Param input JSON result hidden field is missing, reload the page."); inputs.forEach(elem => { let curr = {}; - const testIdx = curr["index"] = elem.querySelector(`#parameterInputRow_${elem.dataset.index}`).value; - const name = curr["name"] = elem.querySelector(`#parameterInputName_${elem.dataset.index}`).value; + const idx = elem.dataset.index; + curr.index = elem.querySelector(`#paramInputRow_${idx}`).value; + const name = curr.name = elem.querySelector(`#paramInputName_${idx}`).value; if (name !== "") { - curr["type"] = elem.querySelector(`#parameterInputType_${elem.dataset.index}`).value; + curr.type = elem.querySelector(`#paramInputType_${elem.dataset.index}`).value; - const val = elem.querySelector(`#parameterInputValue_${elem.dataset.index}`); - if (curr["type"] === "Boolean") { - curr["value"] = val.checked; - } else if (curr["type"] === "Date" || curr["type"] === "DateTime") { + const val = elem.querySelector(`#paramInputValue_${elem.dataset.index}`); + if (curr.type === "Boolean") { + curr.value = val.checked; + } else if (curr.type === "Date" || curr.type === "DateTime") { const date = new Date(val.value); - curr["value"] = `${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}/${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth()}/${date.getFullYear()}`; + curr.value = `${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}/${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth()}/${date.getFullYear()}`; } else { - curr["value"] = val.value; + curr.value = val.value; } inputJSON.push(curr); @@ -164,15 +165,15 @@ function cleanParamInput(container) { if (this.checked) { loadParamInputs(container); } else { - const strParamRes = container.querySelector("input[name='parameterJson']"); - if (!strParamRes) return console.warn("Parameter input JSON result hidden field is missing, reload the page."); + const strParamRes = container.querySelector("input[name='jsonParams']"); + if (!strParamRes) return console.warn("Param input JSON result hidden field is missing, reload the page."); strParamRes.value = normalizeJsonFormat(JSON.stringify([])); } } function addNewParam(container) { - const paramContainer = container.querySelector("ul[name='testParameters']"); - const params = paramContainer.querySelectorAll("li[name='testParameter']") || []; + const paramContainer = container.querySelector("ul[name='testParams']"); + const params = paramContainer.querySelectorAll("li[name='testParam']") || []; const nextIdx = params.length !== 0 ? parseInt(Array.from(params).reduce((prev, curr) => { if (parseInt(prev.dataset.index) > parseInt(curr.dataset.index)) return prev; @@ -188,25 +189,25 @@ function addNewParam(container) { } const elem = ` -
                • +
                • - +
                  - +
                  - +
                  - +
                  - ${selectableTypeList}
                  - + @@ -216,8 +217,8 @@ function addNewParam(container) { paramContainer.insertAdjacentHTML("beforeend", elem); - const testLabel = paramContainer.querySelector(`#parameterInputTest_${nextIdx}`); - const spinner = paramContainer.querySelector(`#parameterInputRow_${nextIdx}`); + const testLabel = paramContainer.querySelector(`#paramInputTest_${nextIdx}`); + const spinner = paramContainer.querySelector(`#paramInputRow_${nextIdx}`); const handleSpinner = () => { if (spinner.value === '') { @@ -236,17 +237,17 @@ function addNewParam(container) { spinner.dispatchEvent(new Event("change")); - Array.from(paramContainer.querySelectorAll(`[name='parameterInput']`)).filter(input => input.getAttribute("id").endsWith("_" + nextIdx.toString())) + Array.from(paramContainer.querySelectorAll(`[name='paramInput']`)).filter(input => input.getAttribute("id").endsWith("_" + nextIdx.toString())) .forEach(input => input.addEventListener("change", () => generateAndPutJSONResult(container))); - const delButton = paramContainer.querySelector(`#delParameterInput_${nextIdx} > span > button`); + const delButton = paramContainer.querySelector(`#delParamInput_${nextIdx} > span > button`); delButton.addEventListener("click", () => deleteParam(delButton, container)); - const typeField = paramContainer.querySelector(`#parameterInputType_${nextIdx}`); - const valueField = paramContainer.querySelector(`#parameterInputValue_${nextIdx}`); + const typeField = paramContainer.querySelector(`#paramInputType_${nextIdx}`); + const valueField = paramContainer.querySelector(`#paramInputValue_${nextIdx}`); typeField.addEventListener("change", () => { valueField.value = ""; - valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); + valueField.setAttribute("type", map4TypeAssociations[typeField.value] || "text"); }); } @@ -256,8 +257,8 @@ function deleteParam(elem, container) { } // has to be declared like this, because it has to be globally accessible and multiple steps can be added in a single job, which would throw duplicate exception -if (typeof mapForTypeAssociations === "undefined") { - mapForTypeAssociations = { +if (typeof map4TypeAssociations === "undefined") { + map4TypeAssociations = { String: 'text', Number: 'number', Boolean: 'checkbox', @@ -274,7 +275,7 @@ if (typeof mapForTypeAssociations === "undefined") { } function loadParamInputs(container) { - const paramResultStr = container.querySelector("input[name='parameterJson']"); + const paramResultStr = container.querySelector("input[name='jsonParams']"); // one some browsers the value attribute may return with extraneous quotes let params = paramResultStr.value; @@ -293,19 +294,19 @@ function loadParamInputs(container) { for (let i = 0; i < json.length; ++i) addNewParam(container); - const parameters = container.querySelectorAll("li[name='testParameter']"); + const testParams = container.querySelectorAll("li[name='testParam']"); for (let i = 0; i < json.length; ++i) { - const currElem = parameters[i]; + const currElem = testParams[i]; const currElemVal = json[i]; - currElem.querySelector(`#parameterInputRow_${currElem.dataset.index}`).value = currElemVal["index"] || 1; - currElem.querySelector(`#parameterInputName_${currElem.dataset.index}`).value = currElemVal["name"] || ""; - const valueField = currElem.querySelector(`#parameterInputValue_${currElem.dataset.index}`) - const typeField = currElem.querySelector(`#parameterInputType_${currElem.dataset.index}`); + currElem.querySelector(`#paramInputRow_${currElem.dataset.index}`).value = currElemVal["index"] || 1; + currElem.querySelector(`#paramInputName_${currElem.dataset.index}`).value = currElemVal["name"] || ""; + const valueField = currElem.querySelector(`#paramInputValue_${currElem.dataset.index}`) + const typeField = currElem.querySelector(`#paramInputType_${currElem.dataset.index}`); typeField.value = currElemVal["type"] || "String"; - valueField.setAttribute("type", mapForTypeAssociations[typeField.value] || "text"); + valueField.setAttribute("type", map4TypeAssociations[typeField.value] || "text"); if (typeField.value === "Boolean") { valueField.checked = currElemVal["value"] || false; } else if (typeField.value === "Date" || typeField.value === "DateTime") { From 6cd908e8ca69ea757ca465b53622bb9dc254ea5b Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 19 Oct 2022 15:21:43 +0300 Subject: [PATCH 2241/2502] small optimization --- .../automation/tools/uft/model/SpecifyParametersModel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index ca382814d9..ded3091d2a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -47,6 +47,7 @@ import java.util.stream.Collectors; public class SpecifyParametersModel extends AbstractDescribableImpl { + private final static String PASSWORD = "Password"; // FOR GUI private final static EnumDescription STRING_TYPE = new EnumDescription("String", "String"); @@ -54,7 +55,7 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE, PASSWORD_TYPE); @@ -105,7 +106,7 @@ public void addProperties(Properties props, String searchStr, Node node) throws String name = curr.get("name").toString(); String type = curr.get("type").toString(); String val = curr.get("value").toString(); - if (type.equals("Password") && StringUtils.isNotBlank(val)) + if (type.equals(PASSWORD) && StringUtils.isNotBlank(val)) { val = EncryptionUtils.encrypt(val, node); } From 2a061f08aede1d1a7e960d11ce21c8d13bd20e08 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 19 Oct 2022 15:38:37 +0300 Subject: [PATCH 2242/2502] rename constant PASSWORD as PWD --- .../tools/uft/model/SpecifyParametersModel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index ded3091d2a..cef35f4ac5 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -47,7 +47,7 @@ import java.util.stream.Collectors; public class SpecifyParametersModel extends AbstractDescribableImpl { - private final static String PASSWORD = "Password"; + private final static String PWD = "Password"; // FOR GUI private final static EnumDescription STRING_TYPE = new EnumDescription("String", "String"); @@ -55,9 +55,9 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE, PASSWORD_TYPE); + public final static List paramTypesGUI = Arrays.asList(STRING_TYPE, NUMBER_TYPE, DATE_TYPE, BOOL_TYPE, ANY_TYPE, PWD_TYPE); // FOR API private final static EnumDescription INT_TYPE = new EnumDescription("Int", "Int"); @@ -67,7 +67,7 @@ public class SpecifyParametersModel extends AbstractDescribableImpl paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, PASSWORD_TYPE); + public final static List paramTypesAPI = Arrays.asList(STRING_TYPE, INT_TYPE, FLOAT_TYPE, DATETIME_TYPE, BOOL_TYPE, LONG_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, PWD_TYPE); public final static Map> mapping = new HashMap<>(); public final static int NUM_OF_TYPES = paramTypesAPI.size() + paramTypesGUI.size(); @@ -106,7 +106,7 @@ public void addProperties(Properties props, String searchStr, Node node) throws String name = curr.get("name").toString(); String type = curr.get("type").toString(); String val = curr.get("value").toString(); - if (type.equals(PASSWORD) && StringUtils.isNotBlank(val)) + if (type.equals(PWD) && StringUtils.isNotBlank(val)) { val = EncryptionUtils.encrypt(val, node); } From 90b6e8a3512795f4c3c0cafb64ec5c75123bf2b9 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 20 Oct 2022 20:24:35 +0300 Subject: [PATCH 2243/2502] fixes and optimizations --- .../tools/uft/model/SpecifyParametersModel.java | 17 ++++++++--------- .../model/SpecifyParametersModel/config.jelly | 10 +++------- src/main/webapp/js/specifyParametersUtils.js | 8 ++++---- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java index cef35f4ac5..a315513bd6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/uft/model/SpecifyParametersModel.java @@ -40,7 +40,6 @@ import org.apache.commons.lang3.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; -import net.minidev.json.parser.ParseException; import javax.annotation.Nonnull; import java.util.*; @@ -77,23 +76,23 @@ public class SpecifyParametersModel extends AbstractDescribableImpl + @@ -114,15 +114,15 @@ - + - + - + @@ -204,19 +204,19 @@ - + - + - + - + @@ -260,7 +260,7 @@ - ${mcServer.mcServerName} @@ -269,86 +269,94 @@ - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  @@ -372,5 +380,6 @@ \ No newline at end of file diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index 859038e457..a51bce2cb4 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -25,127 +25,190 @@ * * ___________________________________________________________________ */ +if (typeof RUN_FROM_FS_BUILDER_SELECTOR == "undefined") { + RUN_FROM_FS_BUILDER_SELECTOR = 'div[name="builder"][descriptorid="com.microfocus.application.automation.tools.run.RunFromFileBuilder"]'; +} +const templates = { "regions": [ "Europe (Frankfurt)" ], "os": [ "Windows Server 2022" ], "browsers": [ { "type": "Chrome", "versions": [ { "version": "117", "tag": "117" }, { "version": "117", "tag": "latest" }, { "version": "116", "tag": "latest-1" }, { "version": "116", "tag": "116" }, { "version": "115", "tag": "latest-2" }, { "version": "115", "tag": "115" } ] }, { "type": "Edge", "versions": [ { "version": "117", "tag": "117" }, { "version": "117", "tag": "latest" }, { "version": "116", "tag": "latest-1" }, { "version": "116", "tag": "116" }, { "version": "115", "tag": "latest-2" }, { "version": "115", "tag": "115" } ] }, { "type": "Firefox", "versions": [ { "version": "117", "tag": "117" }, { "version": "117", "tag": "latest" }, { "version": "116", "tag": "latest-1" }, { "version": "116", "tag": "116" }, { "version": "115", "tag": "latest-2" }, { "version": "115", "tag": "115" } ] } ] } -function loadMobileInfo(a) { - var buttonStatus = false; - if (buttonStatus) return; - buttonStatus = true; - var recreatJob = document.getElementsByName("runfromfs.recreateJob")[0].checked; - var mcUserName = document.getElementsByName("runfromfs.mcUserName")[0].value; - var mcPassword = document.getElementsByName("runfromfs.mcPassword")[0].value; - var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; - var mcExecToken = document.getElementsByName("runfromfs.mcExecToken")[0].value; - var authType = document.querySelector('input[name$="authModel"]:checked').value; - var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; - var useProxy = document.getElementsByName("proxySettings")[0].checked; - var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; - var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; - var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; - var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; - var baseUrl = ""; - var isMcCredentialMissing; - if ('base' == authType) { - isMcCredentialMissing = (mcUserName.trim() == "" || mcPassword.trim() == ""); +function getDigitalLab(divMain) { + const dl = divMain.querySelector("#mobileSpecificSection"); + const o = { serverName: dl.querySelector('select[name="mcServerName"]').value, + userName: "", + password: "", + tenantId: "", + accessKey: "", + authType: dl.querySelector('input[name$="authModel"]:checked').value, + useProxy: dl.querySelector('input[name="mcUseProxy"]').checked, + proxyAddress: "", + useProxyAuth: false, + proxyUserName: "", + proxyPassword: "", + err: dl.querySelector("#errorMessage"), + recreateJob: dl.querySelector('input[name="recreateJob"]').checked, + jobId: dl.querySelector('input[name="fsJobId"]').value, + uftOneVersion: dl.querySelector('input[name="uftOneVersion"]').value, // TODO find a better approach + deviceInfo: dl.querySelector("#deviceInfo") + }; + if (o.authType == "base") { + o.userName = dl.querySelector('input[name="mcUserName"]').value; + o.password = dl.querySelector('input[name="mcPassword"]').value; + o.tenantId = dl.querySelector('input[name="mcTenantId"]').value; } else { - isMcCredentialMissing = mcExecToken.trim() == ""; - } - - const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; - const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); - if (isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing) { - document.getElementById("errorMessage").style.display = "block"; - buttonStatus = false; - return; + o.accessKey = dl.querySelector('input[name="mcAccessKey"]').value; } - var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; - //recreate job if checked - if (recreatJob) { - previousJobId = ""; + if (o.useProxy) { + o.proxyAddress = dl.querySelector('input[name="fsProxyAddress"]').value; + o.useProxyAuth = dl.querySelector('input[name="mcUseProxyAuth"]').checked; + if (o.useProxyAuth) { + o.proxyUserName = dl.querySelector('input[name="fsProxyUserName"]').value; + o.proxyPassword = dl.querySelector('input[name="fsProxyPassword"]').value; + } } - if (!useProxy) { - proxyAddress = proxyUserName = proxyPassword = ""; + return o; +} + +function setupDigitalLab() { + let divMain = null; + if (document.location.href.indexOf("pipeline-syntax")>0) { // we are on pipeline-syntax page, where runFromFileBuilder step can be selected only once + divMain = document; + } else if (document.currentScript) { // this block is used for non-IE browsers, for the first FS build step only, it finds very fast the parent DIV + divMain = document.currentScript.parentElement.closest(RUN_FROM_FS_BUILDER_SELECTOR); + } + setTimeout(function() { prepareDigitalLab(divMain)}, 100); +} +function prepareDigitalLab(divMain) { + if (divMain == null) { // this block is needed for IE, but also for non-IE browsers when adding more than one FS build step + let divs = document.querySelectorAll(RUN_FROM_FS_BUILDER_SELECTOR); + divMain = divs[divs.length - 1]; + } + const dl = divMain.querySelector("#mobileSpecificSection"); + //TODO show/hide dynamically + dl.querySelector("#deviceInfo").style.display = "none"; +} +function loadInfo(a, b) { + b.disabled = true; + try { + const divMain = b.parentElement.closest(RUN_FROM_FS_BUILDER_SELECTOR); + const dl = getDigitalLab(divMain); + const isMcCredentialMissing = ("base" == dl.authType ? (dl.userName.trim() == "" || dl.password.trim() == "") : dl.accessKey.trim() == ""); + + const isProxyAddressRequiredButMissing = dl.useProxy && dl.proxyAddress.trim() == ""; + const isProxyCredentialRequiredButMissing = dl.useProxyAuth && (dl.proxyUserName.trim() == "" || dl.proxyPassword.trim() == ""); + if (isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing) { + dl.err.style.display = "block"; + b.disabled = false; + return; + } + + //TODO use a dynamic flag + if (b.id == "browserLab") { + loadBrowserLabInfo(a, b, dl); + } else if (b.value = "wizard") { + loadMobileInfo(a, b, dl); + } + } catch (e) { + console.error(e); + } finally { + b.disabled = false; } + } + +function loadBrowserLabInfo(a, b, o) { + a.getBrowserLab(o.serverName, o.accessKey, o.useProxyAuth, o.proxyAddress, o.proxyUserName, o.proxyPassword, o.uftOneVersion, function (response) { + if (response?.responseJSON) { + const json = response.responseJSON; + console.log(json); + o.err.style.display = "none"; + } else { + o.err.style.display = "block"; + } + b.disabled = false; + }); +} + +function loadMobileInfo(a, b, o) { + let baseUrl = ""; - a.getMcServerUrl(mcUrl, function (r) { + a.getMcServerUrl(o.serverName, function (r) { baseUrl = r.responseObject(); if (baseUrl) { baseUrl = baseUrl.trim().replace(/[\/]+$/, ""); } else { - ParallelRunnerEnv.setEnvironmentError(button, true); - buttonStatus = false; + ParallelRunnerEnv.setEnvironmentError(b, true);//TODO check if this is OK + b.disabled = false; return; } - a.getJobId(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, authType, - useAuthentication, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { - var jobId = response.responseObject(); - if (jobId == null) { - document.getElementById("errorMessage").style.display = "block"; - buttonStatus = false; - return; - } - //hide the error message after success login - document.getElementById("errorMessage").style.display = "none"; - var openedWindow = window.open('/', 'test parameters', 'height=820,width=1130'); - openedWindow.location.href = 'about:blank'; - openedWindow.location.href = baseUrl + "/integration/#/login?jobId=" + jobId + "&displayUFTMode=true"; - var messageCallBack = function (event) { - if (event && event.data && event.data == "mcCloseWizard") { - a.populateAppAndDevice(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, authType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, jobId, function (app) { - var jobInfo = app.responseObject(); - let deviceId = "", OS = "", manufacturerAndModel = "", targetLab = ""; - if (jobInfo['deviceJSON']) { - if (jobInfo['deviceJSON']['deviceId']) { - deviceId = jobInfo['deviceJSON']['deviceId']; - } - if (jobInfo['deviceJSON']['OS']) { - OS = jobInfo['deviceJSON']['OS']; - } - if (jobInfo['deviceJSON']['manufacturerAndModel']) { - manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; - } + let prevJobId = o.recreateJob ? "" : o.jobId; + a.getJobId(baseUrl, o.userName, o.password, o.tenantId, o.accessKey, o.authType, o.useProxyAuth, o.proxyAddress, o.proxyUserName, o.proxyPassword, prevJobId, function (response) { + var jobId = response.responseObject(); + if (jobId == null) { + o.err.style.display = "block"; + b.disabled = false; + return; + } + //hide the error message after success login + o.err.style.display = "none"; + var openedWindow = window.open('/', 'test parameters', 'height=820,width=1130'); + openedWindow.location.href = 'about:blank'; + openedWindow.location.href = baseUrl + "/integration/#/login?jobId=" + jobId + "&displayUFTMode=true"; + var messageCallBack = function (event) { + if (event && event.data && event.data == "mcCloseWizard") { + a.populateAppAndDevice(baseUrl, o.userName, o.password, o.tenantId, o.accessKey, o.authType, o.useProxyAuth, o.proxyAddress, o.proxyUserName, o.proxyPassword, jobId, function (app) { + var jobInfo = app.responseObject(); + let deviceId = "", OS = "", manufacturerAndModel = "", targetLab = ""; + if (jobInfo['deviceJSON']) { + if (jobInfo['deviceJSON']['deviceId']) { + deviceId = jobInfo['deviceJSON']['deviceId']; + } + if (jobInfo['deviceJSON']['OS']) { + OS = jobInfo['deviceJSON']['OS']; + } + if (jobInfo['deviceJSON']['manufacturerAndModel']) { + manufacturerAndModel = jobInfo['deviceJSON']['manufacturerAndModel']; + } + } + if (jobInfo['deviceCapability']) { + if (jobInfo['deviceCapability']['OS']) { + OS = jobInfo['deviceCapability']['OS']; + } + if (jobInfo['deviceCapability']['manufacturerAndModel']) { + manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; } - if (jobInfo['deviceCapability']) { - if (jobInfo['deviceCapability']['OS']) { - OS = jobInfo['deviceCapability']['OS']; - } - if (jobInfo['deviceCapability']['manufacturerAndModel']) { - manufacturerAndModel = jobInfo['deviceCapability']['manufacturerAndModel']; - } - if (jobInfo['deviceCapability']['targetLab']) { - targetLab = jobInfo['deviceCapability']['targetLab']; - } + if (jobInfo['deviceCapability']['targetLab']) { + targetLab = jobInfo['deviceCapability']['targetLab']; } - document.getElementsByName("runfromfs.fsDeviceId")[0].value = deviceId; - document.getElementsByName("runfromfs.fsOs")[0].value = OS; - document.getElementsByName("runfromfs.fsManufacturerAndModel")[0].value = manufacturerAndModel; - document.getElementsByName("runfromfs.fsTargetLab")[0].value = targetLab; - document.getElementsByName("runfromfs.fsLaunchAppName")[0].value = jobInfo['definitions']['launchApplicationName']; - document.getElementsByName("runfromfs.fsInstrumented")[0].value = jobInfo['definitions']['instrumented']; - document.getElementsByName("runfromfs.fsAutActions")[0].value = jobInfo['definitions']['autActions']; - document.getElementsByName("runfromfs.fsDevicesMetrics")[0].value = jobInfo['definitions']['deviceMetrics']; - document.getElementsByName("runfromfs.fsExtraApps")[0].value = jobInfo['extraApps']; - document.getElementsByName("runfromfs.fsJobId")[0].value = jobInfo['jobUUID']; - buttonStatus = false; - document.getElementById("errorMessage").style.display = "none"; - window.removeEventListener("message", messageCallBack, false); - openedWindow.close(); - }); - } - }; - window.addEventListener("message", messageCallBack, false); - - function checkChild() { - if (openedWindow && openedWindow.closed) { - clearInterval(timer); - buttonStatus = false; - } + } + const div = o.deviceInfo; + div.querySelector('input[name="fsDeviceId"]').value = deviceId; + div.querySelector('input[name="fsOs"]').value = OS; + div.querySelector('input[name="fsManufacturerAndModel"]').value = manufacturerAndModel; + div.querySelector('input[name="fsTargetLab"]').value = targetLab; + div.querySelector('input[name="fsLaunchAppName"]').value = jobInfo['definitions']['launchApplicationName']; + div.querySelector('input[name="fsInstrumented"]').value = jobInfo['definitions']['instrumented']; + div.querySelector('input[name="fsAutActions"]').value = jobInfo['definitions']['autActions']; + div.querySelector('input[name="fsDevicesMetrics"]').value = jobInfo['definitions']['deviceMetrics']; + div.querySelector('input[name="fsExtraApps"]').value = jobInfo['extraApps']; + div.querySelector('input[name="fsJobId"]').value = jobInfo['jobUUID']; + b.disabled = false; + o.err.style.display = "none"; + window.removeEventListener("message", messageCallBack, false); + openedWindow.close(); + }); } + }; + window.addEventListener("message", messageCallBack, false); - var timer = setInterval(checkChild, 500); - }); - }); + function checkChild() { + if (openedWindow && openedWindow.closed) { + clearInterval(timer); + b.disabled = false; + } + } + var timer = setInterval(checkChild, 500); + }); + }); } function hideAndMoveAdvancedBody(_id) { @@ -153,4 +216,164 @@ function hideAndMoveAdvancedBody(_id) { const initialAdvancedBlock = tBody.previousSibling; // advanced link button block and here was hidden the initial advanced block content initialAdvancedBlock.querySelector(".advancedBody").appendChild(tBody); // moves the initial advanced block content back to the hidden block initialAdvancedBlock.querySelector(".advancedLink").style.display = ""; // enables once again the advanced link +} + +function onCloudBrowserLabClick(a, b, path) { + const div = b.parentElement.closest("#mobileSpecificSection"); + let dlg = div.querySelector("#cloudBrowsersModal"); + if (dlg == null) { + dlg = generateModalDialog(path); + div.appendChild(dlg); + } + + fillOsesDDL(dlg); + fillBrowsersAndVersionsDDLs(dlg); + fillRegionsDDL(dlg); + + dlg.style.display = "block"; + return true; +} + +function fillRegionsDDL(dlg) { + const ddl = dlg.querySelector('select[name="cldBrowserLoc"]'); + const arr = templates.regions.sort(); + fillDDL(ddl, arr); +} + +function fillOsesDDL(dlg) { + const ddl = dlg.querySelector('select[name="cldBrowserOS"]'); + const arr = templates.os; + fillDDL(ddl, arr); +} + +function fillBrowsersAndVersionsDDLs(dlg) { + const ddlB = dlg.querySelector('select[name="cldBrowser"]'); + const ddlV = dlg.querySelector('select[name="cldBrowserVer"]'); + let mapBV = new Map(); + //const arrB = templates.browsers.map(b => b.type).sort(); + //fillDDL(ddlB, arrB); + + templates.browsers.forEach((obj) => { + mapBV.set(obj.type, obj.versions?.map(v => v.tag).sort()); + }); + fillBrowsersDDL(ddlB, mapBV); + + ddlB.onchange = (e) => { + //const arr = getBrowserVersions(e.target.value); + const arr = ddlB.selectedOptions[0]?.versions; + if (arr?.length) { + fillDDL(ddlV, arr); + } else { + ddlV.length = 0; + } + }; + + const arr = ddlB.selectedOptions[0]?.versions; + arr?.length && fillDDL(ddlV, arr); + //fillDDL(ddlV, getBrowserVersions(ddlB.value)); +} + +function getBrowserVersions(type) { + return templates.browsers.find(b => b.type == type)?.versions.map(b => b.tag).sort(); +} + +function fillBrowsersDDL(ddl, map) { + ddl.length = 0; + if (map?.size) { + let x = 0; + map.forEach((val, key) => { + let opt = new Option(key, key, 0 == x++); + //opt.dataset.versions = JSON.stringify(val); + opt.versions = val; + ddl[ddl.length] = opt; + }); + } +} + +function fillDDL(ddl, arr) { + ddl.length = 0; + if (arr?.length) { + for (var i = 0; i < arr.length; ++i) { + ddl[ddl.length] = new Option(arr[i], arr[i], i == 0); + } + } +} + +function hideCloudBrowserModal(b) { + b.parentElement.closest("div.modal").style.display = "none"; +} + +function onSaveCloudBrowser(b) { + //TODO save details + hideCloudBrowserModal(b); +} + +function loadCssIfNotAlreadyLoaded(path) { + const ss = document.styleSheets; + for (let i = 0, max = ss.length; i < max; i++) { + if (ss[i].href == path) + return; + } + let link = document.createElement("link"); + link.rel = "stylesheet"; + link.type = "text/css"; + link.href = path; + + document.head.appendChild(link); +} + +function generateModalDialog(rootUrl) { + loadCssIfNotAlreadyLoaded(rootUrl + "plugin/hp-application-automation-tools-plugin/css/modal_dialog.css"); + + var browsersModal = document.createElement("div"); + browsersModal.setAttribute("id","cloudBrowsersModal"); + browsersModal.setAttribute("class","modal"); + + let content = document.createElement("div"); + content.setAttribute("class","modal-content"); + + let hdr = document.createElement("div"); + hdr.setAttribute("class","modal-header"); + + var xDiv = document.createElement("div"); + xDiv.innerHTML = "x"; + xDiv.setAttribute("class","close"); + xDiv.setAttribute("onclick","hideCloudBrowserModal(this)"); + + var title = document.createElement("div"); + title.innerHTML = "Choose a browser"; + title.setAttribute("class","modal-title"); + + var body = document.createElement("div"); + body.setAttribute("class","modal-body"); + + addEmptySelect(body, "Operating System", "cldBrowserOS"); + addEmptySelect(body, "Browser Type", "cldBrowser"); + addEmptySelect(body, "Browser Version", "cldBrowserVer"); + addEmptySelect(body, "Location", "cldBrowserLoc"); + + var sDiv = document.createElement('div'); + sDiv.innerHTML = "SAVE"; + sDiv.setAttribute("class","save-text"); + sDiv.setAttribute("onclick",'onSaveCloudBrowser(this)'); + + var footer = document.createElement("div"); + footer.setAttribute("class","modal-footer"); + + footer.appendChild(sDiv); + hdr.appendChild(xDiv); + hdr.appendChild(title); + content.appendChild(hdr); + content.appendChild(body); + content.appendChild(footer); + browsersModal.appendChild(content); + + return browsersModal; +}; + +function addEmptySelect(parent, label, name) { + let div = document.createElement("div"); + div.setAttribute("class", "modal-body-item"); + div.innerHTML = ``; + parent.appendChild(div); } \ No newline at end of file diff --git a/src/main/webapp/css/PARALLEL_RUNNER_UI.css b/src/main/webapp/css/modal_dialog.css similarity index 96% rename from src/main/webapp/css/PARALLEL_RUNNER_UI.css rename to src/main/webapp/css/modal_dialog.css index 13f7f15dd9..4433df94c3 100644 --- a/src/main/webapp/css/PARALLEL_RUNNER_UI.css +++ b/src/main/webapp/css/modal_dialog.css @@ -112,7 +112,7 @@ color: #000;text-decoration: none;cursor: pointer; } -.browser-item { +.browser-item, .modal-body-item { position: relative; padding-top: 25px; vertical-align: middle; @@ -139,3 +139,9 @@ letter-spacing: normal; color: #000000; } + +.modal-body-item select { + float: right; + vertical-align: middle; + width: 200px; +} diff --git a/src/main/webapp/parallelRunnerEnvironment.js b/src/main/webapp/parallelRunnerEnvironment.js index bbfc47efb4..d7bb389033 100644 --- a/src/main/webapp/parallelRunnerEnvironment.js +++ b/src/main/webapp/parallelRunnerEnvironment.js @@ -146,7 +146,7 @@ ModalDialog.hide = function(modalId) { * @constructor */ ModalDialog.generate = function(path) { - var modalCSS = path + "plugin/hp-application-automation-tools-plugin/css/PARALLEL_RUNNER_UI.css"; + var modalCSS = path + "plugin/hp-application-automation-tools-plugin/css/modal_dialog.css"; // add the css style ModalDialog.addStyleSheet(modalCSS); @@ -313,50 +313,49 @@ Utils.setJenkinsElementVisibility = function(element,isVisible) { * @param button the environment wizard button */ Utils.loadMC = function(a,button){ - var buttonStatus = false; - if(buttonStatus) return; - buttonStatus = true; - var mcUserName = document.getElementsByName("runfromfs.mcUserName")[0].value; - var mcPassword = document.getElementsByName("runfromfs.mcPassword")[0].value; - var mcTenantId = document.getElementsByName("runfromfs.mcTenantId")[0].value; - var mcExecToken = document.getElementsByName("runfromfs.mcExecToken")[0].value; - var mcAuthType = document.querySelector('input[name$="authModel"]:checked').value; - var mcUrl = document.getElementsByName("runfromfs.mcServerName")[0].value; - var useProxy = document.getElementsByName("proxySettings")[0].checked; - var proxyAddress = document.getElementsByName("runfromfs.fsProxyAddress")[0].value; - var useAuthentication = document.getElementsByName("runfromfs.fsUseAuthentication")[0].checked; - var proxyUserName = document.getElementsByName("runfromfs.fsProxyUserName")[0].value; - var proxyPassword = document.getElementsByName("runfromfs.fsProxyPassword")[0].value; + button.disabled = true; + const divMain = button.parentElement.closest(RUN_FROM_FS_BUILDER_SELECTOR); + var mcUserName = divMain.querySelector('input[name="mcUserName"]').value; + var mcPassword = divMain.querySelector('input[name="mcPassword"]').value; + var mcTenantId = divMain.querySelector('input[name="mcTenantId"]').value; + var mcAccessKey = divMain.querySelector('input[name="mcAccessKey"]').value; + var mcAuthType = divMain.querySelector('input[name$="authModel"]:checked').value; + var mcUrl = divMain.querySelector('input[name="mcServerName"]').value; + var useProxy = divMain.querySelector('input[name="proxySettings"]').checked; + var proxyAddress = divMain.querySelector('input[name="fsProxyAddress"]').value; + var useAuthentication = divMain.querySelector('input[name="fsUseAuthentication"]').checked; + var proxyUserName = divMain.querySelector('input[name="fsProxyUserName"]').value; + var proxyPassword = divMain.querySelector('input[name="fsProxyPassword"]').value; var baseUrl = ""; var isMcCredentialMissing; if ('base' == mcAuthType) { isMcCredentialMissing = mcUserName.trim() == "" || mcPassword.trim() == ""; } else { - isMcCredentialMissing = mcExecToken.trim() == ""; + isMcCredentialMissing = mcAccessKey.trim() == ""; } const isProxyAddressRequiredButMissing = useProxy && proxyAddress.trim() == ""; const isProxyCredentialRequiredButMissing = useAuthentication && (proxyUserName.trim() == "" || proxyPassword.trim() == ""); if(isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing){ ParallelRunnerEnv.setEnvironmentError(button,true); - buttonStatus = false; + button.disabled = false; return; } - var previousJobId = document.getElementsByName("runfromfs.fsJobId")[0].value; + var previousJobId = divMain.querySelector('[name="fsJobId"]').value; a.getMcServerUrl(mcUrl, function(r){ baseUrl = r.responseObject(); if(baseUrl){ baseUrl = baseUrl.trim().replace(/[\/]+$/, ""); } else { ParallelRunnerEnv.setEnvironmentError(button,true); - buttonStatus = false; + button.disabled = false; return; } - a.getJobId(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, mcAuthType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { + a.getJobId(baseUrl, mcUserName, mcPassword, mcTenantId, mcAccessKey, mcAuthType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, previousJobId, function (response) { var jobId = response.responseObject(); if(jobId == null) { ParallelRunnerEnv.setEnvironmentError(button,true); - buttonStatus = false; + button.disabled = false; return; } var openedWindow = window.open('/','test parameters','height=820,width=1130'); @@ -364,7 +363,7 @@ Utils.loadMC = function(a,button){ openedWindow.location.href = baseUrl+"/integration/#/login?jobId="+jobId+"&displayUFTMode=true&deviceOnly=true"; var messageCallBack = function (event) { if (event && event.data && event.data=="mcCloseWizard") { - a.populateAppAndDevice(baseUrl, mcUserName, mcPassword, mcTenantId, mcExecToken, mcAuthType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, jobId, function (app) { + a.populateAppAndDevice(baseUrl, mcUserName, mcPassword, mcTenantId, mcAccessKey, mcAuthType, useAuthentication, proxyAddress, proxyUserName, proxyPassword, jobId, function (app) { var jobInfo = app.responseObject(); let deviceId = "", OS = "", manufacturerAndModel = ""; if(jobInfo['deviceJSON']){ @@ -389,7 +388,7 @@ Utils.loadMC = function(a,button){ console.log(deviceId); ParallelRunnerEnv.setEnvironmentSettingsInput(button,Utils.parseMCInformation(deviceId,OS,manufacturerAndModel)); - buttonStatus = false; + button.disabled = false; ParallelRunnerEnv.setEnvironmentError(button,false); window.removeEventListener("message",messageCallBack, false); openedWindow.close(); @@ -400,7 +399,7 @@ Utils.loadMC = function(a,button){ function checkChild() { if (openedWindow && openedWindow.closed) { clearInterval(timer); - buttonStatus = false; + button.disabled = false; } } var timer = setInterval(checkChild, 500); @@ -475,6 +474,7 @@ ParallelRunnerEnv.setEnvironmentError = function(button, enable) { * @param visible - should the modal be visible?(true / false) * @param path - the patch to the root of the plugin */ + //TODO replace document with divMain computed from button ParallelRunnerEnv.setBrowsersModalVisibility = function(button,modalId,visible,path) { var modal = document.getElementById(modalId); // it wasn't generated, so we need to generate it @@ -608,15 +608,15 @@ RunFromFileSystemEnv.setInputVisibility = function(panel, name, visible) { }; RunFromFileSystemEnv.setFsTestsVisibility = function(panel, visible) { - this.setMultiLineTextBoxVisibility(panel, "runfromfs.fsTests", visible); + this.setMultiLineTextBoxVisibility(panel, "fsTests", visible); }; RunFromFileSystemEnv.setFsReportPathVisibility = function(panel, visible) { - this.setInputVisibility(panel, "runfromfs.fsReportPath", visible); + this.setInputVisibility(panel, "fsReportPath", visible); }; RunFromFileSystemEnv.setTimeoutVisibility = function (panel, visible) { - this.setInputVisibility(panel, "runfromfs.fsTimeout", visible); + this.setInputVisibility(panel, "fsTimeout", visible); }; RunFromFileSystemEnv.setParamsVisibility = function(panel, visible) { From 38031cc1b359dfededb18fdb246e7d7140169f9a Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 1 Nov 2023 15:11:13 +0200 Subject: [PATCH 2457/2502] draft changes, still need to test / fix some issues --- .../automation/tools/mc/Constants.java | 2 +- .../tools/mc/JobConfigurationProxy.java | 32 ++- .../tools/model/CloudBrowserModel.java | 43 ++++ .../tools/model/RunFromFileSystemModel.java | 17 +- .../tools/run/RunFromFileBuilder.java | 21 +- .../tools/run/RunFromFileBuilder/config.jelly | 209 +++++++++------- src/main/webapp/configure.js | 236 ++++++++++-------- src/main/webapp/parallelRunnerEnvironment.js | 30 +-- 8 files changed, 349 insertions(+), 241 deletions(-) create mode 100644 src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java index 83aba5b669..5840ba604f 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java @@ -59,7 +59,7 @@ public class Constants { public static final String GET_JOB_UEL = "/rest/job/"; public static final String GET_BROWSER_LAB_URL = "/rest/v2/browser-lab/uftone/templates"; public final static String ICON = "icon"; - public final static String JESEEIONEQ = "JSESSIONID="; + public final static String JSESSIONID_EQ = "JSESSIONID="; public final static String TENANT_COOKIE = "TENANT_ID_COOKIE"; public final static String ACCESS_TOKEN = "access_token"; public final static String TOKEN_TYPE = "token_type"; diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 049114a005..d3e251f3f2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -40,10 +40,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; /** * communicate with MC servers, login to MC, upload application to MC server, create job, get job details. @@ -87,11 +84,11 @@ public JSONObject loginToMC(String mcUrl, AuthModel authModel, ProxySettings pro sendObject.put("name", tempUsername); sendObject.put("password", authModel.getMcPassword()); sendObject.put("accountName", "default"); - response = HttpUtils.doPost(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL, headers, sendObject.toJSONString().getBytes()); + response = HttpUtils.doPost(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL, headers, sendObject.toJSONString().getBytes(), true); } else { if (Oauth2TokenUtil.validate(authModel.getMcExecToken())) { sendObject = Oauth2TokenUtil.getJSONObject(); - response = HttpUtils.doPost(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL_OAUTH, headers, sendObject.toJSONString().getBytes()); + response = HttpUtils.doPost(HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()), mcUrl + Constants.LOGIN_URL_OAUTH, headers, sendObject.toJSONString().getBytes(), true); } else { System.out.println("ERROR:: oauth token is invalid."); return returnObject; @@ -229,7 +226,7 @@ public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, String hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); String jsessionId = (String) loginJson.get(Constants.JSESSIONID); headers.put(Constants.LOGIN_SECRET, hp4mSecret); - String cookies = Constants.JESEEIONEQ + jsessionId; + String cookies = Constants.JSESSIONID_EQ + jsessionId; if (TOKEN.equals(authModel.getValue())) { String oauth = (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY); if (!StringUtils.isNullOrEmpty(oauth)) { @@ -261,14 +258,25 @@ public String createTempJob(String mcUrl, AuthModel authModel, ProxySettings pro return null; } String hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); - String jsessionId = (String) loginJson.get(Constants.JSESSIONID); + List args = new ArrayList<>(); + args.add(hp4mSecret); + String oauth2 = "", jsessionId = ""; + if (TOKEN.equals(authModel.getValue())) { + oauth2 = loginJson.getAsString(Constants.OAUTH2_COOKIE_KEY); + args.add(oauth2); + } else { + jsessionId = (String) loginJson.get(Constants.JSESSIONID); + args.add(jsessionId); + } - if (thereIsNoArgumentNullOrEmpty(hp4mSecret, jsessionId)) { + if (thereIsNoArgumentNullOrEmpty(args.toArray(new String[0]))) { Map headers = new HashMap<>(); headers.put(Constants.LOGIN_SECRET, hp4mSecret); - StringBuilder cookies = new StringBuilder(Constants.JESEEIONEQ).append(jsessionId); + StringBuilder cookies = new StringBuilder().append(jsessionId); if (TOKEN.equals(authModel.getValue())) { - cookies.append(';').append(Constants.OAUTH2_COOKIE_KEY).append('=').append((String) loginJson.get(Constants.OAUTH2_COOKIE_KEY)); + cookies.append(Constants.OAUTH2_COOKIE_KEY).append('=').append(oauth2); + } else { + cookies.append(Constants.JSESSIONID_EQ).append(jsessionId); } headers.put(Constants.COOKIE, cookies.toString()); HttpUtils.ProxyInfo proxyInfo = proxy == null ? null : HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); @@ -303,7 +311,7 @@ public JSONObject getJobById(String mcUrl, AuthModel authModel, ProxySettings pr if (thereIsNoArgumentNullOrEmpty(jobUUID, hp4mSecret, jsessionId)) { Map headers = new HashMap<>(); headers.put(Constants.LOGIN_SECRET, hp4mSecret); - String cookies = Constants.JESEEIONEQ + jsessionId; + String cookies = Constants.JSESSIONID_EQ + jsessionId; if (TOKEN.equals(authModel.getValue())) { cookies += (";" + Constants.OAUTH2_COOKIE_KEY + "=" + loginJson.get(Constants.OAUTH2_COOKIE_KEY)); } diff --git a/src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java b/src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java new file mode 100644 index 0000000000..f9729e1277 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java @@ -0,0 +1,43 @@ +package com.microfocus.application.automation.tools.model; + +import org.kohsuke.stapler.DataBoundConstructor; + +import java.io.Serializable; + +public class CloudBrowserModel implements Serializable { + private String version; + private String type; + private String region; + private String os; + private String uftOneVersion; + + @DataBoundConstructor + public CloudBrowserModel(String uftOneVersion, String cloudBrowserType, String cloudBrowserVersion, String cloudBrowserRegion, String cloudBrowserOs) { + this.uftOneVersion = uftOneVersion; + this.type = cloudBrowserType; + this.version = cloudBrowserVersion; + this.os = cloudBrowserOs; + this.region = cloudBrowserRegion; + } + + public String getVersion() { + return version; + } + + public String getType() { + return type; + } + + public String getRegion() { + return region; + } + + public String getOs() { + return os; + } + + public String getUftOneVersion() { + return uftOneVersion; + } + +} diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java index 7e9ab0ede9..99928193d6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java @@ -73,7 +73,6 @@ public class RunFromFileSystemModel extends AbstractDescribableImpl @@ -246,20 +244,20 @@ - -
                  -
                  -
                  -
                  -
                  -
                  - Digital Lab Options -
                  - -
                  -
                  -
                  - + +
                  +
                  +
                  +
                  +
                  +
                  + Digital Lab Options +
                  + +
                  +
                  +
                  + - + - + - + @@ -293,8 +291,8 @@ - - + + @@ -308,74 +306,95 @@ +
                  + + + + + + +
                  + + + + + + + + + + + + +
                  +
                  +
                  +
                  - - - - - +
                  + + + + + + + + + + + + + + + + + -
                  - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
                  - - - - - - - - - - - - - - - - - - - - - - - -
                  - - - -
                  -
                  -
                  -
                  - - - - - -
                  -
                  -
                  -
                  -
                  + + + +
                  +
                  +
                  +
                  + + + + + +
                  +
                  +
                  +
                  +
                  - ${mcServer.mcServerName} @@ -108,6 +140,16 @@ + + + + + + + + +
                  From c2f0eee6ac4cbde455938c210d77e53c63a93c60 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 16 Nov 2023 15:57:21 +0200 Subject: [PATCH 2463/2502] increase the timespan to 1 sec before calling startListening4Params --- src/main/webapp/js/specifyParametersUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index edee408f10..7625bfc1fa 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -46,7 +46,7 @@ function setupParamSpecification() { setTimeout(() => { startListening4Params(main); - }, 200); + }, 1000); } function startListening4Params(mainContainer) { From 61b286071f64dad9086ec6cc7e51993c5d198501 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 16 Nov 2023 17:52:06 +0200 Subject: [PATCH 2464/2502] add retry logic --- src/main/webapp/js/specifyParametersUtils.js | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 7625bfc1fa..72636ef012 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -36,7 +36,7 @@ if (typeof BUILDER_SELECTOR === "undefined") { BUILDER_SELECTOR = "div[name='builder'][descriptorid*='com.microfocus.application.automation.tools.run.RunFrom']"; } -function setupParamSpecification() { +function setupParamSpecification(idxOfRetry) { let main = null; if (document.location.href.indexOf("pipeline-syntax") > 0) { main = document; @@ -45,17 +45,25 @@ function setupParamSpecification() { } setTimeout(() => { + if (main == null) { + let divs = document.querySelectorAll(BUILDER_SELECTOR); + if (divs.length == 0) { + let idx = (idxOfRetry || 0); + if (++idx > 5) { + console.error("Failed to initialize Params controls! Please retry or refresh the page."); + return; + } + console.log("Failed to initialize Params controls. Retry=" + idx); + setupParamSpecification(idx); + } else { + main = divs[divs.length - 1]; + } + } startListening4Params(main); - }, 1000); + }, 500); } -function startListening4Params(mainContainer) { - let main = mainContainer; - if (mainContainer == null) { - let divs = document.querySelectorAll(BUILDER_SELECTOR); - main = divs[divs.length - 1]; - } - +function startListening4Params(main) { loadParamInputs(main); const btnAddNewParam = main.querySelector("button[name='addNewParamBtn']"); From d0aee280541bd2da5f59ef1dd62846ce251ec4ae Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 16 Nov 2023 21:39:11 +0200 Subject: [PATCH 2465/2502] small fix --- src/main/webapp/js/specifyParametersUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 72636ef012..6fb7bb8a10 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -55,11 +55,12 @@ function setupParamSpecification(idxOfRetry) { } console.log("Failed to initialize Params controls. Retry=" + idx); setupParamSpecification(idx); + return; } else { main = divs[divs.length - 1]; } } - startListening4Params(main); + startListening4Params(main); }, 500); } From b51d40fccd4400e96d0a446bc721f78480e60c91 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 16 Nov 2023 22:30:14 +0200 Subject: [PATCH 2466/2502] improve the retry mechanism --- src/main/webapp/js/specifyParametersUtils.js | 43 +++++++++++--------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 6fb7bb8a10..9ac5d35da6 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -36,7 +36,7 @@ if (typeof BUILDER_SELECTOR === "undefined") { BUILDER_SELECTOR = "div[name='builder'][descriptorid*='com.microfocus.application.automation.tools.run.RunFrom']"; } -function setupParamSpecification(idxOfRetry) { +function setupParamSpecification() { let main = null; if (document.location.href.indexOf("pipeline-syntax") > 0) { main = document; @@ -44,27 +44,32 @@ function setupParamSpecification(idxOfRetry) { main = document.currentScript.parentElement.closest(BUILDER_SELECTOR); } - setTimeout(() => { - if (main == null) { - let divs = document.querySelectorAll(BUILDER_SELECTOR); - if (divs.length == 0) { - let idx = (idxOfRetry || 0); - if (++idx > 5) { - console.error("Failed to initialize Params controls! Please retry or refresh the page."); - return; - } - console.log("Failed to initialize Params controls. Retry=" + idx); - setupParamSpecification(idx); - return; - } else { - main = divs[divs.length - 1]; - } - } - startListening4Params(main); - }, 500); + if (main == null) { + setTimeout(() => { getFSContainerAndStartListening4Params(0); }, 500); + } else { + setTimeout(() => { startListening4Params(main); }, 500); + } +} + +function getFSContainerAndStartListening4Params(idxOfRetry) { + if (idxOfRetry > 5) { + console.error("Failed to initialize Specific Params controls! Please retry again."); + return null; + } + let divs = document.querySelectorAll(BUILDER_SELECTOR); + if (divs == null || divs.length == 0) { + console.log("Retry to initialize Params controls ..."); + setTimeout(() => { getFSContainerAndStartListening4Params(++idxOfRetry); }, 500); + } else { + startListening4Params(divs[divs.length - 1]); + } } function startListening4Params(main) { + if (main == null) { + console.error("Failed to initialize Specific Params controls! Please retry or refresh the page."); + return; + } loadParamInputs(main); const btnAddNewParam = main.querySelector("button[name='addNewParamBtn']"); From d5a829026d6f99a0825d137d7e6c6ae152a3b5a1 Mon Sep 17 00:00:00 2001 From: wenwen <50070873+wenwen12341234@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:00:36 +0800 Subject: [PATCH 2467/2502] Internal: upload app to specific workspace --- .../application/automation/tools/mc/Constants.java | 2 +- .../automation/tools/mc/JobConfigurationProxy.java | 7 ++++--- .../automation/tools/model/UploadAppPathModel.java | 8 +++++++- .../automation/tools/run/UploadAppBuilder.java | 12 ++---------- .../tools/run/UploadAppBuilder/config.jelly | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java index 424c7e929f..d525e0443a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java @@ -38,7 +38,7 @@ public class Constants { public final static String BOUNDARYSTR = "randomstring"; public final static String DATA = "data"; - public final static String APP_UPLOAD = "/rest/apps/upload?enforceUpload=true"; // make sure unpacked app is uploaded in case of failure during instrumentation + public final static String APP_UPLOAD = "/rest/v2/apps?asyncInstrumentation=false&instrument=true&resign=true&isAppUploadPage=true"; // make sure unpacked app is uploaded in case of failure during instrumentation public final static String CONTENT_TYPE_DOWNLOAD_VALUE = "multipart/form-data; boundary=----"; public final static String FILENAME = "filename"; public static final String LOGIN_SECRET = "x-hp4msecret"; diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 421621cf4f..10f1efe611 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -148,11 +148,12 @@ private JSONObject parseLoginResponse(HttpResponse response) { } //upload app to MC - public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, String appPath) throws IOException { + public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, String appPath, String appUploadWorkspace) throws IOException { File appFile = new File(appPath); - String uploadUrl = mcUrl + Constants.APP_UPLOAD; - + if(!StringUtils.isNullOrEmpty(appUploadWorkspace)){ + uploadUrl += (String.format("&workspaceId=%s",appUploadWorkspace)); + } ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); StringBuilder content = new StringBuilder(); diff --git a/src/main/java/com/microfocus/application/automation/tools/model/UploadAppPathModel.java b/src/main/java/com/microfocus/application/automation/tools/model/UploadAppPathModel.java index d20b827c12..28bb725ffc 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/UploadAppPathModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/UploadAppPathModel.java @@ -42,16 +42,22 @@ */ public class UploadAppPathModel extends AbstractDescribableImpl { private String mcAppPath; + private String mcAppWorkspace; @DataBoundConstructor - public UploadAppPathModel(String mcAppPath) { + public UploadAppPathModel(String mcAppPath, String mcAppWorkspace) { this.mcAppPath = mcAppPath; + this.mcAppWorkspace = mcAppWorkspace; } public String getMcAppPath() { return mcAppPath; } + public String getMcAppWorkspace() { + return mcAppWorkspace; + } + @Extension public static class DescriptorImpl extends Descriptor { public String getDisplayName() { diff --git a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java index a15a7b3d4a..e25ed79d53 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java @@ -100,6 +100,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen String workspace = build.getWorkspace() == null ? "" : build.getWorkspace().toURI().getPath(); for (int i = 1; i <= paths.size(); i++) { + String appUploadWorkspace = paths.get(i - 1).getMcAppWorkspace(); String path = paths.get(i - 1).getMcAppPath(); String originPath = path; if (StringUtils.isNullOrEmpty(path)) { @@ -138,7 +139,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen try { out.println(String.format("starting to upload app %d %s", i, originPath)); - app = job.upload(mcServerUrl, uploadAppModel.getAuthModel(), uploadAppModel.getProxySettings(), path); + app = job.upload(mcServerUrl, uploadAppModel.getAuthModel(), uploadAppModel.getProxySettings(), path, appUploadWorkspace); if (app == null) { if (uploadAppModel.isUseProxy()) { out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s, Proxy url:%s", @@ -244,7 +245,6 @@ public MCServerSettingsModel[] getMcServers() { @JavaScriptMethod public JSONArray getMcWorkspaces(String mcUrl, String authType, String mcUserName, String mcPassword, String mcTenantId, String mcExecToken, boolean useProxy, String proxyAddress, boolean useAuthentication, String proxyUserName, String proxyPassword) { - //ArrayList mcWorkspaceModels= new ArrayList<>(); JSONArray workspaces = null; for (MCServerSettingsModel mcServer : this.getMcServers()) { if (!StringUtils.isNullOrEmpty(mcUrl) @@ -269,14 +269,6 @@ public JSONArray getMcWorkspaces(String mcUrl, String authType, String mcUserNam } } return workspaces; - /*if (workspaces != null) { - for (int i = 0; i < workspaces.size(); i++) { - JSONObject workspace = (JSONObject) workspaces.get(i); - MCWorkspaceModel mcWorkspaceModel = new MCWorkspaceModel(workspace.getAsString("name"), workspace.getAsString("uuid")); - mcWorkspaceModels.add(mcWorkspaceModel); - } - } - return mcWorkspaceModels;*/ } } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index f17fe9238c..004f2e5283 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -143,8 +143,8 @@ - - From 7a2cc353a20803fec6f3fc9204b9653cf20b35e7 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Fri, 17 Nov 2023 11:10:08 +0200 Subject: [PATCH 2468/2502] add error handling and wait cursor while loading the FS --- src/main/webapp/js/specifyParametersUtils.js | 34 ++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/js/specifyParametersUtils.js b/src/main/webapp/js/specifyParametersUtils.js index 9ac5d35da6..ae0947f5af 100644 --- a/src/main/webapp/js/specifyParametersUtils.js +++ b/src/main/webapp/js/specifyParametersUtils.js @@ -37,6 +37,7 @@ if (typeof BUILDER_SELECTOR === "undefined") { } function setupParamSpecification() { + document.body.style.cursor = "wait"; let main = null; if (document.location.href.indexOf("pipeline-syntax") > 0) { main = document; @@ -47,21 +48,36 @@ function setupParamSpecification() { if (main == null) { setTimeout(() => { getFSContainerAndStartListening4Params(0); }, 500); } else { - setTimeout(() => { startListening4Params(main); }, 500); + setTimeout(() => { + try { + startListening4Params(main); + } catch(e) { + console.error(e); + } finally { + document.body.style.cursor = ""; + } + }, 200); } } function getFSContainerAndStartListening4Params(idxOfRetry) { - if (idxOfRetry > 5) { - console.error("Failed to initialize Specific Params controls! Please retry again."); - return null; - } let divs = document.querySelectorAll(BUILDER_SELECTOR); if (divs == null || divs.length == 0) { - console.log("Retry to initialize Params controls ..."); - setTimeout(() => { getFSContainerAndStartListening4Params(++idxOfRetry); }, 500); + if (idxOfRetry > 5) { + console.error("Failed to initialize Specific Params controls! Please retry again."); + document.body.style.cursor = ""; + } else { + console.log("Retry to initialize Specific Params controls ..."); + setTimeout(() => { getFSContainerAndStartListening4Params(++idxOfRetry); }, 500); + } } else { - startListening4Params(divs[divs.length - 1]); + try { + startListening4Params(divs[divs.length - 1]); + } catch (e) { + console.error(e); + } finally { + document.body.style.cursor = ""; + } } } @@ -124,7 +140,7 @@ function startListening4Params(main) { }) }); - const chkAreParamsEnabled = main.querySelector("input[name='areParamsEnabled']"); + const chkAreParamsEnabled = main.querySelector("input[name='areParametersEnabled']"); if (chkAreParamsEnabled) { chkAreParamsEnabled.addEventListener("click", () => cleanParamInput(main)); } From d8328a0c490e5f77249e62bc83ac74d009b2b0d6 Mon Sep 17 00:00:00 2001 From: Daniel Danan Date: Sun, 19 Nov 2023 10:45:07 +0200 Subject: [PATCH 2469/2502] Improvement: Allow timeslot duration to be parameterized. --- .../automation/tools/pc/PcClient.java | 7 +++-- .../automation/tools/pc/PcModel.java | 30 ++++++++++++++----- .../automation/tools/run/PcBuilder.java | 4 +-- .../tools/run/PcBuilder/config.jelly | 14 +++++---- .../tools/run/PcBuilder/config.properties | 6 ++-- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java b/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java index 63f82508cd..5d4926e47e 100644 --- a/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java +++ b/src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java @@ -148,14 +148,15 @@ public int startRun() throws NumberFormatException, ClientProtocolException, PcE Messages.Project(), model.getAlmProject(true), Messages.TestID(), Integer.parseInt(model.getTestId(true)), Messages.TestInstanceID(), testInstance, - Messages.TimeslotDuration(), model.getTimeslotDuration(), + Messages.TimeslotDuration(), + new TimeslotDuration(model.getTimeslotDurationHours(true), model.getTimeslotDurationMinutes(true)), Messages.PostRunAction(), model.getPostRunAction().getValue(), Messages.UseVUDS(), model.isVudsMode())); PcRunResponse response = null; try { response = restProxy.startRun(testID, testInstance, - model.getTimeslotDuration(), + new TimeslotDuration(model.getTimeslotDurationHours(true),model.getTimeslotDurationMinutes(true)), model.getPostRunAction().getValue(), model.isVudsMode(), 0); @@ -202,7 +203,7 @@ public int startRun() throws NumberFormatException, ClientProtocolException, PcE try { response = restProxy.startRun(testID, testInstance, - model.getTimeslotDuration(), + new TimeslotDuration(model.getTimeslotDurationHours(true) ,model.getTimeslotDurationMinutes(true)), model.getPostRunAction().getValue(), model.isVudsMode(), 0); diff --git a/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java b/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java index 31950908b6..04bffb95b9 100644 --- a/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/pc/PcModel.java @@ -53,7 +53,6 @@ public class PcModel { private final String almProject; private final String testId; private final String autoTestInstanceID; - private final TimeslotDuration timeslotDuration; private final PostRunAction postRunAction; private final boolean vudsMode; private final String description; @@ -68,7 +67,8 @@ public class PcModel { private String retry; private String retryDelay; private String retryOccurrences; - + private String timeslotDurationHours; + private String timeslotDurationMinutes; @DataBoundConstructor public PcModel(String serverAndPort, String pcServerName, String credentialsId, String almDomain, String almProject, @@ -84,7 +84,8 @@ public PcModel(String serverAndPort, String pcServerName, String credentialsId, this.testId = testId; this.autoTestInstanceID = autoTestInstanceID; this.testInstanceId = testInstanceId; - this.timeslotDuration = new TimeslotDuration(timeslotDurationHours, timeslotDurationMinutes); + this.timeslotDurationHours = timeslotDurationHours; + this.timeslotDurationMinutes = timeslotDurationMinutes; this.postRunAction = postRunAction; this.vudsMode = vudsMode; this.description = description; @@ -243,9 +244,24 @@ public String getAutoTestInstanceID() { return this.autoTestInstanceID; } - public TimeslotDuration getTimeslotDuration() { + public String getTimeslotDurationHours() { + + return this.timeslotDurationHours; + } + + public String getTimeslotDurationHours(boolean fromPcClient) { + + return fromPcClient ? useParameterIfNeeded(buildParameters, this.timeslotDurationHours) : getTimeslotDurationHours(); + } + + public String getTimeslotDurationMinutes() { + + return this.timeslotDurationMinutes; + } + + public String getTimeslotDurationMinutes(boolean fromPcClient) { - return this.timeslotDuration; + return fromPcClient ? useParameterIfNeeded(buildParameters, this.timeslotDurationMinutes) : getTimeslotDurationMinutes(); } public boolean isVudsMode() { @@ -295,11 +311,11 @@ public String runParamsToString() { String trendString = ("USE_ID").equals(addRunToTrendReport) ? String.format(", TrendReportID = '%s'", trendReportId) : ""; return String.format("[PCServer='%s', CredentialsId='%s', Domain='%s', Project='%s', TestID='%s', " + - "TestInstanceID='%s', TimeslotDuration='%s', PostRunAction='%s', " + + "TestInstanceID='%s', TimeslotDurationHours='%s', TimeslotDurationMinutes='%s', PostRunAction='%s', " + "VUDsMode='%s, trending='%s', HTTPSProtocol='%s', authenticateWithToken='%s']", pcServerName, credentialsId, almDomain, almProject, testId, - testInstanceId, timeslotDuration, postRunAction.getValue(), + testInstanceId, timeslotDurationHours, timeslotDurationMinutes, postRunAction.getValue(), vudsModeString, trendString, HTTPSProtocol, authenticateWithToken); } diff --git a/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java index 6bbf46b30d..4d7b1be19d 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/PcBuilder.java @@ -986,11 +986,11 @@ public String getAlmDomain() { } public String getTimeslotDurationHours() { - return timeslotDurationHours; + return getPcModel().getTimeslotDurationHours(); } public String getTimeslotDurationMinutes() { - return timeslotDurationMinutes; + return getPcModel().getTimeslotDurationMinutes(); } public PostRunAction getPostRunAction() { diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly index 32b50c0bdf..f659c8e598 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/PcBuilder/config.jelly @@ -332,13 +332,14 @@ + else if (value == 480) minutes.value = 0; }" /> + value = (v < 30 && document.getElementById('${h_id}').value == 0) ? 30 : v; }" /> Publish OpenText \ tests result option in the Post-build \ Actions section so that the tests results are published. -ParametrizationMessage= The following fields can be parametrized: ''LRE Server'', ''Domain'', \ - ''Project'', ''Test ID'', ''Test Instance ID'', ''Trend report ID'' and ''Local Proxy''. \ No newline at end of file +ParametrizationMessage=The following fields can be parametrized: ''LRE Server'', ''LRE Credentials'', \ + ''Domain'', ''Project'', ''Test ID'', ''Test Instance ID'', \ + ''Trend report ID'', ''Local Proxy'', ''Proxy Credentials'' \ + and ''Timeslot Duration'' (in two separate parameters: ''Hours'' and ''Minutes''). \ No newline at end of file From 0ec1da09d76eb5f0fe79fc7c9f866067d0911d9f Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 20 Nov 2023 23:35:47 +0200 Subject: [PATCH 2470/2502] * US-865003 [ParallelRunner] Support Access Key * do not set URL field in CloudBrowser AOM if empty --- .../ParallelRunnerEnvironmentUtil.cs | 33 +++++++----- .../ParallelTestRunConfiguration.cs | 2 + HpToolsLauncher/TestRunners/GuiTestRunner.cs | 10 ++-- .../automation/tools/mc/AuthType.java | 18 +++++++ .../tools/mc/JobConfigurationProxy.java | 26 +++++++--- .../automation/tools/model/AuthModel.java | 51 ++++++++----------- .../tools/run/RunFromFileBuilder/config.jelly | 2 +- 7 files changed, 86 insertions(+), 56 deletions(-) create mode 100644 src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java diff --git a/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs index d1bf6dbb67..39ee852b96 100644 --- a/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs +++ b/HpToolsLauncher/ParallelRunner/ParallelRunnerEnvironmentUtil.cs @@ -27,11 +27,14 @@ */ using HpToolsLauncher.ParallelTestRunConfiguraion; +using HpToolsLauncher.Utils; using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using System.Web.Script.Serialization; +using AuthType = HpToolsLauncher.McConnectionInfo.AuthType; namespace HpToolsLauncher.ParallelRunner { @@ -383,29 +386,31 @@ public static ProxySettings GetMCProxySettings(McConnectionInfo mcConnectionInfo /// /// Parses the MC settings and returns the corresponding UFT settings. /// - /// the mc settings + /// the mc settings /// the parallel runner uft settings - public static UFTSettings ParseMCSettings(McConnectionInfo mcConnectionInfo) + public static UFTSettings ParseMCSettings(McConnectionInfo mc) { - if (mcConnectionInfo == null) return null; + if (mc == null) return null; - if (string.IsNullOrEmpty(mcConnectionInfo.HostAddress) || - string.IsNullOrEmpty(mcConnectionInfo.UserName) || - string.IsNullOrEmpty(mcConnectionInfo.Password) || - string.IsNullOrEmpty(mcConnectionInfo.HostPort)) + if (mc.HostAddress.IsNullOrEmpty() || + (mc.MobileAuthType == AuthType.UsernamePassword && mc.UserName.IsNullOrEmpty() && mc.Password.IsNullOrEmpty()) || + (mc.MobileAuthType == AuthType.AuthToken && mc.ExecToken.IsNullOrEmpty()) || + string.IsNullOrEmpty(mc.HostPort)) return null; MCSettings mcSettings = new MCSettings { - username = mcConnectionInfo.UserName, - password = WinUserNativeMethods.ProtectBSTRToBase64(mcConnectionInfo.Password), - hostname = mcConnectionInfo.HostAddress, - port = Convert.ToInt32(mcConnectionInfo.HostPort), - protocol = mcConnectionInfo.UseSslAsInt > 0 ? "https" : "http", - tenantId = mcConnectionInfo.TenantId, + username = mc.UserName, + password = WinUserNativeMethods.ProtectBSTRToBase64(mc.Password), + hostname = mc.HostAddress, + port = Convert.ToInt32(mc.HostPort), + protocol = mc.UseSSL ? "https" : "http", + tenantId = mc.TenantId, + authType = (int)mc.MobileAuthType, + accessKey = Convert.ToBase64String(Encoding.UTF8.GetBytes(mc.ExecToken)) }; - var proxy = GetMCProxySettings(mcConnectionInfo); + var proxy = GetMCProxySettings(mc); // set the proxy information if we have it if (proxy != null) diff --git a/HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs b/HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs index adf6fbc632..6d6e02896b 100644 --- a/HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs +++ b/HpToolsLauncher/ParallelRunner/ParallelTestRunConfiguration.cs @@ -44,6 +44,8 @@ public class MCSettings public string tenantId { get; set; } public string workspaceId { get; set; } public ProxySettings proxy { get; set; } + public int authType { get; set; } + public string accessKey { get; set; } } public class ProxySettings { diff --git a/HpToolsLauncher/TestRunners/GuiTestRunner.cs b/HpToolsLauncher/TestRunners/GuiTestRunner.cs index e794ec17cc..d44a4b6c2e 100644 --- a/HpToolsLauncher/TestRunners/GuiTestRunner.cs +++ b/HpToolsLauncher/TestRunners/GuiTestRunner.cs @@ -38,6 +38,7 @@ using System.Runtime.InteropServices; using System.Threading; using Resources = HpToolsLauncher.Properties.Resources; +using AuthType = HpToolsLauncher.McConnectionInfo.AuthType; namespace HpToolsLauncher { @@ -339,17 +340,17 @@ private void SetMobileInfo() tulip.SetTestOptionsVal(MOBILE_HOST_PORT, _mcConnection.HostPort); } - McConnectionInfo.AuthType mcAuthType = _mcConnection.MobileAuthType; + AuthType mcAuthType = _mcConnection.MobileAuthType; switch (mcAuthType) { - case McConnectionInfo.AuthType.AuthToken: + case AuthType.AuthToken: var token = _mcConnection.GetAuthToken(); tulip.SetTestOptionsVal(MOBILE_CLIENTID, token.ClientId); tulip.SetTestOptionsVal(MOBILE_SECRET, token.SecretKey); break; - case McConnectionInfo.AuthType.UsernamePassword: + case AuthType.UsernamePassword: if (!_mcConnection.UserName.IsNullOrEmpty()) { tulip.SetTestOptionsVal(MOBILE_USER, _mcConnection.UserName); @@ -769,7 +770,8 @@ private bool HandleCloudBrowser(Version qtpVersion, ref string errorReason) var launcher = _qtpApplication.Test.Settings.Launchers[WEB]; launcher.Active = true; launcher.SetLab(CLOUD_BROWSER); - launcher.Address = _cloudBrowser.Url; + if (!_cloudBrowser.Url.IsNullOrWhiteSpace()) + launcher.Address = _cloudBrowser.Url; launcher.CloudBrowser.OS = _cloudBrowser.OS; launcher.CloudBrowser.Browser = _cloudBrowser.Browser; launcher.CloudBrowser.BrowserVersion = _cloudBrowser.Version; diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java b/src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java new file mode 100644 index 0000000000..fe46ef47d5 --- /dev/null +++ b/src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java @@ -0,0 +1,18 @@ +package com.microfocus.application.automation.tools.mc; + +public enum AuthType { + Base, + Token, + Unknown; + + public static AuthType fromString(String value) { + switch(value.toLowerCase()) { + case "base": + return AuthType.Base; + case "token": + return AuthType.Token; + default: + return AuthType.Unknown; + } + } +} diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 80765ef631..612b7bef46 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -76,7 +76,8 @@ public JSONObject loginToMC(String mcUrl, AuthModel authModel, ProxySettings pro proxy = new ProxySettings(); } HttpResponse response; - if ("base".equals(authModel.getValue())) { + AuthType authType = authModel.getAuthType(); + if (authType == AuthType.Base) { String tempUsername = authModel.getMcUserName(); if (!StringUtils.isNullOrEmpty(authModel.getMcTenantId())) { tempUsername += "#" + authModel.getMcTenantId(); @@ -92,7 +93,7 @@ public JSONObject loginToMC(String mcUrl, AuthModel authModel, ProxySettings pro System.out.println("ERROR:: oauth token is invalid."); return returnObject; } - return parseLoginResponse(response); + return parseLoginResponse(response, authType); } catch (Exception e) { e.printStackTrace(); } @@ -112,7 +113,7 @@ private JSONObject generateNewToken(String mcUrl, String accessKey, ProxySetting JSONObject sendObject = Oauth2TokenUtil.getJSONObject(); String url = mcUrl + Constants.OAUTH_TOKEN_URL; response = doPost(proxy, url, headers, sendObject); - return parseTokenResponse(response); + return parseTokenResponse(response, AuthType.Token); } System.out.println("ERROR: oauth token is invalid."); return null; @@ -128,7 +129,7 @@ private Map getRequestHeaders() { headers.put(Constants.CONTENT_TYPE, "application/json;charset=UTF-8"); return headers; } - private JSONObject parseLoginResponse(HttpResponse response) { + private JSONObject parseLoginResponse(HttpResponse response, AuthType authType) { if (response == null || response.getHeaders() == null) { return null; } @@ -138,13 +139,24 @@ private JSONObject parseLoginResponse(HttpResponse response) { if (hp4mSecretList != null && !hp4mSecretList.isEmpty() && !StringUtils.isNullOrEmpty(hp4mSecretList.get(0))) { returnObject.put(Constants.LOGIN_SECRET, hp4mSecretList.get(0)); } - returnObject.put(Constants.COOKIES, response.getCookiesAsString()); + if (authType == AuthType.Token && headerFields.containsKey(Constants.SET_COOKIE)) { + List cookies = headerFields.get(Constants.SET_COOKIE); + if (cookies != null && !cookies.isEmpty()) { + for (String cookie : cookies) { + if (cookie.startsWith(Constants.OAUTH2_COOKIE_KEY)) { + returnObject.put(Constants.OAUTH2_COOKIE_KEY, getCookieValue(cookie, Constants.OAUTH2_COOKIE_KEY)); + break; + } + } + } + } + returnObject.put(Constants.COOKIES, response.getCookiesAsString()); return returnObject; } - private JSONObject parseTokenResponse(HttpResponse response) { - JSONObject returnObject = parseLoginResponse(response); + private JSONObject parseTokenResponse(HttpResponse response, AuthType authType) { + JSONObject returnObject = parseLoginResponse(response, authType); if (returnObject != null) { JSONObject body = response.getJsonObject(); if (body != null) { diff --git a/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java b/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java index 870b53dc80..de7b750d25 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java @@ -1,16 +1,19 @@ package com.microfocus.application.automation.tools.model; +import com.microfocus.application.automation.tools.mc.AuthType; import hudson.util.Secret; +import org.apache.commons.lang3.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import java.io.Serializable; public class AuthModel implements Serializable { - private String mcUserName; - private Secret mcPassword; - private String mcTenantId; - private Secret mcExecToken; - private String value; + private final String mcUserName; + private final Secret mcPassword; + private final String mcTenantId; + private final Secret mcExecToken; + private final String value; + private AuthType authType; @DataBoundConstructor public AuthModel(String mcUserName, String mcPassword, String mcTenantId, String mcExecToken, String value) { @@ -19,12 +22,16 @@ public AuthModel(String mcUserName, String mcPassword, String mcTenantId, String this.mcTenantId = mcTenantId; this.mcExecToken = Secret.fromString(mcExecToken); this.value = value; + authType = AuthType.fromString(value); + if (authType == AuthType.Unknown) { + if (StringUtils.isNotBlank(mcExecToken)) { + authType = AuthType.Token; + } else if (StringUtils.isNotBlank(mcUserName) && StringUtils.isNotBlank(mcPassword)) { + authType = AuthType.Base; + } + } } - public AuthModel(String mcExecToken) { - this.mcExecToken = Secret.fromString(mcExecToken); - this.value = "token"; - } public String getMcUserName() { return mcUserName; } @@ -49,30 +56,10 @@ public String getMcExecToken() { } } - public void setMcUserName(String mcUserName) { - this.mcUserName = mcUserName; - } - - public void setMcPassword(String mcPassword) { - this.mcPassword = Secret.fromString(mcPassword); - } - - public void setMcTenantId(String mcTenantId) { - this.mcTenantId = mcTenantId; - } - - public void setMcExecToken(String mcExecToken) { - this.mcExecToken = Secret.fromString(mcExecToken); - } - public String getValue() { return value; } - public void setValue(String value) { - this.value = value; - } - public String getMcEncryptedExecToken() { if (null != mcExecToken) { return mcExecToken.getEncryptedValue(); @@ -88,4 +75,8 @@ public String getMcEncryptedPassword() { return null; } } -} + + public AuthType getAuthType() { + return authType; + } +} \ No newline at end of file diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 43ca3a6db9..91a30c23cb 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -312,7 +312,7 @@ - + From 21b7b9ff0afb9b6824f87b75006b1a3bef5d341e Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Mon, 20 Nov 2023 23:43:10 +0200 Subject: [PATCH 2471/2502] US-828069 [Jenkins][Parallel][Mobile] Run parallel mobile tests with Access Key authentication --- .../application/automation/tools/mc/AuthType.java | 12 ++++++------ .../automation/tools/mc/JobConfigurationProxy.java | 6 +++--- .../automation/tools/model/AuthModel.java | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java b/src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java index fe46ef47d5..baa3c889f6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/AuthType.java @@ -1,18 +1,18 @@ package com.microfocus.application.automation.tools.mc; public enum AuthType { - Base, - Token, - Unknown; + BASE, + TOKEN, + UNKNOWN; public static AuthType fromString(String value) { switch(value.toLowerCase()) { case "base": - return AuthType.Base; + return AuthType.BASE; case "token": - return AuthType.Token; + return AuthType.TOKEN; default: - return AuthType.Unknown; + return AuthType.UNKNOWN; } } } diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 612b7bef46..498f1004d4 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -77,7 +77,7 @@ public JSONObject loginToMC(String mcUrl, AuthModel authModel, ProxySettings pro } HttpResponse response; AuthType authType = authModel.getAuthType(); - if (authType == AuthType.Base) { + if (authType == AuthType.BASE) { String tempUsername = authModel.getMcUserName(); if (!StringUtils.isNullOrEmpty(authModel.getMcTenantId())) { tempUsername += "#" + authModel.getMcTenantId(); @@ -113,7 +113,7 @@ private JSONObject generateNewToken(String mcUrl, String accessKey, ProxySetting JSONObject sendObject = Oauth2TokenUtil.getJSONObject(); String url = mcUrl + Constants.OAUTH_TOKEN_URL; response = doPost(proxy, url, headers, sendObject); - return parseTokenResponse(response, AuthType.Token); + return parseTokenResponse(response, AuthType.TOKEN); } System.out.println("ERROR: oauth token is invalid."); return null; @@ -139,7 +139,7 @@ private JSONObject parseLoginResponse(HttpResponse response, AuthType authType) if (hp4mSecretList != null && !hp4mSecretList.isEmpty() && !StringUtils.isNullOrEmpty(hp4mSecretList.get(0))) { returnObject.put(Constants.LOGIN_SECRET, hp4mSecretList.get(0)); } - if (authType == AuthType.Token && headerFields.containsKey(Constants.SET_COOKIE)) { + if (authType == AuthType.TOKEN && headerFields.containsKey(Constants.SET_COOKIE)) { List cookies = headerFields.get(Constants.SET_COOKIE); if (cookies != null && !cookies.isEmpty()) { for (String cookie : cookies) { diff --git a/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java b/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java index de7b750d25..2402511966 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/AuthModel.java @@ -23,11 +23,11 @@ public AuthModel(String mcUserName, String mcPassword, String mcTenantId, String this.mcExecToken = Secret.fromString(mcExecToken); this.value = value; authType = AuthType.fromString(value); - if (authType == AuthType.Unknown) { + if (authType == AuthType.UNKNOWN) { if (StringUtils.isNotBlank(mcExecToken)) { - authType = AuthType.Token; + authType = AuthType.TOKEN; } else if (StringUtils.isNotBlank(mcUserName) && StringUtils.isNotBlank(mcPassword)) { - authType = AuthType.Base; + authType = AuthType.BASE; } } } From afa0845deaebf556b68e580715c951635458d78e Mon Sep 17 00:00:00 2001 From: wenwen <50070873+wenwen12341234@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:21:22 +0800 Subject: [PATCH 2472/2502] Internal: upload multiple apps to different workspaces --- .../tools/run/UploadAppBuilder/config.jelly | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index 004f2e5283..7548175bc9 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -54,12 +54,7 @@ document.getElementsByName("uploadApp.fsProxyPassword")[0].disabled="true"; } } - function GetMcWorkspaces(obj){ - var index = obj.selectedIndex; - var val = obj.options[index].value; - alert(val); - } - function refreshWorkspaces(a){ + function refreshWorkspaces(event,a){ var mcUrl = document.getElementsByName("uploadApp.mcServerName")[0].value; var authType = document.querySelector('input[name$="authModel"]:checked').value; var mcUserName = document.getElementsByName("uploadApp.mcUserName")[0].value; @@ -76,18 +71,16 @@ const workspaces = r.responseJSON; workspaces.forEach((item) => { str = str + ""; }); console.log(str); - document.getElementById('mcWorkspaces').innerHTML= str; + event.target.nextElementSibling.innerHTML= str; }); } - ${mcServer.mcServerName} @@ -140,16 +133,11 @@ - - - + - - -
                  From 33bd383af60e3fe1c30e24e8014819ddbc05514c Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Tue, 21 Nov 2023 14:06:07 +0200 Subject: [PATCH 2473/2502] fix the button label after loading --- src/main/webapp/configure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index 091143fcf1..0110509116 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -102,7 +102,7 @@ function startLoadInfo(a, b, path) { async function triggerBtnState(b, disabled) { b.disabled = disabled; if (b.name == "cloudBrowserLab") { - b.value = disabled ? "Loading ..." : "Cloud Browser Lab"; + b.value = disabled ? "Loading ..." : "Browser settings"; } else if (b.name == "digitalLabWizard") { b.value = disabled ? "Loading ..." : "Wizard"; } else if (b.name == "env-wizard") { From 21a052f03a2197bc4fe87e2008d18f7861602384 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Wed, 22 Nov 2023 18:22:45 +0200 Subject: [PATCH 2474/2502] temporary revert some Cloud Browser support changes --- .../tools/mc/JobConfigurationProxy.java | 6 +-- .../tools/model/CloudBrowserModel.java | 8 +--- .../tools/model/RunFromFileSystemModel.java | 4 +- .../tools/run/RunFromFileBuilder.java | 8 ++-- .../tools/run/RunFromFileBuilder/config.jelly | 39 ++----------------- src/main/webapp/configure.js | 26 +++---------- 6 files changed, 19 insertions(+), 72 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 498f1004d4..b1c9854a85 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -262,7 +262,7 @@ public JSONObject getJobById(String mcUrl, AuthModel authModel, ProxySettings pr return removeIcon(jobJsonObject); } - public JSONObject getBrowserLab(String mcUrl, String accessKey, ProxySettings proxy, String uftOneVersion) { + public JSONObject getBrowserLab(String mcUrl, String accessKey, ProxySettings proxy) { JSONObject jsonObject = null; try { @@ -274,14 +274,14 @@ public JSONObject getBrowserLab(String mcUrl, String accessKey, ProxySettings pr String token = loginJson.getAsString(Constants.ACCESS_TOKEN); String tokenType = loginJson.getAsString(Constants.TOKEN_TYPE); String cookies = loginJson.getAsString(Constants.COOKIES); - if (thereIsNoArgumentNullOrEmpty(uftOneVersion, hp4mSecret, token, tokenType, cookies)) { + if (thereIsNoArgumentNullOrEmpty(hp4mSecret, token, tokenType, cookies)) { Map headers = new HashMap<>(); headers.put(Constants.ACCEPT, "application/json"); headers.put(Constants.LOGIN_SECRET, hp4mSecret); headers.put(Constants.COOKIE, cookies); headers.put(RESTConstants.AUTHORIZATION, String.format("%s %s", tokenType, token)); HttpUtils.ProxyInfo proxyInfo = proxy == null ? null : HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); - String url = String.format("%s%s?toolVersion=%s", mcUrl, Constants.GET_BROWSER_LAB_URL, uftOneVersion); + String url = String.format("%s%s?toolVersion=23.4", mcUrl, Constants.GET_BROWSER_LAB_URL); HttpResponse response = HttpUtils.doGet(proxyInfo, url, headers, null); if (response != null && response.getJsonObject() != null) { diff --git a/src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java b/src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java index fd664c5319..9612a664e6 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/CloudBrowserModel.java @@ -10,12 +10,10 @@ public class CloudBrowserModel implements Serializable { private String type; private String region; private String os; - private String uftOneVersion; @DataBoundConstructor - public CloudBrowserModel(String uftOneVersion, String cloudBrowserUrl, String cloudBrowserType, String cloudBrowserVersion, String cloudBrowserRegion, String cloudBrowserOs) { + public CloudBrowserModel(String cloudBrowserUrl, String cloudBrowserType, String cloudBrowserVersion, String cloudBrowserRegion, String cloudBrowserOs) { this.url = cloudBrowserUrl; - this.uftOneVersion = uftOneVersion; this.type = cloudBrowserType; this.version = cloudBrowserVersion; this.os = cloudBrowserOs; @@ -38,10 +36,6 @@ public String getOs() { return os; } - public String getUftOneVersion() { - return uftOneVersion; - } - public String getUrl() { return url; } diff --git a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java index 4a7e952ce7..22eed53dee 100644 --- a/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java +++ b/src/main/java/com/microfocus/application/automation/tools/model/RunFromFileSystemModel.java @@ -118,7 +118,7 @@ public RunFromFileSystemModel(String fsTests, String fsTimeout, String fsUftRunM String ignoreErrorStrings, String analysisTemplate, String displayController, String mcServerName, AuthModel authModel, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, - String fsExtraApps, String fsJobId, ProxySettings proxySettings, boolean useSSL, String fsReportPath, CloudBrowserModel cloudBrowserModel) { + String fsExtraApps, String fsJobId, ProxySettings proxySettings, boolean useSSL, String fsReportPath) { this.setFsTests(fsTests); this.fsTimeout = fsTimeout; @@ -147,7 +147,7 @@ public RunFromFileSystemModel(String fsTests, String fsTimeout, String fsUftRunM this.proxySettings = proxySettings; this.useSSL = useSSL; this.authModel = authModel; - this.cloudBrowserModel = cloudBrowserModel; + this.cloudBrowserModel = null; } /** diff --git a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java index bf87797d60..8217725148 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/RunFromFileBuilder.java @@ -168,13 +168,13 @@ public RunFromFileBuilder(String fsTests, String fsTimeout, String fsUftRunMode, String analysisTemplate, String mcServerName, AuthModel authModel, String fsDeviceId, String fsTargetLab, String fsManufacturerAndModel, String fsOs, String fsAutActions, String fsLaunchAppName, String fsDevicesMetrics, String fsInstrumented, String fsExtraApps, String fsJobId, ProxySettings proxySettings, - boolean useSSL, boolean isParallelRunnerEnabled, String fsReportPath, CloudBrowserModel cloudBrowserModel) { + boolean useSSL, boolean isParallelRunnerEnabled, String fsReportPath) { this.isParallelRunnerEnabled = isParallelRunnerEnabled; runFromFileModel = new RunFromFileSystemModel(fsTests, fsTimeout, fsUftRunMode, controllerPollingInterval, perScenarioTimeOut, ignoreErrorStrings, displayController, analysisTemplate, mcServerName, authModel, fsDeviceId, fsTargetLab, fsManufacturerAndModel, fsOs, fsAutActions, fsLaunchAppName, fsDevicesMetrics, fsInstrumented, fsExtraApps, fsJobId, - proxySettings, useSSL, fsReportPath, cloudBrowserModel); + proxySettings, useSSL, fsReportPath); } /** @@ -1071,12 +1071,12 @@ public String getMcServerUrl(String serverName) { } @JavaScriptMethod - public JSONObject getBrowserLab(String serverName, String accessKey, boolean useProxyAuth, String proxyAddr, String proxyUserName, String proxyPassword, String uftOneVersion) { + public JSONObject getBrowserLab(String serverName, String accessKey, boolean useProxyAuth, String proxyAddr, String proxyUserName, String proxyPassword) { String serverUrl = getMcServerUrl(serverName); if (StringUtils.isNotBlank(serverUrl)) { serverUrl = StringUtils.stripEnd(serverUrl, "/"); ProxySettings proxy = new ProxySettings(useProxyAuth, proxyAddr, proxyUserName, proxyPassword); - return instance.getBrowserLab(serverUrl, accessKey, proxy, uftOneVersion); + return instance.getBrowserLab(serverUrl, accessKey, proxy); } return null; } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 91a30c23cb..98f6d3c387 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -71,6 +71,7 @@ background: none; } textarea.jenkins-input, textarea.setting-input{ + height: 5em; resize: vertical; } div.setting-main { @@ -82,16 +83,11 @@ div.repeated-container { width:100%; } - .cloud-browser-section { - width:50%; + .device-info-section { + width:100%; margin-bottom: 10px; --section-padding: 5px; } - input[name="uftOneVersion"], input[name="cloudBrowserLab"] { - display: inline-block; - overflow: hidden; - width: 140px; - } @@ -307,33 +303,6 @@ -
                  - - - - - - - - - -
                  - - - - - - - - - - - - -
                  -
                  -
                  -
                  @@ -375,7 +344,7 @@ - +
                  diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index 0110509116..8dce5c71ef 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -46,7 +46,6 @@ function getDigitalLab(divMain) { err: dl.querySelector("#errorMessage"), recreateJob: dl.querySelector('input[name="recreateJob"]').checked, jobId: dl.querySelector('input[name="fsJobId"]').value, - uftOneVersion: dl.querySelector('input[name="uftOneVersion"]'), deviceInfo: dl.querySelector(".device-info-section") }; if (o.authType == "base") { @@ -78,23 +77,14 @@ function setupDigitalLab() { setTimeout(function() { prepareDigitalLab(divMain)}, 100); } function prepareDigitalLab(divMain) { - if (divMain == null) { // this block is needed for IE, but also for non-IE browsers when adding more than one FS build step +/* if (divMain == null) { // this block is needed for IE, but also for non-IE browsers when adding more than one FS build step let divs = document.querySelectorAll(RUN_FROM_FS_BUILDER_SELECTOR); divMain = divs[divs.length - 1]; - } - const dl = divMain.querySelector("#mobileSpecificSection"); - const cldBM = dl.querySelector('input[name="cloudBrowserModel"]'); - const dvcInfo = dl.querySelector(".device-info-section"); - cldBM.onclick = (e) => { - dvcInfo.style.display = e.target.checked ? "none" : "block"; - }; - if (cldBM.checked) { - dvcInfo.style.display = "none"; - } + }*/ } -function startLoadInfo(a, b, path) { - triggerBtnState(b, true); +async function startLoadInfo(a, b, path) { + await triggerBtnState(b, true); setTimeout( async () => { await loadInfo(a, b, path)}, 100); } @@ -126,12 +116,6 @@ async function loadInfo(a, b, path) { } if (b.name == "cloudBrowserLab") { - if (dl.uftOneVersion.value.trim() == "") { - alert("UFT One Version is required!"); - dl.uftOneVersion.focus(); - await triggerBtnState(b, false); - return; - } await loadBrowserLabInfo(a, b, dl, path); } else if (b.name == "digitalLabWizard") { await loadMobileInfo(a, b, dl); @@ -157,7 +141,7 @@ async function loadBrowserLabInfo(a, b, o, path) { if (div.browsers?.length) { await fillAndShowDDLs(b, div, dlg); } else { - await a.getBrowserLab(o.serverName, o.execToken, o.useProxyAuth, o.proxyAddress, o.proxyUserName, o.proxyPassword, o.uftOneVersion.value, async (response) => { + await a.getBrowserLab(o.serverName, o.execToken, o.useProxyAuth, o.proxyAddress, o.proxyUserName, o.proxyPassword, async (response) => { try { if (response?.responseJSON) { const json = response.responseJSON; From c0fa1be6d713a266b23bece0023235952cdd937c Mon Sep 17 00:00:00 2001 From: wenwen <50070873+wenwen12341234@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:22:26 +0800 Subject: [PATCH 2475/2502] Internal: bug fix during debug --- .../automation/tools/mc/Constants.java | 1 + .../automation/tools/mc/HttpUtils.java | 4 + .../tools/mc/JobConfigurationProxy.java | 99 +++++++++++-------- .../tools/run/UploadAppBuilder.java | 83 +++++++++++----- .../tools/run/UploadAppBuilder/config.jelly | 36 +++++-- 5 files changed, 155 insertions(+), 68 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java index d525e0443a..167bb1be8b 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java @@ -56,6 +56,7 @@ public class Constants { public static final String CREATE_JOB_URL = "/rest/job/createTempJob"; public static final String GET_JOB_UEL = "/rest/job/"; public static final String GET_ALL_WORKSPACES_URL = "/rest/v2/workspaces"; + public static final String GET_WORKSPACE_URL = "/rest/v2/workspaces"; public final static String ICON = "icon"; public final static String JESEEIONEQ = "JSESSIONID="; public final static String TENANT_COOKIE = "TENANT_ID_COOKIE"; diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java index 1584c99745..b37095d8b2 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/HttpUtils.java @@ -112,6 +112,10 @@ private static HttpResponse doHttp(ProxyInfo proxyInfo, String requestMethod, St response.setJsonObject((JSONObject) object); } else if (object instanceof JSONArray) { response.setJsonArray((JSONArray) object); + } else if(object instanceof Boolean){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("error", !((Boolean) object).booleanValue()); + response.setJsonObject(jsonObject); } } else { System.out.println(requestMethod + " " + connectionUrl + " failed with response code:" + responseCode); diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 10f1efe611..bbb4dfde9a 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -110,12 +110,16 @@ public JSONObject loginToMC(String mcUrl, AuthModel authModel, ProxySettings pro } private JSONObject parseLoginResponse(HttpResponse response) { + JSONObject returnObject = new JSONObject(); if (response == null || response.getHeaders() == null) { return null; + }else if(response.getJsonObject() != null){ + if(response.getJsonObject().containsKey("error") && response.getJsonObject().getAsString("error").equals("true")){ + return null; + } } Map> headerFields = response.getHeaders(); List hp4mSecretList = headerFields.get(Constants.LOGIN_SECRET); - JSONObject returnObject = new JSONObject(); if (hp4mSecretList != null && !hp4mSecretList.isEmpty()) { setToRespJSON(returnObject, Constants.LOGIN_SECRET, hp4mSecretList.get(0)); } @@ -147,8 +151,55 @@ private JSONObject parseLoginResponse(HttpResponse response) { return returnObject; } + //check workspace exist or not in MC + public JSONObject isWorkspaceExist(Map headers, String mcUrl, ProxySettings proxy, String appUploadWorkspace) throws IOException { + if (null == proxy) { + proxy = new ProxySettings(); + } + String getWorkspaceUrl = mcUrl + Constants.GET_WORKSPACE_URL; + if(!StringUtils.isNullOrEmpty(getWorkspaceUrl)){ + getWorkspaceUrl += (String.format("/%s",appUploadWorkspace)); + } + HttpUtils.ProxyInfo proxyInfo = HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); + HttpResponse response = HttpUtils.doGet(proxyInfo, getWorkspaceUrl, headers, null); + if (response != null && response.getJsonObject() != null) { + return response.getJsonObject(); + } + return null; + } + + //login into MC server + public Map login(String mcUrl, AuthModel authModel, ProxySettings proxy){ + Map headers = new HashMap<>(); + try{ + if (null == proxy) { + proxy = new ProxySettings(); + } + JSONObject loginJson = loginToMC(mcUrl, authModel, proxy); + if (loginJson != null && !loginJson.isEmpty()) { + String hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); + String jsessionId = (String) loginJson.get(Constants.JSESSIONID); + headers.put(Constants.LOGIN_SECRET, hp4mSecret); + String cookies = Constants.JESEEIONEQ + jsessionId; + if (TOKEN.equals(authModel.getValue())) { + String oauth = (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY); + if (!StringUtils.isNullOrEmpty(oauth)) { + cookies += (";" + Constants.OAUTH2_COOKIE_KEY + "=" + (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY)); + } else { + System.out.println("ERROR:: loginToMC failed with null oauth cookie."); + } + } + headers.put(Constants.COOKIE, cookies); + } + }catch (Exception e) { + e.printStackTrace(); + } + + return headers; + } + //upload app to MC - public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, String appPath, String appUploadWorkspace) throws IOException { + public JSONObject upload(Map headers, String mcUrl, ProxySettings proxy, String appPath, String appUploadWorkspace) throws IOException { File appFile = new File(appPath); String uploadUrl = mcUrl + Constants.APP_UPLOAD; if(!StringUtils.isNullOrEmpty(appUploadWorkspace)){ @@ -176,27 +227,10 @@ public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, byte[] bytes = outputStream.toByteArray(); outputStream.close(); + if (null == proxy) { proxy = new ProxySettings(); } - Map headers = new HashMap<>(); - JSONObject loginJson = loginToMC(mcUrl, authModel, proxy); - if (loginJson != null) { - String hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); - String jsessionId = (String) loginJson.get(Constants.JSESSIONID); - headers.put(Constants.LOGIN_SECRET, hp4mSecret); - String cookies = Constants.JESEEIONEQ + jsessionId; - if (TOKEN.equals(authModel.getValue())) { - String oauth = (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY); - if (!StringUtils.isNullOrEmpty(oauth)) { - cookies += (";" + Constants.OAUTH2_COOKIE_KEY + "=" + (String) loginJson.get(Constants.OAUTH2_COOKIE_KEY)); - } else { - System.out.println("ERROR:: loginToMC failed with null oauth cookie."); - } - } - headers.put(Constants.COOKIE, cookies); - } - headers.put(Constants.CONTENT_TYPE, Constants.CONTENT_TYPE_DOWNLOAD_VALUE + Constants.BOUNDARYSTR); headers.put(Constants.FILENAME, appFile.getName()); @@ -212,26 +246,11 @@ public JSONObject upload(String mcUrl, AuthModel authModel, ProxySettings proxy, //get all workspaces from MC public JSONArray getAllMcWorkspaces(String mcUrl, AuthModel authModel, ProxySettings proxy) throws IOException { try { - JSONObject loginJson = loginToMC(mcUrl, authModel, proxy); - if (loginJson == null) { - return null; - } - String hp4mSecret = (String) loginJson.get(Constants.LOGIN_SECRET); - String jsessionId = (String) loginJson.get(Constants.JSESSIONID); - - if (thereIsNoArgumentNullOrEmpty(hp4mSecret, jsessionId)) { - Map headers = new HashMap<>(); - headers.put(Constants.LOGIN_SECRET, hp4mSecret); - String cookies = Constants.JESEEIONEQ + jsessionId; - if (TOKEN.equals(authModel.getValue())) { - cookies += (";" + Constants.OAUTH2_COOKIE_KEY + "=" + loginJson.get(Constants.OAUTH2_COOKIE_KEY)); - } - headers.put(Constants.COOKIE, cookies); - HttpUtils.ProxyInfo proxyInfo = proxy == null ? null : HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); - HttpResponse response = HttpUtils.doGet(proxyInfo, mcUrl + Constants.GET_ALL_WORKSPACES_URL, headers, "includeSharedAssets=true"); - if (response != null && response.getJsonArray() != null) { - return response.getJsonArray(); - } + Map headers = login(mcUrl, authModel, proxy); + HttpUtils.ProxyInfo proxyInfo = proxy == null ? null : HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); + HttpResponse response = HttpUtils.doGet(proxyInfo, mcUrl + Constants.GET_ALL_WORKSPACES_URL, headers, "includeSharedAssets=true"); + if (response != null && response.getJsonArray() != null) { + return response.getJsonArray(); } } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java index e25ed79d53..6e0ed9f846 100644 --- a/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java +++ b/src/main/java/com/microfocus/application/automation/tools/run/UploadAppBuilder.java @@ -53,6 +53,7 @@ import java.nio.file.NoSuchFileException; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -96,6 +97,25 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen return false; } else { mcServerUrl = mcServerSettingsModel.getProperties().getProperty("MobileHostAddress"); + Map headers = job.login(mcServerUrl, uploadAppModel.getAuthModel(), uploadAppModel.getProxySettings()); + if (headers == null || headers.size() == 0) { + if (uploadAppModel.isUseProxy()) { + out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s, Proxy url:%s", + mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress())); + } else if (uploadAppModel.isUseAuthentication()) { + out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s, Proxy url:%s, proxy userName:%s", + mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress(), uploadAppModel.getProxySettings().getFsProxyUserName())); + } else { + out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s", mcServerUrl)); + } + build.setResult(Result.FAILURE); + return false; + } + + if(paths == null || paths.size() == 0) { + return true; + } + out.println(String.format("There are %d apps to be uploaded.", paths.size())); String workspace = build.getWorkspace() == null ? "" : build.getWorkspace().toURI().getPath(); @@ -136,20 +156,27 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen continue; } } - + //check workspace exist or not in MC server + String appUploadWorkspaceName = ""; + if(!StringUtils.isNullOrEmpty(appUploadWorkspace)){ + JSONObject result = job.isWorkspaceExist(headers, mcServerUrl, uploadAppModel.getProxySettings(), appUploadWorkspace); + if(result == null || (result != null && (!result.containsKey("uuid") || !result.getAsString("uuid").equals(appUploadWorkspace)))){ + out.println(String.format("Failed to upload app %d %s, Cause cannot find target workspace id: %s", i, originPath, appUploadWorkspace)); + build.setResult(Result.FAILURE); + allSuccess = false; + continue; + }else{ + appUploadWorkspaceName = result.getAsString("name"); + } + }else{ + appUploadWorkspaceName = "Shared assets"; + } + //upload app try { - out.println(String.format("starting to upload app %d %s", i, originPath)); - app = job.upload(mcServerUrl, uploadAppModel.getAuthModel(), uploadAppModel.getProxySettings(), path, appUploadWorkspace); + out.println(String.format("starting to upload app %d %s to workspace %s", i, originPath, appUploadWorkspaceName)); + app = job.upload(headers, mcServerUrl, uploadAppModel.getProxySettings(), path, appUploadWorkspace); if (app == null) { - if (uploadAppModel.isUseProxy()) { - out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s, Proxy url:%s", - mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress())); - } else if (uploadAppModel.isUseAuthentication()) { - out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s, Proxy url:%s, proxy userName:%s", - mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress(), uploadAppModel.getProxySettings().getFsProxyUserName())); - } else { - out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s.", mcServerUrl)); - } + out.println(String.format("Failed to upload app.")); build.setResult(Result.FAILURE); return false; } @@ -170,15 +197,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen allSuccess = false; continue; } catch (Exception e) { - if (uploadAppModel.isUseProxy()) { - out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s, Proxy url:%s", - mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress())); - } else if (uploadAppModel.isUseAuthentication()) { - out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s, Proxy url:%s, proxy userName:%s", - mcServerUrl, uploadAppModel.getProxySettings().getFsProxyAddress(), uploadAppModel.getProxySettings().getFsProxyUserName())); - } else { - out.println(String.format("Failed to upload app, Cause Digital Lab connection info is incorrect. url:%s", mcServerUrl)); - } + out.println(String.format("Failed to upload app.")); build.setResult(Result.FAILURE); return false; } finally { @@ -268,7 +287,27 @@ public JSONArray getMcWorkspaces(String mcUrl, String authType, String mcUserNam System.out.println(String.format("Failed to get workspaces, Cause Digital Lab connection info is incorrect. url:%s", mcUrl)); } } - return workspaces; + return changeResult(workspaces); + } + + private JSONArray changeResult(JSONArray workspaces){ + JSONArray result = new JSONArray(); + if (workspaces != null) { + for (int i = 0; i < workspaces.size(); i++) { + JSONObject workspace = (JSONObject) workspaces.get(i); + if(workspace.getAsString("name").equals("Shared assets")){ + result.add(workspace); + } + } + for (int i = 0; i < workspaces.size(); i++) { + JSONObject workspace = (JSONObject) workspaces.get(i); + if(!workspace.getAsString("name").equals("Shared assets")){ + result.add(workspace); + } + } + } + return result; } + } } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index 7548175bc9..f73dc7e390 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -54,7 +54,9 @@ document.getElementsByName("uploadApp.fsProxyPassword")[0].disabled="true"; } } + function refreshWorkspaces(event,a){ + var saveWorkspace = event.target.nextElementSibling.options[0].value; var mcUrl = document.getElementsByName("uploadApp.mcServerName")[0].value; var authType = document.querySelector('input[name$="authModel"]:checked').value; var mcUserName = document.getElementsByName("uploadApp.mcUserName")[0].value; @@ -67,16 +69,37 @@ var proxyUserName = document.getElementsByName("uploadApp.fsProxyUserName")[0].value; var proxyPassword = document.getElementsByName("uploadApp.fsProxyPassword")[0].value; a.getMcWorkspaces(mcUrl, authType, mcUserName, mcPassword, mcTenantId, mcExecToken, useProxy, proxyAddress, useAuthentication, proxyUserName, proxyPassword, function (r) { - var str = ""; + let str = ""; const workspaces = r.responseJSON; workspaces.forEach((item) => { - str = str + ""; + if(saveWorkspace == ""){ + if(item.name == "Shared assets"){ + str = str + ""; + }else{ + str = str + ""; + } + }else{ + if(item.uuid == saveWorkspace){ + str = str + ""; + }else{ + str = str + ""; + } + } }); - console.log(str); event.target.nextElementSibling.innerHTML= str; }); } + + window.addEventListener("load",(event) => { + let items = document.getElementsByClassName("mcRefreshButton"); + let len = items.length; + if(len > 0){ + Array.prototype.forEach.call(items, function (element) { + element.click(); + }); + } + }) + @@ -134,8 +157,9 @@ - - + From 7e0dffbe27ea956530774e63578f9a29b33d3264 Mon Sep 17 00:00:00 2001 From: wenwen <50070873+wenwen12341234@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:25:39 +0800 Subject: [PATCH 2476/2502] Internal: check signing service --- .../automation/tools/mc/Constants.java | 3 +- .../tools/mc/JobConfigurationProxy.java | 28 +++++++++++++++++++ .../tools/run/UploadAppBuilder/config.jelly | 19 ++++++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java index 167bb1be8b..dafd051796 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/Constants.java @@ -38,7 +38,7 @@ public class Constants { public final static String BOUNDARYSTR = "randomstring"; public final static String DATA = "data"; - public final static String APP_UPLOAD = "/rest/v2/apps?asyncInstrumentation=false&instrument=true&resign=true&isAppUploadPage=true"; // make sure unpacked app is uploaded in case of failure during instrumentation + public final static String APP_UPLOAD = "/rest/v2/apps"; // make sure unpacked app is uploaded in case of failure during instrumentation public final static String CONTENT_TYPE_DOWNLOAD_VALUE = "multipart/form-data; boundary=----"; public final static String FILENAME = "filename"; public static final String LOGIN_SECRET = "x-hp4msecret"; @@ -57,6 +57,7 @@ public class Constants { public static final String GET_JOB_UEL = "/rest/job/"; public static final String GET_ALL_WORKSPACES_URL = "/rest/v2/workspaces"; public static final String GET_WORKSPACE_URL = "/rest/v2/workspaces"; + public static final String GET_ADMIN_SETTINGS_URL = "/rest/v2/adminSettings"; public final static String ICON = "icon"; public final static String JESEEIONEQ = "JSESSIONID="; public final static String TENANT_COOKIE = "TENANT_ID_COOKIE"; diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index bbb4dfde9a..e2b4015929 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -168,6 +168,28 @@ public JSONObject isWorkspaceExist(Map headers, String mcUrl, Pr return null; } + //check signing service + public String isSigningServiceEnabled(Map headers, String mcUrl, ProxySettings proxy) throws IOException { + if (null == proxy) { + proxy = new ProxySettings(); + } + String getAdminSettingUrl = mcUrl + Constants.GET_ADMIN_SETTINGS_URL; + if(!StringUtils.isNullOrEmpty(getAdminSettingUrl)){ + getAdminSettingUrl += (String.format("/%s","PACKAGING_IOS")); + } + HttpUtils.ProxyInfo proxyInfo = HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); + HttpResponse response = HttpUtils.doGet(proxyInfo, getAdminSettingUrl, headers, null); + if (response != null && response.getJsonArray() != null) { + for (int i = 0; i < response.getJsonArray().size(); i++) { + JSONObject setting = (JSONObject) response.getJsonArray().get(i); + if(setting.getAsString("name").equals("IOS_PACKAGER_ENABLE")){ + return setting.getAsString("value"); + } + } + } + return null; + } + //login into MC server public Map login(String mcUrl, AuthModel authModel, ProxySettings proxy){ Map headers = new HashMap<>(); @@ -202,6 +224,12 @@ public Map login(String mcUrl, AuthModel authModel, ProxySetting public JSONObject upload(Map headers, String mcUrl, ProxySettings proxy, String appPath, String appUploadWorkspace) throws IOException { File appFile = new File(appPath); String uploadUrl = mcUrl + Constants.APP_UPLOAD; + String signingServiceEnabled = this.isSigningServiceEnabled(headers, mcUrl, proxy); + if(!StringUtils.isNullOrEmpty(signingServiceEnabled) && signingServiceEnabled.equalsIgnoreCase("true")){ + uploadUrl += "?asyncInstrumentation=false&instrument=true&resign=true&isAppUploadPage=true"; + }else{ + uploadUrl += "?asyncInstrumentation=false&instrument=true&resign=false&isAppUploadPage=true"; + } if(!StringUtils.isNullOrEmpty(appUploadWorkspace)){ uploadUrl += (String.format("&workspaceId=%s",appUploadWorkspace)); } diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index f73dc7e390..392f2ad6bd 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -44,6 +44,17 @@ + + From 0c2d32f0e5f804da6cb9efb21456ebb9e710e1be Mon Sep 17 00:00:00 2001 From: wenwen <50070873+wenwen12341234@users.noreply.github.com> Date: Tue, 28 Nov 2023 13:46:53 +0800 Subject: [PATCH 2491/2502] Internal: rename workspace text --- .../automation/tools/run/UploadAppBuilder/config.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index ce85beff1b..1159fdcaa5 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -194,7 +194,7 @@ - + From 3268bd1d408c29b46a01da2ed1831c65a64eeab9 Mon Sep 17 00:00:00 2001 From: wenwen <50070873+wenwen12341234@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:38:29 +0800 Subject: [PATCH 2492/2502] Internal: fix UI element align issue --- .../tools/run/UploadAppBuilder/config.jelly | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index 1159fdcaa5..6554d16e3c 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -49,14 +49,19 @@ @@ -195,10 +200,12 @@ - - +
                  + + +
                  From 234cdd6f0d7cbe93bd9e54bbe6453603fd7cef9c Mon Sep 17 00:00:00 2001 From: Xiao-Jing Zhang Date: Wed, 6 Dec 2023 17:43:05 +0800 Subject: [PATCH 2493/2502] Defect#1355061: rename upload descriptor --- .../automation/tools/run/UploadAppBuilder/config.jelly | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly index 6554d16e3c..1acbc8d531 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/UploadAppBuilder/config.jelly @@ -46,7 +46,7 @@ - + @@ -307,55 +326,77 @@ - -
                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  + Digital Lab login information or proxy is incorrect. - -
                  +
                  + + + +
                  + + + Digital Lab login information or proxy is incorrect. + +
                  + + + + + + + + + + + + +
                  +
                  +
                  +
                  - - -
                  @@ -376,6 +417,5 @@ \ No newline at end of file diff --git a/src/main/webapp/configure.js b/src/main/webapp/configure.js index e38c48261d..5c11bd6cea 100644 --- a/src/main/webapp/configure.js +++ b/src/main/webapp/configure.js @@ -47,7 +47,6 @@ function getDigitalLab(divMain) { useProxyAuth: false, proxyUserName: "", proxyPassword: "", - err: dl.querySelector("#errorMessage"), recreateJob: dl.querySelector('input[name="recreateJob"]').checked, jobId: dl.querySelector('input[name="fsJobId"]').value, deviceInfo: dl.querySelector(".device-info-section") @@ -71,24 +70,8 @@ function getDigitalLab(divMain) { return o; } -function setupDigitalLab() { - let divMain = null; - if (document.location.href.indexOf("pipeline-syntax")>0) { // we are on pipeline-syntax page, where runFromFileBuilder step can be selected only once - divMain = document; - } else if (document.currentScript) { // this block is used for non-IE browsers, for the first FS build step only, it finds very fast the parent DIV - divMain = document.currentScript.parentElement.closest(RUN_FROM_FS_BUILDER_SELECTOR); - } - setTimeout(function() { prepareDigitalLab(divMain)}, 100); -} -function prepareDigitalLab(divMain) { -/* if (divMain == null) { // this block is needed for IE, but also for non-IE browsers when adding more than one FS build step - let divs = document.querySelectorAll(RUN_FROM_FS_BUILDER_SELECTOR); - divMain = divs[divs.length - 1]; - }*/ -} - -async function startLoadInfo(a, b, path) { - await triggerBtnState(b, true); +function startLoadInfo(a, b, path) { + triggerBtnState(b, true); setTimeout( async () => { await loadInfo(a, b, path)}, 100); } @@ -107,26 +90,27 @@ async function loadInfo(a, b, path) { let dl = {}; try { const divMain = b.parentElement.closest(RUN_FROM_FS_BUILDER_SELECTOR); + const err = b.parentElement.querySelector(".error-msg"); dl = getDigitalLab(divMain); - dl.err.style.display = "none"; + err.style.display = "none"; const isMcCredentialMissing = ("base" == dl.authType ? (dl.userName.trim() == "" || dl.password.trim() == "") : dl.execToken.trim() == ""); const isProxyAddressRequiredButMissing = dl.useProxy && dl.proxyAddress.trim() == ""; const isProxyCredentialRequiredButMissing = dl.useProxyAuth && (dl.proxyUserName.trim() == "" || dl.proxyPassword.trim() == ""); if (isMcCredentialMissing || isProxyAddressRequiredButMissing || isProxyCredentialRequiredButMissing) { - dl.err.style.display = "block"; + err.style.display = "inline-block"; await triggerBtnState(b, false); return; } if (b.name == "cloudBrowserLab") { - await loadBrowserLabInfo(a, b, dl, path); + await loadBrowserLabInfo(a, b, dl, path, err); } else if (b.name == "digitalLabWizard") { - await loadMobileInfo(a, b, dl); + await loadMobileInfo(a, b, dl, err); } } catch (e) { console.error(e); - dl && (dl.err.style.display = "block"); + err.style.display = "inline-block"; await triggerBtnState(b, false); } } @@ -138,7 +122,7 @@ async function fillAndShowDDLs(b, div, dlg) { await triggerBtnState(b, false); dlg.style.display = "block"; } -async function loadBrowserLabInfo(a, b, o, path) { +async function loadBrowserLabInfo(a, b, o, path, err) { const div = b.parentElement.closest("#mobileSpecificSection"); const dlg = await generateModalDialog(path); div.appendChild(dlg); @@ -154,7 +138,7 @@ async function loadBrowserLabInfo(a, b, o, path) { div.regions = json.regions; await fillAndShowDDLs(b, div, dlg); } else { - o.err.style.display = "block"; + err.style.display = "inline-block"; await triggerBtnState(b, false); } } catch (e) { @@ -165,15 +149,14 @@ async function loadBrowserLabInfo(a, b, o, path) { } } -async function loadMobileInfo(a, b, o) { +async function loadMobileInfo(a, b, o, err) { let baseUrl = ""; - await a.getMcServerUrl(o.serverName, async (r) => { baseUrl = r.responseObject(); if (baseUrl) { baseUrl = baseUrl.trim().replace(/[\/]+$/, ""); } else { - o.err.style.display = "block"; + err.style.display = "inline-block"; await triggerBtnState(b, false); return; } @@ -181,12 +164,12 @@ async function loadMobileInfo(a, b, o) { await a.getJobId(baseUrl, o.userName, o.password, o.tenantId, o.execToken, o.authType, o.useProxyAuth, o.proxyAddress, o.proxyUserName, o.proxyPassword, prevJobId, async (response) => { let jobId = response.responseObject(); if (jobId == null) { - o.err.style.display = "block"; + err.style.display = "inline-block"; await triggerBtnState(b, false); return; } //hide the error message after success login - o.err.style.display = "none"; + err.style.display = "none"; let openedWindow = window.open('/', 'test parameters', 'height=820,width=1130'); openedWindow.location.href = 'about:blank'; openedWindow.location.href = baseUrl + "/integration/#/login?jobId=" + jobId + "&displayUFTMode=true"; @@ -229,7 +212,7 @@ async function loadMobileInfo(a, b, o) { div.querySelector('textarea[name="fsExtraApps"]').value = jobInfo['extraApps'] ?? ""; div.querySelector('input[name="fsJobId"]').value = jobInfo['jobUUID']; await triggerBtnState(b, false); - o.err.style.display = "none"; + err.style.display = "none"; window.removeEventListener("message", msgCallback, false); openedWindow.close(); }); From beec79a27b8bd04d10dd29edd5a12bc9bfeba088 Mon Sep 17 00:00:00 2001 From: Dorin Bogdan Date: Thu, 18 Jan 2024 16:44:32 +0200 Subject: [PATCH 2498/2502] updae toolVersion --- .../application/automation/tools/mc/JobConfigurationProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java index 1f806c3004..38ea1975e4 100644 --- a/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java +++ b/src/main/java/com/microfocus/application/automation/tools/mc/JobConfigurationProxy.java @@ -365,7 +365,7 @@ public JSONObject getBrowserLab(String mcUrl, String accessKey, ProxySettings pr headers.put(Constants.COOKIE, cookies); headers.put(RESTConstants.AUTHORIZATION, String.format("%s %s", tokenType, token)); HttpUtils.ProxyInfo proxyInfo = proxy == null ? null : HttpUtils.setProxyCfg(proxy.getFsProxyAddress(), proxy.getFsProxyUserName(), proxy.getFsProxyPassword()); - String url = String.format("%s%s?toolVersion=2023", mcUrl, Constants.GET_BROWSER_LAB_URL); + String url = String.format("%s%s?toolVersion=23.4", mcUrl, Constants.GET_BROWSER_LAB_URL); HttpResponse response = HttpUtils.doGet(proxyInfo, url, headers, null); if (response != null && response.getJsonObject() != null) { From a36bd3b7b64c509538ed53614fd477f619e67a5e Mon Sep 17 00:00:00 2001 From: Xiao-Jing Zhang Date: Mon, 22 Jan 2024 13:55:24 +0800 Subject: [PATCH 2499/2502] US#1411194: add Cross-Origin-Opener-Policy header --- .../automation/tools/run/RunFromFileBuilder/config.jelly | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly index 06ede14261..03e488f996 100644 --- a/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly +++ b/src/main/resources/com/microfocus/application/automation/tools/run/RunFromFileBuilder/config.jelly @@ -94,6 +94,7 @@ } + From 49bd710350fddd5d427003c032b44cc2b2a67a4b Mon Sep 17 00:00:00 2001 From: mayar Date: Thu, 1 Feb 2024 17:34:50 +0200 Subject: [PATCH 2500/2502] user story #2397050: [FTE Cloud] Refactor Discovery logic and use new Unit2Runner links --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d069991afa..94d2646fff 100644 --- a/pom.xml +++ b/pom.xml @@ -488,7 +488,7 @@ integrations-sdk com.hpe.adm.octane.ciplugins - 2.23.4.7 + 2.24.1.2 From 43a624982f452e739ab22d7eae17e2faa668333d Mon Sep 17 00:00:00 2001 From: NShitrit Date: Mon, 19 Feb 2024 12:26:40 +0200 Subject: [PATCH 2501/2502] tech: set Jenkins minimum version to 2.375.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 61bbaace29..c35759cc2d 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 1 C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Release - 2.346.1 + 2.375.1 false 8 2.55 From b67bd0421eee306b75b2d6cdce7e047b67053aa7 Mon Sep 17 00:00:00 2001 From: NShitrit Date: Tue, 20 Feb 2024 12:34:15 +0200 Subject: [PATCH 2502/2502] tech: set Jenkins minimum version to 2.375.1, increase BOM dependency for latest Jenkins --- pom.xml | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c35759cc2d..9d7d16b9bf 100644 --- a/pom.xml +++ b/pom.xml @@ -351,8 +351,8 @@ io.jenkins.tools.bom - bom-2.289.x - 984.vb5eaac999a7e + bom-2.375.x + 2198.v39c76fc308ca pom import @@ -629,5 +629,36 @@ jaxb 2.3.6-1 + + + +