org.puremvc.java.patterns.command
Class MacroCommandTest

java.lang.Object
  extended by org.puremvc.java.patterns.command.MacroCommandTest

public class MacroCommandTest
extends java.lang.Object

Test the PureMVC SimpleCommand class.

See Also:
MacroCommandTestVO, MacroCommandTestCommand

Constructor Summary
MacroCommandTest()
           
 
Method Summary
 void testMacroCommandExecute()
          Tests operation of a MacroCommand.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacroCommandTest

public MacroCommandTest()
Method Detail

testMacroCommandExecute

public void testMacroCommandExecute()
Tests operation of a MacroCommand.

This test creates a new Notification, adding a MacroCommandTestVO as the body. It then creates a MacroCommandTestCommand and invokes its execute method, passing in the Notification.

The MacroCommandTestCommand has defined an initializeMacroCommand method, which is called automatically by its constructor. In this method the MacroCommandTestCommand adds 2 SubCommands to itself, MacroCommandTestSub1Command and MacroCommandTestSub2Command.

The MacroCommandTestVO has 2 result properties, one is set by MacroCommandTestSub1Command by multiplying the input property by 2, and the other is set by MacroCommandTestSub2Command by multiplying the input property by itself.

Success is determined by evaluating the 2 result properties on the MacroCommandTestVO that was passed to the MacroCommandTestCommand on the Notification body.