1
2
3
4
5
6
7
8
9
10
11 package org.mule.examples.webapp;
12
13 import org.mortbay.jetty.Server;
14 import org.mortbay.jetty.servlet.WebApplicationContext;
15
16
17
18
19
20 public class JettyTestCase extends AbstractWebappTestCase
21 {
22 public static final String WEBAPP_WAR_FILE = "/home/travis/mule/examples/webapp/target/mule-examples.war";
23 public static final String WEBAPP_CONTEXT_PATH = "/mule-examples";
24 public static final int JETTY_PORT = 8090;
25
26 Server jetty = null;
27
28 protected void doSetUp() throws Exception
29 {
30 super.doSetUp();
31
32 if (jetty == null)
33 {
34
35 jetty = new Server();
36 WebApplicationContext wc = new WebApplicationContext(WEBAPP_WAR_FILE);
37 wc.setContextPath(WEBAPP_CONTEXT_PATH);
38 wc.setWAR(WEBAPP_WAR_FILE);
39 jetty.addContext(wc);
40
41
42
43
44
45 jetty.start();
46 }
47 }
48
49 protected void suitePreTearDown() throws Exception
50 {
51 super.suitePreTearDown();
52 if (jetty != null)
53 {
54 jetty.stop();
55 }
56 }
57 }