]> source.dussan.org Git - aspectj.git/commitdiff
AspectJ6: picking up compiler interface changes
authoraclement <aclement>
Thu, 17 Jan 2008 00:05:27 +0000 (00:05 +0000)
committeraclement <aclement>
Thu, 17 Jan 2008 00:05:27 +0000 (00:05 +0000)
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java

index f24fb6a8233b034fabb53f169531ab5a973ede1c..9f1e23f7aed4133500b45c33539bfde6ccae4e28 100644 (file)
@@ -184,13 +184,17 @@ public class AjdtCommandTestCase extends TestCase {
                        text.indexOf("Usage") != -1);                   
        }
        
-       public void testVersionOutput() throws InvalidInputException {
+       public void  q() throws InvalidInputException {
                String[] args = new String[] { "-version" };
                
-               PrintStream saveOut = System.err;
+               PrintStream saveOut = System.out;
+               PrintStream saveErr = System.err;
                ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
+               ByteArrayOutputStream byteArrayErr = new ByteArrayOutputStream();
                PrintStream newOut = new PrintStream(byteArrayOut);
-               System.setErr(newOut);
+               PrintStream newErr = new PrintStream(byteArrayErr);
+               System.setOut(newOut);
+               System.setErr(newErr);
                
                try {
                        try {
@@ -200,13 +204,14 @@ public class AjdtCommandTestCase extends TestCase {
                                        counter);
                        } catch (AbortException  ae) { }
                } finally {
-                       System.setErr(saveOut);
+                       System.setOut(saveOut);
+                       System.setErr(saveErr);
                }
                
                String text = byteArrayOut.toString();
-
+               String text2 = byteArrayErr.toString();
                assertTrue(
-                       "version output",
+                       "version output does not include 'AspectJ Compiler', output was:\n'"+text+"'",
                        text.indexOf("AspectJ Compiler") != -1);                
        }
        
index 4ec4e5e789dc6f5ad9b555971485d2ff7e34458e..aa8c4d33f738b074469426777a9b1a8b56855a6b 100644 (file)
@@ -26,6 +26,7 @@ import org.aspectj.bridge.MessageHandler;
 import org.aspectj.bridge.MessageWriter;
 import org.aspectj.testing.util.TestUtil;
 import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
+import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 
 /**
@@ -342,7 +343,7 @@ public class BuildArgParserTestCase extends TestCase {
                AjBuildConfig config = genBuildConfig(new String[] {  "-Xlint:error", "-target", "1.4"}, messageWriter);
                assertTrue(
                                "target set",  
-                               config.getOptions().targetJDK == CompilerOptions.JDK1_4); 
+                               config.getOptions().targetJDK == ClassFileConstants.JDK1_4); 
 
                assertTrue(
                        "Xlint option set",
@@ -442,10 +443,10 @@ public class BuildArgParserTestCase extends TestCase {
                assertTrue("should be in 1.5 mode",config.getBehaveInJava5Way());
                config = genBuildConfig(new String[]{"-source","1.4"},messageWriter);
                assertTrue("should not be in 1.5 mode",!config.getBehaveInJava5Way());
-               assertTrue("should be in 1.4 mode",config.getOptions().sourceLevel == CompilerOptions.JDK1_4);
+               assertTrue("should be in 1.4 mode",config.getOptions().sourceLevel == ClassFileConstants.JDK1_4);
                config = genBuildConfig(new String[]{"-source","1.3"},messageWriter);
                assertTrue("should not be in 1.5 mode",!config.getBehaveInJava5Way());
-               assertTrue("should be in 1.3 mode",config.getOptions().sourceLevel == CompilerOptions.JDK1_3);
+               assertTrue("should be in 1.3 mode",config.getOptions().sourceLevel == ClassFileConstants.JDK1_3);
        }
 
        public void testOptions() throws InvalidInputException {
@@ -454,10 +455,10 @@ public class BuildArgParserTestCase extends TestCase {
                AjBuildConfig config = genBuildConfig(new String[] {"-target", TARGET, "-source", TARGET}, messageWriter);
                assertTrue(
                        "target set",  
-                       config.getOptions().targetJDK == CompilerOptions.JDK1_4);
+                       config.getOptions().targetJDK == ClassFileConstants.JDK1_4);
                assertTrue(
                        "source set",  
-                       config.getOptions().sourceLevel == CompilerOptions.JDK1_4);
+                       config.getOptions().sourceLevel == ClassFileConstants.JDK1_4);
        }
        
        public void testLstFileExpansion() throws IOException, FileNotFoundException, InvalidInputException {