Junit4.1 with Ant 1.6.5 issues
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nagesh_Babu
Posted On:   Monday, July 31, 2006 04:21 AM

Junit4.1 with Ant 1.6.5 not passing tests when expected exception is thrown. Need a work around the problem when using Junit4.1 with Ant1.6.5 Sample example code in Junit Cookbook faq is not working due to ant's dreaded jar file / classpath mis-match. My code snippet is as below @Test (expected=java.lang.IndexOutOfBoundsException.class) public void testForException() { Object o = emptyList.get(0); } Ant task is supposed to pass this test as it is an expected exception and i have declared it. Tried many options like giving package name of exception, with no respite. I have extended the class junit.framework.TestCase    More>>

Junit4.1 with Ant 1.6.5 not passing tests when expected exception is thrown.


			
Need a work around the problem when using Junit4.1 with Ant1.6.5

Sample example code in Junit Cookbook faq is not working due to ant's dreaded jar file / classpath mis-match.

My code snippet is as below

@Test (expected=java.lang.IndexOutOfBoundsException.class)
public void testForException()
{
Object o = emptyList.get(0);
}

Ant task is supposed to pass this test as it is an expected exception and i have declared it.

Tried many options like giving package name of exception, with no respite.

I have extended the class junit.framework.TestCase

thanks in advance.

   <<Less
About | Sitemap | Contact