Search in sources :

Example 1 with ServiceCodeExceptionMapper

use of com.emc.storageos.svcs.errorhandling.mappers.ServiceCodeExceptionMapper in project coprhd-controller by CoprHD.

the class ErrorHandlingTest method setupServer.

@BeforeClass
public static void setupServer() throws Exception {
    _server = new Server(port);
    // AuthN servlet filters
    ServletContextHandler rootHandler = new ServletContextHandler();
    rootHandler.setContextPath("/");
    _server.setHandler(rootHandler);
    final StorageApplication application = new StorageApplication();
    final Set<Object> resources = new HashSet<Object>();
    resources.add(new ErrorHandlingTestResource());
    resources.add(new ServiceCodeExceptionMapper());
    application.setResource(resources);
    final ResourceConfig config = new DefaultResourceConfig();
    config.add(application);
    rootHandler.addServlet(new ServletHolder(new ServletContainer(config)), "/*");
    _server.start();
}
Also used : Server(org.eclipse.jetty.server.Server) DefaultResourceConfig(com.sun.jersey.api.core.DefaultResourceConfig) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) ServletContainer(com.sun.jersey.spi.container.servlet.ServletContainer) DataObject(com.emc.storageos.db.client.model.DataObject) StorageApplication(com.emc.storageos.api.service.impl.resource.StorageApplication) ResourceConfig(com.sun.jersey.api.core.ResourceConfig) DefaultResourceConfig(com.sun.jersey.api.core.DefaultResourceConfig) ServletContextHandler(org.eclipse.jetty.servlet.ServletContextHandler) ServiceCodeExceptionMapper(com.emc.storageos.svcs.errorhandling.mappers.ServiceCodeExceptionMapper) HashSet(java.util.HashSet) BeforeClass(org.junit.BeforeClass)

Aggregations

StorageApplication (com.emc.storageos.api.service.impl.resource.StorageApplication)1 DataObject (com.emc.storageos.db.client.model.DataObject)1 ServiceCodeExceptionMapper (com.emc.storageos.svcs.errorhandling.mappers.ServiceCodeExceptionMapper)1 DefaultResourceConfig (com.sun.jersey.api.core.DefaultResourceConfig)1 ResourceConfig (com.sun.jersey.api.core.ResourceConfig)1 ServletContainer (com.sun.jersey.spi.container.servlet.ServletContainer)1 HashSet (java.util.HashSet)1 Server (org.eclipse.jetty.server.Server)1 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1 BeforeClass (org.junit.BeforeClass)1