aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-01-20 10:26:46 +0000
committeraclement <aclement>2005-01-20 10:26:46 +0000
commit759be74616a981dc6002a9e7e6bc64223d28bda0 (patch)
treeb5525286d109cba7f7ac04af4b48f1b5cdd80fc5 /tests
parenta972be27a5ebccca011bb5962766ad73502252cd (diff)
downloadaspectj-759be74616a981dc6002a9e7e6bc64223d28bda0.tar.gz
aspectj-759be74616a981dc6002a9e7e6bc64223d28bda0.zip
Get enum value fields to work in the ASM. Plus test reorg as we are now adding tests that will only run on 1.5
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/Rainbow.java3
-rw-r--r--tests/src/org/aspectj/systemtest/AllTests15.java21
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsRequireJava15.java44
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150_NeedJava15.java30
7 files changed, 106 insertions, 0 deletions
diff --git a/tests/bugs150/Rainbow.java b/tests/bugs150/Rainbow.java
new file mode 100644
index 000000000..7b1aa769d
--- /dev/null
+++ b/tests/bugs150/Rainbow.java
@@ -0,0 +1,3 @@
+public enum Rainbow {
+ Red,Orange,Yellow,Green,Blue,Indigo,Violet;
+}
diff --git a/tests/src/org/aspectj/systemtest/AllTests15.java b/tests/src/org/aspectj/systemtest/AllTests15.java
new file mode 100644
index 000000000..647bd722a
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/AllTests15.java
@@ -0,0 +1,21 @@
+/*
+ * Created on 19-01-2005
+ */
+package org.aspectj.systemtest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.aspectj.systemtest.ajc150.AllTestsAspectJ150_NeedJava15;
+
+public class AllTests15 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.5");
+ //$JUnit-BEGIN$
+ suite.addTest(AllTests14.suite());
+ suite.addTestSuite(AllTestsAspectJ150_NeedJava15.class);
+ //$JUnit-END$
+ return suite;
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index fdd6f10a4..a84821aab 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -16,6 +16,9 @@ import junit.framework.Test;
import org.aspectj.testing.XMLBasedAjcTestCase;
+/**
+ * These are tests that will run on Java 1.4 and use the old harness format for test specification.
+ */
public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public static Test suite() {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java
index 44c65430a..9c4c08fdc 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsNoHarness.java
@@ -20,6 +20,8 @@ import org.aspectj.tools.ajc.CompilationResult;
/**
+ * These are tests that run on Java 1.4 and use the new ajctestcase format.
+ * If you have a test that *needs* to run on Java 1.5 then look in Ajc150TestsRequireJava15.java
*/
public class Ajc150TestsNoHarness extends TestUtils {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsRequireJava15.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsRequireJava15.java
new file mode 100644
index 000000000..42dc6f839
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150TestsRequireJava15.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc150;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import org.aspectj.asm.AsmManager;
+import org.aspectj.tools.ajc.CompilationResult;
+
+
+/**
+ * These tests only execute in a 1.5 environment.
+ */
+public class Ajc150TestsRequireJava15 extends TestUtils {
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ baseDir = new File("../tests/bugs150");
+ }
+
+ public void testBadASMforEnums() throws IOException {
+ CompilationResult cR = ajc(baseDir,new String[]{"Rainbow.java","-emacssym","-1.5"});
+ System.err.println(cR);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintWriter pw = new PrintWriter(baos);
+ AsmManager.dumptree(pw,AsmManager.getDefault().getHierarchy().getRoot(),0);
+ pw.flush();
+ String tree = baos.toString();
+ assertTrue("Expected 'Red [enumvalue]' somewhere in here:"+tree,tree.indexOf("Red [enumvalue]")!=-1);
+ }
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
index fa0cff9c5..a528692bd 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
@@ -13,6 +13,9 @@ package org.aspectj.systemtest.ajc150;
import junit.framework.Test;
import junit.framework.TestSuite;
+/**
+ * This pulls together tests we have written for AspectJ 1.5.0 that don't need Java 1.5 to run
+ */
public class AllTestsAspectJ150 {
public static Test suite() {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150_NeedJava15.java b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150_NeedJava15.java
new file mode 100644
index 000000000..ff0f19202
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150_NeedJava15.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc150;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * This is a superset of AllTestsAspectJ150 that includes tests that must be run on Java 1.5
+ */
+public class AllTestsAspectJ150_NeedJava15 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Java5");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(Ajc150TestsRequireJava15.class);
+ suite.addTestSuite(Autoboxing.class);
+
+ //$JUnit-END$
+ return suite;
+ }
+}