| Package | org.puremvc.as3.multicore.utilities.pipes.plumbing |
| Class | public class FilterTest |
| Inheritance | FilterTest flexunit.framework.TestCase |
| Method | Defined by | ||
|---|---|---|---|
|
FilterTest(methodName:String)
Constructor.
| FilterTest | ||
|
suite():TestSuite
[static]
Create the TestSuite.
| FilterTest | ||
|
Test setting filter to bypass mode, writing, then setting back to filter mode and writing.
| FilterTest | ||
|
Test connecting input and output pipes to a filter as well as disconnecting the output.
| FilterTest | ||
|
testFilteringNormalMessage():void
Test applying filter to a normal message.
| FilterTest | ||
|
Test setting filter function by sending control message.
| FilterTest | ||
|
Test setting filter parameters by sending control message.
| FilterTest | ||
|
testUseFilterToStopAMessage():void
Test using a filter function to stop propagation of a message.
| FilterTest | ||
| FilterTest | () | constructor |
public function FilterTest(methodName:String)Constructor.
ParametersmethodName:String — the name of the test method an instance to run
|
| suite | () | method |
public static function suite():TestSuiteCreate the TestSuite.
ReturnsTestSuite |
| testBypassAndFilterModeToggle | () | method |
public function testBypassAndFilterModeToggle():voidTest setting filter to bypass mode, writing, then setting back to filter mode and writing.
| testConnectingAndDisconnectingIOPipes | () | method |
public function testConnectingAndDisconnectingIOPipes():voidTest connecting input and output pipes to a filter as well as disconnecting the output.
| testFilteringNormalMessage | () | method |
public function testFilteringNormalMessage():voidTest applying filter to a normal message.
| testSetFilterByControlMessage | () | method |
public function testSetFilterByControlMessage():voidTest setting filter function by sending control message.
| testSetParamsByControlMessage | () | method |
public function testSetParamsByControlMessage():voidTest setting filter parameters by sending control message.
| testUseFilterToStopAMessage | () | method |
public function testUseFilterToStopAMessage():voidTest using a filter function to stop propagation of a message.
The way to stop propagation of a message from within a filter
is to throw an error from the filter function. This test creates
two NORMAL messages, each with header objects that contain
a bozoLevel property. One has this property set to
10, the other to 3.
Creates a Filter, named 'bozoFilter' with an anonymous pipe listener
feeding the output back into this test. The filter funciton is an
anonymous function that throws an error if the message's bozoLevel
property is greater than the filter parameter bozoThreshold.
the anonymous filter parameters object has a bozoThreshold
value of 5.
The messages are written to the filter and it is shown that the
message with the bozoLevel of 10 is not written, while
the message with the bozoLevel of 3 is.