@BeforeClass public static void startServer() throws Exception { final Map<String, String> initParams = new HashMap<String, String>(); initParams.put( "com.sun.jersey.config.property.resourceConfigClass", "com.sun.jersey.api.core.PackagesResourceConfig"); initParams.put("com.sun.jersey.config.property.packages", "org.atomify"); selectorThread = GrizzlyWebContainerFactory.create( UriBuilder.fromUri("http://localhost/").port(8081).build(), initParams); }
protected static void startJersey(String packages) throws Exception { final URI baseUri = UriBuilder.fromUri(SURL).build(); final Map<String, String> initParams = new HashMap<String, String>(); initParams.put("com.sun.jersey.config.property.packages", packages); try { threadSelector = GrizzlyWebContainerFactory.create(baseUri, initParams); } catch (IOException e) { log.infof(e, "Error starting Grizzly"); } }