Skip to content

Commit 55c0535

Browse files
committed
Add Java 11 to smoke test matrix
1 parent 3c65f76 commit 55c0535

File tree

18 files changed

+49
-26
lines changed

18 files changed

+49
-26
lines changed

agent/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ shadowJar() {
7474
// javax.lang.model.element.Modifier which is no longer in the bootstrap class loader in Java 9, and this causes
7575
// spring class path scanning to fail when trying to read com.google.errorprone.annotations.ForOverride
7676
// (java.lang.NoClassDefFoundError: [Ljavax/lang/model/element/Modifier;)
77-
exclude shadowPrefix.replace('.', '/') + '/com/google/errorprone/**'
77+
exclude 'com/google/errorprone/**'
7878
}
7979

8080
task shadowJar2(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
openjdk:7-jre
2-
openjdk:8-jre
2+
openjdk:8-jre
3+
azul/zulu-openjdk:11

test/smoke/framework/testCore/src/main/java/com/microsoft/applicationinsights/smoketest/AiSmokeTest.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import java.io.File;
4242
import java.io.FileReader;
4343
import java.io.IOException;
44+
import java.net.URL;
4445
import java.util.ArrayDeque;
4546
import java.util.ArrayList;
4647
import java.util.Arrays;
@@ -70,11 +71,18 @@ public static Collection<Object[]> parameterGenerator() throws IOException {
7071
List<String> appServers = Resources.readLines(Resources.getResource("appServers.txt"), Charsets.UTF_8);
7172
System.out.println("Target appservers="+Arrays.toString(appServers.toArray()));
7273
String os = System.getProperty("applicationinsights.smoketest.os", "linux");
74+
URL jreExcludesURL = Thread.currentThread().getContextClassLoader().getResource("jre.excludes.txt");
75+
List<String> jreExcludes;
76+
if (jreExcludesURL == null) {
77+
jreExcludes = new ArrayList<>();
78+
} else {
79+
jreExcludes = Resources.readLines(jreExcludesURL, Charsets.UTF_8);
80+
}
7381
Multimap<String, String> appServers2jres = HashMultimap.create();
7482
for (String appServer : appServers) {
7583
List<String> serverJres;
7684
try {
77-
serverJres = getAppServerJres(appServer);
85+
serverJres = getAppServerJres(appServer, jreExcludes);
7886
} catch (Exception e) {
7987
System.err.printf("SKIPPING '%s'. Could not configure jres: %s%n", appServer, e);
8088
continue;
@@ -93,14 +101,14 @@ public static Collection<Object[]> parameterGenerator() throws IOException {
93101
return rval;
94102
}
95103

96-
private static List<String> getAppServerJres(String appServer) throws IOException {
97-
List<String> rval = Resources.readLines(Resources.getResource(appServer+".jre.txt"), Charsets.UTF_8);
98-
return Lists.transform(rval, new Function<String, String>() {
99-
@Override
100-
public String apply(String input) {
101-
return input.replaceAll("[:/]", "_");
104+
private static List<String> getAppServerJres(String appServer, List<String> jreExcludes) throws IOException {
105+
List<String> jres = new ArrayList<>();
106+
for (String jre : Resources.readLines(Resources.getResource(appServer+".jre.txt"), Charsets.UTF_8)) {
107+
if (!jreExcludes.contains(jre)) {
108+
jres.add(jre.replaceAll("[:/]", "_"));
102109
}
103-
});
110+
}
111+
return jres;
104112
}
105113

106114
@Parameter(0) public String appServer;

test/smoke/testApps/SpringBoot1_3Auto/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ ext.testAppArtifactFilename = war.archiveFileName.get()
1010

1111
dependencies {
1212
compile aiWebAutoJar
13-
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.21.RELEASE'
14-
providedRuntime group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '1.5.21.RELEASE'
13+
compile (group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.3.8.RELEASE') {
14+
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
15+
}
1516

1617
providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
1718
}

test/smoke/testApps/SpringBoot1_3Auto/src/main/java/com/microsoft/ajl/simple/SpringBootApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.springframework.boot.autoconfigure.SpringBootApplication;
44
import org.springframework.boot.builder.SpringApplicationBuilder;
5-
import org.springframework.boot.web.support.SpringBootServletInitializer;
5+
import org.springframework.boot.context.web.SpringBootServletInitializer;
66

77
@SpringBootApplication
88
public class SpringBootApp extends SpringBootServletInitializer {

test/smoke/testApps/SpringBoot1_3Auto/src/main/java/com/microsoft/ajl/simple/TestController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
package com.microsoft.ajl.simple;
22

3-
import org.springframework.web.bind.annotation.GetMapping;
3+
import org.springframework.web.bind.annotation.RequestMapping;
4+
import org.springframework.web.bind.annotation.RequestMethod;
45
import org.springframework.web.bind.annotation.RestController;
56

67
@RestController
78
public class TestController {
89

9-
@GetMapping("/")
10+
@RequestMapping(path = "/", method = RequestMethod.GET)
1011
public String root() {
1112
return "OK";
1213
}
1314

1415

15-
@GetMapping("/test")
16+
@RequestMapping(path = "/test", method = RequestMethod.GET)
1617
public String test() {
1718
return "OK!";
1819
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`jre.excludes.txt` is needed because Spring Boot 1.3 does not support Java 11
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
azul/zulu-openjdk:11

test/smoke/testApps/SpringBootAuto/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ ext.testAppArtifactFilename = war.archiveFileName.get()
1010

1111
dependencies {
1212
compile aiWebAutoJar
13-
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.21.RELEASE'
14-
providedRuntime group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '1.5.21.RELEASE'
13+
compile (group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.1.7.RELEASE') {
14+
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
15+
}
16+
compile group: 'org.reactivestreams', name: 'reactive-streams', version: '1.0.3'
1517

1618
providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
1719
}

test/smoke/testApps/SpringBootAuto/src/main/java/com/microsoft/ajl/simple/SpringBootApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.springframework.boot.autoconfigure.SpringBootApplication;
44
import org.springframework.boot.builder.SpringApplicationBuilder;
5-
import org.springframework.boot.web.support.SpringBootServletInitializer;
5+
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
66

77
@SpringBootApplication
88
public class SpringBootApp extends SpringBootServletInitializer {

0 commit comments

Comments
 (0)