Rachel Rachel - 1 year ago 134
Java Question

JUnit : AssertionFailedError, tests not found in

Here is my

in question,

public class DetailsTest extends TestCase
public void testGetQuotes() throws Exception
int bookSize = getBookSize();
List<Details> detailList = getDetailLists();
assertEquals(bookSize, detailList.size());

My class extends
JUnit : TestCase
, not sure what is wrong in here that is causing the issue...am using
junit 3.8.1

I have gone through similar questions on SO but it has not been very helpful.

Update 2 : StackTrace

1) warning(junit.framework.TestSuite$1)junit.framework.AssertionFailedError: No tests found in com.comp.Details.DetailsTest
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)

Tests run: 1, Failures: 1, Errors: 0

Update 3: I just had Details class in my testSuite and not DetailsTest, fixed it and now it works fine...one of those days...you see...

Answer Source

Are you calling addTestSuite


where you should be calling addTest

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download