Error while running Parameterized test
Hi,
I'm currently working on a really simple Parameterized TestCase. I'm using flexunit 4.0-rc1 and flexmojos 3.5.0.
When I do 'mvn clean test' I get the following error:
<testsuite errors="0" failures="1" name="com.finams.bnpflexlib.utils.StringUtilsTest" tests="1" time="0">
<testcase name="initializationError" time="0">
<failure message="Custom runner class org.flexunit.runners.Parameterized cannot be instantiated" type="com.finams.bnpflexlib.utils.StringUtilsTest">Error: Custom runner class org.flexunit.runners.Parameterized cannot be instantiated
at org.flexunit.internals.runners::InitializationError()
Here is my TestCase (StringUtils is a simple class with a single method that converts numbers to strings, I did it to manage the specific case of a NaN parameter):
package com.finams.bnpflexlib.utils { import org.flexunit.Assert; import org.flexunit.runners.Parameterized; import com.finams.bnpflexlib.utils.StringUtils; [RunWith("org.flexunit.runners.Parameterized")] public class StringUtilsTest { [Datapoints] static public var referential:Array = [ {numeric: 0, alpha: '0'}, {numeric: 1500, alpha: '1500'}, {numeric: 42, alpha: '42'}, {numeric: 15.15, alpha: '15.15'}, {numeric: 999, alpha: '999'}, {numeric: 17.0123456789, alpha: '17.0123456789'}, {numeric: 123456789, alpha: '123456789'}, {numeric: 0.00000000001, alpha: '0.00000000001'}, {numeric: -1, alpha: '-1'}, {numeric: 0.00000000015, alpha: '0.00000000015'}, {numeric: -1.01, alpha: '-1.01'}, {numeric: 0.12345678912, alpha: '0.12345678912'}, {numeric: -123456789, alpha: '-123456789'}, {numeric: 0.0, alpha: '0.0'}, {numeric: -1.123456789, alpha: '-1.123456789'}, {numeric: -0.0, alpha: '-0.0'} ]; public function StringUtilsTest() {} [Test(description="Ensure that a NaN number will produce an empty string.")] public function checkNbToStringWithNaNParameter():void { var result:String; result = StringUtils.nbToString(NaN); Assert.assertEquals(result, ''); } [Ignore] [Test(dataprovider="referential", description="Check conversion with a set of values")] public function checkNumbers(nb:Number, ref:String):void { var result:String; result = StringUtils.nbToString(nb); Assert.assertEquals('Conversion fault: expected ' + ref + ', got ' + nb.toString(), result, 'ref'); } } }
I wonder what's wrong...
