aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/Test.java
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2013-08-11 21:52:08 +0900
committerchibash <chiba@javassist.org>2013-08-11 21:52:08 +0900
commite5492bf606d2054122e5a79e6ae9306da07f0742 (patch)
treeba85a205081558d5cddddcd3e2a7c402f3d5ae1b /src/test/Test.java
parent9098c6f88cfcde95115d44d49b766bb4e8f715ff (diff)
downloadjavassist-e5492bf606d2054122e5a79e6ae9306da07f0742.tar.gz
javassist-e5492bf606d2054122e5a79e6ae9306da07f0742.zip
fixed JASSIST-207
Diffstat (limited to 'src/test/Test.java')
-rw-r--r--src/test/Test.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/Test.java b/src/test/Test.java
new file mode 100644
index 00000000..51591cf9
--- /dev/null
+++ b/src/test/Test.java
@@ -0,0 +1,16 @@
+import javassist.*;
+
+public class Test {
+ public static void main(String[] args) throws Exception {
+ ClassPool cp = ClassPool.getDefault();
+ // ClassPool cp = new ClassPool();
+ cp.insertClassPath("./target/test-classes");
+ CtClass cc = cp.get("test4.JIRA207");
+ // cc.getClassFile().setMajorVersion(javassist.bytecode.ClassFile.JAVA_4);
+ CtMethod cm = cc.getDeclaredMethod("foo");
+ cm.insertBefore("throw new Exception();");
+ CtMethod cm2 = cc.getDeclaredMethod("run2");
+ cm2.insertBefore("throw new Exception();");
+ cc.writeFile();
+ }
+}