Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceConfig.property()


        Map<String, String> languages = Maps.newHashMap();
        languages.put("english", "en");
        languages.put("french", "fr");

        ResourceConfig rc = new ResourceConfig(LanguageVariantResource.class);
        rc.property(ServerProperties.LANGUAGE_MAPPINGS, languages);
        rc.property(ServerProperties.MEDIA_TYPE_MAPPINGS, mediaTypes);
        return rc;
    }

    @Test
View Full Code Here


        languages.put("english", "en");
        languages.put("french", "fr");

        ResourceConfig rc = new ResourceConfig(LanguageVariantResource.class);
        rc.property(ServerProperties.LANGUAGE_MAPPINGS, languages);
        rc.property(ServerProperties.MEDIA_TYPE_MAPPINGS, mediaTypes);
        return rc;
    }

    @Test
    public void testMediaTypesAndLanguages() {
View Full Code Here

                TypeVariableResource.class,
                UniqueResource.class,

                TestDisableValidationFailOnErrorResource.class // we should still be able to invoke a GET on this one.
        );
        rc.property(ServerProperties.RESOURCE_VALIDATION_IGNORE_ERRORS, true);
        ApplicationHandler ah = new ApplicationHandler(rc);

        final ContainerRequest request = RequestContextBuilder.from("/test-disable-validation-fail-on-error", "GET").build();
        ContainerResponse response = ah.apply(request).get();
View Full Code Here

    }

    @Test
    public void testInjectedConfigurable() throws Exception {
        final ResourceConfig resourceConfig = getTestResourceConfig(InjectConfigurableDynamicFeature.class);
        resourceConfig.property("hello", "world");

        final ApplicationHandler application = createApplication(resourceConfig);

        assertNull(application.getConfiguration().getProperty("foo"));
View Full Code Here

    }

    @Override
    protected Application configure() {
        final ResourceConfig resourceConfig = new ResourceConfig(MyResource.class, MyMBW5.class, MyMBW6.class);
        resourceConfig.property(MessageProperties.LEGACY_WORKERS_ORDERING, true);
        return resourceConfig;
    }

    @Test
    public void orderingTest() {
View Full Code Here

        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.register(oAuth1ServerFeature);
        resourceConfig.register(MyProtectedResource.class);
        resourceConfig.register(new LoggingFilter(Logger.getLogger(OAuthClientServerTest.class.getName()), true));
        resourceConfig.register(OAuthAuthorizationResource.class);
        resourceConfig.property(OAuth1ServerProperties.TIMESTAMP_UNIT, "SECONDS");
        resourceConfig.property(OAuth1ServerProperties.MAX_NONCE_CACHE_SIZE, 20);
        return resourceConfig;
    }

    @Path("resource")
View Full Code Here

public class MonitoringStatisticsLocatorTest extends JerseyTest {

    @Override
    protected Application configure() {
        final ResourceConfig resourceConfig = new ResourceConfig(StatisticsResource.class);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, true);
        resourceConfig.property(ServerProperties.APPLICATION_NAME, "testApp");
        return resourceConfig;
    }

    @Path("resource")
View Full Code Here

        resourceConfig.register(oAuth1ServerFeature);
        resourceConfig.register(MyProtectedResource.class);
        resourceConfig.register(new LoggingFilter(Logger.getLogger(OAuthClientServerTest.class.getName()), true));
        resourceConfig.register(OAuthAuthorizationResource.class);
        resourceConfig.property(OAuth1ServerProperties.TIMESTAMP_UNIT, "SECONDS");
        resourceConfig.property(OAuth1ServerProperties.MAX_NONCE_CACHE_SIZE, 20);
        return resourceConfig;
    }

    @Path("resource")
    public static class MyProtectedResource {
View Full Code Here

    @Override
    protected Application configure() {
        final ResourceConfig resourceConfig = new ResourceConfig(StatisticsResource.class);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, true);
        resourceConfig.property(ServerProperties.APPLICATION_NAME, "testApp");
        return resourceConfig;
    }

    @Path("resource")
    public static class StatisticsResource {
View Full Code Here

    }

    @Override
    protected Application configure() {
        final ResourceConfig resourceConfig = new ResourceConfig(Resource.class, DoubleInterceptor.class);
        resourceConfig.property(CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER, BUFFER_SIZE);
        return resourceConfig;
    }

    @Override
    protected void configureClient(ClientConfig config) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.