diff options
author | aclement <aclement> | 2005-11-11 13:51:57 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-11 13:51:57 +0000 |
commit | 3226d27a82e968da0f04e6b4fb5a29a03fbdb0f5 (patch) | |
tree | 4cf014693721667e4d77cfbfb8338b8042273003 /loadtime/testsrc | |
parent | 7218c96f13f61055bf2952778fc0b44848e43663 (diff) | |
download | aspectj-3226d27a82e968da0f04e6b4fb5a29a03fbdb0f5.tar.gz aspectj-3226d27a82e968da0f04e6b4fb5a29a03fbdb0f5.zip |
Matthews patches from 95529
Diffstat (limited to 'loadtime/testsrc')
-rw-r--r-- | loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java b/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java index fe3139314..093a0125a 100644 --- a/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java +++ b/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java @@ -69,6 +69,11 @@ public class WeavingURLClassLoaderTest extends TestCase { } } + /* + * We won't get an exception because the aspect path is empty and there is + * no aop.xml file so the weaver will be disabled and no reweaving will + * take place + */ public void testLoadWovenClass () { setSystemProperty(WeavingURLClassLoader.WEAVING_ASPECT_PATH,""); setSystemProperty(WeavingURLClassLoader.WEAVING_CLASS_PATH,WOVEN_JAR); @@ -83,6 +88,9 @@ public class WeavingURLClassLoaderTest extends TestCase { } } + /* + * We get an exception because the class was not built reweavable + */ public void testWeaveWovenClass () { setSystemProperty(WeavingURLClassLoader.WEAVING_ASPECT_PATH,ADVICE_ASPECTS); setSystemProperty(WeavingURLClassLoader.WEAVING_CLASS_PATH,ADVICE_ASPECTS + File.pathSeparator + WOVEN_JAR); @@ -345,6 +353,7 @@ public class WeavingURLClassLoaderTest extends TestCase { fail("Expecting java.lang.NoClassDefFoundError"); } catch (Exception ex) { + assertTrue("Expecting java.lang.NoClassDefFoundError but caught " + ex,ex.getMessage().contains("java.lang.NoClassDefFoundError")); } } @@ -463,7 +472,9 @@ public class WeavingURLClassLoaderTest extends TestCase { method.invoke(null,params); } catch (InvocationTargetException ex) { - throw new RuntimeException(ex.getTargetException().toString()); + Throwable targetException = ex.getTargetException(); + if (targetException instanceof RuntimeException) throw (RuntimeException)ex.getTargetException(); + else throw new RuntimeException(ex.getTargetException().toString()); } catch (Exception ex) { throw new RuntimeException(ex.toString()); |