Browse Source

modifies a test case for JIRA JASSIST-248.

tags/rel_3_21_0-java9-ea
chibash 8 years ago
parent
commit
5b0544a385
2 changed files with 8 additions and 3 deletions
  1. 2
    2
      src/test/javassist/JvstTest5.java
  2. 6
    1
      src/test/test5/JIRA248.java

+ 2
- 2
src/test/javassist/JvstTest5.java View File

@@ -128,11 +128,11 @@ public class JvstTest5 extends JvstTestRoot {

public void testJIRA248() throws Exception {
CtClass cc = sloader.get("test5.JIRA248");
String methodBody = "public int run() { return foo() + super.foo() + super.bar(); }";
String methodBody = "public int run() { return foo() + super.foo() + super.bar() + test5.JIRA248Intf2.super.baz(); }";
CtMethod ctMethod = CtMethod.make(methodBody, cc);
cc.addMethod(ctMethod);
cc.writeFile();
Object obj = make(cc.getName());
assertEquals(271, invoke(obj, "run"));
assertEquals(40271, invoke(obj, "run"));
}
}

+ 6
- 1
src/test/test5/JIRA248.java View File

@@ -4,6 +4,10 @@ interface JIRA248Intf {
default int foo() { return 1; }
}

interface JIRA248Intf2 {
default int baz() { return 40000; }
}

class JIRA248Sup2 {
public int bar() { return 200; }
}
@@ -11,7 +15,8 @@ class JIRA248Sup2 {
class JIRA248Sup extends JIRA248Sup2 implements JIRA248Intf {
}

public class JIRA248 extends JIRA248Sup {
public class JIRA248 extends JIRA248Sup implements JIRA248Intf2 {
public int foo() { return 70; }
public int bar() { return 3000; }
public int baz() { return 500000; }
}

Loading…
Cancel
Save