Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Commit

Permalink
reproduced JENKINS-19383
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Oct 25, 2013
1 parent a62e389 commit 9deadd5
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 4 deletions.
26 changes: 26 additions & 0 deletions pom.xml
Expand Up @@ -59,6 +59,31 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
<version>2.3.0</version>
<outputDirectory>target</outputDirectory>
<destFileName>ivy.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand All @@ -84,6 +109,7 @@
<artifactId>constant-pool-scanner</artifactId>
<version>1.2</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions src/test/client/Main.java
Expand Up @@ -4,6 +4,7 @@
import java.lang.String;
import java.lang.System;
import java.util.*;
import org.apache.ivy.core.settings.*;

/**
* Code that refers to classes that change.
Expand Down Expand Up @@ -62,4 +63,10 @@ void runTest() {
}
new SubType().runTest();
}

public void testJenkins19383() {
Jenkins19383 j = new Jenkins19383();
assertNotNull(j.triggers);
new IvySettings(new IvyVariableContainerImpl());
}
}
7 changes: 3 additions & 4 deletions src/test/java/CompatibilityTest.java
Expand Up @@ -37,8 +37,6 @@ private void assertFieldType(Class<?> i, Class<?> type, String name) throws NoSu
}

private AntClassLoader createClassLoader(String v) throws IOException {
File f1 = new File("target/test-classes/"+ v);
File f2 = new File("target/test-classes/client");
final Transformer t = new Transformer();
AntClassLoader cl = new AntClassLoader() {
@Override
Expand All @@ -52,8 +50,9 @@ protected Class<?> defineClassFromData(File container, byte[] classData, String
}
};

cl.addPathComponent(f1);
cl.addPathComponent(f2);
cl.addPathComponent(new File("target/test-classes/"+ v));
cl.addPathComponent(new File("target/test-classes/client"));
cl.addPathComponent(new File("target/ivy.jar"));

t.loadRules(cl);

Expand Down
2 changes: 2 additions & 0 deletions src/test/v1/Foo.java
@@ -1,5 +1,7 @@
import java.util.*;

// this is the code against which the client is compiled
// the test will then run that client with the v2 version.
class Foo {
static class Inner {
List x = new ArrayList();
Expand Down
5 changes: 5 additions & 0 deletions src/test/v1/Jenkins19383.java
@@ -0,0 +1,5 @@
import java.util.*;

class Jenkins19383 {
public List triggers = new ArrayList();
}
7 changes: 7 additions & 0 deletions src/test/v2/Jenkins19383.java
@@ -0,0 +1,7 @@
import org.jenkinsci.bytecode.AdaptField;
import java.util.*;

class Jenkins19383 {
@AdaptField(was=List.class)
public LinkedList triggers = new LinkedList();
}

0 comments on commit 9deadd5

Please sign in to comment.