diff options
author | chibash <chiba@javassist.org> | 2013-12-02 20:05:24 +0900 |
---|---|---|
committer | Scott Marlow <smarlow@redhat.com> | 2013-12-02 10:12:27 -0500 |
commit | 7b73bcb55349356b3819c732a18d8a20bf5073d6 (patch) | |
tree | 712135e21a0a1b262fe0a8b530059683a30156a1 /src/test/javassist/JvstTest4.java | |
parent | bf5722a70048db339334b23793465c299922785b (diff) | |
download | javassist-7b73bcb55349356b3819c732a18d8a20bf5073d6.tar.gz javassist-7b73bcb55349356b3819c732a18d8a20bf5073d6.zip |
fixed JASSIST-211
Diffstat (limited to 'src/test/javassist/JvstTest4.java')
-rw-r--r-- | src/test/javassist/JvstTest4.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index df4533bb..f1aca09e 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -938,4 +938,22 @@ public class JvstTest4 extends JvstTestRoot { cc.writeFile(); Object obj = make(cc.getName()); } + + public void testWhileTrueKO() throws Exception { + final ClassPool pool = ClassPool.getDefault(); + final CtClass cc = pool.makeClass("test4.TestWhileTrueKO"); + String source = "public void testWhile() { while(true) { break; } }"; + cc.addMethod(CtMethod.make(source, cc)); + cc.writeFile(); + make(cc.getName()); + } + + public void testWhileTrueOK() throws Exception { + final ClassPool pool = ClassPool.getDefault(); + final CtClass cc = pool.makeClass("test4.TestWhileTrueOK"); + String source = "public void testWhile() { while(0==0) { break; }}"; + cc.addMethod(CtMethod.make(source, cc)); + cc.writeFile(); + make(cc.getName()); + } } |