Skip to content

Commit

Permalink
adds a test case for JIRA JASSIST-248
Browse files Browse the repository at this point in the history
  • Loading branch information
chibash committed Sep 24, 2015
1 parent e68077d commit 5bbbcdf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/javassist/JvstTest5.java
Expand Up @@ -125,4 +125,14 @@ public void testInnerClassAttributeRemove() throws Exception {
Object obj = make(cc.getName());
assertEquals(1, invoke(obj, "run"));
}

public void testJIRA248() throws Exception {
CtClass cc = sloader.get("test5.JIRA248");
String methodBody = "public int run() { return foo() + super.foo(); }";
CtMethod ctMethod = CtMethod.make(methodBody, cc);
cc.addMethod(ctMethod);
cc.writeFile();
Object obj = make(cc.getName());
assertEquals(71, invoke(obj, "run"));
}
}
12 changes: 12 additions & 0 deletions src/test/test5/JIRA248.java
@@ -0,0 +1,12 @@
package test5;

interface JIRA248Intf {
default int foo() { return 1; }
}

class JIRA248Sup implements JIRA248Intf {
}

public class JIRA248 extends JIRA248Sup {
public int foo() { return 70; }
}

0 comments on commit 5bbbcdf

Please sign in to comment.