use of com.meterware.servletunit.ServletRunner in project v7files by thiloplanz.
the class MiltonServletTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
Properties props = UnitTestSupport.getDefaultProperties();
props.put("auth.provider", "demo");
props.put("acl.provider", "global");
props.put("acl.read", "admins");
props.put("acl.write", "admins");
UnitTestSupport.initConfiguration(props);
sr = new ServletRunner();
Hashtable<String, String> initParams = new Hashtable<String, String>();
initParams.put("webdav.endpoint", "webdav");
initParams.put("resource.factory.factory.class", ResourceFactoryFactory.class.getName());
sr.registerServlet("myServlet/*", MiltonServlet.class.getName(), initParams);
}
use of com.meterware.servletunit.ServletRunner in project cxf by apache.
the class ErrorContextSerletTest method testInvoke.
@Test
public void testInvoke() {
try {
sr = new ServletRunner(getResourceAsStream(getConfiguration()), CONTEXT);
sr.newClient().getResponse(CONTEXT_URL + "/services");
// there expect a spring bean exception
fail("we expect a spring bean Exception here");
} catch (Exception ex) {
// supprot spring 2.0.x and sping 2.5
assertTrue("we expect a Bean Exception here", ex instanceof org.springframework.beans.FatalBeanException);
}
}
use of com.meterware.servletunit.ServletRunner in project codeu-2018-team12 by codeu-2018-team12.
the class ProfileIntegrationTest method setup.
@Before
public void setup() throws IOException, SAXException {
appEngineTestHelper.setUp();
// Unfortunately, the ServletRunner constructors that take java.io.File (the
// non-deprecated ones) have a bug, so we have to use the two argument string
// form.
//
// See https://sourceforge.net/p/httpunit/mailman/message/27259892 for details.
servletRunner = new ServletRunner("src/main/webapp/WEB-INF/web.xml", "");
servletClient = servletRunner.newClient();
}
use of com.meterware.servletunit.ServletRunner in project teammates by TEAMMATES.
the class GaeSimulation method setup.
/**
* Sets up the GAE simulation.
*/
public synchronized void setup() {
System.out.println("Setting up GAE simulation");
LocalTaskQueueTestConfig localTasks = new LocalTaskQueueTestConfig();
localTasks.setQueueXmlPath(QUEUE_XML_PATH);
LocalUserServiceTestConfig localUserServices = new LocalUserServiceTestConfig();
LocalDatastoreServiceTestConfig localDatastore = new LocalDatastoreServiceTestConfig();
LocalMailServiceTestConfig localMail = new LocalMailServiceTestConfig();
LocalSearchServiceTestConfig localSearch = new LocalSearchServiceTestConfig();
localSearch.setPersistent(false);
LocalModulesServiceTestConfig localModules = new LocalModulesServiceTestConfig();
LocalLogServiceTestConfig localLog = new LocalLogServiceTestConfig();
helper = new LocalServiceTestHelper(localDatastore, localMail, localUserServices, localTasks, localSearch, localModules, localLog);
helper.setUp();
sc = new ServletRunner().newClient();
localLogService = LocalLogServiceTestConfig.getLocalLogService();
}
Aggregations