]> source.dussan.org Git - aspectj.git/commitdiff
Guard test execution on 1.5 vm level.
authoraclement <aclement>
Fri, 11 Mar 2005 09:42:49 +0000 (09:42 +0000)
committeraclement <aclement>
Fri, 11 Mar 2005 09:42:49 +0000 (09:42 +0000)
tests/src/org/aspectj/systemtest/ajc150/DeclareAnnotationTests.java

index e87e45fa90584f4f3043b5959fecb0ef88f636ec..856dfad319cacbb6d59be26a0174118b51ef92bb 100644 (file)
@@ -287,36 +287,39 @@ public class DeclareAnnotationTests extends XMLBasedAjcTestCase {
   public void testStructureModel() {
     // AsmManager.setReporting("c:/debug.txt",true,true,true,true);
        runTest("declare all annotations on one class - source weaving");
-       IHierarchy top = AsmManager.getDefault().getHierarchy();
        
-       IProgramElement ipe = top.findElementForLabel(top.getRoot(),
-               IProgramElement.Kind.DECLARE_ANNOTATION_AT_TYPE,
-               "declare at_type: p.q.DeathByAnnotations : @Colored(\"red\")");
-       assertTrue("Couldn't find 'declare @type' element in the tree",ipe!=null);
-       
-    List l = AsmManager.getDefault().getRelationshipMap().get(ipe);
-       assertTrue("Should have a relationship but does not ",l.size()>0);
-       
-       ipe = top.findElementForLabel(top.getRoot(),
-               IProgramElement.Kind.DECLARE_ANNOTATION_AT_METHOD,
-               "declare at_method: * m*(..) : @Fruit(\"tomato\")");
-       assertTrue("Couldn't find 'declare @method element in the tree",ipe!=null);
-       
-    l = AsmManager.getDefault().getRelationshipMap().get(ipe);
-       assertTrue("Should have a relationship but does not ",l.size()>0);
-       
-       ipe = top.findElementForLabel(top.getRoot(),
-               IProgramElement.Kind.DECLARE_ANNOTATION_AT_CONSTRUCTOR,
-               "declare at_constructor: p.q.DeathByAnnotations.new(..) : @Fruit(\"tomato\")");
-       assertTrue("Couldn't find 'declare @constructor element in the tree",ipe!=null);
-    l = AsmManager.getDefault().getRelationshipMap().get(ipe);
-       assertTrue("Should have a relationship but does not ",l.size()>0);
-       
-       ipe = top.findElementForLabel(top.getRoot(),
-               IProgramElement.Kind.DECLARE_ANNOTATION_AT_FIELD,
-               "declare at_field: * p.q.DeathByAnnotations.* : @Material(\"wood\")");
-       assertTrue("Couldn't find 'declare @field element in the tree",ipe!=null);
-    l = AsmManager.getDefault().getRelationshipMap().get(ipe);
-       assertTrue("Should have a relationship but does not ",l.size()>0);
+       if (getCurrentTest().canRunOnThisVM()) {
+               IHierarchy top = AsmManager.getDefault().getHierarchy();
+               
+               IProgramElement ipe = top.findElementForLabel(top.getRoot(),
+                       IProgramElement.Kind.DECLARE_ANNOTATION_AT_TYPE,
+                       "declare at_type: p.q.DeathByAnnotations : @Colored(\"red\")");
+               assertTrue("Couldn't find 'declare @type' element in the tree",ipe!=null);
+               
+           List l = AsmManager.getDefault().getRelationshipMap().get(ipe);
+               assertTrue("Should have a relationship but does not ",l.size()>0);
+               
+               ipe = top.findElementForLabel(top.getRoot(),
+                       IProgramElement.Kind.DECLARE_ANNOTATION_AT_METHOD,
+                       "declare at_method: * m*(..) : @Fruit(\"tomato\")");
+               assertTrue("Couldn't find 'declare @method element in the tree",ipe!=null);
+               
+           l = AsmManager.getDefault().getRelationshipMap().get(ipe);
+               assertTrue("Should have a relationship but does not ",l.size()>0);
+               
+               ipe = top.findElementForLabel(top.getRoot(),
+                       IProgramElement.Kind.DECLARE_ANNOTATION_AT_CONSTRUCTOR,
+                       "declare at_constructor: p.q.DeathByAnnotations.new(..) : @Fruit(\"tomato\")");
+               assertTrue("Couldn't find 'declare @constructor element in the tree",ipe!=null);
+           l = AsmManager.getDefault().getRelationshipMap().get(ipe);
+               assertTrue("Should have a relationship but does not ",l.size()>0);
+               
+               ipe = top.findElementForLabel(top.getRoot(),
+                       IProgramElement.Kind.DECLARE_ANNOTATION_AT_FIELD,
+                       "declare at_field: * p.q.DeathByAnnotations.* : @Material(\"wood\")");
+               assertTrue("Couldn't find 'declare @field element in the tree",ipe!=null);
+           l = AsmManager.getDefault().getRelationshipMap().get(ipe);
+               assertTrue("Should have a relationship but does not ",l.size()>0);
+       }
   }
 }
\ No newline at end of file