aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime
diff options
context:
space:
mode:
authoraclement <aclement>2010-05-05 16:51:48 +0000
committeraclement <aclement>2010-05-05 16:51:48 +0000
commit84226fc188d2e5deb532d0d49841ffbd019670b1 (patch)
treec4928fa4e35799d4d30e300e0b88aa079bfb701b /loadtime
parentf36300f8ce14d6d971144a62a784d11c9540379d (diff)
downloadaspectj-84226fc188d2e5deb532d0d49841ffbd019670b1.tar.gz
aspectj-84226fc188d2e5deb532d0d49841ffbd019670b1.zip
311762
Diffstat (limited to 'loadtime')
-rw-r--r--loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java b/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java
index 98e427833..0305b9660 100644
--- a/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java
+++ b/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java
@@ -83,6 +83,20 @@ public class WeavingURLClassLoaderTest extends TestCase {
}
}
+ public void testGarbageName() {
+ setSystemProperty(WeavingURLClassLoader.WEAVING_ASPECT_PATH, "");
+ setSystemProperty(WeavingURLClassLoader.WEAVING_CLASS_PATH, WOVEN_JAR);
+ WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader());
+
+ try {
+ loader.loadClass("[Lorg.springframework.webflow.config.FlowLocation;Editor");
+ } catch (ClassNotFoundException cnfe) {
+ // success!
+ } catch (Exception ex) {
+ fail(ex.toString());
+ }
+ }
+
/*
* We get an exception because the class was not built reweavable
*/
@@ -490,10 +504,11 @@ public class WeavingURLClassLoaderTest extends TestCase {
method.invoke(null, params);
} catch (InvocationTargetException ex) {
Throwable targetException = ex.getTargetException();
- if (targetException instanceof RuntimeException)
+ if (targetException instanceof RuntimeException) {
throw (RuntimeException) ex.getTargetException();
- else
+ } else {
throw new RuntimeException(ex.getTargetException().toString());
+ }
} catch (Exception ex) {
throw new RuntimeException(ex.toString());
}
@@ -523,10 +538,11 @@ public class WeavingURLClassLoaderTest extends TestCase {
for (Enumeration enu = savedProperties.keys(); enu.hasMoreElements();) {
String key = (String) enu.nextElement();
String value = savedProperties.getProperty(key);
- if (value == NULL)
+ if (value == NULL) {
systemProperties.remove(key);
- else
+ } else {
systemProperties.setProperty(key, value);
+ }
}
}