use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project camel by apache.
the class CamelCatalogRestTest method setup.
@Before
public void setup() {
catalog = new CamelCatalogRest();
port = AvailablePortFinder.getNextAvailable(9000);
// setup Apache CXF REST server
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(CamelCatalogRest.class);
sf.setResourceProvider(CamelCatalogRest.class, new SingletonResourceProvider(catalog));
// to use jackson for json
sf.setProvider(JacksonJsonProvider.class);
sf.setAddress("http://localhost:" + port);
// create and start the CXF server (non blocking)
server = sf.create();
server.start();
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project camel by apache.
the class CamelCatalogSwaggerTest method setup.
@Before
public void setup() {
catalog = new CamelCatalogRest();
port = AvailablePortFinder.getNextAvailable(9000);
// setup Apache CXF REST server
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(CamelCatalogRest.class);
sf.setResourceProvider(CamelCatalogRest.class, new SingletonResourceProvider(catalog));
Swagger2Feature swagger = new Swagger2Feature();
swagger.setBasePath("/");
swagger.setScanAllResources(false);
swagger.setPrettyPrint(true);
swagger.setSupportSwaggerUi(true);
swagger.setTitle("Camel Catalog REST Api");
swagger.setDescription("REST Api for the Camel Catalog");
swagger.setVersion(catalog.getCatalogVersion());
swagger.setContact("Apache Camel");
sf.getFeatures().add(swagger);
// to use jackson for json
sf.setProvider(JacksonJsonProvider.class);
sf.setAddress("http://localhost:" + port);
// create and start the CXF server (non blocking)
server = sf.create();
server.start();
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.
the class MetadataResourceTest method setUpResources.
@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
sf.setResourceClasses(MetadataResource.class);
sf.setResourceProvider(MetadataResource.class, new SingletonResourceProvider(new MetadataResource()));
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.
the class RecursiveMetadataResourceTest method setUpResources.
@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
sf.setResourceClasses(RecursiveMetadataResource.class);
sf.setResourceProvider(RecursiveMetadataResource.class, new SingletonResourceProvider(new RecursiveMetadataResource()));
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.
the class DetectorResourceTest method setUpResources.
@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
sf.setResourceClasses(DetectorResource.class);
sf.setResourceProvider(DetectorResource.class, new SingletonResourceProvider(new DetectorResource()));
}
Aggregations