Skip to content

Commit a9ddf67

Browse files
authored
Merge pull request #38 from timja/update-docker-fixtures
Update docker fixtures for Java 11
2 parents 67aff4a + 81b0ba3 commit a9ddf67

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

pom.xml

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.jenkins-ci</groupId>
66
<artifactId>jenkins</artifactId>
7-
<version>1.54</version>
7+
<version>1.76</version>
88
<relativePath />
99
</parent>
1010
<groupId>org.jenkins-ci.test</groupId>
@@ -51,14 +51,13 @@
5151
</build>
5252
<properties>
5353
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
54-
<java.level>8</java.level>
55-
<findbugs.failOnError>false</findbugs.failOnError> <!-- TODO -->
54+
<spotbugs.failOnError>false</spotbugs.failOnError> <!-- TODO -->
5655
</properties>
5756
<dependencies>
5857
<dependency>
5958
<groupId>commons-io</groupId>
6059
<artifactId>commons-io</artifactId>
61-
<version>2.7</version>
60+
<version>2.11.0</version>
6261
</dependency>
6362
<dependency>
6463
<groupId>org.jenkins-ci</groupId>
@@ -68,12 +67,12 @@
6867
<dependency>
6968
<groupId>com.fasterxml.jackson.core</groupId>
7069
<artifactId>jackson-databind</artifactId>
71-
<version>2.13.0</version>
70+
<version>2.13.3</version>
7271
</dependency>
7372
<dependency>
7473
<groupId>org.jenkins-ci</groupId>
7574
<artifactId>annotation-indexer</artifactId>
76-
<version>1.9</version>
75+
<version>1.16</version>
7776
<optional>true</optional>
7877
</dependency>
7978
<dependency>
@@ -84,12 +83,11 @@
8483
<dependency>
8584
<groupId>junit</groupId>
8685
<artifactId>junit</artifactId>
87-
<version>4.13.1</version>
8886
</dependency>
8987
<dependency>
9088
<groupId>org.jboss.shrinkwrap</groupId>
9189
<artifactId>shrinkwrap-depchain</artifactId>
92-
<version>1.2.2</version>
90+
<version>1.2.6</version>
9391
<type>pom</type>
9492
<scope>test</scope>
9593
</dependency>

src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/JavaContainer/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ FROM jenkins/sshd:32edfdd58111
88
RUN apt-get update && \
99
apt-get install --no-install-recommends -y \
1010
software-properties-common \
11-
openjdk-8-jre-headless \
12-
openjdk-8-jdk-headless \
11+
openjdk-11-jdk-headless \
1312
curl \
1413
ant \
1514
maven

src/test/java/org/jenkinsci/test/acceptance/docker/fixtures/JavaContainerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static void backToCache() {
8585
@Test
8686
public void smokes() throws Exception {
8787
JavaContainer c = rule.get();
88-
assertThat(c.popen(new CommandBuilder("java", "-version")).verifyOrDieWith("could not launch Java"), containsString("openjdk version \"1.8.0_"));
88+
assertThat(c.popen(new CommandBuilder("java", "-version")).verifyOrDieWith("could not launch Java"), containsString("openjdk version \"11"));
8989
c.sshWithPublicKey(new CommandBuilder("id"));
9090
}
9191

src/test/java/org/jenkinsci/test/acceptance/docker/fixtures/SshdContainerTest.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626

2727
import static org.hamcrest.CoreMatchers.allOf;
2828
import static org.hamcrest.CoreMatchers.containsString;
29+
import static org.hamcrest.MatcherAssert.assertThat;
30+
2931
import org.jenkinsci.test.acceptance.docker.DockerRule;
3032
import org.junit.Rule;
3133
import org.junit.Test;
3234

3335
import org.jenkinsci.utils.process.CommandBuilder;
34-
import static org.junit.Assert.assertThat;
3536

3637
public class SshdContainerTest {
3738

@@ -50,12 +51,10 @@ public void smokes() throws Exception {
5051
public void locale() throws Exception {
5152
JavaContainer c = javaContainerRule.get();
5253
// cf. https://stackoverflow.com/a/4384506/12916
53-
assertThat(c.popen(new CommandBuilder("jrunscript", "-e", "'println(java.lang.System.getProperty(\"file.encoding\") + \" vs. \" + java.lang.System.getProperty(\"sun.jnu.encoding\"))'")).verifyOrDieWith("could not run jrunscript"),
54+
assertThat(c.popen(new CommandBuilder("echo", "'System.out.println(System.getProperty(\"file.encoding\") + \" vs. \" + System.getProperty(\"sun.jnu.encoding\"))'", "| jshell -")).verifyOrDieWith("could not run jshell"),
5455
containsString("UTF-8 vs. UTF-8"));
55-
assertThat(c.popen(new CommandBuilder("jrunscript", "-e", "'var f = new java.io.File(\"hello\\u010d\\u0950\"); new java.io.FileOutputStream(f).close(); println(\"name: \" + java.net.URLEncoder.encode(f.name, \"UTF-8\")); println(\"exists: \" + f.file)'")).verifyOrDieWith("could not run jrunscript"),
56+
assertThat(c.popen(new CommandBuilder("echo", "'var f = new java.io.File(\"hello\\u010d\\u0950\"); new java.io.FileOutputStream(f).close(); System.out.println(\"name: \" + java.net.URLEncoder.encode(f.getName(), \"UTF-8\")); System.out.println(\"exists: \" + f.exists())'", "| jshell -")).verifyOrDieWith("could not run jshell"),
5657
allOf(containsString("exists: true"), containsString("name: hello%C4%8D%E0%A5%90")));
57-
assertThat(c.popen(new CommandBuilder("sh", "-c", "'ls | native2ascii -encoding UTF-8'")).verifyOrDieWith("could not run ls"),
58-
containsString("hello\\u010d\\u0950"));
5958
}
6059

6160
}

0 commit comments

Comments
 (0)