[ 
https://issues.apache.org/jira/browse/CLI-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12690127#action_12690127
 ] 

Sebb edited comment on CLI-178 at 3/27/09 5:28 PM:
---------------------------------------------------

That's because the class is abstract:

public abstract class ParserTestCase extends TestCase

The class is extended by 3 different classes in order to test the 3 different 
parsers; it is not intended to be run stand-alone.

If you wish to run the tests from Ant, just make sure that it does not run that 
class as a test.

      was (Author: s...@apache.org):
    That's because the class is abstract:

public abstract class ParserTestCase extends TestCase

Surefire does not run abstract test cases; I tried just now, and when I removed 
the abstract clause the test case ran - and failed.

I've no idea why the class is abstract.
  
> org.apache.commons.cli.ParserTestCase: Test doesn't pass on Sun JDK 1.6.0.12, 
> Gentoo Linux
> ------------------------------------------------------------------------------------------
>
>                 Key: CLI-178
>                 URL: https://issues.apache.org/jira/browse/CLI-178
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.2
>         Environment: Gentoo Linux, Sun JDK 1.6.0.12
>            Reporter: Jean-Noel Rivasseau
>             Fix For: 1.3
>
>
> Hello, I was bumping the Gentoo version of commons-CLI to 1.2 and in the 
> process tried to run the tests. It fails at this test:
>     [junit] Testsuite: org.apache.commons.cli.ParserTestCase
>     [junit]     at 
> sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
>     [junit]     at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>     [junit]     at junit.framework.TestSuite.createTest(TestSuite.java:54)
>     [junit]     at junit.framework.TestSuite.addTestMethod(TestSuite.java:280)
>     [junit]     at junit.framework.TestSuite.<init>(TestSuite.java:140)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:396)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
>     [junit] ))
>     [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.073 sec
>     [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.073 sec
>     [junit]
>     [junit] Testcase: warning took 0.005 sec
>     [junit]     FAILED
>     [junit] Cannot instantiate test case: testSimpleShort 
> (java.lang.InstantiationException
>     [junit]     at 
> sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
>     [junit]     at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>     [junit]     at junit.framework.TestSuite.createTest(TestSuite.java:54)
>     [junit]     at junit.framework.TestSuite.addTestMethod(TestSuite.java:280)
>     [junit]     at junit.framework.TestSuite.<init>(TestSuite.java:140)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:396)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
>     [junit] )
>     [junit] junit.framework.AssertionFailedError: Cannot instantiate test 
> case: testSimpleShort (java.lang.InstantiationException
>     [junit]     at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>     [junit] )
>     [junit]
> Note that the others tests before run fine. Note that when using Maven all 
> the tests run fine but only because the problematic test is *NOT* run. Does 
> that means that it should not be run? (I used mvn ant:ant to generate an Ant 
> buildfile as Gentoo packaging system does not support Maven yet).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to