Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480758 - =dev-java/commons-digester-{2.1,3.2} - Tests fail.
Summary: =dev-java/commons-digester-{2.1,3.2} - Tests fail.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2013-08-12 17:33 UTC by Tom Wijsman (TomWij) (RETIRED)
Modified: 2015-07-09 09:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,94.07 KB, text/x-log)
2013-08-12 17:33 UTC, Tom Wijsman (TomWij) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-08-12 17:33:03 UTC
Created attachment 355790 [details]
build.log

See attachment.
Comment 1 Patrice Clement gentoo-dev 2015-07-09 09:34:07 UTC
    [junit] Running org.apache.commons.digester.annotations.AbstractAnnotatedPojoTestCase
    [junit] Testsuite: org.apache.commons.digester.annotations.AbstractAnnotatedPojoTestCase
    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.079 sec
    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.079 sec
    [junit] 
    [junit] Testcase: initializationError took 0.005 sec
    [junit] 	Caused an ERROR
    [junit] No runnable methods
    [junit] java.lang.Exception: No runnable methods
    [junit] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    [junit] 

Note the "AbstractAnnotatedPojoTestCase.java" which is, of course, an abstract class.

https://en.wikibooks.org/wiki/Java_Programming/Keywords/abstract

As we all know, abstract clases cannot be directly instantiated. Simply ignore them in the build.xml file:

Index: files/commons-digester-2.1-build.xml
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-java/commons-digester/files/commons-digester-2.1-build.xml,v
retrieving revision 1.1
diff -u -B -r1.1 commons-digester-2.1-build.xml
--- files/commons-digester-2.1-build.xml        12 Aug 2013 19:45:23 -0000      1.1
+++ files/commons-digester-2.1-build.xml        9 Jul 2015 09:22:09 -0000
@@ -154,6 +154,7 @@
           <exclude name="**/TestRule.java"/>
           <exclude name="**/TestRuleSet.java"/>
           <exclude name="**/Test*$*.java"/>
+          <exclude name="**/*Abstract*.java"/>
         </fileset>
       </batchtest>
       <batchtest todir="${maven.test.reports}" if="test">

I'm surprised though, since it is a Maven-generated build.xml file. It should create the exclude markup to ignore abstract classes automatically. Weird. :/ Anyway. This fixes the issue for both ebuilds:

BUILD SUCCESSFUL
Total time: 50 seconds
>>> Completed testing dev-java/commons-digester-2.1-r1

BUILD SUCCESSFUL
Total time: 58 seconds
>>> Completed testing dev-java/commons-digester-3.2-r2

+*commons-digester-3.2-r2 (09 Jul 2015)
+*commons-digester-2.1-r1 (09 Jul 2015)
+
+  09 Jul 2015; Patrice Clement <monsieurp@gentoo.org>
+  +commons-digester-2.1-r1.ebuild, +commons-digester-3.2-r2.ebuild,
+  files/commons-digester-2.1-build.xml:
+  Enable back test USE flag and ignore abstract classes when running test cases.
+  Fix bug 480758.
+