Search in sources :

Example 6 with PackagesResourceConfig

use of com.sun.jersey.api.core.PackagesResourceConfig in project ribbon by Netflix.

the class NettyClientTest method init.

@BeforeClass
public static void init() throws Exception {
    PackagesResourceConfig resourceConfig = new PackagesResourceConfig("com.netflix.ribbon.test.resources");
    port = (new Random()).nextInt(1000) + 4000;
    SERVICE_URI = "http://localhost:" + port + "/";
    ExecutorService service = Executors.newFixedThreadPool(20);
    try {
        server = HttpServerFactory.create(SERVICE_URI, resourceConfig);
        server.setExecutor(service);
        server.start();
    } catch (Exception e) {
        e.printStackTrace();
        fail("Unable to start server");
    }
// LogManager.getRootLogger().setLevel(Level.DEBUG);
}
Also used : Random(java.util.Random) ExecutorService(java.util.concurrent.ExecutorService) PackagesResourceConfig(com.sun.jersey.api.core.PackagesResourceConfig) ClientException(com.netflix.client.ClientException) IOException(java.io.IOException) BeforeClass(org.junit.BeforeClass)

Aggregations

PackagesResourceConfig (com.sun.jersey.api.core.PackagesResourceConfig)6 Random (java.util.Random)2 ExecutorService (java.util.concurrent.ExecutorService)2 BeforeClass (org.junit.BeforeClass)2 AnnisRunnerException (annis.AnnisRunnerException)1 MultipleIniWebEnvironment (annis.security.MultipleIniWebEnvironment)1 ClientException (com.netflix.client.ClientException)1 ResourceConfig (com.sun.jersey.api.core.ResourceConfig)1 IoCComponentProviderFactory (com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory)1 WebApplication (com.sun.jersey.spi.container.WebApplication)1 ServletContainer (com.sun.jersey.spi.container.servlet.ServletContainer)1 SpringComponentProviderFactory (com.sun.jersey.spi.spring.container.SpringComponentProviderFactory)1 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 HashMap (java.util.HashMap)1 DispatcherType (javax.servlet.DispatcherType)1 EnvironmentLoaderListener (org.apache.shiro.web.env.EnvironmentLoaderListener)1 Server (org.eclipse.jetty.server.Server)1 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1