You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Matthew Beermann (JIRA)" <ji...@codehaus.org> on 2006/05/22 21:39:41 UTC

[jira] Created: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

TestListenerInvocationHandler incorrectly assumes getName()
-----------------------------------------------------------

         Key: SUREFIRE-42
         URL: http://jira.codehaus.org/browse/SUREFIRE-42
     Project: surefire
        Type: Bug

    Versions: 2.0    
    Reporter: Matthew Beermann


I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails:

org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
java.lang.reflect.UndeclaredThrowableException
	at $Proxy0.addError(Unknown Source)
	at junit.framework.TestResult.addError(TestResult.java:36)
...
Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
	at java.lang.Class.getMethod(Class.java:986)
	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
	... 23 more

At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Matthew Beermann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-42?page=all ]

Matthew Beermann updated SUREFIRE-42:
-------------------------------------

    Attachment: SUREFIRE-42-surefire-junit.patch

Better patch, this one follows the Maven code and patch conventions.

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>                 Key: SUREFIRE-42
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-42
>             Project: surefire
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Matthew Beermann
>             Fix For: 2.1
>
>         Attachments: patch.txt, SUREFIRE-42-surefire-junit.patch
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails:
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> 	at $Proxy0.addError(Unknown Source)
> 	at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> 	at java.lang.Class.getMethod(Class.java:986)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> 	... 23 more
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Kenney Westerhof (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kenney Westerhof updated SUREFIRE-42:
-------------------------------------

    Description: 
I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails: 
org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.addError(Unknown Source)
at junit.framework.TestResult.addError(TestResult.java:36)
...
Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
at java.lang.Class.getMethod(Class.java:986)
at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
... 23 more 
At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

  was:
I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails:

org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
java.lang.reflect.UndeclaredThrowableException
	at $Proxy0.addError(Unknown Source)
	at junit.framework.TestResult.addError(TestResult.java:36)
...
Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
	at java.lang.Class.getMethod(Class.java:986)
	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
	... 23 more

At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

     Complexity:   (was: Intermediate)

I think I already fixed this bug a while ago; is it still a problem?

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>                 Key: SUREFIRE-42
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-42
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>            Reporter: Matthew Beermann
>             Fix For: 2.4
>
>         Attachments: patch.txt, SUREFIRE-42-surefire-junit.patch
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails: 
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> at $Proxy0.addError(Unknown Source)
> at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> at java.lang.Class.getMethod(Class.java:986)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> ... 23 more 
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Matthew Beermann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-42?page=all ]

Matthew Beermann updated SUREFIRE-42:
-------------------------------------

    Attachment: patch.txt

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>          Key: SUREFIRE-42
>          URL: http://jira.codehaus.org/browse/SUREFIRE-42
>      Project: surefire
>         Type: Bug

>     Versions: 2.0
>     Reporter: Matthew Beermann
>  Attachments: patch.txt
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails:
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> 	at $Proxy0.addError(Unknown Source)
> 	at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> 	at java.lang.Class.getMethod(Class.java:986)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> 	... 23 more
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated SUREFIRE-42:
---------------------------------

    Patch Submitted: [Yes]

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>                 Key: SUREFIRE-42
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-42
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>            Reporter: Matthew Beermann
>             Fix For: 2.4
>
>         Attachments: patch.txt, SUREFIRE-42-surefire-junit.patch
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails: 
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> at $Proxy0.addError(Unknown Source)
> at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> at java.lang.Class.getMethod(Class.java:986)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> ... 23 more 
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Matthew Beermann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98296 ] 

Matthew Beermann commented on SUREFIRE-42:
------------------------------------------

I haven't retried it in a while, but if you tell me it's fixed, I'll believe you. :)

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>                 Key: SUREFIRE-42
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-42
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>            Reporter: Matthew Beermann
>             Fix For: 2.4
>
>         Attachments: patch.txt, SUREFIRE-42-surefire-junit.patch
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails: 
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> at $Proxy0.addError(Unknown Source)
> at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> at java.lang.Class.getMethod(Class.java:986)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> ... 23 more 
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated SUREFIRE-42:
---------------------------------

    Fix Version/s:     (was: 2.3)
                   2.4

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>                 Key: SUREFIRE-42
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-42
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>            Reporter: Matthew Beermann
>             Fix For: 2.4
>
>         Attachments: patch.txt, SUREFIRE-42-surefire-junit.patch
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails:
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> 	at $Proxy0.addError(Unknown Source)
> 	at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> 	at java.lang.Class.getMethod(Class.java:986)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> 	... 23 more
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich closed SUREFIRE-42.
--------------------------------

    Resolution: Cannot Reproduce

This bug was fixed at some point; integration test checked in revision 597574.

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>                 Key: SUREFIRE-42
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-42
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>            Reporter: Matthew Beermann
>             Fix For: 2.4
>
>         Attachments: patch.txt, SUREFIRE-42-surefire-junit.patch
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails: 
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> at $Proxy0.addError(Unknown Source)
> at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> at java.lang.Class.getMethod(Class.java:986)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> ... 23 more 
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-42) TestListenerInvocationHandler incorrectly assumes getName()

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-42?page=all ]

Brett Porter updated SUREFIRE-42:
---------------------------------

    Fix Version/s: 2.1

> TestListenerInvocationHandler incorrectly assumes getName()
> -----------------------------------------------------------
>
>                 Key: SUREFIRE-42
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-42
>             Project: surefire
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Matthew Beermann
>             Fix For: 2.1
>
>         Attachments: patch.txt
>
>
> I'm running test cases that extend our own custom base test case. If one of the tests fails, Surefire itself fails:
> org.apache.maven.surefire.booter.SurefireExecutionException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> org.apache.maven.surefire.testset.TestSetFailedException: com.cerner.system.util.CalendarsTest; nested exception is java.lang.reflect.UndeclaredThrowableException: null
> java.lang.reflect.UndeclaredThrowableException
> 	at $Proxy0.addError(Unknown Source)
> 	at junit.framework.TestResult.addError(TestResult.java:36)
> ...
> Caused by: java.lang.NoSuchMethodException: com.cerner.junit.madhatter.classreloader.ReloadedTestCaseDecorator.getName()
> 	at java.lang.Class.getMethod(Class.java:986)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.getStackTraceWriter(TestListenerInvocationHandler.java:171)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleAddError(TestListenerInvocationHandler.java:160)
> 	at org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(TestListenerInvocationHandler.java:134)
> 	... 23 more
> At TestListenerInvocationHandler:171, I see that it's trying to reflect to a method called getName(). This seems like a very poor assumption, given that nothing on the Test or TestListener interfaces guarantees that there'll be a method called getName(). At the very least, shouldn't the NoSuchMethodException be caught and handled somewhere? See: http://www.junit.org/junit/javadoc/3.8.1/index.htm

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira