From c522105f33a84b9fcb396e8fd8ea51336bffaaf7 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 21 Jan 2008 20:07:53 +0000 Subject: [PATCH] support weaving of java. and javax. in ltw - risky business --- tests/features160/weavingJavaxPackage/A.java | 11 ++++++ tests/features160/weavingJavaxPackage/X.aj | 5 +++ .../features160/weavingJavaxPackage/aop1.xml | 6 ++++ .../features160/weavingJavaxPackage/aop2.xml | 6 ++++ .../systemtest/ajc160/AllTestsAspectJ160.java | 1 + .../systemtest/ajc160/NewFeatures.java | 35 +++++++++++++++++++ .../systemtest/ajc160/newfeatures-tests.xml | 27 ++++++++++++++ 7 files changed, 91 insertions(+) create mode 100644 tests/features160/weavingJavaxPackage/A.java create mode 100644 tests/features160/weavingJavaxPackage/X.aj create mode 100644 tests/features160/weavingJavaxPackage/aop1.xml create mode 100644 tests/features160/weavingJavaxPackage/aop2.xml create mode 100644 tests/src/org/aspectj/systemtest/ajc160/NewFeatures.java create mode 100644 tests/src/org/aspectj/systemtest/ajc160/newfeatures-tests.xml diff --git a/tests/features160/weavingJavaxPackage/A.java b/tests/features160/weavingJavaxPackage/A.java new file mode 100644 index 000000000..262767b1a --- /dev/null +++ b/tests/features160/weavingJavaxPackage/A.java @@ -0,0 +1,11 @@ +package javax.foo; + +public class A { + public static void main(String []argv) throws Exception { + new A().foo(); + } + + public void foo() { + System.out.println("Method running"); + } +} diff --git a/tests/features160/weavingJavaxPackage/X.aj b/tests/features160/weavingJavaxPackage/X.aj new file mode 100644 index 000000000..8c52b24c1 --- /dev/null +++ b/tests/features160/weavingJavaxPackage/X.aj @@ -0,0 +1,5 @@ +aspect X { + before(): execution(* f*(..)) { + System.out.println("advised"); + } +} diff --git a/tests/features160/weavingJavaxPackage/aop1.xml b/tests/features160/weavingJavaxPackage/aop1.xml new file mode 100644 index 000000000..4425615b2 --- /dev/null +++ b/tests/features160/weavingJavaxPackage/aop1.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/features160/weavingJavaxPackage/aop2.xml b/tests/features160/weavingJavaxPackage/aop2.xml new file mode 100644 index 000000000..196917aa1 --- /dev/null +++ b/tests/features160/weavingJavaxPackage/aop2.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java b/tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java index 9f2ce8cd8..d9fab5cda 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java +++ b/tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java @@ -20,6 +20,7 @@ public class AllTestsAspectJ160 { TestSuite suite = new TestSuite("AspectJ 1.6.0 tests"); //$JUnit-BEGIN$ suite.addTest(SanityTests.suite()); + suite.addTest(NewFeatures.suite()); //$JUnit-END$ return suite; } diff --git a/tests/src/org/aspectj/systemtest/ajc160/NewFeatures.java b/tests/src/org/aspectj/systemtest/ajc160/NewFeatures.java new file mode 100644 index 000000000..0fbb0e661 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc160/NewFeatures.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2006 IBM + * 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://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Andy Clement - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc160; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { + + // Supporting -Xset:weaveJavaPackages=true and -Xset:weaveJavaxPackages=true + public void testWeaveJavaxClassesNo() { runTest("weave javax classes - no");} + public void testWeaveJavaxClassesYes() { runTest("weave javax classes - yes");} + + ///////////////////////////////////////// + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(NewFeatures.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc160/newfeatures-tests.xml"); + } + + +} diff --git a/tests/src/org/aspectj/systemtest/ajc160/newfeatures-tests.xml b/tests/src/org/aspectj/systemtest/ajc160/newfeatures-tests.xml new file mode 100644 index 000000000..b12520d9f --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc160/newfeatures-tests.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5