1
2 package inklings.jgatms.command;
3
4 import org.apache.commons.chain.Command;
5 import org.apache.commons.chain.Context;
6 import org.apache.commons.chain.impl.ContextBase;
7
8 import inklings.jgatms.bean.Member;
9 import inklings.jgatms.CommandKeys;
10 import inklings.jgatms.ContextKeys;
11 import inklings.jgatms.context.JgatmsContext;
12
13 /***
14 * Tests the <code>AddMember</code> JGATMS command.
15 */
16 public class AddMemberTest extends BaseTestCase {
17
18 /***
19 * Verifies that a member can be added to the database.
20 */
21 public void testAddMember() throws Exception {
22
23 JgatmsContext context = new JgatmsContext();
24 Command command = catalog.getCommand(CommandKeys.ADD_MEMBER);
25 assertNotNull(CommandKeys.ADD_MEMBER + " not found", command);
26
27 Member member = new Member();
28
29 context.setMember(member);
30 command.execute(context);
31 String dispatch = context.getDispatch();
32 assertTrue("Unsuccessful command execution.",
33 dispatch.equals(ContextKeys.SUCCESS_DISPATCH));
34 }
35 }
This page was automatically generated by Maven