You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Overview

Although FlexUnit 4.x framework provides a broad and powerful set of functionality, it is not the only game in town. Furthermore, it is by no means the oldest. So, even though we strongly suggest writing tests the "FlexUnit 4 way," we understand that there is a lot to learn, and that you may already have tests written for other unit testing frameworks. For these reasons, FlexUnit 4 provides the ability to integrate tests written in other unit testing frameworks into a FlexUnit 4 environment. This allows for both a gradual transition from other frameworks into FlexUnit 4, as well as the ability to do current development in FlexUnit 4 while keeping your previously-developed tests all under the same test project.

Currently supported frameworks include:

  • fluint1
  • flexUnit1

How it works

In FlexUnit 4.x, the running of all tests, theories, suites, etc. are handled by what is called a Runner. A Runner wraps all expectations on the look and behavior of all of the afore-mentioned test aspects.

These can include, but are not limited to:

  • How a method is determined to be a TestMethod, whether by metadata or by a standard naming schema.
  • When a test completes, and what the criteria is for completion.
  • When a test passes or fails, and what the criteria is for these.
  • Whether or not a TestCase needs to extend certain base classes, implement an interface, etc.
  • What defines a TestSuite, how to find TestCases within said Suite, and what Runners each TestCase should use.

Hence, although different test frameworks may have radically different definitions for each of these aspects, a Runner can wrap all of these differences, thus obfuscating all of this from the framework itself. In other words, only the Runner itself, and not the FlexUnit 4.x framework as a whole, needs to know how any of these criteria work. Because of this, we can write "wrapper runners" that provide an interface into FlexUnit 4 while delegating all functionality to an entirely different unit testing framework.

In addition, the FlexUnit 4.x framework has some "intelligence" in figuring out what runner it should use. In other words, based on how a given TestMethod, TestCase, and/or TestSuite looks, FlexUnit 4.x will automatically determine which runner to use (as long as it is explicitly supported within the framework). And, even if it is not supported, all you have to do is add the RunWith metadata tag to your TestCase or TestSuite, and FlexUnit 4.x will use whatever Runner you specify.

Preferred Test Framework Not Support?

If a test framework is not supported, you have the capability of writing your own custom runner so that it is! For more, see Custom Runners.

  • No labels