1 64 65 package com.jcorporate.expresso.services.controller.tests; 66 67 import com.jcorporate.expresso.core.controller.ControllerResponse; 68 import com.jcorporate.expresso.services.test.ControllerTestCase; 69 import com.jcorporate.expresso.services.test.ControllerTestSuite; 70 import com.jcorporate.expresso.services.test.TestSystemInitializer; 71 import junit.framework.TestSuite; 72 import org.apache.cactus.WebRequest; 73 74 75 81 public class RegistrationControllerTests extends ControllerTestCase { 82 83 90 public RegistrationControllerTests(String testName) throws Exception { 91 super(testName, com.jcorporate.expresso.services.controller.SimpleRegistration.class); 92 } 93 94 95 101 public static void main(String [] args) throws Exception { 102 junit.textui.TestRunner.run(suite()); 103 } 104 105 106 115 public static TestSuite suite() throws Exception { 116 ControllerTestSuite cts = new ControllerTestSuite(); 117 cts.addReadOnlySchemaDependency(com.jcorporate.expresso.core.ExpressoSchema.class); 118 cts.addTestSuite(RegistrationControllerTests.class); 119 120 return cts; 121 } 122 123 124 135 public void beginDBMenuTest(WebRequest theRequest) { 136 try { 137 super.setupParameters("showDBMenu", theRequest); 138 super.logIn(theRequest); 139 } catch (Exception e) { 140 e.printStackTrace(); 141 fail(e.getMessage()); 142 } 143 } 144 145 146 150 public void testDBMenuTest() { 151 try { 152 ControllerResponse response = super.controllerProcess(); 153 assertTrue("Must get a non-null ControllerResponse Object", response != null); 154 } catch (Exception e) { 155 e.printStackTrace(); 156 fail(e.getMessage()); 157 } 158 } 159 160 161 168 public void beginPromptSelfRegister(WebRequest theRequest) { 169 try { 170 super.setupParameters("promptSelfRegister", theRequest); 171 theRequest.addParameter("dbContext", TestSystemInitializer.getTestContext()); 172 } catch (Exception e) { 173 e.printStackTrace(); 174 fail(e.getMessage()); 175 } 176 } 177 178 181 public void testPromptSelfRegister() { 182 try { 183 ControllerResponse response = super.controllerProcess(); 184 assertTrue("Must get a non-null ControllerResponse Object", 185 response != null); 186 } catch (Exception e) { 187 e.printStackTrace(); 188 fail(e.getMessage()); 189 } 190 191 192 } 193 194 } | Popular Tags |