~ubuntu-branches/ubuntu/natty/aspectj/natty

« back to all changes in this revision

Viewing changes to org.aspectj/modules/tests/src/org/aspectj/systemtest/model/Model5Tests.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-10-04 16:37:23 UTC
  • mfrom: (1.1.3 upstream) (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091004163723-ck4y7j7fhjxskkie
Tags: 1.6.6+dfsg-1
* New upstream release.
  - Update 02_use_gjdoc.diff patch
* Update my email address

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/********************************************************************
2
 
 * Copyright (c) 2006 Contributors. All rights reserved. 
3
 
 * This program and the accompanying materials are made available 
4
 
 * under the terms of the Eclipse Public License v1.0 
5
 
 * which accompanies this distribution and is available at 
6
 
 * http://eclipse.org/legal/epl-v10.html 
7
 
 *  
8
 
 * Contributors: IBM Corporation - initial API and implementation 
9
 
 *                               Helen Hawkins   - initial version
10
 
 *******************************************************************/
11
 
package org.aspectj.systemtest.model;
12
 
 
13
 
import java.io.File;
14
 
 
15
 
import junit.framework.Test;
16
 
 
17
 
import org.aspectj.testing.XMLBasedAjcTestCase;
18
 
import org.aspectj.weaver.World;
19
 
 
20
 
/**
21
 
 * Tests the model when there is a requirement on Java5 features.
22
 
 * @see org.aspectj.systemtest.model.ModelTestCase 
23
 
 */
24
 
public class Model5Tests extends ModelTestCase {
25
 
 
26
 
        static {
27
 
                // Switch this to true for a single iteration if you want to reconstruct the
28
 
                // 'expected model' files.
29
 
                regenerate = false;
30
 
                // Switch this to true if you want to debug the comparison
31
 
                debugTest = false;
32
 
        }
33
 
        
34
 
        public void testDeclareAtTypeInStructureModel_pr115607() {runModelTest("declare at type appears correctly in structure model","pr115607");}
35
 
        public void testStructureModelForGenericITD_pr131932() {runModelTest("structure model for generic itd","pr131932");}
36
 
        public void testDeclareAnnotationAppearsInStructureModel_pr132130() {runModelTest("declare annotation appears in structure model when in same file","pr132130");}
37
 
        public void testAtAspectDEOWInStructureModel_pr120356() {runModelTest("@AJ deow appear correctly when structure model is generated","pr120356");}
38
 
        public void testDeclareAtMethodRelationship_pr143924() {runModelTest("declare @method relationship","pr143924");}
39
 
        public void testNewIProgramElementMethodsForGenerics_pr141730() {runModelTest("new iprogramelement methods for generics","pr141730_2");}
40
 
 
41
 
        // if not filling in the model for classes contained in jar files then
42
 
        // want to ensure that the relationship map is correct and has nodes
43
 
        // which can be used in AJDT - ensure no NPE occurs for the end of
44
 
        // the relationship with inpath
45
 
        public void testAspectPathRelWhenNotFillingInModel_pr141730() {
46
 
                World.createInjarHierarchy = false;
47
 
                try {
48
 
                        // the aspect used for this test has advice, declare parents, deow,
49
 
                        // and declare @type, @constructor, @field and @method. We only expect
50
 
                        // there to be relationships in the map for declare parents and declare @type
51
 
                        // (provided the model isn't being filled in) because the logic in the other
52
 
                        // addXXXRelationship methods use AspectJElementHierarchy.findElementForType().
53
 
                        // This method which returns null because there is no such ipe. The relationship is
54
 
                        // therefore not added to the model. Adding declare @type and declare parents
55
 
                        // uses AspectJElementHierarchy.findElementForHandle() which returns the file
56
 
                        // node ipe if it can't find one for the given handle. Therefore the relationships
57
 
                        // are added against the file node. Before change to using ipe's to create handles
58
 
                        // we also had the deow relationship, however, now we don't because this also
59
 
                        // uses findElementForType to find the targetNode which in the inpath case is null.
60
 
                        runModelTest("ensure inpath injar relationships are correct when not filling in model","pr141730_4");
61
 
                } finally {
62
 
                        World.createInjarHierarchy = true;
63
 
                }
64
 
        }
65
 
        
66
 
        // ///////////////////////////////////////
67
 
        public static Test suite() {
68
 
                return XMLBasedAjcTestCase.loadSuite(Model5Tests.class);
69
 
        }
70
 
 
71
 
        protected File getSpecFile() {
72
 
                return new File("../tests/src/org/aspectj/systemtest/model/model.xml");
73
 
        }
74
 
 
75
 
}