Quantcast
Channel: Adobe Community : Popular Discussions - FlexUnit
Viewing all articles
Browse latest Browse all 25673

Error while running Parameterized test

$
0
0

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()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\internals\runners\InitializationError.as:50]     at org.flexunit.internals.builders::MetaDataBuilder/createInitializationError()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\internals\builders\MetaDataBuilder.as:209]     at org.flexunit.internals.builders::MetaDataBuilder/buildWithSecondSignature()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\internals\builders\MetaDataBuilder.as:179]     at org.flexunit.internals.builders::MetaDataBuilder/buildRunner()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\internals\builders\MetaDataBuilder.as:146]     at org.flexunit.internals.builders::MetaDataBuilder/runnerForClass()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\internals\builders\MetaDataBuilder.as:115]     at org.flexunit.runners.model::RunnerBuilderBase/safeRunnerForClass()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runners\model\RunnerBuilderBase.as:63]     at org.flexunit.internals.builders::AllDefaultPossibilitiesBuilder/runnerForClass()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\internals\builders\AllDefaultPossibilitiesBuilder.as:106]     at org.flexunit.runners.model::RunnerBuilderBase/safeRunnerForClass()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runners\model\RunnerBuilderBase.as:63]     at org.flexunit.runners.model::RunnerBuilderBase/localRunners()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runners\model\RunnerBuilderBase.as:119]     at org.flexunit.runners.model::RunnerBuilderBase/runners()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runners\model\RunnerBuilderBase.as:87]     at org.flexunit.runners::Suite()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runners\Suite.as:170]     at org.flexunit.runner::Request$/classes()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runner\Request.as:201]     at Function/http://adobe.com/AS3/2006/builtin::apply()     at org.flexunit.runner::FlexUnitCore/runClasses()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:191]     at Function/http://adobe.com/AS3/2006/builtin::apply()     at org.flexunit.runner::FlexUnitCore/run()[C:\Users\dmoore\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:171]     at Function/http://adobe.com/AS3/2006/builtin::apply()     at org.sonatype.flexmojos.unitestingsupport.flexunit4::FlexUnit4Listener/run()[/home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/flexmojos-unittest-flexunit4/src/main/flex/org/sonatype/flexmojos/unitestingsupport/flexunit4/FlexUnit4Listener.as:42]     at org.sonatype.flexmojos.unitestingsupport::SocketReporter/runTests()[/home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/unitestingsupport/SocketReporter.as:243]     at org.sonatype.flexmojos.unitestingsupport::TestApplication/runTests()[/home/nexus/flexmojos/trunk/target/checkout/flexmojos-testing/flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/unitestingsupport/TestApplication.as:40]     at flash.events::EventDispatcher/dispatchEventFunction()     at flash.events::EventDispatcher/dispatchEvent()     at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]     at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]     at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]     at Function/http://adobe.com/AS3/2006/builtin::apply()     at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]     at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]</failure>  </testcase></testsuite>

 

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...


Viewing all articles
Browse latest Browse all 25673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>