From 11e7c2ef992f4b26a7839a06594b5cc6139221a8 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 24 Feb 2009 20:27:41 +0000 Subject: [PATCH] 265729: testcode --- .../base/src/be/cronos/aop/App.java | 13 +++++++ .../src/be/cronos/experiment/AppTest.java | 38 +++++++++++++++++++ .../base/src/be/cronos/aop/App.java | 16 ++++++++ .../be/cronos/aop/InterTypeAspectSupport.java | 12 ++++++ .../be/cronos/aop/aspects/EnforceLogging.aj | 16 ++++++++ .../be/cronos/aop/aspects/InterTypeAspect.aj | 16 ++++++++ 6 files changed, 111 insertions(+) create mode 100644 tests/multiIncremental/pr265729_client/base/src/be/cronos/aop/App.java create mode 100644 tests/multiIncremental/pr265729_client/base/src/be/cronos/experiment/AppTest.java create mode 100644 tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/App.java create mode 100644 tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/InterTypeAspectSupport.java create mode 100644 tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/EnforceLogging.aj create mode 100644 tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/InterTypeAspect.aj diff --git a/tests/multiIncremental/pr265729_client/base/src/be/cronos/aop/App.java b/tests/multiIncremental/pr265729_client/base/src/be/cronos/aop/App.java new file mode 100644 index 000000000..3e6566992 --- /dev/null +++ b/tests/multiIncremental/pr265729_client/base/src/be/cronos/aop/App.java @@ -0,0 +1,13 @@ +package be.cronos.aop; + + +@InterTypeAspectSupport +public class App { + public static void main(String[] args) { + // System.out.println( "Hello World!" ); //should throw compiler error, + // OK + App app = new App(); + app.foo(42); + + } +} diff --git a/tests/multiIncremental/pr265729_client/base/src/be/cronos/experiment/AppTest.java b/tests/multiIncremental/pr265729_client/base/src/be/cronos/experiment/AppTest.java new file mode 100644 index 000000000..1290de08e --- /dev/null +++ b/tests/multiIncremental/pr265729_client/base/src/be/cronos/experiment/AppTest.java @@ -0,0 +1,38 @@ +//package be.cronos.experiment; +// +//import junit.framework.Test; +//import junit.framework.TestCase; +//import junit.framework.TestSuite; +// +///** +// * Unit test for simple App. +// */ +//public class AppTest +// extends TestCase +//{ +// /** +// * Create the test case +// * +// * @param testName name of the test case +// */ +// public AppTest( String testName ) +// { +// super( testName ); +// } +// +// /** +// * @return the suite of tests being tested +// */ +// public static Test suite() +// { +// return new TestSuite( AppTest.class ); +// } +// +// /** +// * Rigourous Test :-) +// */ +// public void testApp() +// { +// assertTrue( true ); +// } +//} diff --git a/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/App.java b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/App.java new file mode 100644 index 000000000..a49827673 --- /dev/null +++ b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/App.java @@ -0,0 +1,16 @@ +package be.cronos.aop; + +import be.cronos.aop.InterTypeAspectSupport; + +@InterTypeAspectSupport +public class App +{ + public static void main( String[] args ) + { + //System.out.println( "Hello World!" ); //should throw compiler error, OK + App app = new App(); + app.foo(42); + + + } +} diff --git a/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/InterTypeAspectSupport.java b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/InterTypeAspectSupport.java new file mode 100644 index 000000000..e73cc30d5 --- /dev/null +++ b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/InterTypeAspectSupport.java @@ -0,0 +1,12 @@ +package be.cronos.aop; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface InterTypeAspectSupport { + +} diff --git a/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/EnforceLogging.aj b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/EnforceLogging.aj new file mode 100644 index 000000000..ee00366d7 --- /dev/null +++ b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/EnforceLogging.aj @@ -0,0 +1,16 @@ +package be.cronos.aop.aspects; + +//import junit.framework.TestCase; + +public aspect EnforceLogging { + pointcut scope(): + !within(*TestCase+); + + pointcut printing(): + get(* System.out) || get(* System.err) || call(* printStackTrace()); + + declare error + : scope() && printing() + : "Don't print to Console, use logger"; + +} diff --git a/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/InterTypeAspect.aj b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/InterTypeAspect.aj new file mode 100644 index 000000000..39c3ae769 --- /dev/null +++ b/tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/InterTypeAspect.aj @@ -0,0 +1,16 @@ +package be.cronos.aop.aspects; + +import be.cronos.aop.InterTypeAspectSupport; + +public aspect InterTypeAspect { + + public interface InterTypeAspectInterface { + } + + declare parents : (@InterTypeAspectSupport *) implements InterTypeAspectInterface; + + public String InterTypeAspectInterface.foo(int i) { + return "bar"; + } + +} -- 2.39.5