Package org.glassfish.jersey.server

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


    }

    @Test
    public void testManagedClientInjection3() throws ExecutionException, InterruptedException {
        final ResourceConfig resourceConfig = new ResourceConfig(Resource4.class);
        resourceConfig.property(Managed.class.getName() + ".property.test-property", "test-value");
        resourceConfig.property(Managed.class.getName() + ".baseUri", "http://oracle.com");
        initiateWebApplication(resourceConfig);

        final ContainerResponse response = apply(
                RequestContextBuilder.from("/test/3", "GET").
View Full Code Here


    @Test
    public void testManagedClientInjection3() throws ExecutionException, InterruptedException {
        final ResourceConfig resourceConfig = new ResourceConfig(Resource4.class);
        resourceConfig.property(Managed.class.getName() + ".property.test-property", "test-value");
        resourceConfig.property(Managed.class.getName() + ".baseUri", "http://oracle.com");
        initiateWebApplication(resourceConfig);

        final ContainerResponse response = apply(
                RequestContextBuilder.from("/test/3", "GET").
                        build()
View Full Code Here

        Map<String, MediaType> mediaTypes = Maps.newHashMap();
        mediaTypes.put("foo", MediaType.valueOf("application/foo"));
        mediaTypes.put("bar", MediaType.valueOf("application/bar"));

        ResourceConfig rc = new ResourceConfig(Resource.class);
        rc.property(ServerProperties.MEDIA_TYPE_MAPPINGS, mediaTypes);
        handler = new ApplicationHandler(rc);
    }

    @Test
    public void testGetFoo() throws Exception {
View Full Code Here

    }

    @Test
    public void testEnable() throws ExecutionException, InterruptedException {
        ResourceConfig resourceConfig = new ResourceConfig(RootResource.class);
        resourceConfig.property(ServerProperties.RESOURCE_VALIDATION_DISABLE, "false");

        ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        try {
            final ContainerResponse response = applicationHandler.apply(
View Full Code Here

    }

    @Test
    public void testDisable() throws ExecutionException, InterruptedException {
        ResourceConfig resourceConfig = new ResourceConfig(RootResource.class);
        resourceConfig.property(ServerProperties.RESOURCE_VALIDATION_DISABLE, "true");

        ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        final ContainerResponse response = applicationHandler.apply(
                RequestContextBuilder.from("/root/sub", "GET").build()).get();
View Full Code Here

        for (Binder b : additionalBinders) {
            rc.register(b);
        }

        rc.property(MessageProperties.LEGACY_WORKERS_ORDERING, true);

        //add a rest config listener for possible reload of Jersey
        new RestConfigChangeListener(habitat, r, rc, sc);

        return rc;
View Full Code Here

                                            final ServerContext sc,
                                            final ServiceLocator habitat,
                                            final Set<? extends Binder> additionalBinders)
            throws EndpointRegistrationException {
        ResourceConfig rc = new ResourceConfig(classes);
        rc.property(ServerProperties.MEDIA_TYPE_MAPPINGS, getMimeMappings());
        rc.register(CsrfProtectionFilter.class);
        rc.register(UriConnegFilter.class);
        for (Binder b : additionalBinders) {
            rc.register(b);
        }
View Full Code Here

        rc.register(CsrfProtectionFilter.class);
        rc.register(UriConnegFilter.class);
        for (Binder b : additionalBinders) {
            rc.register(b);
        }
        rc.property(MessageProperties.LEGACY_WORKERS_ORDERING, true);
        //Disable as much as possible
        rc.property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, true);
        rc.property(ServerProperties.WADL_FEATURE_DISABLE, true);
        rc.property(ServerProperties.BV_FEATURE_DISABLE, true);
        rc.property(ServerProperties.RESOURCE_VALIDATION_DISABLE, true);
View Full Code Here

        for (Binder b : additionalBinders) {
            rc.register(b);
        }
        rc.property(MessageProperties.LEGACY_WORKERS_ORDERING, true);
        //Disable as much as possible
        rc.property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, true);
        rc.property(ServerProperties.WADL_FEATURE_DISABLE, true);
        rc.property(ServerProperties.BV_FEATURE_DISABLE, true);
        rc.property(ServerProperties.RESOURCE_VALIDATION_DISABLE, true);
        return rc;
    }
View Full Code Here

            rc.register(b);
        }
        rc.property(MessageProperties.LEGACY_WORKERS_ORDERING, true);
        //Disable as much as possible
        rc.property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, true);
        rc.property(ServerProperties.WADL_FEATURE_DISABLE, true);
        rc.property(ServerProperties.BV_FEATURE_DISABLE, true);
        rc.property(ServerProperties.RESOURCE_VALIDATION_DISABLE, true);
        return rc;
    }
   
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.