当前位置: 首页>>代码示例>>Java>>正文


Java TestProperties类代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:Issue1341.java

示例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;
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:18,代码来源:AbstractListingResourceTest.java

示例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();

}
 
开发者ID:infinitiessoft,项目名称:keystone4j,代码行数:24,代码来源:EndpointResourceTest.java

示例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();
}
 
开发者ID:infinitiessoft,项目名称:keystone4j,代码行数:22,代码来源:AuthResourceTest.java

示例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
      )
  );
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:24,代码来源:HttpClientSourceIT.java

示例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
      )
  );
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:18,代码来源:HttpProcessorIT.java

示例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);

}
 
开发者ID:thenewcircle,项目名称:class_3647,代码行数:35,代码来源:JerseyResourceTest.java

示例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;
}
 
开发者ID:ctc-g,项目名称:sinavi-jfw,代码行数:18,代码来源:LocaleContextFilterTest.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:TestIssue885.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:Issue1367_jaxrs.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:Issue1392.java

示例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;
}
 
开发者ID:aruld,项目名称:dropwizard-pagination,代码行数:10,代码来源:LinkWebAppTest.java

示例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);
}
 
开发者ID:dropwizard,项目名称:dropwizard-vavr,代码行数:8,代码来源:LazyParamConverterProviderTest.java

示例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);
}
 
开发者ID:dropwizard,项目名称:dropwizard-vavr,代码行数:8,代码来源:OptionParamConverterProviderTest.java

示例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);
}
 
开发者ID:dropwizard,项目名称:dropwizard-vavr,代码行数:9,代码来源:ValueMessageBodyWriterTest.java


注:本文中的org.glassfish.jersey.test.TestProperties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。