use of net.morimekta.providence.server.ProvidenceServlet in project providence by morimekta.
the class RPCProvidenceHttpTest method setUp.
@Before
public void setUp() throws Exception {
Log.setLog(new NoLogging());
rc = copyResourceTo("/pvdrc", temp.getRoot());
copyResourceTo("/test.thrift", temp.getRoot());
impl = mock(MyService.Iface.class);
server = new Server(0);
DefaultSerializerProvider provider = new DefaultSerializerProvider();
ServletContextHandler handler = new ServletContextHandler();
handler.addServlet(new ServletHolder(new ProvidenceServlet(new MyService.Processor(impl), provider)), "/" + ENDPOINT);
server.setHandler(handler);
server.start();
port = getExposedPort(server);
Thread.sleep(1);
exitCode = 0;
rpc = new RPC(console.tty()) {
@Override
protected void exit(int i) {
exitCode = i;
}
};
}
use of net.morimekta.providence.server.ProvidenceServlet in project providence by morimekta.
the class TestApplication method run.
@Override
public void run(TestConfiguration testConfiguration, Environment environment) throws Exception {
Calculator.Iface impl = new TestCalculator();
environment.jersey().register(DefaultProvidenceMessageBodyReader.class);
environment.jersey().register(DefaultProvidenceMessageBodyWriter.class);
environment.jersey().register(new TestCalculatorResource(impl));
environment.getApplicationContext().addServlet(new ServletHolder(new ProvidenceServlet(new Calculator.Processor(impl), new DefaultSerializerProvider())), "/test");
}
Aggregations