Created
May 19, 2013 10:17
-
-
Save kinisoftware/5607277 to your computer and use it in GitHub Desktop.
Booting Jetty from Java code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Suite.class) | |
@SuiteClasses({ MyTestClass.class }) | |
public class JettyServerRESTTestSuite { | |
private static final String APP_NAME = "/context"; | |
private static final int PORT = 4141; | |
public static final String APP_SERVER_ADDRESS = "http://localhost:" + PORT + APP_NAME + "/rest" + APP_NAME; | |
private static Server server; | |
@BeforeClass | |
public static void setUp() throws Exception { | |
WebAppContext webAppContext = new WebAppContext("src/main/webapp", APP_NAME); | |
System.setProperty("DEBUG", "true"); | |
server = new Server(PORT); | |
... | |
server.start(); | |
} | |
@AfterClass | |
public static void stop() throws Exception { | |
server.stop(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment