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

  • Home
  • SEARCH
  • 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 6344309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:36:44+00:00 2026-05-24T20:36:44+00:00

I am trying to run a parametrized tests… Was trying to implement it like

  • 0

I am trying to run a parametrized tests… Was trying to implement it like it explained here:
http://docs.flexunit.org/index.php?title=Parameterized_Test_Styles

Here is what my test case looking

import org.flexunit.runners.Parameterized;

[RunWith("org.flexunit.runners.Parameterized")]
public class ArrayBasedStackTests
{       
    [Paremeters]
    public static var stackProvider:Array = [new ArrayBasedStack(), new LinkedListBasedStack()] ;

    private var _stack:IStack;

    public function ArrayBasedStackTests(param:IStack)
    {
        _stack = param;
    }


    [Before]
    public function setUp():void
    {
    }

    [After]
    public function tearDown():void
    {
    }

    [Test ( description = "Checks isEmpty method of the stack. For empty stack", dataProvider="stackProvider" )]
    public function isEmptyStackPositiveTest():void
    {
        var stack:IStack = _stack;
        assertEquals( true, stack.isEmpty() );
    }

But this code throws following initializing Error:

Error: Custom runner class org.flexunit.runners.Parameterized should
be linked into project and implement IRunner. Further it needs to have
a constructor which either just accepts the class, or the class and a
builder.

Need help to fix it

UPDATE

I’ve updated the code so it looks like this

    [RunWith("org.flexunit.runners.Parameterized")]
public class ArrayBasedStackTests
{       
    private var foo:Parameterized;

    [Parameters]
    public static function stacks():Array
    {
        return  [ [new ArrayBasedStack()], [new LinkedListBasedStack()] ] ;
    }

    [Before]
    public function setUp():void
    {
    }

    [After]
    public function tearDown():void
    {
    }

    [Test ( description = "Checks isEmpty method of the stack. For empty stack", dataProvider="stacks")]
    public function isEmptyStackPositiveTest(stack:IStack):void
    {
        assertEquals( true, _stack.isEmpty() );
    }

It works. But the result is a bit strange. I have 4 test executed instead of 2. (I have 2 items in data provider, so cant get why do I have 4 tests).

Output

http://screencast.com/t/G8DHbcjDUkJ

  • 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-24T20:36:45+00:00Added an answer on May 24, 2026 at 8:36 pm

    The [Parameters] meta-data specifies that the parameters are passed to the constructor of the test – so the test class is called for each parameter. You also have the dataProvider set for the specific test method, so the test method is also called once for each parameter. Two calls for the test, and two calls to the method, ends up running four tests.

    The solution is to either use [Parameters] meta-tag which specifies the data to use for the whole test class, or use the dataProvider for each test method, but not both with the same data at the same time.

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

Sidebar

Related Questions

When trying to run the sample code here: http://www.nikhilk.net/Live-Search-REST-API.aspx I get: Error 52 The
Im trying to run something like this: <a href=login.php?logout=1 id=logout>logout</a> <div id=main> <?php require_once('getPhotos.php')
Trying to run the following command in php to run powershell command... the following
While trying to run all the unit tests in my solution(Visual Studio 2010) I
I am trying to run a distinct-values XPath using Saxon. Here is my code:
I'm trying to follow a tutorial on Tapestry. (http://tapestry.apache.org/tapestry5.1/tutorial1/env.html) The tutorial recommends Jetty 5.1
While trying to run a string through PHP's htmlentities function, I have some cases
Trying to run RabbitMQ on VPS with Ubuntu 10.04. Doing everything like usual: added
I am trying to do run a bulk deletion using parameterized queries. Currently, I
I am trying run a program from a qmake .pro file which modifies the

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.