]> source.dussan.org Git - aspectj.git/commitdiff
265729: testcode
authoraclement <aclement>
Tue, 24 Feb 2009 20:27:41 +0000 (20:27 +0000)
committeraclement <aclement>
Tue, 24 Feb 2009 20:27:41 +0000 (20:27 +0000)
tests/multiIncremental/pr265729_client/base/src/be/cronos/aop/App.java [new file with mode: 0644]
tests/multiIncremental/pr265729_client/base/src/be/cronos/experiment/AppTest.java [new file with mode: 0644]
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/App.java [new file with mode: 0644]
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/InterTypeAspectSupport.java [new file with mode: 0644]
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/EnforceLogging.aj [new file with mode: 0644]
tests/multiIncremental/pr265729_lib/base/src/be/cronos/aop/aspects/InterTypeAspect.aj [new file with mode: 0644]

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 (file)
index 0000000..3e65669
--- /dev/null
@@ -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 (file)
index 0000000..1290de0
--- /dev/null
@@ -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 (file)
index 0000000..a498276
--- /dev/null
@@ -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 (file)
index 0000000..e73cc30
--- /dev/null
@@ -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 (file)
index 0000000..ee00366
--- /dev/null
@@ -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 (file)
index 0000000..39c3ae7
--- /dev/null
@@ -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";
+    }
+
+}