From: aclement Date: Thu, 7 Jan 2010 03:27:33 +0000 (+0000) Subject: remove aspectjrt dependency X-Git-Tag: V1_6_8~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fe3e4e542930d7ea4b516823c4258ca7df782c6d;p=aspectj.git remove aspectjrt dependency --- diff --git a/loadtime/.classpath b/loadtime/.classpath index c4d795a66..2d821b9df 100644 --- a/loadtime/.classpath +++ b/loadtime/.classpath @@ -14,6 +14,5 @@ - diff --git a/loadtime/testdata/anaspect.jar b/loadtime/testdata/anaspect.jar new file mode 100644 index 000000000..5fae3393a Binary files /dev/null and b/loadtime/testdata/anaspect.jar differ diff --git a/loadtime/testsrc/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java b/loadtime/testsrc/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java index d222d0140..9565e8ce1 100644 --- a/loadtime/testsrc/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java +++ b/loadtime/testsrc/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java @@ -23,7 +23,6 @@ import junit.framework.TestCase; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; -import org.aspectj.lang.annotation.Aspect; import org.aspectj.weaver.World; import org.aspectj.weaver.World.TypeMap; import org.aspectj.weaver.bcel.BcelWorld; @@ -466,7 +465,8 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { // } public void testAcceptanceSpeedStarDotDotStar() throws Exception { - URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL() }, null); + URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL(), + new File("../loadtime/testdata/anaspect.jar").toURI().toURL() }, null); JavaClass jc = getClassFrom("../loadtime/bin", "org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest$TestOne"); byte[] bs = jc.getBytes(); @@ -477,7 +477,7 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { TestWeavingContext wc = new TestWeavingContext(loader); Definition d = new Definition(); d.getExcludePatterns().add("*..*CGLIB*"); - d.getAspectClassNames().add("org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest$AnAspect"); + d.getAspectClassNames().add("AnAspect"); wc.addDefinition(d); ClassLoaderWeavingAdaptor adaptor = new ClassLoaderWeavingAdaptor(); adaptor.initialize(loader, wc); @@ -516,7 +516,8 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { // excludes="!xxxx" should also be fast matched... public void testAcceptanceSpeedExactName() throws Exception { - URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL() }, null); + URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL(), + new File("../loadtime/testdata/anaspect.jar").toURI().toURL() }, null); JavaClass jc = getClassFrom("../loadtime/bin", "org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest$TestOne"); byte[] bs = jc.getBytes(); @@ -527,7 +528,7 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { TestWeavingContext wc = new TestWeavingContext(loader); Definition d = new Definition(); d.getExcludePatterns().add("org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest.TestOneCGLIB"); - d.getAspectClassNames().add("org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest$AnAspect"); + d.getAspectClassNames().add("AnAspect"); wc.addDefinition(d); TestClassLoaderWeavingAdaptor adaptor = new TestClassLoaderWeavingAdaptor(); adaptor.initialize(loader, wc); @@ -580,11 +581,12 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { public TestClassLoaderWeavingAdaptor getAdaptor(Definition... definitions) { try { - URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL() }, null); + URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL(), + new File("../loadtime/testdata/anaspect.jar").toURI().toURL() }, null); TestWeavingContext wc = new TestWeavingContext(loader); for (Definition definition : definitions) { // need some random aspect or the weaver will shut down! - definition.getAspectClassNames().add("org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest$AnAspect"); + definition.getAspectClassNames().add("AnAspect"); wc.addDefinition(definition); } TestClassLoaderWeavingAdaptor adaptor = new TestClassLoaderWeavingAdaptor(); @@ -597,7 +599,8 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { public TestClassLoaderWeavingAdaptor getAdaptor(String[] includePatterns, String[] excludePatterns) { try { - URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL() }, null); + URLClassLoader loader = new URLClassLoader(new URL[] { new File("../loadtime/bin").toURI().toURL(), + new File("../loadtime/testdata/anaspect.jar").toURI().toURL() }, null); TestWeavingContext wc = new TestWeavingContext(loader); Definition d = new Definition(); if (includePatterns != null) { @@ -611,7 +614,7 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { } } // need some random aspect or the weaver will shut down! - d.getAspectClassNames().add("org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest$AnAspect"); + d.getAspectClassNames().add("AnAspect"); wc.addDefinition(d); TestClassLoaderWeavingAdaptor adaptor = new TestClassLoaderWeavingAdaptor(); adaptor.initialize(loader, wc); @@ -661,10 +664,11 @@ public class ClassLoaderWeavingAdaptorTest extends TestCase { return SyntheticRepository.getInstance(cp); } - @Aspect - static class AnAspect { - - } + // + // @Aspect + // static class AnAspect { + // + // } class TestOne {