Search in sources :

Example 1 with TJWSEmbeddedJaxrsServer

use of org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer in project narayana by jbosstm.

the class BaseTest method startRestEasy.

protected static void startRestEasy(Class<?>... classes) throws Exception {
    server = new TJWSEmbeddedJaxrsServer();
    server.setPort(PORT);
    server.start();
    Registry registry = server.getDeployment().getRegistry();
    ResteasyProviderFactory factory = server.getDeployment().getDispatcher().getProviderFactory();
    if (classes != null)
        for (Class<?> clazz : classes) registry.addPerRequestResource(clazz);
    factory.registerProvider(TMUnavailableMapper.class);
    factory.registerProvider(TransactionStatusMapper.class);
    factory.registerProvider(HttpResponseMapper.class);
    factory.registerProvider(NotFoundMapper.class);
}
Also used : TJWSEmbeddedJaxrsServer(org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer) AfterClass(org.junit.AfterClass) Registry(org.jboss.resteasy.spi.Registry) ResteasyProviderFactory(org.jboss.resteasy.spi.ResteasyProviderFactory)

Example 2 with TJWSEmbeddedJaxrsServer

use of org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer in project jbpm by kiegroup.

the class RestService method start.

public static void start() {
    server = new TJWSEmbeddedJaxrsServer();
    server.setPort(PORT);
    server.getDeployment().setResources(Arrays.asList(new Resource()));
    server.start();
}
Also used : TJWSEmbeddedJaxrsServer(org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer)

Example 3 with TJWSEmbeddedJaxrsServer

use of org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer in project scheduling by ow2-proactive.

the class RestTestServer method startServer.

@BeforeClass
public static void startServer() throws IOException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    bypassProActiveLogger();
    preventProActiveToChangeSecurityManager();
    server = new TJWSEmbeddedJaxrsServer();
    silentServerError();
    port = findFreePort();
    server.setPort(port);
    server.setRootResourcePath("/");
    server.start();
}
Also used : TJWSEmbeddedJaxrsServer(org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer) BeforeClass(org.junit.BeforeClass)

Example 4 with TJWSEmbeddedJaxrsServer

use of org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer in project jbpm by kiegroup.

the class RestService method start.

public static void start() {
    server = new TJWSEmbeddedJaxrsServer();
    server.setPort(PORT);
    server.getDeployment().setResources(Collections.singletonList((Object) new Resource()));
    server.start();
}
Also used : TJWSEmbeddedJaxrsServer(org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer)

Aggregations

TJWSEmbeddedJaxrsServer (org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer)4 Registry (org.jboss.resteasy.spi.Registry)1 ResteasyProviderFactory (org.jboss.resteasy.spi.ResteasyProviderFactory)1 AfterClass (org.junit.AfterClass)1 BeforeClass (org.junit.BeforeClass)1