]> source.dussan.org Git - aspectj.git/commitdiff
annoValMatch: testcode
authoraclement <aclement>
Mon, 25 Feb 2008 21:29:09 +0000 (21:29 +0000)
committeraclement <aclement>
Mon, 25 Feb 2008 21:29:09 +0000 (21:29 +0000)
tests/src/org/aspectj/systemtest/ajc160/AnnotationValueMatchingTests.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc160/annotationValueMatching.xml

diff --git a/tests/src/org/aspectj/systemtest/ajc160/AnnotationValueMatchingTests.java b/tests/src/org/aspectj/systemtest/ajc160/AnnotationValueMatchingTests.java
new file mode 100644 (file)
index 0000000..85df301
--- /dev/null
@@ -0,0 +1,55 @@
+/* *******************************************************************
+ * Copyright (c) 2008 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://www.eclipse.org/legal/epl-v10.html 
+ *  
+ *  Contributors
+ *  Andy Clement 
+ * ******************************************************************/
+package org.aspectj.systemtest.ajc160;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ * Parameter value matching
+ * 
+ */
+public class AnnotationValueMatchingTests extends XMLBasedAjcTestCase {
+       
+       public void testParsing() { runTest("parsing"); }
+       public void testBroken1() { runTest("broken - 1"); }
+       public void testParsingAllAnnotationValueKinds() { runTest("allkinds"); }
+       public void testSimpleCase() { runTest("simple"); }
+       public void testReferencingEnums1() { runTest("enum references - 1"); }
+       public void testReferencingEnums2() { runTest("enum references - 2"); }
+       public void testReferencingEnums3() { runTest("enum references - 3"); }
+       public void testIntValueMatching() { runTest("int value matching");}
+       public void testFloatValueMatching() { runTest("float value matching");}
+       public void testDoubleValueMatching() { runTest("double value matching");}
+       public void testByteValueMatching() { runTest("byte value matching");}
+       public void testLongValueMatching() { runTest("long value matching");}
+       public void testBooleanValueMatching() { runTest("boolean value matching");}
+       public void testShortValueMatching() { runTest("short value matching");}
+       public void testCharValueMatching() { runTest("char value matching");}
+       public void testStringValueMatching() { runTest("string value matching");}
+       public void testExampleOne() { runTest("example one");}
+       public void testError_InvalidValueTypes() { runTest("error case");}
+       public void testErrorOne_NonExistingValue() { runTest("error - non existing value");}
+
+       /////////////////////////////////////////
+       public static Test suite() {
+           return XMLBasedAjcTestCase.loadSuite(AnnotationValueMatchingTests.class);
+       }
+
+       protected File getSpecFile() {
+           return new File("../tests/src/org/aspectj/systemtest/ajc160/annotationValueMatching.xml");
+       }
+}
index c537244f2f047bffbf8282c1eafb2e73daf7de5e..ebcc8b4c26eba51936fff130d06e16813304ed89 100644 (file)
      </compile>
    </ajc-test>
    
+   <ajc-test dir="features160/annotationValueMatching" title="allkinds">
+     <compile options="-1.5 -showWeaveInfo" files="AllKinds.java"> 
+     </compile>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="int value matching">
+     <compile options="-1.5 -showWeaveInfo" files="IntValueMatching.java"> 
+       <message kind="weave" text="Join point 'method-execution(void IntValueMatching.b())' in Type 'IntValueMatching' (IntValueMatching.java:9) advised by before advice from 'X' (IntValueMatching.java:21)"/>
+     </compile>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="float value matching">
+     <compile options="-1.5 -showWeaveInfo" files="FloatValueMatching.java"> 
+       <message kind="weave" text="methodTwo"/>
+     </compile>
+     <run class="FloatValueMatching"/>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="double value matching">
+     <compile options="-1.5 -showWeaveInfo" files="DoubleValueMatching.java"> 
+       <message kind="weave" text="methodOne"/>
+     </compile>
+     <run class="DoubleValueMatching"/>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="char value matching">
+     <compile options="-1.5 -showWeaveInfo" files="CharValueMatching.java"> 
+       <message kind="weave" text="methodTwo"/>
+     </compile>
+     <run class="CharValueMatching"/>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="long value matching">
+     <compile options="-1.5 -showWeaveInfo" files="LongValueMatching.java"> 
+       <message kind="weave" text="methodOne"/>
+     </compile>
+     <run class="LongValueMatching"/>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="string value matching">
+     <compile options="-1.5 -showWeaveInfo" files="StringValueMatching.java"> 
+       <message kind="weave" text="methodOne"/>
+     </compile>
+     <run class="StringValueMatching"/>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="boolean value matching">
+     <compile options="-1.5 -showWeaveInfo" files="BooleanValueMatching.java"> 
+       <message kind="weave" text="methodOne"/>
+     </compile>
+     <run class="BooleanValueMatching"/>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="byte value matching">
+     <compile options="-1.5 -showWeaveInfo" files="ByteValueMatching.java"> 
+       <message kind="weave" text="methodOne"/>
+     </compile>
+     <run class="ByteValueMatching"/>
+   </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="short value matching">
+     <compile options="-1.5 -showWeaveInfo" files="ShortValueMatching.java"> 
+       <message kind="weave" text="methodOne"/>
+     </compile>
+     <run class="ShortValueMatching"/>
+   </ajc-test>
+
    <ajc-test dir="features160/annotationValueMatching" title="parsing">
      <compile options="-1.5 -showWeaveInfo Parsing.java"/>
    </ajc-test>
        <message kind="weave" text="Join point 'method-execution(void Marked.c())' in Type 'Marked' (Simple.java:21) advised by before advice from 'X' (Simple.java:28)"/>
      </compile>       
    </ajc-test>
+
+   <ajc-test dir="features160/annotationValueMatching" title="example one">
+     <compile options="-1.5 -showWeaveInfo ExampleOne.java">
+       <message kind="weave" text="m002"/>
+       <message kind="weave" text="m003"/>
+       <message kind="weave" text="m005"/>
+     </compile>       
+     <run class="ExampleOne">
+       <stderr>
+         <line text="tracing execution(void ExampleOne.m002())"/>
+         <line text="tracing execution(void ExampleOne.m003())"/>
+         <line text="tracing execution(void ExampleOne.m005())"/>
+       </stderr>
+     </run>
+   </ajc-test>
+   
+   <ajc-test dir="features160/annotationValueMatching" title="error case">
+     <compile options="-1.5 Error.java">
+       <message kind="error" text="Invalid annotation value 'Color.GREEN', expected int value"/>
+       <message kind="error" text="Invalid annotation value 'hello', expected float value"/>
+       <message kind="error" text="Invalid annotation value 'foo', expected byte value"/>
+       <message kind="error" text="Invalid annotation value '123', expected boolean value"/>
+       <message kind="error" text="Invalid annotation value '12', expected enum value"/>
+       <message kind="error" text="Invalid annotation value '4212312312', expected short value"/>
+       <message kind="error" text="Invalid annotation value 'no', expected char value"/>
+       <message kind="error" text="Invalid annotation value '30.0f', expected long value"/>
+       <message kind="error" text="Invalid annotation value 'foo', expected double value"/>
+     </compile>
+   </ajc-test>
+   
+   <ajc-test dir="features160/annotationValueMatching" title="error - non existing value">
+     <compile options="-1.5 ErrorOne.java">
+       <message kind="error" text="The annotation 'Anno' does not define a value named 'ival'"/>
+     </compile>
+   </ajc-test>
    
 </suite>
\ No newline at end of file