This is the mail archive of the mailing list for the Mauve project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RunnerProcess ignore abstract classes

This is a fix written by Raif (sorry for the delay Raif, I thought you
had committed this) that marks abstract classes as
NOT_A_TEST_DESCRIPTION instead of trying to instantiate them and
reporting a failure.  Note, these files SHOULD be marked "not-a-test"
but this little patch is a nice way of dealing with them regardless of
whether or not they are properly tagged.

2006-06-29  Anthony Balkissoon  <>

	(runtest): Check if the class is abstract (and therefore not a test) 
	and mark it as NOT_A_TEST_DESCRIPTION if so.

RCS file: /cvs/mauve/mauve/,v
retrieving revision 1.10
diff -u -r1.10
---	27 Jun 2006 20:53:35 -0000	1.10
+++	29 Jun 2006 17:13:27 -0000
@@ -41,6 +41,7 @@
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.util.Vector;
@@ -254,6 +255,13 @@
         Class k = Class.forName(name);
+        int mods = k.getModifiers();
+        if (Modifier.isAbstract(mods))
+          {
+            description = NOT_A_TEST_DESCRIPTION;
+            return;
+          }
         Object o = k.newInstance();
         if (! (o instanceof Testlet))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]