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

« back to all changes in this revision

Viewing changes to org.aspectj/modules/tests/src/org/aspectj/systemtest/ajc150/Enums.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) 2004 IBM 
3
 
 * All rights reserved. This program and the accompanying materials
4
 
 * are made available under the terms of the Eclipse Public License v1.0
5
 
 * which accompanies this distribution, and is available at
6
 
 * http://www.eclipse.org/legal/epl-v10.html
7
 
 *
8
 
 * Contributors:
9
 
 *    Andy Clement - initial API and implementation
10
 
 *******************************************************************************/
11
 
package org.aspectj.systemtest.ajc150;
12
 
 
13
 
import java.io.File;
14
 
 
15
 
import junit.framework.Test;
16
 
 
17
 
import org.aspectj.testing.XMLBasedAjcTestCase;
18
 
 
19
 
 
20
 
/**
21
 
 * Enums, the rules/tests:
22
 
 * 
23
 
 * 1. cannot make ITDC on an enum
24
 
 * 2. cannot make ITDM or ITDF on an enum
25
 
 * 3. cannot use declare parents to change the super type of an enum
26
 
 * 4. cannot use decp to make an enum type implement an interface
27
 
 * 5. cannot use decp to dec java.lang.Enum as the parent of any type
28
 
 * 6. cannot extend set of values in an enum via an ITD like construct
29
 
 * 7. Compilation error if you explicitly identify an Enum type.  
30
 
 * 8. Lint warning if a non-explicit type pattern would match an enum type.
31
 
 * 
32
 
 */
33
 
public class Enums extends XMLBasedAjcTestCase {
34
 
 
35
 
          public static Test suite() {
36
 
            return XMLBasedAjcTestCase.loadSuite(Enums.class);
37
 
          }
38
 
 
39
 
          protected File getSpecFile() {
40
 
            return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
41
 
          }
42
 
          
43
 
  // Cannot make ITDC on an enum
44
 
  public void test001_itdcsOnEnumNotAllowed() {
45
 
        runTest("cant itd constructor on enum");
46
 
  }
47
 
 
48
 
  // Cannot make ITDM or ITDF on an enum
49
 
  public void test002_itdFieldOrMethodOnEnumNotAllowed() {
50
 
        runTest("cant itd field or method on enum");
51
 
  }
52
 
 
53
 
  // Deals with the cases where an explicit type is specified and it is an enum type
54
 
  public void test003_decpOnEnumNotAllowed_errors() {
55
 
        runTest("declare parents and enums");
56
 
  }
57
 
 
58
 
  //Deals with the cases where an wild type pattern is specified and it hits an enum type
59
 
  public void test004_decpOnEnumNotAllowed_xlints() {
60
 
        runTest("wildcard enum match in itd");
61
 
  }
62
 
//      CompilationResult cR = binaryWeave("testcode.jar","EnumAspect04.aj",0,2,false);
63
 
//      IMessage msg = (IMessage)cR.getWarningMessages().get(0);
64
 
//      assertTrue("Expected a message about an enum type matching a declare parents but being ignored: "+msg,
65
 
//                      msg.toString().indexOf("matches a declare parents type pattern")!=-1);
66
 
//      msg = (IMessage)cR.getWarningMessages().get(1);
67
 
//      assertTrue("Expected a message about an enum type matching a declare parents but being ignored: "+msg,
68
 
//                      msg.toString().indexOf("matches a declare parents type pattern")!=-1);
69
 
//      verifyWeavingMessagesOutput(cR,new String[]{});
70
 
//  }
71
 
 
72
 
}
 
 
b'\\ No newline at end of file'