Explorar o código

remove: UnsupportedTestException

Ranides Atterwim %!s(int64=10) %!d(string=hai) anos
pai
achega
5b598c18ec

+ 12 - 14
assira.junit/src/main/java/net/ranides/assira/junit/QTesterSuite.java

@@ -135,25 +135,23 @@ public class QTesterSuite {
             } catch (IllegalAccessException | IllegalArgumentException ex) {
                 throw QAssert.rethrow(ex);
             } catch (InvocationTargetException ex) {
-                if(ex.getTargetException() instanceof UnsupportedTestException) {
-                    if( !((UnsupportedTestException)ex.getTargetException()).silent() ) {
-                        printf(" - SUITE: %s [%d] %s.%s - IGNORED%n",
+                if(ex.getTargetException() instanceof UnsupportedOperationException) {
+                    if(debug) {
+                        ex.printStackTrace();
+                    }
+                    UnsupportedOperationException uoe = (UnsupportedOperationException)ex.getTargetException();
+                    
+                    if( !"TEST.SILENT".equals(uoe.getMessage())) {
+                        String comment = "TEST.IGNORE".equals(uoe.getMessage()) ? "IGNORED" : "UNSUPPORTED";
+                        printf(" - SUITE: %s [%d] %s.%s - %s%n",
                             type.getName(),
                             counter.next(),
                             method.getDeclaringClass().getSimpleName(),
-                            method.getName()
+                            method.getName(),
+                            comment
                         );
                     }
-                } else if(ex.getTargetException() instanceof UnsupportedOperationException) {
-                    if(debug) {
-                        ex.printStackTrace();
-                    }
-                    printf(" - SUITE: %s [%d] %s.%s - UNSUPPORTED%n",
-                        type.getName(),
-                        counter.next(),
-                        method.getDeclaringClass().getSimpleName(),
-                        method.getName()
-                    );
+                    
                 } else {
                     throw QAssert.rethrow(ex.getTargetException());
                 }

+ 0 - 29
assira.junit/src/main/java/net/ranides/assira/junit/UnsupportedTestException.java

@@ -1,29 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/???
- */
-package net.ranides.assira.junit;
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public class UnsupportedTestException extends UnsupportedOperationException {
-    
-    private final boolean silent;
-    
-    public UnsupportedTestException() {
-        this(false);
-    }
-
-    public UnsupportedTestException(boolean silent) {
-        this.silent = silent;
-    }
-
-    public boolean silent() {
-        return silent;
-    }
-    
-}

+ 2 - 3
assira.junit/src/test/java/net/ranides/assira/junit/mockup/Testers.java

@@ -9,7 +9,6 @@ package net.ranides.assira.junit.mockup;
 import java.util.Map;
 import java.util.function.Supplier;
 import javax.annotation.Resource;
-import net.ranides.assira.junit.UnsupportedTestException;
 import net.ranides.assira.junit.mockup.TesterObjects.*;
 import net.ranides.assira.junit.mockup.TesterInterfaces.*;
 import org.junit.Ignore;
@@ -56,12 +55,12 @@ public class Testers {
         
         @Test
         public void ignored(IntA object) {
-            throw new UnsupportedTestException();
+            throw new UnsupportedOperationException("TEST.IGNORE");
         }
         
         @Test
         public void silent(IntA object) {
-            throw new UnsupportedTestException(true);
+            throw new UnsupportedOperationException("TEST.SILENT");
         }
 
     }