Search in sources :

Example 1 with ServletRestTransport

use of org.apache.servicecomb.transport.rest.servlet.ServletRestTransport in project java-chassis by ServiceComb.

the class TestInspectorImpl method initInspector.

private static InspectorImpl initInspector(String urlPrefix) {
    SCBEngine scbEngine = SCBBootstrap.createSCBEngineForTest();
    scbEngine.getTransportManager().clearTransportBeforeInit();
    if (StringUtils.isNotEmpty(urlPrefix)) {
        Map<String, Transport> transportMap = Deencapsulation.getField(scbEngine.getTransportManager(), "transportMap");
        transportMap.put(RESTFUL, new ServletRestTransport());
        ClassLoaderScopeContext.setClassLoaderScopeProperty(DefinitionConst.URL_PREFIX, urlPrefix);
    }
    scbEngine.run();
    InspectorImpl inspector = new InspectorImpl().setInspectorConfig(scbEngine.getPriorityPropertyManager().createConfigObject(InspectorConfig.class)).setSchemas(schemas);
    inspector.correctBasePathForOnlineTest(scbEngine);
    return inspector;
}
Also used : SCBEngine(org.apache.servicecomb.core.SCBEngine) ServletRestTransport(org.apache.servicecomb.transport.rest.servlet.ServletRestTransport) Transport(org.apache.servicecomb.core.Transport) ServletRestTransport(org.apache.servicecomb.transport.rest.servlet.ServletRestTransport)

Aggregations

SCBEngine (org.apache.servicecomb.core.SCBEngine)1 Transport (org.apache.servicecomb.core.Transport)1 ServletRestTransport (org.apache.servicecomb.transport.rest.servlet.ServletRestTransport)1