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 {
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);
}
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;
/**
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",
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 {
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 {