Packageorg.puremvc.as3.multicore.utilities.pipes.plumbing
Classpublic class JunctionTest
InheritanceJunctionTest Inheritance flexunit.framework.TestCase

Test the Junction class.



Public Methods
 MethodDefined by
  
JunctionTest(methodName:String)
Constructor.
JunctionTest
  
suite():TestSuite
[static] Create the TestSuite.
JunctionTest
  
Test adding a PipeListener to an Input Pipe.
JunctionTest
  
Test registering an INPUT pipe to a junction.
JunctionTest
  
Test registering an OUTPUT pipe to a junction.
JunctionTest
  
Test using sendMessage on an OUTPUT pipe.
JunctionTest
Constructor detail
JunctionTest()constructor
public function JunctionTest(methodName:String)

Constructor.

Parameters
methodName:String — the name of the test method an instance to run
Method detail
suite()method
public static function suite():TestSuite

Create the TestSuite.

Returns
TestSuite
testAddingPipeListenerToAnInputPipe()method 
public function testAddingPipeListenerToAnInputPipe():void

Test adding a PipeListener to an Input Pipe.

Registers an INPUT Pipe with a Junction, then tests the Junction's addPipeListener method, connecting the output of the pipe back into to the test. If this is successful, it sends a message down the pipe and checks to see that it was received.

testRegisterRetrieveAndRemoveInputPipe()method 
public function testRegisterRetrieveAndRemoveInputPipe():void

Test registering an INPUT pipe to a junction.

Tests that the INPUT pipe is successfully registered and that the hasPipe and hasInputPipe methods work. Then tests that the pipe can be retrieved by name.

Finally, it removes the registered INPUT pipe and tests that all the previous assertions about it's registration and accessability via the Junction are no longer true.

testRegisterRetrieveAndRemoveOutputPipe()method 
public function testRegisterRetrieveAndRemoveOutputPipe():void

Test registering an OUTPUT pipe to a junction.

Tests that the OUTPUT pipe is successfully registered and that the hasPipe and hasOutputPipe methods work. Then tests that the pipe can be retrieved by name.

Finally, it removes the registered OUTPUT pipe and tests that all the previous assertions about it's registration and accessability via the Junction are no longer true.

testSendMessageOnAnOutputPipe()method 
public function testSendMessageOnAnOutputPipe():void

Test using sendMessage on an OUTPUT pipe.

Creates a Pipe, Junction and Message. Adds the PipeListener to the Pipe. Adds the Pipe to the Junction as an OUTPUT pipe. uses the Junction's sendMessage method to send the Message, then checks that it was received.