本文整理汇总了Java中org.mortbay.jetty.testing.ServletTester.start方法的典型用法代码示例。如果您正苦于以下问题:Java ServletTester.start方法的具体用法?Java ServletTester.start怎么用?Java ServletTester.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mortbay.jetty.testing.ServletTester
的用法示例。
在下文中一共展示了ServletTester.start方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
import org.mortbay.jetty.testing.ServletTester; //导入方法依赖的package包/类
@Before
public void before() {
tester = new ServletTester();
tester.addServlet(GetRootServlet.class, "/*");
tester.addServlet(GetStatusServlet.class, GetStatusServlet.CONTEXT_PATH);
tester.addServlet(AddTransServlet.class, AddTransServlet.CONTEXT_PATH);
tester.addServlet(StartTransServlet.class, StartTransServlet.CONTEXT_PATH);
tester.addServlet(PauseTransServlet.class, PauseTransServlet.CONTEXT_PATH);
try {
tester.start();
System.out.println("Started");
} catch (Exception ex) {
ex.printStackTrace();
Assert.fail(ex.getMessage());
}
}
示例2: setup
import org.mortbay.jetty.testing.ServletTester; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
tester = new ServletTester();
tester.setContextPath("/");
tester.addServlet(TaskLogServlet.class, "/tasklog");
tester.start();
}
示例3: setUp
import org.mortbay.jetty.testing.ServletTester; //导入方法依赖的package包/类
protected void setUp() throws Exception
{
tester = new ServletTester();
tester.setContextPath("/");
tester.addServlet(InfoServlet.class, contextPath);
baseURL = tester.createSocketConnector(true);
tester.start();
}
示例4: setUp
import org.mortbay.jetty.testing.ServletTester; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
servletTester = new ServletTester();
servletTester.setContextPath("/");
servletTester.setResourceBase("src/main/webapp");
servletTester.addServlet(RetrievePDF.class, "/RetrievePDF");
servletTester.addServlet(org.mortbay.jetty.servlet.DefaultServlet.class, "/*");
servletTester.start();
request = new HttpTester();
request.setMethod("GET");
request.setURI("/RetrievePDF");
request.setVersion("HTTP/1.0");
}
示例5: init
import org.mortbay.jetty.testing.ServletTester; //导入方法依赖的package包/类
@Before
public void init() throws Exception {
tester = new ServletTester();
XmlWebApplicationContext wac;
tester.setAttribute(Servlet.springCtxAttrName, wac = (XmlWebApplicationContext) FrameworkServlet.DEFAULT_CONTEXT_CLASS.newInstance());
wac.setConfigLocation("classpath:/com/griddynamics/banshun/controllers-test/parent-context.xml");
wac.refresh();
tester.addServlet(Servlet.class, "*.html");
tester.start();
}
示例6: init
import org.mortbay.jetty.testing.ServletTester; //导入方法依赖的package包/类
@Before
public void init() throws Exception {
tester = new ServletTester();
XmlWebApplicationContext wac;
tester.setAttribute(Servlet.springCtxAttrName, wac = (XmlWebApplicationContext) FrameworkServlet.DEFAULT_CONTEXT_CLASS.newInstance());
wac.setConfigLocation("classpath:/com/griddynamics/banshun/scan-test/parent-context.xml");
wac.refresh();
tester.addServlet(Servlet.class, "*.html");
tester.start();
}