Search in sources :

Example 1 with JettyRunner

use of com.helger.photon.jetty.JettyRunner in project phoss-smp by phax.

the class MockWebServer method startRegularServer.

/**
 * Starts HTTP server exposing JAX-RS resources defined in this application.
 *
 * @return The Jetty runner
 */
@Nonnull
public static JettyRunner startRegularServer() {
    final JettyRunner ret = new JettyRunner();
    ret.setContextPath(CONTEXT_PATH).setPort(PORT).setStopPort(STOP_PORT);
    try {
        ret.startServer();
    } catch (final Exception ex) {
        throw new IllegalStateException("Failed to start server", ex);
    }
    return ret;
}
Also used : JettyRunner(com.helger.photon.jetty.JettyRunner) Nonnull(javax.annotation.Nonnull)

Example 2 with JettyRunner

use of com.helger.photon.jetty.JettyRunner in project phase4 by phax.

the class RunInJettyAS4TEST9090 method startNinetyServer.

public static void startNinetyServer() throws Exception {
    s_aSC = ScopedConfig.create(new FileSystemResource("src/test/resources/test-phase4-9090.properties"));
    final JettyRunner aJetty = new JettyRunner();
    aJetty.setPort(PORT).setStopPort(STOP_PORT).setAllowAnnotationBasedConfig(false);
    aJetty.startServer();
}
Also used : FileSystemResource(com.helger.commons.io.resource.FileSystemResource) JettyRunner(com.helger.photon.jetty.JettyRunner)

Example 3 with JettyRunner

use of com.helger.photon.jetty.JettyRunner in project phase4 by phax.

the class MockJettySetup method startServer.

@BeforeClass
public static void startServer() throws Exception {
    LOGGER.info("MockJettySetup - starting");
    if (_isRunJetty()) {
        final int nPort = _getJettyPort();
        s_aJetty = new JettyRunner("AS4 Mock Jetty");
        s_aJetty.setPort(nPort).setStopPort(nPort + 1000).setAllowAnnotationBasedConfig(false);
        s_aJetty.startServer();
    } else {
        s_aJetty = null;
        WebScopeManager.onGlobalBegin(MockServletContext.create());
        final File aSCPath = new File("target/junittest").getAbsoluteFile();
        WebFileIO.initPaths(new File(AS4Configuration.getDataPath()).getAbsoluteFile(), aSCPath.getAbsolutePath(), false);
        GlobalIDFactory.setPersistentIntIDFactory(new FileIntIDFactory(WebFileIO.getDataIO().getFile("ids.dat")));
    }
    RequestTrackerSettings.setLongRunningRequestsCheckEnabled(false);
    RequestTrackerSettings.setParallelRunningRequestsCheckEnabled(false);
    s_aResMgr = new AS4ResourceHelper();
    LOGGER.info("MockJettySetup - started");
}
Also used : FileIntIDFactory(com.helger.commons.id.factory.FileIntIDFactory) JettyRunner(com.helger.photon.jetty.JettyRunner) File(java.io.File) AS4ResourceHelper(com.helger.phase4.util.AS4ResourceHelper) BeforeClass(org.junit.BeforeClass)

Aggregations

JettyRunner (com.helger.photon.jetty.JettyRunner)3 FileIntIDFactory (com.helger.commons.id.factory.FileIntIDFactory)1 FileSystemResource (com.helger.commons.io.resource.FileSystemResource)1 AS4ResourceHelper (com.helger.phase4.util.AS4ResourceHelper)1 File (java.io.File)1 Nonnull (javax.annotation.Nonnull)1 BeforeClass (org.junit.BeforeClass)1