Skip to content
Permalink
Browse files

Merge pull request #1 from cpoenisch/JENKINS-31999

[JENKINS-31999] added Pipeline support
  • Loading branch information...
cpoenisch committed May 27, 2016
2 parents 0d7918d + e3db05f commit 0cd8a4445bd6311009fcc8738a6568cdabec84df
Showing with 3,768 additions and 1,765 deletions.
  1. +75 −44 pom.xml
  2. +1 −1 src/main/java/de/tracetronic/jenkins/plugins/ecutest/ETPlugin.java
  3. +40 −38 ...ginManagerCleanUp.java → main/java/de/tracetronic/jenkins/plugins/ecutest/ETPluginException.java}
  4. +10 −11 src/main/java/de/tracetronic/jenkins/plugins/ecutest/env/view/TestEnvActionView.java
  5. +8 −8 src/main/java/de/tracetronic/jenkins/plugins/ecutest/env/view/ToolEnvActionView.java
  6. +35 −11 ...ain/java/de/tracetronic/jenkins/plugins/ecutest/extension/jobdsl/ReportPublisherDslExtension.java
  7. +446 −434 src/main/java/de/tracetronic/jenkins/plugins/ecutest/extension/jobdsl/TestBuilderDslExtension.java
  8. +13 −6 src/main/java/de/tracetronic/jenkins/plugins/ecutest/extension/jobdsl/ToolBuilderDslExtension.java
  9. +4 −4 src/main/java/de/tracetronic/jenkins/plugins/ecutest/log/TTConsoleLogger.java
  10. +3 −5 src/main/java/de/tracetronic/jenkins/plugins/ecutest/log/TTConsoleNote.java
  11. +3 −3 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/AbstractArchiveFileReport.java
  12. +6 −6 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/AbstractReportAction.java
  13. +124 −57 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/AbstractReportPublisher.java
  14. +12 −10 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/AbstractRequestHandler.java
  15. +2 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/AbstractTestReport.java
  16. +12 −1 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXBuildAction.java
  17. +2 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXProjectAction.java
  18. +59 −67 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisher.java
  19. +2 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXReport.java
  20. +16 −17 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXReportGenerator.java
  21. +19 −20 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXReportUploader.java
  22. +4 −5 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/AbstractATXAction.java
  23. +6 −5 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/AbstractATXReportHandler.java
  24. +4 −5 ...n/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/AbstractReportGeneratorAction.java
  25. +6 −5 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGenerator.java
  26. +11 −1 ...main/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorBuildAction.java
  27. +2 −2 ...in/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorProjectAction.java
  28. +85 −68 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisher.java
  29. +66 −49 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisher.java
  30. +34 −42 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitReportGenerator.java
  31. +15 −17 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitTestResultParser.java
  32. +4 −5 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/log/AbstractETLogAction.java
  33. +10 −1 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogBuildAction.java
  34. +3 −3 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogParser.java
  35. +2 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogProjectAction.java
  36. +100 −68 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisher.java
  37. +4 −5 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/AbstractTRFAction.java
  38. +10 −1 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFBuildAction.java
  39. +2 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFProjectAction.java
  40. +32 −30 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisher.java
  41. +111 −43 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/AbstractTestBuilder.java
  42. +80 −22 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilder.java
  43. +39 −11 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilder.java
  44. +39 −11 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilder.java
  45. +6 −4 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/client/AbstractTestClient.java
  46. +15 −13 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/client/PackageClient.java
  47. +16 −13 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/client/ProjectClient.java
  48. +7 −3 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/client/TestClient.java
  49. +4 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/scan/AbstractTestScanner.java
  50. +117 −20 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/AbstractToolBuilder.java
  51. +92 −75 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilder.java
  52. +64 −48 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilder.java
  53. +31 −37 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilder.java
  54. +28 −39 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilder.java
  55. +10 −8 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/client/AbstractToolClient.java
  56. +31 −23 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/client/ETClient.java
  57. +33 −16 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/client/TSClient.java
  58. +15 −9 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/client/ToolClient.java
  59. +3 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/installation/AbstractToolInstallation.java
  60. +2 −2 src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/installation/ETInstallation.java
  61. +32 −17 src/main/java/de/tracetronic/jenkins/plugins/ecutest/util/DllUtil.java
  62. +5 −10 src/main/java/de/tracetronic/jenkins/plugins/ecutest/util/ProcessUtil.java
  63. +1 −1 src/main/resources/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisher/config.jelly
  64. +1 −1 ...main/resources/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisher/config.properties
  65. +1 −0 src/main/resources/index.jelly
  66. +30 −6 src/test/java/de/tracetronic/jenkins/plugins/ecutest/SystemTestBase.java
  67. +1 −1 ...t/java/de/tracetronic/jenkins/plugins/ecutest/extension/jobdsl/ReportPublisherDslExtensionST.java
  68. +1 −1 ...acetronic/jenkins/plugins/ecutest/extension/jobdsl/ReportPublisherParamInstallDslExtensionST.java
  69. +84 −8 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherST.java
  70. +44 −9 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherTest.java
  71. +86 −9 ...test/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherST.java
  72. +59 −31 ...st/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherTest.java
  73. +85 −5 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherST.java
  74. +56 −12 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherTest.java
  75. +13 −11 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitTestResultParserST.java
  76. +94 −5 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherST.java
  77. +27 −9 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherTest.java
  78. +84 −4 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherST.java
  79. +21 −0 src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherTest.java
  80. +102 −9 src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderST.java
  81. +46 −8 src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderTest.java
  82. +94 −7 src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderST.java
  83. +43 −8 src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderTest.java
  84. +94 −7 src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderST.java
  85. +43 −8 src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderTest.java
  86. +94 −4 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderST.java
  87. +107 −73 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderTest.java
  88. +94 −6 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderST.java
  89. +37 −8 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderTest.java
  90. +96 −4 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderST.java
  91. +35 −6 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderTest.java
  92. +88 −5 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderST.java
  93. +35 −6 src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderTest.java
119 pom.xml
@@ -79,11 +79,12 @@

<properties>
<!-- Jenkins base -->
<jenkins.version>1.565.3</jenkins.version>
<jenkins-test-harness.version>1.565.3</jenkins-test-harness.version>
<jenkins.version>1.580.1</jenkins.version>
<jenkins-test-harness.version>1.580.1</jenkins-test-harness.version>

<!-- Jenkins plugins -->
<matrix-project.version>1.4</matrix-project.version>
<junit.version>1.3</junit.version>
<job-dsl.version>1.37</job-dsl.version>

<!-- Static code analysis -->
@@ -93,6 +94,7 @@
<!-- Test scope -->
<equalsverifier.version>1.7.8</equalsverifier.version>
<mockito-core.version>1.10.19</mockito-core.version>
<workflow.version>1.4.2</workflow.version>
<concurrency>2</concurrency>

<!-- JACOB -->
@@ -152,6 +154,12 @@
<artifactId>matrix-project</artifactId>
<version>${matrix-project.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>job-dsl</artifactId>
@@ -176,6 +184,25 @@
<version>${equalsverifier.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-aggregator</artifactId>
<version>${workflow.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>${workflow.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>${workflow.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
@@ -185,15 +212,33 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<!-- Includes system tests ending with ST -->
<include>**/*Test.java</include>
<include>**/*ST.java</include>
</includes>
<excludes>
<exclude>InjectedTest.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*ST.java</include>
<include>InjectedTest.java</include>
</includes>
<reuseForks>true</reuseForks>
<forkCount>${concurrency}</forkCount>
</configuration>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@@ -262,37 +307,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.3,)
</versionRange>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@@ -314,6 +328,29 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.3,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
@@ -326,15 +363,9 @@
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<versionRange>
[2.10.1,)
</versionRange>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<versionRange>[2.10.1,)</versionRange>
<goals>
<goal>javadoc</goal>
</goals>
@@ -58,7 +58,7 @@
/**
* Defines the TEST-GUIDE version that the provided ATX configuration is based on.
*/
public static final ToolVersion ATX_VERSION = new ToolVersion(1, 29, 0, 0);
public static final ToolVersion ATX_VERSION = new ToolVersion(1, 30, 0, 0);

/**
* Helper class to easily compare tool versions defined by major, minor, micro and qualifier version. Mainly used to
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 TraceTronic GmbH
* Copyright (c) 2015-2016 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@@ -29,49 +29,51 @@
*/
package de.tracetronic.jenkins.plugins.ecutest;

import hudson.Util;
import hudson.PluginWrapper;

import java.io.IOException;

import org.jvnet.hudson.test.TestPluginManager;

/**
* Cleanup the temporary directory created by {@link org.jvnet.hudson.test.TestPluginManager}.
* <p>
* Call {@link #registerCleanup()} at least once from anywhere.
* Exception thrown if an error occurs while performing plugin-specific operations.
*
* @author Christian Pönisch <christian.poenisch@tracetronic.de>
*/
public class TestPluginManagerCleanUp {
public class ETPluginException extends Exception {

private static final long serialVersionUID = 1L;

private static Thread deleteThread = null;
/**
* Instantiates a new {@link ETPluginException}.
*
* @param cause
* the cause of the {@link Exception}
*/
public ETPluginException(final Throwable cause) {
super(cause);
}

/**
* Instantiates a new {@link ETPluginException}.
*
* @param message
* the message to attach to the {@link Exception}
* @param cause
* the cause of the {@link Exception}
*/
public ETPluginException(final String message, final Throwable cause) {
super(message, cause);
}

public static synchronized void registerCleanup() {
if (deleteThread != null) {
return;
}
deleteThread = new Thread("HOTFIX: cleanup " + TestPluginManager.INSTANCE.rootDir) {
/**
* Instantiates a new {@link ETPluginException}.
*
* @param message
* the message to attach to the {@link Exception}
*/
public ETPluginException(final String message) {
super(message);
}

@Override
public void run() {
if (TestPluginManager.INSTANCE != null && TestPluginManager.INSTANCE.rootDir != null
&& TestPluginManager.INSTANCE.rootDir.exists()) {
// Work as PluginManager#stop
for (final PluginWrapper p : TestPluginManager.INSTANCE.getPlugins()) {
p.stop();
p.releaseClassLoader();
}
TestPluginManager.INSTANCE.getPlugins().clear();
System.gc();
try {
Util.deleteRecursive(TestPluginManager.INSTANCE.rootDir);
} catch (final IOException x) {
x.printStackTrace();
}
}
}
};
Runtime.getRuntime().addShutdownHook(deleteThread);
/**
* Instantiates a new {@link ETPluginException}.
*/
public ETPluginException() {
super();
}
}
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 TraceTronic GmbH
* Copyright (c) 2015-2016 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@@ -31,11 +31,10 @@

import hudson.EnvVars;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.InvisibleAction;
import hudson.model.ParameterValue;
import hudson.model.TaskListener;
import hudson.model.AbstractBuild;
import hudson.model.Run;
import hudson.model.StringParameterValue;
import hudson.model.listeners.RunListener;

@@ -59,20 +58,20 @@

private static final Logger LOGGER = Logger.getLogger(TestEnvActionView.class.getName());

private final AbstractBuild<?, ?> build;
private final Run<?, ?> build;
private final transient TaskListener listener;

/**
* Instantiates a new {@link TestEnvActionView}.
*
* @param build
* @param run
* the build
* @param listener
* the listener
*/
public TestEnvActionView(final AbstractBuild<?, ?> build, final TaskListener listener) {
public TestEnvActionView(final Run<?, ?> run, final TaskListener listener) {
super();
this.build = build;
build = run;
this.listener = listener;
}

@@ -90,9 +89,9 @@ public TestEnvActionView(final AbstractBuild<?, ?> build, final TaskListener lis
try {
final EnvVars envVars = build.getEnvironment(listener);
String buildWs = "";
final FilePath buildWsPath = build.getWorkspace();
final String buildWsPath = envVars.get("WORKSPACE");
if (buildWsPath != null) {
buildWs = buildWsPath.getRemote() + File.separator;
buildWs = buildWsPath + File.separator;
}

for (int i = 0; i < testBuilderSize; i++) {
@@ -116,10 +115,10 @@ public TestEnvActionView(final AbstractBuild<?, ?> build, final TaskListener lis
* Listener notifying the build on completion and adding this {@link TestEnvActionView} as a new build action.
*/
@Extension
public static final class RunListenerImpl extends RunListener<AbstractBuild<?, ?>> {
public static final class RunListenerImpl extends RunListener<Run<?, ?>> {

@Override
public void onCompleted(final AbstractBuild<?, ?> run, final TaskListener listener) {
public void onCompleted(final Run<?, ?> run, final TaskListener listener) {
if (run.getAction(TestEnvInvisibleAction.class) != null) {
run.addAction(new TestEnvActionView(run, listener));
}

0 comments on commit 0cd8a44

Please sign in to comment.
You can’t perform that action at this time.