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


Java ResourceHelpers类代码示例

本文整理汇总了Java中io.dropwizard.testing.ResourceHelpers的典型用法代码示例。如果您正苦于以下问题:Java ResourceHelpers类的具体用法?Java ResourceHelpers怎么用?Java ResourceHelpers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResourceHelpers类属于io.dropwizard.testing包,在下文中一共展示了ResourceHelpers类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testH2

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
@Test
public void testH2() throws Exception {
    JettyClientConfiguration h2conf = new JettyClientConfiguration();
    Http2ClientTransportFactory h2transport = new Http2ClientTransportFactory();
    h2transport.setTrustStorePath(ResourceHelpers.resourceFilePath("stores/h2_client.jts"));
    h2transport.setTrustStorePassword("h2_client");
    h2transport.setValidatePeers(false);
    h2conf.setConnectionFactoryBuilder(h2transport);

    HttpClient client = new JettyClientBuilder(environment)
            .using(h2conf)
            .build();
    String response = client.GET(String.format("https://127.0.0.1:%d/application/greet", h2.getLocalPort()))
            .getContentAsString();
    assertThat(objectMapper.readTree(response))
            .isEqualTo(objectMapper.readTree(FixtureHelpers.fixture("server_response.json")));
}
 
开发者ID:arteam,项目名称:dropwizard-http2-client,代码行数:18,代码来源:Http2ClientIntegrationTest.java

示例2: startApplicationWith

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public static DropwizardTestSupport<ApplicationConfiguration> startApplicationWith(
        int initialDelayInMillis, Class testClass, int periodInMillis) {

    ConfigOverride[] configOverrides = {
        ConfigOverride.config("testClasses", testClass.getName()),
        ConfigOverride.config("initialDelayInMillis", String.valueOf(initialDelayInMillis)),
        ConfigOverride.config("periodInMillis", String.valueOf(periodInMillis))
    };

    DropwizardTestSupport<ApplicationConfiguration> applicationConfigurationDropwizardTestSupport =
            new DropwizardTestSupport<>(Atam4jTestApplication.class,
                    ResourceHelpers.resourceFilePath("atam4j-config.yml"),
                    configOverrides);

    applicationConfigurationDropwizardTestSupport.before();
    return applicationConfigurationDropwizardTestSupport;
}
 
开发者ID:atam4j,项目名称:atam4j,代码行数:18,代码来源:Atam4jApplicationStarter.java

示例3: SamlEngineAppRule

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public SamlEngineAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) {
    super(SamlEngineIntegrationApplication.class,
            ResourceHelpers.resourceFilePath("saml-engine.yml"),
            withDefaultOverrides(isCountryEnabled, configOverrides)
    );
    BootstrapUtils.reset();
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:8,代码来源:SamlEngineAppRule.java

示例4: setup

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public void setup(
        Class<? extends Application<TestConfiguration>> applicationClass,
        String configPath, ConfigOverride... configOverrides) {
    dropwizardTestSupport = new DropwizardTestSupport<>(applicationClass,
            ResourceHelpers.resourceFilePath(configPath), configOverrides);
    dropwizardTestSupport.before();
}
 
开发者ID:pac4j,项目名称:dropwizard-pac4j,代码行数:8,代码来源:AbstractApplicationTest.java

示例5: RegisterRule

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public RegisterRule() {
    this.appRule = new DropwizardAppRule<>(RegisterApplication.class,
            ResourceHelpers.resourceFilePath("test-app-config.yaml"));
    wipeRule = new WipeDatabaseRule(TestRegister.values());
    wholeRule = RuleChain
            .outerRule(appRule)
            .around(wipeRule);
}
 
开发者ID:openregister,项目名称:openregister-java,代码行数:9,代码来源:RegisterRule.java

示例6: loadConfigurationWithExternalPathOfFieldsResourceFile

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
@Test
public void loadConfigurationWithExternalPathOfFieldsResourceFile() throws URISyntaxException {
    @SuppressWarnings("ConstantConditions")
    String fileUrl = ResourceHelpers.resourceFilePath("config/fields.yaml");

    FieldsConfiguration fieldsConfiguration = new FieldsConfiguration(fileUrl);

    assertThat(fieldsConfiguration.getField("register").get().fieldName, equalTo("register"));
}
 
开发者ID:openregister,项目名称:openregister-java,代码行数:10,代码来源:FieldsConfigurationTest.java

示例7: buildApp

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public static DropwizardAppRule<TestConfiguration> buildApp(
    String configFile, final Before before
) {
    return new DropwizardAppRule<>(
        new DropwizardTestSupport<TestConfiguration>(
            TestApp.class, ResourceHelpers.resourceFilePath(configFile)
        ) {
            @Override
            public void before() {
                super.before();
                before.before(getEnvironment());
            }
        }
    );
}
 
开发者ID:timmolter,项目名称:dropwizard-sundial,代码行数:16,代码来源:SundialBundleITBase.java

示例8: SamlProxyAppRule

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public SamlProxyAppRule(boolean isCountryEnabled, ConfigOverride... configOverrides) {
    super(SamlProxyApplication.class,
            ResourceHelpers.resourceFilePath("saml-proxy.yml"),
            withDefaultOverrides(isCountryEnabled, configOverrides)
    );
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:7,代码来源:SamlProxyAppRule.java

示例9: buildResponseFromFile

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
private SAMLObject buildResponseFromFile() throws IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, org.opensaml.core.xml.io.UnmarshallingException {
    String xmlString = new String(Files.readAllBytes(Paths.get(ResourceHelpers.resourceFilePath("EIDASAMLResponse.xml"))));
    return (Response) new SamlObjectParser().getSamlObject(xmlString);
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:5,代码来源:CountryAuthnResponseTranslatorServiceTest.java

示例10: ConfigAppRule

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public ConfigAppRule(ConfigOverride... configOverrides) {
    super(ConfigApplication.class,
            ResourceHelpers.resourceFilePath("config.yml"),
            withDefaultOverrides(configOverrides)
    );
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:7,代码来源:ConfigAppRule.java

示例11: MatchingServiceAdapterAppRule

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public MatchingServiceAdapterAppRule(boolean isCountryEnabled, ConfigOverride... otherConfigOverrides) {
    super(MatchingServiceAdapterApplication.class,
            ResourceHelpers.resourceFilePath("verify-matching-service-adapter.yml"),
            MatchingServiceAdapterAppRule.withDefaultOverrides(isCountryEnabled, otherConfigOverrides)
    );
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:7,代码来源:MatchingServiceAdapterAppRule.java

示例12: buildAppRule

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public static DropwizardAppRule<ConerCoreConfiguration> buildAppRule() {
    return new DropwizardAppRule<>(
            ConerCoreApplication.class,
            ResourceHelpers.resourceFilePath("config/test.yml")
    );
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:7,代码来源:IntegrationTestUtils.java

示例13: setup

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
protected void setup(Class<? extends Application<TestConfiguration>> applicationClass) {
    dropwizardTestSupport = new DropwizardTestSupport<>(applicationClass, ResourceHelpers.resourceFilePath("integration-test.yaml"),
            ConfigOverride.config("dataSource.url", "jdbc:hsqldb:mem:DbTest" + System.nanoTime() + "?hsqldb.translate_dti_types=false"));
    dropwizardTestSupport.before();
}
 
开发者ID:scottescue,项目名称:dropwizard-entitymanager,代码行数:6,代码来源:AbstractIntegrationTest.java

示例14: main

import io.dropwizard.testing.ResourceHelpers; //导入依赖的package包/类
public static void main(String... args) throws Exception {
    VaadinApplication.main("server", ResourceHelpers.resourceFilePath("dummy.yaml"));
}
 
开发者ID:jangalinski,项目名称:dropwizard-vaadin,代码行数:4,代码来源:VaadinApplicationStarter.java


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