This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

junit AssertionFailedError  RSS feed

 
Ranch Hand
Posts: 89
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I get the following error whenever I run a test case:

junit.framework.AssertionFailedError: No tests found in <path of test class>

I am using JUnit 4 for testing. The class contains tests methods denoted by @Test.

I am unable to understand as to why I am getting the above error.

-Nidhi
 
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So is your other problem at http://www.coderanch.com/t/108617/tools/JUnit-error resolved?

*How* to you try to run the tests? Are you using the string "<path of test class>" somewhere? You will probably need to replace that string with, well, the actual path of the test class...
 
Nidhi Singhal
Ranch Hand
Posts: 89
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

My last problem has got resolved. It was a compile time error as it was unable to find a jar file.

In the below error statement:
junit.framework.AssertionFailedError: No tests found in <path of test class>

By string <path of test class> I mean to say that the error shows the path of the test class here.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see.

Can you show us the code of the testcase class, please?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

Was your problem resolved? I am having the same issue and the test code I am running came straight from the JUnit FAQ page:

package junitfaq;

import org.junit.*;
import static org.junit.Assert.*;
import java.util.*;

public class UtilTest {

private Collection<Object> collection;

@Before
public void setUp() {
collection = new ArrayList<Object>();
}

@Test
public void testEmptyCollection() {
assertTrue(collection.isEmpty());
}

/*
@Test
public void testOneItemCollection() {
collection.add("itemA");
assertEquals(1, collection.size());
}
*/
}

If you can share your solution that would be great!

Thanks,
Armando
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same question: How are you trying to run the test?

My first guess would be that your test runner is expecting a JUnit 3 testcase.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!