13 Replies Latest reply: Oct 7, 2010 10:07 AM by pdkn RSS

    Error while running Parameterized test

    Sébastien VARLET Community Member

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

        • 1. Re: Error while running Parameterized test
          Michael Labriola Community Member

          in actionscript metadata is a string. since there isnt an actual reference to the parameterized runner class anywhere in your code, the linker isnt including it in the final swf. when the metadata string is evaluated at runtime, it cannot find the runner class in memory as it will not exist in that swf

           

          two options. ensure the runner is linked in by making reference to it in the test case somewhere. use the second release candidate where we force it to be linked in because a lot of people were having similar issues

           

          hope that explains and helps

          mike

          • 2. Re: Error while running Parameterized test
            Sébastien VARLET Community Member

            First, thanks for your answer.

             

            I saw in the wiki of flexunit.org that you declare a private property named foo of type Parameterized.

             

            I did it, but I still have the problem :

             

            <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 updated TestCase:

             

            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
                 {
                      private var foo:Parameterized;
                      
                      [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'}/* ,
                           {numeric: , alpha: ''}, {numeric: , alpha: ''},
                           {numeric: , alpha: ''}, {numeric: , alpha: ''},
                           {numeric: , alpha: ''}, {numeric: , alpha: ''},
                           {numeric: , alpha: ''}, {numeric: , alpha: ''},
                           {numeric: , alpha: ''}, {numeric: , alpha: ''},
                           {numeric: , alpha: ''}, {numeric: , alpha: ''},
                           {numeric: , alpha: ''}, {numeric: , alpha: ''}, */
                      ];
                      
                      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'm not sure if I can use another version of flexunit since 4.0-rc1 seems to be a flexmojos restriction.

            • 3. Re: Error while running Parameterized test
              Michael Labriola Community Member

              Okay, I see two more problems

               

              Problem #1, [Test(dataprovider= ... the 'p' in dataProvider should be capitalized. If you get a chance, also file this as an enhancement so we can look for either or at least warn.

               

              Problem #2, the dataprovider is not formed correctly. It needs to be an array of arrays, so:

               

              static public var referential:Array = [

              [0, '0'],

              [1500, '1500']

              ];

              I think that will fix the situation.
              Another issue we clearly have is that, in the case where something is marked Ignore, we shouldn't even bother going to look for the dataProvider.
              I think this will get you running,
              Mike

              • 4. Re: Error while running Parameterized test
                R>M>L Community Member

                Hi,

                Regarding using later versions of FlexUnit, you may want to take a look at:

                http://groups.google.com/group/flex-mojos/browse_thread/thread/cd9387317c744d37/aebf9317df 2f17fe?#aebf9317df2f17fe

                 

                Obviously, ideally all one needs is placing the new libraries in a repository and using (but sometimes this isn't an ideal World ;-) )

                HTH, R.

                • 5. Re: Error while running Parameterized test
                  Sébastien VARLET Community Member

                  I corrected what was wrong but still have the same problem:

                   

                   

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

                   

                   

                   

                  The new version of my test case:

                   

                   

                  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
                       {
                            public var foo:Parameterized;
                            
                            [Datapoints]
                            static public var referential:Array = [
                                 [0,                '0'],
                                 [1500,                '1500'],
                                 [42,                '42'],
                                 [15.15,           '15.15'],
                                 [999,                '999'],
                                 [17.0123456789, '17.0123456789'],
                                 [123456789,      '123456789'],
                                 [0.00000000001, '0.00000000001'],
                                 [-1,                '-1'],
                                 [0.00000000015, '0.00000000015'],
                                 [-1.01,           '-1.01'],
                                 [0.12345678912, '0.12345678912'],
                                 [-123456789,      '-123456789'],
                                 [0.0,                '0.0'],
                                 [-1.123456789,      '-1.123456789'],
                                 [-0.0,                '-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');
                            }
                       }
                  }
                  

                   

                  [EDIT]

                  I just tried to put a flexunit-4.0.0 swc file and changed my declared dependency in my pom.xml. I still have the same problem.

                  [/EDIT]

                   

                  What should I do then ?

                  • 6. Re: Error while running Parameterized test
                    Michael Labriola Community Member

                    the dot zero release of flexunit doesnt have parameterized testing, only dot one versions. so using the swc you mention in your edit will fail. i am also concerned as your post of error messages shows a developers name.. dmoore... this means it is not a release build in any way. iall release builds are built from our server. somewhere you are getting a really old development lib and not a approved version

                     

                    can you try to grab a version from builds.flexunit.org

                     

                    mike

                    • 7. Re: Error while running Parameterized test
                      Sébastien VARLET Community Member

                      Thanks, you finally found the solution. I had to download flexunit 4.1.0-RC1 and put it in my local repository to make it work.

                      • 8. Re: Error while running Parameterized test
                        Michael Labriola Community Member

                        Glad to hear it.

                         

                        One final note. The [DataPoints[ metadata you have in your example is extraneous. It won't hurt anything but it isn't needed either.

                         

                        Cheers,

                        Mike

                        • 9. Re: Error while running Parameterized test
                          Sébastien VARLET Community Member

                          Hi,

                           

                          Why do you say so ? do you mean that [Datapoint] is not interpreted by flexunit yet ? or do you mean the way I use it doesn't need to declare [Datapoint] ?

                          • 10. Re: Error while running Parameterized test
                            Michael Labriola Community Member

                            The DataPoint and DataPoints metadata is used by the Theory runner. It is not used by the Parameterized runner, so it is just being ignored in your case.

                             

                            So it is used, just not in this context, so here it is ignored.

                             

                            Mike

                            • 11. Re: Error while running Parameterized test
                              pdkn

                              Interesting to know about [Datapoints]. Someone may wish to update the wiki at some stage? http://docs.flexunit.org/index.php?title=Parameterized_Test_Styles

                              • 12. Re: Error while running Parameterized test
                                Michael Labriola Community Member

                                agreed. side note. we are a completely volunteer unfunded open source project and the wiki is open to editing. so should anyone want to fix this before the limited team here can address, it is always greatly appreciated.

                                • 13. Re: Error while running Parameterized test
                                  pdkn Community Member

                                  Ooh, didin't realise I can edit wiki - will get to it...