1 package com.sri.common.controller;
2
3 import java.util.HashMap;
4 import com.jcorporate.expresso.core.controller.ExpressoResponse;
5 import com.jcorporate.expresso.core.controller.Output;
6 import com.jcorporate.expresso.services.test.ControllerTestFixture;
7 import junit.framework.TestCase;
8
9 /***
10 * With the test controller, both the inline states and the component resolved
11 * states should be able to be reached.
12 * @author Michael Rimov
13 * @version 1.0
14 */
15 public class TestContainerController extends TestCase {
16
17 private ControllerTestFixture fixture;
18
19 protected void setUp() throws Exception {
20 super.setUp();
21 fixture = new ControllerTestFixture();
22 fixture.setUp();
23 }
24
25 protected void tearDown() throws Exception {
26 fixture.tearDown();
27 fixture = null;
28 super.tearDown();
29 }
30
31 public void testRunDoState() throws Exception {
32 ExpressoResponse response = fixture.invokeFacade(ComponentControllerTestModel.class, new HashMap(), "do");
33 assertEquals("Got Here", response.getOutput("doState").getContent());
34 }
35
36 public void testRunPromptState() throws Exception {
37 ExpressoResponse response = fixture.invokeFacade(ComponentControllerTestModel.class, new HashMap(), "prompt");
38 Output o = response.getOutput("GeneratedRequest");
39 assertEquals("1", o.getContent());
40 }
41
42 }