]> source.dussan.org Git - aspectj.git/commitdiff
lets have maven fail if those tests fail...
authorAndy Clement <aclement@pivotal.io>
Sat, 15 Aug 2020 05:45:11 +0000 (22:45 -0700)
committerAndy Clement <aclement@pivotal.io>
Sat, 15 Aug 2020 05:45:11 +0000 (22:45 -0700)
19 files changed:
ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreModuleTests.java
ajde.core/src/test/java/org/aspectj/ajde/core/TestBuildProgressMonitor.java
ajde.core/src/test/java/org/aspectj/ajde/core/TestMessageHandler.java
ajde/src/test/java/org/aspectj/ajde/ui/utils/TestBuildProgressMonitor.java
testing-drivers/pom.xml
tests/pom.xml
tests/src/test/java/org/aspectj/systemtest/ajc11/Ajc11Tests.java
tests/src/test/java/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/test/java/org/aspectj/systemtest/ajc150/GenericITDsDesign.java
tests/src/test/java/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java
tests/src/test/java/org/aspectj/systemtest/ajc153/JDTLikeHandleProviderTests.java
tests/src/test/java/org/aspectj/systemtest/ajc154/CustomMungerExtensionTest.java
tests/src/test/java/org/aspectj/systemtest/ajc161/Ajc161Tests.java
tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/AbstractMultiProjectIncrementalAjdeInteractionTestbed.java
tests/src/test/java/org/aspectj/systemtest/incremental/tools/MoreOutputLocationManagerTests.java
tests/src/test/java/org/aspectj/systemtest/java14/Java14Tests.java
tests/src/test/java/org/aspectj/systemtest/model/ModelTestCase.java
tests/src/test/java/org/aspectj/tests/TestsModuleTests.java

index 0e9991eebe0f97a1bb54bb62c3989823646e8377..45d70a8459accafd063847bb8ff80f8b0a2cdf6e 100644 (file)
@@ -1,11 +1,11 @@
 /********************************************************************
- * 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;
@@ -30,6 +30,8 @@ import junit.framework.TestSuite;
 
 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);
@@ -49,6 +51,7 @@ public class AjdeCoreModuleTests extends TestCase {
                return suite;
        }
 
+
        public AjdeCoreModuleTests(String name) {
                super(name);
        }
index 5269a586a7eb41ef91c45d4b436d5c7016094470..e25632cf9071ffabecbbd566aaab7ee129c0f1ee 100644 (file)
@@ -20,7 +20,6 @@ import java.util.List;
  */
 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;
@@ -34,31 +33,43 @@ public class TestBuildProgressMonitor implements IBuildProgressMonitor {
        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;
                        }
@@ -66,9 +77,7 @@ public class TestBuildProgressMonitor implements IBuildProgressMonitor {
        }
 
        public void begin() {
-               if (verbose) {
-                       System.out.println("build started");
-               }
+               info("build started");
                currentVal = 0;
        }
 
@@ -81,15 +90,15 @@ public class TestBuildProgressMonitor implements IBuildProgressMonitor {
        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);
                }
index 662971cfeda97fa1997d451991a3ac84bb9e03af..8b707d1b7bf9d586cb0e6fe30228f2b1d8d13234 100644 (file)
@@ -1,11 +1,11 @@
 /********************************************************************
- * 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;
@@ -50,7 +50,9 @@ public class TestMessageHandler implements IBuildMessageHandler {
                } 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;
        }
 
index 09d7941913ae5213dcca1c0578d0afb283fece71..ef70388ad99e2d5ba3020642279b22b90452402c 100644 (file)
@@ -1,17 +1,16 @@
 /********************************************************************
- * 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;
@@ -23,20 +22,24 @@ 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() {
@@ -44,21 +47,33 @@ public class TestBuildProgressMonitor implements IBuildProgressMonitor {
        }
 
        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;
                        }
@@ -66,7 +81,9 @@ public class TestBuildProgressMonitor implements IBuildProgressMonitor {
        }
 
        public void begin() {
-               System.out.println("build started");
+               if (verbose) {
+                       System.out.println("build started");
+               }
                currentVal = 0;
        }
 
@@ -75,16 +92,18 @@ public class TestBuildProgressMonitor implements IBuildProgressMonitor {
                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) {
index 84593580c38a312653d562fb0d2d204ca9ef32bd..e93bb57ff7e33d0984bcc49abadf0276d330d077 100644 (file)
@@ -80,7 +80,7 @@
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
-                        <testFailureIgnore>true</testFailureIgnore>
+                        <testFailureIgnore>false</testFailureIgnore>
 <excludes>
 <exclude>**/*AjcTestSpecAsTest*</exclude>
 </excludes>
index e3f7700ab87854f162bd146c21e89e93f94fa547..dac9a25f6eae98658f6749099c670e7376918165 100644 (file)
                                        <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>
index 47c64f2f5db7c7661b347d2650b2aa027c0004a7..5bbfbfbdfc618a179e2cb9018d22de8924a86575 100644 (file)
@@ -10,7 +10,6 @@
 package org.aspectj.systemtest.ajc11;
 
 import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.util.LangUtil;
 
 import junit.framework.Test;
 
index 62e96d0dff0ac6b17b118d8b68067094178b61f5..87950db0a35023a90b74fc6ca31b3a0a23eefc2a 100644 (file)
@@ -19,7 +19,6 @@ import org.aspectj.apache.bcel.classfile.Method;
 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;
 
index 210f5f44de35873402fb716089d191698cc1864f..fd315255818044bbe1c1189de39c61a98fe77c1f 100644 (file)
@@ -2,7 +2,6 @@ package org.aspectj.systemtest.ajc150;
 
 import java.io.File;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.List;
 
 import org.aspectj.apache.bcel.classfile.Attribute;
index 8c277a90690b3620561935f8f93fef452781b11e..e05662ce88c57645925e894c19b4db6a78d67c75 100644 (file)
@@ -18,7 +18,6 @@ import java.io.FileReader;
 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;
index b728b8862e3ecb44dfe60a0a7583757e1e7ad7d5..6fa9818aee9a7f48d673aa66e2dd869ec78152b3 100644 (file)
@@ -12,7 +12,6 @@ package org.aspectj.systemtest.ajc153;
 
 import java.io.IOException;
 import java.net.URL;
-import java.util.Iterator;
 import java.util.List;
 
 import org.aspectj.asm.AsmManager;
index 4f50cefca86638cf761bc7b4fac866bab0926e9a..9482c921e25dbf32ba67489d65943addac3fd18b 100644 (file)
@@ -15,7 +15,6 @@ package org.aspectj.systemtest.ajc154;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
index 621c1917c5413be5c99b158c185891fae6a4b212..8641fcb26790b990898cbebf36f4d18e765ff34e 100644 (file)
@@ -10,7 +10,6 @@
  *******************************************************************************/
 package org.aspectj.systemtest.ajc161;
 
-import java.util.Iterator;
 import java.util.Set;
 
 import org.aspectj.asm.AsmManager;
index 1b11815356c6def789931421ebc83ce9e9009672..c8f6e58b9478515dd47025d66b301c1b0c2339a2 100644 (file)
@@ -11,7 +11,6 @@
 package org.aspectj.systemtest.ajc164;
 
 import java.io.PrintWriter;
-import java.util.Iterator;
 import java.util.List;
 
 import org.aspectj.apache.bcel.classfile.LocalVariable;
index 1b8e5c69a2442c8b120d3031ca343086cb8ea77e..dd340c770c74a08e44ecced263205cf126cafbdb 100644 (file)
@@ -23,7 +23,6 @@ import java.io.PrintWriter;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
index 3c13ccb714f3b8719c8b6ba495b0460085c70401..dc19e2993ae71b21e524a70f1ce1792907c264d0 100644 (file)
@@ -14,7 +14,6 @@ import java.io.File;
 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;
index aa95319797b3362b4d247b2f510fdc7cc47dd375..f0e65acd2ca72190672e7b118cdf36bda0467ab7 100644 (file)
@@ -10,7 +10,6 @@
 package org.aspectj.systemtest.java14;
 
 import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.util.LangUtil;
 
 import junit.framework.Test;
 
index c0cf11977b896eb09049441b5be7d5fc22b807cc..b18d9a5f74f1c7f01c5158939889bc0e277e39b6 100644 (file)
@@ -15,7 +15,6 @@ import java.io.File;
 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;
index b08e42aede23595db9a50e5cb3bc04333450b530..72e31e121e69c389c1be52bd9660b332539a2a23 100644 (file)
@@ -1,6 +1,5 @@
 package org.aspectj.tests;
 
-import org.aspectj.systemtest.AllTests17;
 import org.aspectj.systemtest.AllTests18;
 import org.aspectj.systemtest.AllTests19;
 import org.aspectj.util.LangUtil;