[ 
https://issues.apache.org/jira/browse/CACTUS-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Petar Tahchiev reassigned CACTUS-252:
-------------------------------------

    Assignee: Petar Tahchiev

> JUnit 4.x integration
> ---------------------
>
>                 Key: CACTUS-252
>                 URL: https://issues.apache.org/jira/browse/CACTUS-252
>             Project: Cactus
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 1.7.2
>         Environment: Windows XP
> JUnit 4.4
> Cactus 1.7.2
>            Reporter: Jan Krivanek
>            Assignee: Petar Tahchiev
>
> I found workaround that it's possible to "integrate" JUnit 4.4 with Cactus 
> 1.7.2.
> Here is the example how do I do:
> public class CactusTestRunner extends ServletTestCase
> {
>     public static Test suite()
>     {
>         ServletTestSuite suite = new ServletTestSuite("ahojO");   
>         suite.addTest (new JUnit4TestAdapter (xxx.class));
>     }  
> }
> -- creates JUnit 3.8 compatible tests from JUnit 4.4 classes....
> I have to do change in the Cactus method: 
> JUnitVersionHelper.getTestCaseName() to enable to write TestCase names to the 
> output file
>        else if (theTest.getClass().getSimpleName().equals 
> ("JUnit4TestCaseFacade"))
>         {
>             try
>             {
>                 Class cl = Class.forName (theTest.getClass().getName ());
>                 Method me = cl.getMethod ("getDescription");
>                 Object desc = me.invoke (theTest);
>                 Class clDesc = Class.forName (desc.getClass().getName());
>                 Method meDesc = clDesc.getMethod ("getDisplayName");
>                 name = (String) meDesc.invoke (desc);
>             }
>             catch (Throwable e)
>             {                
>                 name = "unknown";
>             }
>         }
> The bad is that you have to have both JUnit 3.8 and JUnit 4.4 archive in 
> testing application. There could be problems with class loader but haven't 
> got any. So I believe that Cactus developers could use my workaround to 
> fastly increase of JUnit dependency to JUnit 4.x.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to