Skip to content

Commit

Permalink
Merge branch 'master' into feature/JENKINS-48711
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Dec 29, 2017
2 parents d2be78c + 7c215bb commit 6edde7f
Show file tree
Hide file tree
Showing 11 changed files with 180 additions and 185 deletions.
8 changes: 6 additions & 2 deletions plugins-compat-tester-cli/pom.xml
Expand Up @@ -7,11 +7,10 @@
<version>0.0.3-SNAPSHOT</version>
</parent>

<groupId>org.jenkins-ci.tests</groupId>
<artifactId>plugins-compat-tester-cli</artifactId>
<version>0.0.3-SNAPSHOT</version>
<name>Plugins compatibility tester CLI</name>
<description>Hudson/Jenkins Plugin compatibility tester against latest released version</description>
<description>Jenkins Plugin Compatibility Tester (PCT) against latest released version</description>

<build>
<plugins>
Expand Down Expand Up @@ -80,5 +79,10 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
</dependencies>
</project>
Expand Up @@ -54,7 +54,7 @@ public class CliOptions {
private File workDirectory;

@Parameter(names = "-reportFile", required = true,
description = "Output report xml file path")
description = "Output report xml file path. This path must contain a directory, e.g. 'out/pct-report.xml'")
private File reportFile;

@Parameter(names = "-includePlugins",
Expand Down
Expand Up @@ -67,6 +67,14 @@ public static void main(String[] args) throws IOException, PlexusContainerExcept
if(!"NOREPORT".equals(options.getReportFile().getName())){
reportFile = options.getReportFile();
}
if (reportFile != null) {
// Check the format requirement
File parentFile = reportFile.getParentFile();
if (parentFile == null) {
throw new IllegalArgumentException("The -reportFile value '" + reportFile + "' does not have a directory specification. " +
"A path should be something like 'out/pct-report.xml'");
}
}

String updateCenterUrl = options.getUpdateCenterUrl();
String parentCoordinates = options.getParentCoord();
Expand All @@ -75,14 +83,16 @@ public static void main(String[] args) throws IOException, PlexusContainerExcept
if (updateCenterUrl != null || parentCoordinates != null) {
throw new IllegalStateException("Cannot specify -war together with either -updateCenterUrl or -parentCoordinates");
}
} else {
if (updateCenterUrl == null) {
updateCenterUrl = PluginCompatTesterConfig.DEFAULT_UPDATE_CENTER_URL;
}
if (parentCoordinates == null) {
parentCoordinates = PluginCompatTesterConfig.DEFAULT_PARENT_GAV;
}
}

// We may need this data even in the -war mode
if (updateCenterUrl == null) {
updateCenterUrl = PluginCompatTesterConfig.DEFAULT_UPDATE_CENTER_URL;
}
if (parentCoordinates == null) {
parentCoordinates = PluginCompatTesterConfig.DEFAULT_PARENT_GAV;
}

PluginCompatTesterConfig config = new PluginCompatTesterConfig(updateCenterUrl, parentCoordinates,
options.getWorkDirectory(), reportFile, options.getM2SettingsFile());
config.setWar(war);
Expand Down
27 changes: 3 additions & 24 deletions plugins-compat-tester-gae-client/pom.xml
Expand Up @@ -7,28 +7,11 @@
<version>0.0.3-SNAPSHOT</version>
</parent>

<groupId>org.jenkins-ci.tests</groupId>
<artifactId>plugins-compat-tester-gae-client</artifactId>
<version>0.0.3-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Plugins compatibility tester for Google App Engine client side API</name>
<description>Hudson/Jenkins Plugin compatibility tester against latest released version - GAE app</description>

<properties>
<powermock.version>1.4.8</powermock.version>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<description>Jenkins Plugin Compatibility Tester (PCT) against latest released version - GAE app client</description>

<dependencies>
<!-- Google App Engine API -->
Expand All @@ -40,30 +23,26 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.2</version>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>10.0.1</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
27 changes: 3 additions & 24 deletions plugins-compat-tester-gae/pom.xml
Expand Up @@ -7,28 +7,11 @@
<version>0.0.3-SNAPSHOT</version>
</parent>

<groupId>org.jenkins-ci.tests</groupId>
<artifactId>plugins-compat-tester-gae</artifactId>
<version>0.0.3-SNAPSHOT</version>
<packaging>war</packaging>
<name>Plugins compatibility tester for Google App Engine</name>
<description>Hudson/Jenkins Plugin compatibility tester against latest released version - GAE app</description>

<properties>
<powermock.version>1.4.8</powermock.version>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<description>Jenkins Plugin Compatibility Tester (PCT) against latest released version - GAE app</description>

<dependencies>
<!-- Google App Engine API -->
Expand All @@ -39,8 +22,7 @@
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<artifactId>javax.servlet-api</artifactId>
</dependency>

<dependency>
Expand All @@ -51,20 +33,17 @@

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
37 changes: 3 additions & 34 deletions plugins-compat-tester-model/pom.xml
Expand Up @@ -7,61 +7,30 @@
<version>0.0.3-SNAPSHOT</version>
</parent>

<groupId>org.jenkins-ci.tests</groupId>
<artifactId>plugins-compat-tester-model</artifactId>
<version>0.0.3-SNAPSHOT</version>
<name>Plugins compatibility tester model layer</name>
<description>Hudson/Jenkins Plugin compatibility model layer</description>

<properties>
<powermock.version>1.4.8</powermock.version>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<description>Jenkins Plugin Compatibility Tester (PCT) model layer</description>

<dependencies>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<groupId>org.jvnet.hudson</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>

Expand Down
Expand Up @@ -26,6 +26,8 @@
package org.jenkins.tools.test.model;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.Xpp3DomDriver;
import hudson.util.XStream2;

import javax.annotation.Nonnull;
import java.io.*;
Expand Down Expand Up @@ -84,20 +86,25 @@ public void save(File reportPath) throws IOException {
tempReportPath.renameTo(reportPath);
}

public static String getXslFilename(File reportPath){
public static String getXslFilename(@Nonnull File reportPath){
return getBaseFilename(reportPath)+".xsl";
}

public static File getXslFilepath(File reportPath){
public static File getXslFilepath(@Nonnull File reportPath){
return new File(getBaseFilepath(reportPath)+".xsl");
}

public static File getHtmlFilepath(File reportPath){
public static File getHtmlFilepath(@Nonnull File reportPath){
return new File(getBaseFilepath(reportPath)+".html");
}

public static String getBaseFilepath(File reportPath){
return reportPath.getParentFile().getAbsolutePath()+"/"+getBaseFilename(reportPath);
public static String getBaseFilepath(@Nonnull File reportPath){
File parentFile = reportPath.getParentFile();
if (parentFile == null) {
throw new IllegalArgumentException("The report path " + reportPath + " does not have a directory specification. " +
"A correct path should be something like 'out/pct-report.xml'");
}
return parentFile.getAbsolutePath()+"/"+getBaseFilename(reportPath);
}

public static String getBaseFilename(File reportPath){
Expand Down Expand Up @@ -163,8 +170,8 @@ public static PluginCompatReport fromXml(File reportPath) throws IOException {
return report;
}

private static XStream createXStream(){
XStream xstream = new XStream();
private static XStream2 createXStream(){
XStream2 xstream = new XStream2(new Xpp3DomDriver());
xstream.setMode(XStream.NO_REFERENCES);
xstream.alias("pluginInfos", PluginInfos.class);
xstream.alias("coord", MavenCoordinates.class);
Expand Down

0 comments on commit 6edde7f

Please sign in to comment.