本文整理汇总了Java中org.glassfish.jersey.test.TestProperties类的典型用法代码示例。如果您正苦于以下问题:Java TestProperties类的具体用法?Java TestProperties怎么用?Java TestProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TestProperties类属于org.glassfish.jersey.test包,在下文中一共展示了TestProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
ResourceConfig config = new ResourceConfig();
FastJsonProvider fastJsonProvider = new FastJsonProvider();
FastJsonConfig fastJsonConfig = new FastJsonConfig();
fastJsonConfig.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect, SerializerFeature.BrowserSecure);
fastJsonProvider.setFastJsonConfig(fastJsonConfig);
config.register(fastJsonProvider);
config.packages("com.alibaba.json.bvt.issue_1300");
return config;
}
示例2: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
MockitoAnnotations.initMocks(this);
ResourceConfig rs = new ResourceConfig();
rs.register(TestBinder.forAllMocksOf(this));
rs.register(JacksonJaxbJsonProvider.class);
rs.register(TestResource.class);
rs.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, Boolean.TRUE);
LinkFactoryResourceConfig.configure(rs);
linkMetaFactory = LinkMetaFactory.createInsecureFactoryForTest();
return rs;
}
示例3: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
service = new Service();
service.setDescription("Keystone Identity Service");
service.setName("keystone");
service.setType("identity");
service.setId("newserviceid");
endpoint = new Endpoint();
endpoint.setId("9775f17cbc814f8d8097a524680bb33c");
endpoint.setInterfaceType("admin");
endpoint.setName("keystone_endpoint");
endpoint.setDescription("keystone endpoint");
endpoint.setUrl("http://localhost:35357/v3.0/");
endpoint.setServiceid("3f813b99431e46c0af877393f6ad91d7");
endpoint.setRegionid("RegionOne");
return new EndpointResourceTestApplication();
}
示例4: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
user = new User();
user.setId("e7912c2225e84ac5905d8cf0b5040a6d");
user.setPassword("[email protected]");
user.setDomain(domain);
domain = new Domain();
domain.setId("default");
identity = new Identity();
identity.getMethods().add("password");
password = new Password();
password.setUser(user);
identity.getAuthMethods().put("password", password);
returnUser = new User();
returnUser.setId("0ca8f6");
returnUser.setPassword("secrete");
returnUser.setDomain(domain);
return new AuthResourceTestApplication();
}
示例5: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
return new ResourceConfig(
Sets.newHashSet(
StreamResource.class,
NewlineStreamResource.class,
TextStreamResource.class,
SlowTextStreamResource.class,
XmlStreamResource.class,
PreemptiveAuthResource.class,
AuthResource.class,
HeaderRequired.class,
AlwaysUnauthorized.class,
HttpStageTestUtil.TestPostCustomType.class,
StreamTokenResetResource.class,
Auth2Resource.class,
Auth2ResourceOwnerWithIdResource.class,
Auth2BasicResource.class,
Auth2JWTResource.class
)
);
}
示例6: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
return new ResourceConfig(
Sets.newHashSet(
TestGet.class,
TestPut.class,
HttpStageTestUtil.TestPostCustomType.class,
TestXmlGet.class,
StreamTokenResetResource.class,
Auth2Resource.class,
Auth2ResourceOwnerWithIdResource.class,
Auth2BasicResource.class,
Auth2JWTResource.class
)
);
}
示例7: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
/**
* Call this method to recreate a jersey test runtime with the following
* configuration changes to the default.
* <ul>
* <li>Enabled logging of HTTP traffic to the STDERR device.</li>
* <li>Enabled dumping of HTTP traffic entities to the STDERR device.</li>
* <li>Registered the resource specific as the generic type argument with
* the Jersey runtime.</li>
* <li>Registered all provides declared in the
* <code>chirp.service.providers</code> package.</li>
* </ul>
*/
@Override
protected Application configure() {
// enable logging of HTTP traffic
enable(TestProperties.LOG_TRAFFIC);
// enable logging of dumped HTTP traffic entities
enable(TestProperties.DUMP_ENTITY);
// Jersey uses java.util.logging - bridge to slf4
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
// create an instance of the parameterized declared class
@SuppressWarnings("unchecked")
final Class<R> resourceClass = (Class<R>) ((ParameterizedType) getClass()
.getGenericSuperclass()).getActualTypeArguments()[0];
// ResourceConfig is a Jersey specific javax.ws.rs.core.Application
// subclass
return new ResourceConfig().register(resourceClass);
}
示例8: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
ResourceConfig config = new ResourceConfig();
config.register(LocaleContextFilter.class, 1);
config.register(new ContainerRequestFilter() {
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
called.incrementAndGet();
locale = LocaleContextKeeper.getLocale();
}
}, 2);
config.register(TestResource.class);
return config;
}
示例9: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
ResourceConfig config = new ResourceConfig();
//config.register(new FastJsonFeature()).register(FastJsonProvider.class);
config.register(new FastJsonFeature()).register(new FastJsonProvider().setPretty(true));
config.packages("com.alibaba.fastjson");
return config;
}
示例10: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
ResourceConfig config = new ResourceConfig();
config.register(FastJsonProvider.class);
config.packages("com.alibaba.json.bvt.issue_1300");
return config;
}
示例11: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
ResourceConfig config = new ResourceConfig();
config.register(FastJsonResolver.class);
config.register(FastJsonFeature.class);
config.packages("com.alibaba.json.bvt.issue_1300");
return config;
}
示例12: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected ResourceConfig configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
final ResourceConfig rc = new ResourceConfig(ItemsResource.class);
rc.register(LoggingFeature.class);
rc.register(DeclarativeLinkingFeature.class);
return rc;
}
示例13: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
return DropwizardResourceConfig.forTesting(new MetricRegistry())
.register(LazyParamFeature.class)
.register(TestResource.class);
}
示例14: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
return DropwizardResourceConfig.forTesting(new MetricRegistry())
.register(OptionParamFeature.class)
.register(TestResource.class);
}
示例15: configure
import org.glassfish.jersey.test.TestProperties; //导入依赖的package包/类
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
return DropwizardResourceConfig.forTesting(new MetricRegistry())
.register(ValueMessageBodyWriter.class)
.register(EmptyValueExceptionMapper.class)
.register(TestResource.class);
}