From fa54cd96661ca2b2fa6c0289bd6b90bc38fa5e47 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 11 Mar 2005 09:42:49 +0000 Subject: [PATCH] Guard test execution on 1.5 vm level. --- .../ajc150/DeclareAnnotationTests.java | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) 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 -- 2.39.5