/********************************************************************
- * Copyright (c) 2007 Contributors. All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
+ * Copyright (c) 2007 Contributors. All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
* Helen Hawkins - initial version
*******************************************************************/
package org.aspectj.ajde.core;
public class AjdeCoreModuleTests extends TestCase {
+ static boolean verbose = System.getProperty("aspectj.tests.verbose", "false").equalsIgnoreCase("true");
+
public static TestSuite suite() {
TestSuite suite = new TestSuite(AjdeCoreModuleTests.class.getName());
suite.addTestSuite(ShowWeaveMessagesTest.class);
return suite;
}
+
public AjdeCoreModuleTests(String name) {
super(name);
}
*/
public class TestBuildProgressMonitor implements IBuildProgressMonitor {
- private static boolean verbose = System.getProperty("aspectj.tests.verbose","false").equalsIgnoreCase("true");
private static boolean debugTests = false;
public int numWovenClassMessages = 0;
private boolean isCancelRequested = false;
public void finish(boolean wasFullBuild) {
- System.out.println("build finished. Was full build: " + wasFullBuild);
+ info("build finished. Was full build: " + wasFullBuild);
}
public boolean isCancelRequested() {
return isCancelRequested;
}
+ private void info(String message) {
+ if (AjdeCoreModuleTests.verbose) {
+ System.out.println(message);
+ }
+ }
+
public void setProgress(double percentDone) {
- System.out.println("progress. Completed " + percentDone + " percent");
+ info("progress. Completed " + percentDone + " percent");
}
public void setProgressText(String text) {
- if (verbose) {
- System.out.println("progress text: " + text);
- }
+ info("progress text: " + text);
String newText = text+" [Percentage="+currentVal+"%]";
messagesReceived.add(newText);
- if (text.startsWith("woven aspect ")) numWovenAspectMessages++;
- if (text.startsWith("woven class ")) numWovenClassMessages++;
- if (text.startsWith("compiled:")) numCompiledMessages++;
+ if (text.startsWith("woven aspect ")) {
+ numWovenAspectMessages++;
+ }
+ if (text.startsWith("woven class ")) {
+ numWovenClassMessages++;
+ }
+ if (text.startsWith("compiled:")) {
+ numCompiledMessages++;
+ }
if (programmableString != null
&& text.contains(programmableString)) {
count--;
if (count==0) {
- if (debugTests) System.out.println("Just got message '"+newText+"' - asking build to cancel");
+ if (debugTests) {
+ System.out.println("Just got message '"+newText+"' - asking build to cancel");
+ }
isCancelRequested = true;
programmableString = null;
}
}
public void begin() {
- if (verbose) {
- System.out.println("build started");
- }
+ info("build started");
currentVal = 0;
}
public boolean containsMessage(String prefix,String distinguishingMarks) {
for (String element: messagesReceived) {
if (element.startsWith(prefix) &&
- element.contains(distinguishingMarks)) return true;
+ element.contains(distinguishingMarks)) {
+ return true;
+ }
}
return false;
}
public void dumpMessages() {
- if (verbose) {
- System.out.println("ProgressMonitorMessages");
- }
+ System.out.println("ProgressMonitorMessages");
for (String element: messagesReceived) {
System.out.println(element);
}
/********************************************************************
- * Copyright (c) 2007 Contributors. All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
+ * Copyright (c) 2007 Contributors. All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
* Helen Hawkins - initial version
*******************************************************************/
package org.aspectj.ajde.core;
} else if (kind.equals(IMessage.ERROR)) {
errors.add(t);
}
- System.out.println("> " + message); //$NON-NLS-1$
+ if (AjdeCoreModuleTests.verbose) {
+ System.out.println("> " + message); //$NON-NLS-1$
+ }
return true;
}
/********************************************************************
- * Copyright (c) 2007 Contributors. All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
+ * Copyright (c) 2007 Contributors. All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
* Helen Hawkins - initial version (bug 148190)
*******************************************************************/
package org.aspectj.ajde.ui.utils;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.ajde.core.IBuildProgressMonitor;
*/
public class TestBuildProgressMonitor implements IBuildProgressMonitor {
+ private final static boolean verbose = System.getProperty("aspectj.tests.verbose", "true")
+ .equalsIgnoreCase("false");
private static boolean debugTests = false;
-
+
public int numWovenClassMessages = 0;
public int numWovenAspectMessages = 0;
public int numCompiledMessages = 0;
-
+
private String programmableString;
private int count;
- private List messagesReceived = new ArrayList();
+ private List<String> messagesReceived = new ArrayList<>();
private int currentVal;
private boolean isCancelRequested = false;
-
+
public void finish(boolean wasFullBuild) {
- System.out.println("build finished. Was full build: " + wasFullBuild);
+ if (verbose) {
+ System.out.println("build finished. Was full build: " + wasFullBuild);
+ }
}
public boolean isCancelRequested() {
}
public void setProgress(double percentDone) {
- System.out.println("progress. Completed " + percentDone + " percent");
+ if (verbose) {
+ System.out.println("progress. Completed " + percentDone + " percent");
+ }
}
public void setProgressText(String text) {
- System.out.println("progress text: " + text);
+ if (verbose) {
+ System.out.println("progress text: " + text);
+ }
String newText = text+" [Percentage="+currentVal+"%]";
messagesReceived.add(newText);
- if (text.startsWith("woven aspect ")) numWovenAspectMessages++;
- if (text.startsWith("woven class ")) numWovenClassMessages++;
- if (text.startsWith("compiled:")) numCompiledMessages++;
+ if (text.startsWith("woven aspect ")) {
+ numWovenAspectMessages++;
+ }
+ if (text.startsWith("woven class ")) {
+ numWovenClassMessages++;
+ }
+ if (text.startsWith("compiled:")) {
+ numCompiledMessages++;
+ }
if (programmableString != null
&& text.contains(programmableString)) {
count--;
if (count==0) {
- if (debugTests) System.out.println("Just got message '"+newText+"' - asking build to cancel");
+ if (debugTests) {
+ System.out.println("Just got message '"+newText+"' - asking build to cancel");
+ }
isCancelRequested = true;
programmableString = null;
}
}
public void begin() {
- System.out.println("build started");
+ if (verbose) {
+ System.out.println("build started");
+ }
currentVal = 0;
}
programmableString = string;
this.count = count;
}
-
+
public boolean containsMessage(String prefix,String distinguishingMarks) {
for (Object o : messagesReceived) {
String element = (String) o;
if (element.startsWith(prefix) &&
- element.contains(distinguishingMarks)) return true;
+ element.contains(distinguishingMarks)) {
+ return true;
+ }
}
return false;
}
-
+
public void dumpMessages() {
System.out.println("ProgressMonitorMessages");
for (Object o : messagesReceived) {
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <testFailureIgnore>true</testFailureIgnore>
+ <testFailureIgnore>false</testFailureIgnore>
<excludes>
<exclude>**/*AjcTestSpecAsTest*</exclude>
</excludes>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.self="override">
- <testFailureIgnore>true</testFailureIgnore>
+ <testFailureIgnore>false</testFailureIgnore>
<includes>
<include>**/TestsModuleTests*</include>
</includes>
package org.aspectj.systemtest.ajc11;
import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.util.LangUtil;
import junit.framework.Test;
import org.aspectj.apache.bcel.classfile.Signature;
import org.aspectj.asm.AsmManager;
import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.util.LangUtil;
import junit.framework.Test;
import java.io.File;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.apache.bcel.classfile.Attribute;
import java.io.PrintStream;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.apache.bcel.classfile.JavaClass;
import java.io.IOException;
import java.net.URL;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.asm.AsmManager;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
*******************************************************************************/
package org.aspectj.systemtest.ajc161;
-import java.util.Iterator;
import java.util.Set;
import org.aspectj.asm.AsmManager;
package org.aspectj.systemtest.ajc164;
import java.io.PrintWriter;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.apache.bcel.classfile.LocalVariable;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
package org.aspectj.systemtest.java14;
import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.util.LangUtil;
import junit.framework.Test;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.asm.AsmManager;
package org.aspectj.tests;
-import org.aspectj.systemtest.AllTests17;
import org.aspectj.systemtest.AllTests18;
import org.aspectj.systemtest.AllTests19;
import org.aspectj.util.LangUtil;