Solved

Junit.framework.AssertionFailedError: No tests found in a.b.c.FooTest

Posted on 2008-10-20
8
2,701 Views
Last Modified: 2013-12-15
I am using "extends TestCase" and it is requiring that I use @Test.  This is where the error is explained:
http://java.syntaxerrors.info/index.php?
Junit.framework.AssertionFailedError: No tests found in a.b.c.FooTest

Could I use TestCase without having to apply @Test?

0
Comment
Question by:chima
  • 4
  • 4
8 Comments
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 22764020
yeah you can use TestCase without having to apply @Test?
0
 

Author Comment

by:chima
ID: 22767583
chaituu, that is re-assuring.  Why is it that I am getting that message that I have to use @Test?
0
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 500 total points
ID: 22776182
if you are using JUnit 3 version then no need to use @Test.if you are using JUnit version 4 you need to use @Test.

check the junit api for @Test is all about.

http://junit.org/apidocs/org/junit/Test.html
0
 

Author Comment

by:chima
ID: 22782068
I'm trying to sent up my java files to use "extended TestCase."  I have changed it to JUnit 3.
Now I am getting this error (see below).   I have added TestCase() constructors, yet I am still getting the error.

junit.framework.AssertionFailedError: Class com.comcast.cable.sit.sams.xmlSchema.Validator has no public constructor TestCase(String name) or TestCase()
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.TestSuite$1.runTest(TestSuite.java:90)
      at junit.framework.TestCase.runBare(TestCase.java:130)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:120)
      at junit.framework.TestSuite.runTest(TestSuite.java:230)
      at junit.framework.TestSuite.run(TestSuite.java:225)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Any suggestions?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 22782737
error says you can't add these constructors TestCase(String name) or TestCase() in your testcase
0
 

Author Comment

by:chima
ID: 22785537
chaituu, might you be able to add more detail to your comment?
Are you saying that the files I have, and the way they are set up, that I can not use "extends TestCase?"  Initially it gave this error: xmlSchema.ValidatorTest has no public constructor TestCase(String name) or TestCase()
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 22792600
can you send the testcase that you have written?
0
 

Author Closing Comment

by:chima
ID: 31507985
I figure that I had to have started with the proper test framework and not try to "automatically" convert the existing java files to Junit testing.  I have another set of files where the convertion did work.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now