From: aclement Date: Fri, 11 Mar 2005 09:42:49 +0000 (+0000) Subject: Guard test execution on 1.5 vm level. X-Git-Tag: V1_5_0M2~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa54cd96661ca2b2fa6c0289bd6b90bc38fa5e47;p=aspectj.git Guard test execution on 1.5 vm level. --- diff --git a/tests/src/org/aspectj/systemtest/ajc150/DeclareAnnotationTests.java b/tests/src/org/aspectj/systemtest/ajc150/DeclareAnnotationTests.java index e87e45fa9..856dfad31 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/DeclareAnnotationTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/DeclareAnnotationTests.java @@ -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