<artifactId>bridge</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>runtime</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>
public WeavingURLClassLoader(URL[] classURLs, URL[] aspectURLs, ClassLoader parent) {
super(classURLs, parent);
- // System.out.println("> WeavingURLClassLoader.WeavingURLClassLoader() classURLs=" + Arrays.asList(classURLs));
+// System.out.println(">WIB WeavingURLClassLoader.WeavingURLClassLoader() classURLs=" + Arrays.asList(classURLs));
+// System.out.println(">WIB WeavingURLClassLoader.WeavingURLClassLoader() aspectURLs=" + Arrays.asList(aspectURLs));
this.aspectURLs = aspectURLs;
/*
+++ /dev/null
-package org.aspectj.loadtime;
-
-/*******************************************************************************
- * Copyright (c) 2005 Contributors.
- * All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexandre Vasseur initial implementation
- *******************************************************************************/
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.aspectj.weaver.loadtime.AjTest;
-import org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptorTest;
-import org.aspectj.weaver.loadtime.WeavingContextTest;
-import org.aspectj.weaver.loadtime.WeavingURLClassLoaderTest;
-import org.aspectj.weaver.loadtime.test.DocumentParserTest;
-
-/**
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
- */
-public class LoadtimeModuleTests extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(LoadtimeModuleTests.class.getName());
-
- suite.addTestSuite(DocumentParserTest.class);
- suite.addTestSuite(AjTest.class);
- suite.addTestSuite(ClassLoaderWeavingAdaptorTest.class);
- // suite.addTestSuite(JRockitAgentTest.class);
- suite.addTestSuite(WeavingContextTest.class);
- suite.addTestSuite(WeavingURLClassLoaderTest.class);
- return suite;
- }
-
- public static void main(String args[]) throws Throwable {
- TestRunner.run(suite());
- }
-
-}
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
+import org.aspectj.util.FileUtil;
+
import junit.framework.TestCase;
import com.bea.jvm.ClassPreProcessor;
public void testJrockitRecursionProtection() {
URLClassLoader thisLoader = (URLClassLoader) getClass().getClassLoader();
+ URL jrockit = FileUtil.getFileURL(new File("../lib/ext/jrockit/jrockit.jar"));
+ URL[] urls = new URL[] {jrockit};
+ thisLoader = new URLClassLoader(urls, thisLoader);
ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
try {
import org.aspectj.bridge.AbortException;
import org.aspectj.testing.util.TestUtil.TestError;
import org.aspectj.util.FileUtil;
-import org.aspectj.weaver.BcweaverTests;
import org.aspectj.weaver.tools.WeavingAdaptor;
/**
*
*/
public class WeavingURLClassLoaderTest extends TestCase {
-
- private final static String ASPECTJRT = "../runtime/bin";
- private final static String CLASSES_JAR = BcweaverTests.TESTDATA_PATH + "/ltw-classes.jar";
- private final static String WOVEN_JAR = BcweaverTests.TESTDATA_PATH + "/ltw-woven.jar";
- private final static String JUNK_JAR = BcweaverTests.TESTDATA_PATH + "/ltw-junk.jar";
- private final static String ADVICE_ASPECTS = BcweaverTests.TESTDATA_PATH + "/ltw-aspects.jar";
- private final static String DW_ADVICE_ASPECTS = BcweaverTests.TESTDATA_PATH + "/ltw-dwaspects.jar";
- private final static String DE_ADVICE_ASPECTS = BcweaverTests.TESTDATA_PATH + "/ltw-deaspects.jar";
- private final static String AROUNDCLOSURE_ASPECTS = BcweaverTests.TESTDATA_PATH + "/ltw-acaspects.jar";
- private final static String ITD_ASPECTS = BcweaverTests.TESTDATA_PATH + "/ltw-itdaspects.jar";
- private final static String PER_ASPECTS = BcweaverTests.TESTDATA_PATH + "/ltw-peraspects.jar";
- private final static String TEST_BASE = BcweaverTests.TESTDATA_PATH + "/WeavingURLClassLoaderTest/builtLibs";
+
+ private final static String TESTDATA_PATH = "../weaver/testdata";
+
+ private final static String ASPECTJRT = "../runtime/target/classes";
+ private final static String CLASSES_JAR = TESTDATA_PATH + "/ltw-classes.jar";
+ private final static String WOVEN_JAR = TESTDATA_PATH + "/ltw-woven.jar";
+ private final static String JUNK_JAR = TESTDATA_PATH + "/ltw-junk.jar";
+ private final static String ADVICE_ASPECTS = TESTDATA_PATH + "/ltw-aspects.jar";
+ private final static String DW_ADVICE_ASPECTS = TESTDATA_PATH + "/ltw-dwaspects.jar";
+ private final static String DE_ADVICE_ASPECTS = TESTDATA_PATH + "/ltw-deaspects.jar";
+ private final static String AROUNDCLOSURE_ASPECTS = TESTDATA_PATH + "/ltw-acaspects.jar";
+ private final static String ITD_ASPECTS = TESTDATA_PATH + "/ltw-itdaspects.jar";
+ private final static String PER_ASPECTS = TESTDATA_PATH + "/ltw-peraspects.jar";
+ private final static String TEST_BASE = TESTDATA_PATH + "/WeavingURLClassLoaderTest/builtLibs";
private final static String NULL = "null";
* Aspects on ASPECTPATH but missing from CLASSPATH
*/
public void testIncompletePath() {
- setSystemProperty(WeavingURLClassLoader.WEAVING_ASPECT_PATH, ADVICE_ASPECTS);
+ URL aspectjrt = FileUtil.getFileURL(new File(ASPECTJRT));
+ setSystemProperty(WeavingURLClassLoader.WEAVING_ASPECT_PATH, ADVICE_ASPECTS+File.pathSeparator+aspectjrt.toString());
setSystemProperty(WeavingURLClassLoader.WEAVING_CLASS_PATH, CLASSES_JAR);
WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader());
+++ /dev/null
-<aspectj>
- <weaver options="-showWeaveInfo">
- </weaver>
- <aspects>
- <aspect name="test.Aspect"/>
- </aspects>
-</aspectj>
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://sswww.aspectj.org/dtd/aspectj_1_5_0.dtd">
-<aspectj>
- <weaver options="-showWeaveInfo">
- <include within="foo..bar.Goo+"/>
- <dump within="foo..*" beforeandafter="true"/>
- </weaver>
- <aspects>
- <exclude within="@Baz"/>
- <include within="@Whoo"/>
- <aspect name="test.Aspect"/>
- </aspects>
-</aspectj>
--- /dev/null
+<aspectj>
+ <weaver options="-showWeaveInfo">
+ </weaver>
+ <aspects>
+ <aspect name="test.Aspect"/>
+ </aspects>
+</aspectj>
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://sswww.aspectj.org/dtd/aspectj_1_5_0.dtd">
+<aspectj>
+ <weaver options="-showWeaveInfo">
+ <include within="foo..bar.Goo+"/>
+ <dump within="foo..*" beforeandafter="true"/>
+ </weaver>
+ <aspects>
+ <exclude within="@Baz"/>
+ <include within="@Whoo"/>
+ <aspect name="test.Aspect"/>
+ </aspects>
+</aspectj>