如何将 SequenceRunner 与 FlexUnit 4 结合使用
在 FlexUnit wiki 中,我读到了非常有趣的 SequenceRunner由 Fluint 人员贡献。现在我尝试运行一个与示例非常相似的测试,但是在执行 SequenceRunner 实例的 run() 方法时,我收到此异常:
Cannot add asynchronous functionality to methods defined by Test,Before or After that are not marked async
Error: Cannot add asynchronous functionality to methods defined by Test,Before or After that are not marked async
at org.flexunit.async::AsyncLocator$/getCallableForTest()[C:\Users\dmoor e\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\async\AsyncLocator.as:82]
at org.fluint.sequence::SequenceWaiter/setupListeners()[C:\Users\dmoore\ Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\fluint\sequence\SequenceWaiter.as:100]
at org.fluint.sequence::SequenceRunner/continueSequence()[C:\Users\dmoor e\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\fluint\sequence\SequenceRunner.as:177]
at org.fluint.sequence::SequenceRunner/run()[C:\Users\dmoore\Documents\_ Production\Flex Unit 4\GIT\FlexUnit4\src\org\fluint\sequence\SequenceRunner.as:124]
是否有人已将 SequenceRunner 与 FlexUnit 4 一起使用。 [Test(async)] 注释已存在。
In the FlexUnit wiki I've read about the very interesting SequenceRunner that was contributed by the Fluint folks. Now I am trying to run a test that is very similar to the example, however when executing the run() Method of the SequenceRunner instance, I get this exception:
Cannot add asynchronous functionality to methods defined by Test,Before or After that are not marked async
Error: Cannot add asynchronous functionality to methods defined by Test,Before or After that are not marked async
at org.flexunit.async::AsyncLocator$/getCallableForTest()[C:\Users\dmoor e\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\flexunit\async\AsyncLocator.as:82]
at org.fluint.sequence::SequenceWaiter/setupListeners()[C:\Users\dmoore\ Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\fluint\sequence\SequenceWaiter.as:100]
at org.fluint.sequence::SequenceRunner/continueSequence()[C:\Users\dmoor e\Documents\_Production\Flex Unit 4\GIT\FlexUnit4\src\org\fluint\sequence\SequenceRunner.as:177]
at org.fluint.sequence::SequenceRunner/run()[C:\Users\dmoore\Documents\_ Production\Flex Unit 4\GIT\FlexUnit4\src\org\fluint\sequence\SequenceRunner.as:124]
Has anyone used the SequenceRunner with FlexUnit 4 already. The [Test(async)] annotation is already present.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个完整的、非常简单的示例测试用例类。
Here is a complete, very simple example test case class.
感谢 Michael Labriola 在 Adobe 论坛 中回答了我的问题,我终于能够使其运行。请注意,Wiki 中的
SequenceRunner
的文档是过时且部分错误。CREATION_COMPLETE
的asyncHandler。而是在测试中添加一个SequenceWaiter
来等待组件的CREATION_COMPLETE
事件[Test(async) ]
使用SequenceRunner
的测试用例的元数据。Thanks to Michael Labriola, who responded to my question in the Adobe Forum I was finally able to make it running. Note that the documentation of
SequenceRunner
in the Wiki is outdated and partially wrong.CREATION_COMPLETE
in the setUp. Rather add aSequenceWaiter
in the test that waits for theCREATION_COMPLETE
event of the component[Test(async)]
Metadata to test cases that useSequenceRunner
.