Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 910297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:01:15+00:00 2026-05-15T17:01:15+00:00

public class NewTest extends SeleneseTestCase { public static Test suite() throws Exception { TestSuite

  • 0

public class NewTest extends SeleneseTestCase {

public static Test suite() throws Exception
{
   TestSuite suite = new TestSuite();

   TestSuite s = new TestSuite("TestCase Name");
      GeneratedTest t = new GeneratedTest("testName");
      t.setFailure("TestCase Name: testName");
      s.addTest(t);
      t = new GeneratedTest("testAge");
      s.addTest(t);
      suite.addTest(s);
   s = new TestSuite("TestCase Name2");
      t = new GeneratedTest("testOOGABOOGA");
      t.setFailure("TestCase Name2: testOOGABOOGA");
      s.addTest(t);
      suite.addTest(s);
   s = new TestSuite("TestCase Name4");
      t = new GeneratedTest("testName");
      t.setFailure("TestCase Name4: testName");
      s.addTest(t);
      t = new GeneratedTest("testAge");
      s.addTest(t);  
      suite.addTest(s);
   s = new TestSuite("TestCase Name3");
      t = new GeneratedTest("testName");
      t.setFailure("TestCase Name3: testName");
      s.addTest(t);
      t = new GeneratedTest("testAge");
      s.addTest(t);
      suite.addTest(s);

   return suite;
}

}


public class GeneratedTest extends TestCase
{
  public String testFailMessage;

  public GeneratedTest(String name)
  {
    ((TestCase)this).setName(name);
  }

  public void runTest()
  {
    if (testFailMessage != null)
    {
      fail(testFailMessage);
    }
  }

  public void setFailure(String msg)
  {
    testFailMessage = msg;
 }
}

As you can see (or maybe you can’t) i’m adding tests to junit at runtime. This is all fine and dandy, except that it doesn’t properly display them. Here, see what I mean:

click here for image

As you can see, tests with the same name don’t even display that they’ve been run, except for the last test with duplicate name, and that test has the error messages from all the other tests with the same name.

Is this simply just a flaw with the way that i’m doing it (junit3 style)? Would I have to change it to use junit4 parameterization to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:01:15+00:00Added an answer on May 15, 2026 at 5:01 pm

    I noticed something similar in Eclipse’s test runner. For JUnit 3.8 style parametrized tests, the names were not being displayed. Switching to JUnit 4 style solved the problem.

    While this isn’t exactly your scenario, I think it is something you’ll have to live with until you can update the tests to JUnit 4. Eclipse does still run the tests which is the important thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class Test { public static void main(String[] args) { DemoAbstractClass abstractClass = new
class test { public $isNew; public function isNew(){} } $ins = new test(); $ins->isNew
This does work: $test = new Test(); $test->blah(); class Test // extends DateInterval {
public class Test { Integer i; int j; public static void main ( String
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class test extends JFrame implements MouseListener {
public class tryAnimActivity extends Activity { /** * The thread to process splash screen
public class Knowing { static final long tooth = 343L; static long doIT(long tooth)
public class A { private A(int param1, String param2) {} public static A createFromCursor(Cursor
given a class definition like: public class Test<T> { T _value; public void Test(T
This code prints out MyUrgentException . Could anybody explain why? class MyException extends Exception{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.