Package org.apache.cxf.transports.http.configuration

Examples of org.apache.cxf.transports.http.configuration.HTTPServerPolicy


    }

   
    @Test
    public void testEqualServerPolicies() {
        HTTPServerPolicy p1 = new HTTPServerPolicy();
        assertTrue(PolicyUtils.equals(p1, p1));
        HTTPServerPolicy p2 = new HTTPServerPolicy();       
        assertTrue(PolicyUtils.equals(p1, p2));
        p1.setContentEncoding("encoding");
        assertTrue(!PolicyUtils.equals(p1, p2));
        p2.setContentEncoding("encoding");
        assertTrue(PolicyUtils.equals(p1, p2));
        p1.setSuppressClientSendErrors(true);
        assertTrue(!PolicyUtils.equals(p1, p2));
    }
View Full Code Here


        testAssertServerPolicy(false);
    }

    void testAssertServerPolicy(boolean outbound) {
        Message message = control.createMock(Message.class);
        HTTPServerPolicy ep = new HTTPServerPolicy();
        HTTPServerPolicy mp = new HTTPServerPolicy();
        HTTPServerPolicy cmp = new HTTPServerPolicy();
        cmp.setReceiveTimeout(60000L);
        HTTPServerPolicy icmp = new HTTPServerPolicy();
        icmp.setSuppressClientSendErrors(true);

        JaxbAssertion<HTTPServerPolicy> ea =
            new JaxbAssertion<HTTPServerPolicy>(PolicyUtils.HTTPSERVERPOLICY_ASSERTION_QNAME, false);
        ea.setData(ep);
        JaxbAssertion<HTTPServerPolicy> ma =
View Full Code Here

   
    @Test
    public void testHTTPServerPolicyAssertionEqual() throws Exception {
        HTTPServerAssertionBuilder ab = new HTTPServerAssertionBuilder();
        JaxbAssertion<HTTPServerPolicy>  a = ab.buildAssertion();
        a.setData(new HTTPServerPolicy());
        assertTrue(a.equal(a));       
        JaxbAssertion<HTTPServerPolicy> b = ab.buildAssertion();
        b.setData(new HTTPServerPolicy());
        assertTrue(a.equal(b));
        HTTPServerPolicy pa = new HTTPServerPolicy();
        a.setData(pa);
        assertTrue(a.equal(a));
        HTTPServerPolicy pb = new HTTPServerPolicy();
        b.setData(pb);
        assertTrue(a.equal(b));
        pa.setSuppressClientSendErrors(true);
        assertTrue(!a.equal(b));      
    }
View Full Code Here

    }
   
    @Test
    public void testServerPolicyInServiceModel()
        throws Exception {
        policy = new HTTPServerPolicy();
        address = getEPR("bar/foo");
        bus = new CXFBusImpl();
       
        transportFactory = new HTTPTransportFactory();
        transportFactory.setBus(bus);
View Full Code Here

    };
   
    private JettyHTTPDestination setUpDestination(
            boolean contextMatchOnStem, boolean mockedBus)
        throws Exception {
        policy = new HTTPServerPolicy();
        address = getEPR("bar/foo");
       

        transportFactory = new HTTPTransportFactory();
View Full Code Here

            Collection<PolicyAssertion> as =
                CastUtils.cast((Collection)it.next(), PolicyAssertion.class);
            LOG.fine("Checking alternative with " + as.size() + " assertions.");
            for (PolicyAssertion a : as) {
                LOG.fine("Assertion: " + a.getClass().getName());
                HTTPServerPolicy p = (JaxbAssertion.cast(a, HTTPServerPolicy.class)).getData();
                LOG.fine("server policy: " + PolicyUtils.toString(p));
            }
        }

    }
View Full Code Here

            && null != endpointInfo.getService()) {
            server = PolicyUtils.getServer(engine, endpointInfo, this);
        }
        if (null == server) {
            server = endpointInfo.getTraversedExtensor(
                    new HTTPServerPolicy(), HTTPServerPolicy.class);
        }
    }
View Full Code Here

    }
    private static List<String> createMutableList(String val) {
        return new ArrayList<String>(Arrays.asList(new String[] {val}));
    }
    void setPolicies(Map<String, List<String>> headers) {
        HTTPServerPolicy policy = server;
        if (policy.isSetCacheControl()) {
            headers.put("Cache-Control",
                        createMutableList(policy.getCacheControl().value()));
        }
        if (policy.isSetContentLocation()) {
            headers.put("Content-Location",
                        createMutableList(policy.getContentLocation()));
        }
        if (policy.isSetContentEncoding()) {
            headers.put("Content-Encoding",
                        createMutableList(policy.getContentEncoding()));
        }
        if (policy.isSetContentType()) {
            headers.put(HttpHeaderHelper.CONTENT_TYPE,
                        createMutableList(policy.getContentType()));
        }
        if (policy.isSetServerType()) {
            headers.put("Server",
                        createMutableList(policy.getServerType()));
        }
        if (policy.isSetHonorKeepAlive() && !policy.isHonorKeepAlive()) {
            headers.put("Connection",
                        createMutableList("close"));
        } else if (policy.isSetKeepAliveParameters()) {
            headers.put("Keep-Alive", createMutableList(policy.getKeepAliveParameters()));
        }
       
   
       
    /*
 
View Full Code Here

    }
   
    @Test
    public void testServerPolicyInServiceModel()
        throws Exception {
        policy = new HTTPServerPolicy();
        address = getEPR("bar/foo");
        bus = new CXFBusImpl();
       
        transportFactory = new JettyHTTPTransportFactory();
        transportFactory.setBus(bus);
View Full Code Here

    };
   
    private JettyHTTPDestination setUpDestination(
            boolean contextMatchOnStem, boolean mockedBus)
        throws Exception {
        policy = new HTTPServerPolicy();
        address = getEPR("bar/foo");
       

        transportFactory = new JettyHTTPTransportFactory() {
            JettyHTTPServerEngineFactory serverEngineFactory;
View Full Code Here

TOP

Related Classes of org.apache.cxf.transports.http.configuration.HTTPServerPolicy

Copyright © 2018 www.massapicom. 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.