當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。