From fdf51a31c8d4e7e3cfb33cc2871ea0d4675225c3 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 17 Jan 2008 00:05:27 +0000 Subject: [PATCH] AspectJ6: picking up compiler interface changes --- .../aspectj/ajdt/ajc/AjdtCommandTestCase.java | 17 +++++++++++------ .../ajdt/ajc/BuildArgParserTestCase.java | 11 ++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java index f24fb6a82..9f1e23f7a 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java @@ -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); } diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java index 4ec4e5e78..aa8c4d33f 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java @@ -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 { -- 2.39.5