You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Dmitrijs Jemeljanovs (JIRA)" <ji...@apache.org> on 2015/11/09 15:34:11 UTC
[jira] [Created] (FLEX-34952) Can't use multiple [BeforeClass]
methods with Parametrized test runner
Dmitrijs Jemeljanovs created FLEX-34952:
-------------------------------------------
Summary: Can't use multiple [BeforeClass] methods with Parametrized test runner
Key: FLEX-34952
URL: https://issues.apache.org/jira/browse/FLEX-34952
Project: Apache Flex
Issue Type: Bug
Components: FlexUnit
Affects Versions: Apache Flex 4.12.0
Reporter: Dmitrijs Jemeljanovs
It is impossible to use multiple [BeforeClass] methods with Parametrized test runner.
Code example:
{code}
package
{
import org.flexunit.asserts.assertEquals;
import org.flexunit.runners.Parameterized;
Parameterized;
[RunWith("org.flexunit.runners.Parameterized")]
public class AnotherTest
{
public static var all: Array = [[0],[1],[2]];
[BeforeClass(order=1)]
public static function prepare1():void
{
var a:int = Math.PI;
}
[BeforeClass(order=2)]
public static function prepare2():void
{
var a:int = Math.PI;
}
[Test(dataProvider="all")]
public function testEquals(i:int):void
{
assertEquals(i, i);
}
}
}
{code}
Output:
{code}
TypeError: Error #1034: Type Coercion failed: cannot convert org.flexunit.runners.model::FrameworkMethod@6fad3a1 to org.flexunit.runner.IRunner.
at org.flexunit.runners::Parameterized/describeChild(Parameterized.as:233)
at org.flexunit.runners::ParentRunner/compare(ParentRunner.as:432)
at Array$/_sort
at Array/http://adobe.com/AS3/2006/builtin::sort
at org.flexunit.runners::ParentRunner/withBeforeClasses(ParentRunner.as:274)
at org.flexunit.runners::ParentRunner/classBlock(ParentRunner.as:236)
at org.flexunit.runners::ParentRunner/run(ParentRunner.as:471)
at org.flexunit.runners::Suite/runChild(Suite.as:140)
at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep(ChildRunnerSequencer.as:71)
at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:130)
at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:98)
at org.flexunit.runners::ParentRunner/run(ParentRunner.as:472)
at org.flexunit.runner::FlexUnitCore/beginRunnerExecution(FlexUnitCore.as:337)
at org.flexunit.runner::FlexUnitCore/verifyRunnerCanBegin(FlexUnitCore.as:318)
at org.flexunit.token::AsyncCoreStartupToken/sendReady(AsyncCoreStartupToken.as:73)
at org.flexunit.runner.notification.async::AsyncListenerWatcher/sendReadyNotification(AsyncListenerWatcher.as:137)
at org.flexunit.runner.notification.async::AsyncListenerWatcher/handleListenerReady(AsyncListenerWatcher.as:152)
at flash.events::EventDispatcher/dispatchEventFunction
at flash.events::EventDispatcher/dispatchEvent
at flexunit.flexui::FlexUnit4TestRunner/handleConnect(FlexUnit4TestRunner.as:335)
at flash.events::EventDispatcher/dispatchEventFunction
at flash.events::EventDispatcher/dispatchEvent
at flash.net::XMLSocket/reflectEvent
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)