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 7620979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:04:53+00:00 2026-05-31T04:04:53+00:00

I am using the following test runner: http://code.google.com/p/migen/source/browse/trunk/java/src/uk/ac/lkl/common/util/testing/LabelledParameterized.java?r=3789 What it does is change the

  • 0

I am using the following test runner: http://code.google.com/p/migen/source/browse/trunk/java/src/uk/ac/lkl/common/util/testing/LabelledParameterized.java?r=3789

What it does is change the name of parameterized tests to be more readable. ie: expected result – “myDefinedTestName”

When I run using eclipse it works correctly: I can see the new names.
When I run using JUnit4Provider:

final JUnit4Provider provider = new JUnit4Provider(params);
provider.invoke(testClass);

it does not. ie: I get “oldTestName[0]”. There is no error. Why and how to fix this?


I have tried using JUnitCore with no success. I have done the following:

TestRunner

import org.junit.runner.JUnitCore;

public class TestRunner {

/**
 * @param args
 */
public static void main(final String[] args) {
    final JUnitCore provider = new JUnitCore();
    provider.addListener(new TestJUnitCore4Listener());
    provider.run(UpdateBackgroundImageParameterizedTests.class);

}

}

Listener

import org.junit.runner.Description;
import org.junit.runner.notification.RunListener;

public class TestJUnitCore4Listener extends RunListener {

    @Override
    public void testFinished(final Description description) throws Exception {
         System.out.println(description.getDisplayName() + " "
            + description.getMethodName());
    }

}

Tests

import static org.junit.Assert.assertTrue;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;

@RunWith(LabelledParameterized.class)
public class UpdateBackgroundImageParameterizedTests {

// Fields
private final String datum;
private final String expectedResult;

/**
 * Constructor is called for every parameter set in generateData()
 * 
 * @param datum
 *            input to be used in tests
 * @param expectedResult
 *            output expected by tests
 */
public UpdateBackgroundImageParameterizedTests(final String datum,
        final String expectedResult) {
    super();
    this.datum = datum;
    this.expectedResult = expectedResult;
}

/**
 * @return a list of expected inputs and outputs
 */
@Parameters
public static Collection<Object[]> generateData() {
    return Arrays.asList(new Object[][] { { "sunny", "a" }, // 0
            { "cloudy", "a" }, // "a"
            { "rain", "a" }, // 2
            { "heavy snow", "a" }, // 3
            { "occasionally thundery", "a" }, // 4
            { "clear skies", "a" }, // 5
            { "error", "a" } }); // 6
}

/**
 * Test updateBackgroundImage using parameter injection for feed Test run
 * for all parameters specified in generateData()
 * 
 * @throws Exception
 */
@Test
public void testUpdateBackgroundImage() throws Exception {
    assertTrue(true);
}

}

using the test runner: http://code.google.com/p/migen/source/browse/trunk/java/src/uk/ac/lkl/common/util/testing/LabelledParameterized.java?r=3789

which is giving the output:

testUpdateBackgroundImage[0](UpdateBackgroundImageParameterizedTests) testUpdateBackgroundImage[0]
testUpdateBackgroundImage[1](UpdateBackgroundImageParameterizedTests) testUpdateBackgroundImage[1]
testUpdateBackgroundImage[2](UpdateBackgroundImageParameterizedTests) testUpdateBackgroundImage[2]
testUpdateBackgroundImage[3](UpdateBackgroundImageParameterizedTests) testUpdateBackgroundImage[3]
testUpdateBackgroundImage[4](UpdateBackgroundImageParameterizedTests) testUpdateBackgroundImage[4]
testUpdateBackgroundImage[5](UpdateBackgroundImageParameterizedTests) testUpdateBackgroundImage[5]
testUpdateBackgroundImage[6](UpdateBackgroundImageParameterizedTests) testUpdateBackgroundImage[6]
  • 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-31T04:04:54+00:00Added an answer on May 31, 2026 at 4:04 am

    The same code worked when using JUnitParams as a test runner instead. So the problem must be with LabelledParameterized.

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

Sidebar

Related Questions

I am trying to remove the attribute xmlns=http://webdev2003.test.com from the following xml using xsl/xslt,
I'm using the following code.. $(document).ready(function(){ $(#test a).click(function(){ var labelTo = $(this).text(); window.location =
The following code using System.Threading; class Test { volatile int counter = 0; public
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
Using the following code ControlCommand(Test Form, , [NAME:ctlMsgQueueCombo], ShowDropDown) ControlSend(Test Form, , [NAME:ctlMsgQueueCombo], This
Hello I am trying to create a stacked barplot using the following code: test
Using NUnit 2.2 on .NET 3.5, the following test fails when using DateTime.Equals. Why?
On Windows using WAMPserver (Apache, MySQL, PHP) I have the following: //test.php if (!defined('LC_MESSAGES'))
See the following Mock Test by using Spring/Spring-MVC public class OrderTest { // SimpleFormController
I can typically test a regular Test::Unit method using the following commandline syntax for

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.