Skip to content

Commit

Permalink
Update dependencies to LTS 5.6
Browse files Browse the repository at this point in the history
This commit updates the dependencies to the ones provided by
SonarQube LTS 5.6.

SonarQube LTS 5.6 requires Java 8 so using Java 7 methods is fine

 * update JUnit to latest
 * update Mockito to latest
 * udpate SonarQube parent to latest
 * udpate SLF4J to the one provided by LTS 5.6
 * since LTS 5.6 requires Java 1.8 we now also require Java 1.8
 * replace deprecated JUnit usage
 * replace MockSensorContext with Mockito mock
 * remove not needed maven-project dependency
 * use ${project.version} instead of -SNAPSHOT versions where possible
   this will avoid issues during a Maven release
 * remove any dependency on commons-lang to void conflicts with ones
   supplied by SonarQube
 * remove any dependency on commons-io to void conflicts with ones
   supplied by SonarQube
  • Loading branch information
marschall committed Feb 9, 2017
1 parent ca80a85 commit cd6ad12
Show file tree
Hide file tree
Showing 13 changed files with 175 additions and 350 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ install: true

jdk:
- oraclejdk8
- openjdk7

script:
- mvn verify -B -e -V
Expand All @@ -14,4 +13,4 @@ cache:
- '$HOME/.m2/repository'

notifications:
email: false
email: false
2 changes: 1 addition & 1 deletion jmeter-report-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- slf4j-log4j12 will be used for testing -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@

package es.excentia.jmeter.report.client.util;

import junit.framework.Assert;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class JavaUtilTest {

@Test
public void testAll() {
Assert.assertTrue(JavaUtil.getJREMajorVersion()>0);
Assert.assertTrue(JavaUtil.getJREMinorVersion()>0);
assertTrue(JavaUtil.getJREMajorVersion() > 0);
assertTrue(JavaUtil.getJREMinorVersion() > 0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@

package es.excentia.jmeter.report.client.util;

import junit.framework.Assert;
import static org.junit.Assert.*;

import org.junit.Test;

public class StringUtilTest {

@Test
public void isBlankTest() {
Assert.assertTrue(StringUtil.isBlank(null));
Assert.assertTrue(StringUtil.isBlank(""));
Assert.assertTrue(StringUtil.isBlank(" "));
Assert.assertTrue(StringUtil.isBlank(" "));
Assert.assertFalse(StringUtil.isBlank("a"));
Assert.assertFalse(StringUtil.isBlank("ab"));
assertTrue(StringUtil.isBlank(null));
assertTrue(StringUtil.isBlank(""));
assertTrue(StringUtil.isBlank(" "));
assertTrue(StringUtil.isBlank(" "));
assertFalse(StringUtil.isBlank("a"));
assertFalse(StringUtil.isBlank("ab"));
}

}
4 changes: 2 additions & 2 deletions jmeter-report-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<version>4.12</version>
<scope>test</scope>
</dependency>

<!-- JMeter Report Client -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jmeter-report-client</artifactId>
<version>0.5-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>

<!-- Logging -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@

package es.excentia.jmeter.report.server.testresults;

import java.io.InputStream;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import junit.framework.Assert;
import java.io.InputStream;

import org.junit.Test;

Expand All @@ -36,13 +37,13 @@ public void testReadJtlFile() throws Exception {
for (String config : JMeterReportServerTestConst.TEST_CONFIGS) {
InputStream is = getClass()
.getResourceAsStream("/" + config + ".jtl.xml");
Assert.assertNotNull("No se encontró en el classpath " + config
assertNotNull("No se encontró en el classpath " + config
+ ".jtl.xml", is);

JtlAbstractSampleReader jtlReader = new JtlAbstractSampleReader(is);
AbstractSample sample = jtlReader.read();
while (sample != null) {
Assert.assertTrue(sample.getTs() > -1);
assertTrue(sample.getTs() > -1);
sample = jtlReader.read();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.HashMap;
import java.util.Map;

import junit.framework.Assert;
import static org.junit.Assert.*;

import org.apache.xmlbeans.XmlOptions;
import org.junit.Test;
Expand All @@ -39,20 +39,20 @@ public class TestResultsDocumentTest {
public void testLoadFile() throws Exception {

// Bind the incoming XML to an XMLBeans type.
InputStream is = getClass().getResourceAsStream("/test-http.jtl.xml");
Assert
.assertNotNull("No se encontró en el classpath test-http.jtl.xml", is);
try (InputStream is = getClass().getResourceAsStream("/test-http.jtl.xml")) {
assertNotNull("No se encontró en el classpath test-http.jtl.xml", is);

XmlOptions options = new XmlOptions();
Map<String, String> ns = new HashMap<String, String>();
ns.put("", JtlAbstractSampleReader.NAMESPACE);
XmlOptions options = new XmlOptions();
Map<String, String> ns = new HashMap<String, String>();
ns.put("", JtlAbstractSampleReader.NAMESPACE);

options.setLoadSubstituteNamespaces(ns);
TestResultsDocument doc = TestResultsDocument.Factory.parse(is, options);
options.setLoadSubstituteNamespaces(ns);
TestResultsDocument doc = TestResultsDocument.Factory.parse(is, options);

TestResults testResults = doc.getTestResults();
Assert.assertNotNull(testResults.getHttpSampleArray());
Assert.assertTrue(testResults.getHttpSampleArray().length > 0);
TestResults testResults = doc.getTestResults();
assertNotNull(testResults.getHttpSampleArray());
assertTrue(testResults.getHttpSampleArray().length > 0);
}
}

}
40 changes: 21 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.codehaus.sonar-plugins</groupId>
<groupId>org.sonarsource.parent</groupId>
<artifactId>parent</artifactId>
<version>19</version>
<relativePath>../parent</relativePath>
<version>38</version>
</parent>

<groupId>org.codehaus.sonar-plugins.jmeter</groupId>
Expand Down Expand Up @@ -89,14 +88,23 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!--
Inherit from org.codehaus.sonar-plugins:parent:18.pom
<jdk.min.version>1.6</jdk.min.version>
Inherit from org.sonarsource.parent:parent:38:pom
-->
<slf4j.version>1.5.6</slf4j.version>
<slf4j.version>1.7.12</slf4j.version>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<!-- doesn't match expectations from parent -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>

<!--This plugin's configuration is used to store Eclipse m2e settings
Expand All @@ -110,28 +118,22 @@
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
com.mycila.maven-license-plugin
</groupId>
<artifactId>
maven-license-plugin
</artifactId>
<versionRange>
[1.9.0,)
</versionRange>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<versionRange>[2.11,)</versionRange>
<goals>
<goal>check</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</pluginManagement>
</build>
</project>
</project>
20 changes: 7 additions & 13 deletions sonar-jmeter-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<properties>
<sonar.pluginClass>org.sonar.plugins.jmeter.JMeterPlugin</sonar.pluginClass>
<sonar.pluginName>JMeter</sonar.pluginName>
<sonar.version>4.5.1</sonar.version>
<sonar.version>5.6.5</sonar.version>
</properties>

<dependencies>
<!-- Sonar plugin -->
<dependency>
<groupId>org.codehaus.sonar</groupId>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>${sonar.version}</version>
<scope>provided</scope>
Expand Down Expand Up @@ -52,7 +52,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-testing-harness</artifactId>
<version>${sonar.version}</version>
<scope>test</scope>
Expand All @@ -70,14 +70,8 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.0.7</version>
<artifactId>mockito-core</artifactId>
<version>2.7.5</version>
<scope>test</scope>
</dependency>

Expand All @@ -89,12 +83,12 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jmeter-report-client</artifactId>
<version>0.5-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jmeter-report-server</artifactId>
<version>0.5-SNAPSHOT</version>
<version>${project.version}</version>
<exclusions>
<!--
Sonar will provide log4j-over-slf4j in
Expand Down
Loading

0 comments on commit cd6ad12

Please sign in to comment.