org.puremvc.java.core
Class ControllerTest

java.lang.Object
  extended by org.puremvc.java.core.ControllerTest

public class ControllerTest
extends java.lang.Object

Test des communication entre ai.


Constructor Summary
ControllerTest()
           
 
Method Summary
 void testGetInstance()
          Tests the Controller Singleton Factory Method
 void testHasCommand()
          Test hasCommand method.
 void testRegisterAndExecuteCommand()
          Tests Command registration and execution.
 void testRegisterAndRemoveCommand()
          Tests Command registration and removal.
 void testReregisterAndExecuteCommand()
          Tests Removing and Reregistering a Command Tests that when a Command is re-registered that it isn't fired twice.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerTest

public ControllerTest()
Method Detail

testGetInstance

public void testGetInstance()
Tests the Controller Singleton Factory Method


testRegisterAndExecuteCommand

public void testRegisterAndExecuteCommand()
Tests Command registration and execution.

This test gets a Singleton Controller instance and registers the ControllerTestCommand class to handle 'ControllerTest' Notifications.

It then constructs such a Notification and tells the Controller to execute the associated Command. Success is determined by evaluating a property on an object passed to the Command, which will be modified when the Command executes.


testRegisterAndRemoveCommand

public void testRegisterAndRemoveCommand()
Tests Command registration and removal.

Tests that once a Command is registered and verified working, it can be removed from the Controller.


testHasCommand

public void testHasCommand()
Test hasCommand method.


testReregisterAndExecuteCommand

public void testReregisterAndExecuteCommand()
Tests Removing and Reregistering a Command

Tests that when a Command is re-registered that it isn't fired twice. This involves, minimally, registration with the controller but notification via the View, rather than direct execution of the Controller's executeCommand method as is done above in testRegisterAndRemove. The bug under test was fixed in AS3 Standard Version 2.0.2. If you run the unit tests with 2.0.1 this test will fail.