本文整理汇总了Java中org.jboss.resteasy.spi.ResteasyDeployment.start方法的典型用法代码示例。如果您正苦于以下问题:Java ResteasyDeployment.start方法的具体用法?Java ResteasyDeployment.start怎么用?Java ResteasyDeployment.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.resteasy.spi.ResteasyDeployment
的用法示例。
在下文中一共展示了ResteasyDeployment.start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEngineWithInjectedClientPost2
import org.jboss.resteasy.spi.ResteasyDeployment; //导入方法依赖的package包/类
@Test
public void testEngineWithInjectedClientPost2() {
final ResteasyDeployment deployment = new ResteasyDeployment();
deployment.start();
final ResteasyProviderFactory providerFactory = deployment.getProviderFactory();
final HttpClient httpClient = Vertx.vertx().createHttpClient(httpClientOptions);
final Client client = new ResteasyClientBuilder()
.providerFactory(providerFactory)
.httpEngine(new VertxClientEngine(httpClient))
.register(GsonMessageBodyHandler.class)
.build();
final Form xform = new Form();
xform.param("userName", "ca1\\\\meowmix");
xform.param("password", "mingnamulan");
xform.param("state", "authenticate");
xform.param("style", "xml");
xform.param("xsl", "none");
final Response response = client.target("https://httpbin.org/post").request(MediaType.APPLICATION_JSON)
.post(Entity.form(xform), Response.class);
assertFalse(response.getStringHeaders().isEmpty());
System.out.println(response.getStringHeaders());
assertFalse(response.getHeaders().isEmpty());
assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getMediaType());
assertTrue(response.hasEntity());
final JsonObject arsString = response.readEntity(JsonObject.class);
assertEquals("xml", arsString.getAsJsonObject("form").get("style").getAsString());
}
示例2: before
import org.jboss.resteasy.spi.ResteasyDeployment; //导入方法依赖的package包/类
@Override
protected final void before() throws Throwable {
deployment = new ResteasyDeployment();
deployment.getDefaultContextObjects().put(SecurityContext.class, new DummySecurityContext());
configureDeployment(deployment);
deployment.start();
ResteasyClientBuilder builder =
new ResteasyClientBuilder()
.httpEngine(new InProcessClientHttpEngine(deployment.getDispatcher(), baseUri));
configureClient(builder);
client = builder.build();
}
示例3: createDeployment
import org.jboss.resteasy.spi.ResteasyDeployment; //导入方法依赖的package包/类
protected NettyBootstrap createDeployment(ResteasyDeployment rd){
if(rd == null){
deployment = new ResteasyDeployment();
}else{
deployment = rd;
}
deployment.start();
return this;
}