Your message dated Tue, 01 Sep 2009 20:34:56 +0100
with message-id <[email protected]>
and subject line Re: ant: <junit><batchtest> attempts to run tests in abstract 
classes
has caused the Debian Bug report #157696,
regarding ant: <junit><batchtest> attempts to run tests in abstract classes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
157696: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=157696
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ant
Version: 1.5-1.hacked.2
Severity: normal
Tags: patch

              ^^^^^^^^^ system is running my locally patched version

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux troop.granta.internal 2.4.5 #1 Wed Mar 6 19:11:51 GMT 2002 i686
Locale: LANG=en_GB.ISO-8859-1, LC_CTYPE=en_GB.ISO-8859-1

Versions of packages ant depends on:
ii  gij-3.0 [java-vir 1:3.0.4-10             The GNU Java bytecode interpreter.
pi  java-virtual-mach 0.3                    Dummy Java virtual machine
ii  junit             3.7-4                  Automated testing framework for Ja
ii  kaffe [java-virtu 1:1.0.6-7+.cvs20020411 A JVM to run Java bytecode
ii  libbsf-java       1:2.2-1                Bean Scripting Framework
ii  liblog4j          1.1b7-1                Logging library for java.
ii  liboro-java       2.0.5-2                Regular expression library for Jav
ii  libregexp-java    1.2.20010409-3         regular expression library for Jav
ii  libxalan2-java    2.3.99D1-2             XSL Transformations (XSLT) process
ii  libxerces2-java   2.0.2-1                Validating XML parser for Java

-- no debconf information

We use abstract base test classes as templates. In a vanilla Ant 1.5-1
they cause several failures because the test class cannot be
instantiated.

The patch causes each abstract class to report one pass entitled
'testNothingToTestInAbstractTestClass'. I claim that this is more sane
than any of

 - running the suite as if it were normal (causes N failures)

 - throwing an exception for the abstract class (one error instead of
   N failures)

 - silently skipping the test (it's not obvious that this is possible
   anyway, but I didn't try because silence is confusing in some
   cases)

It's not obvious that this is the best solution to the problem, but
it's quiet and tidy. More importantly it bring us closer to the green
bar.

It is possible that something similar should be done for
interfaces. I've only just thought of that though. It doesn't seem
very important at the moment.


Matthew  #8-)
-- 

--- 
ant-1.5/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  2002-07-09 16:27:14.000000000 +0100
+++ 
ant-1.5.hacked/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
   2002-08-20 22:27:33.000000000 +0100
@@ -65,6 +65,7 @@
 import junit.framework.TestSuite;
 import junit.framework.AssertionFailedError;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 
 import java.io.BufferedReader;
 import java.io.ByteArrayOutputStream;
@@ -240,6 +241,11 @@
                 AntClassLoader.initializeClass(testClass);
             }
             
+            if (Modifier.isAbstract(testClass.getModifiers())) {
+                testClass = 
Class.forName("org.apache.tools.ant.taskdefs.optional.junit.PlaceholderAbstractTest");
+                // throw new Exception("Class " + testClass + " is abstract");
+            }
+            
             Method suiteMethod = null;
             try {
                 // check if there is a suite method



New file, 
ant-1.5.hacked/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlaceholderAbstractTest.java:

package org.apache.tools.ant.taskdefs.optional.junit;

/**
 * Dummy test class which stands in for abstract test classes.
 * Invoked by the JUnitTestRunner
 */
public class PlaceholderAbstractTest extends junit.framework.TestCase {

    public PlaceholderAbstractTest(String s) {
        super(s);
    }

    public void testNothingToTestInAbstractTestClass() {
        // This gets run, but obviously never fails.  The purpose is to leave 
some
        // evidence as to why the desired class did nothing.
    }
}


--- End Message ---
--- Begin Message ---
Tag: wontfix

This bug is not related to the packaging issue, it's a wishlist item
that is known upstream (since 2003...)


--- End Message ---
_______________________________________________
pkg-java-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers

Reply via email to