Package org.apache.cxf.ws.rm

Examples of org.apache.cxf.ws.rm.RMManager$DefaultSequenceIdentifierGenerator


    public void testRobustWithSomeFaults() throws Exception {
        LOG.fine("Creating greeter client");
        SpringBusFactory bf = new SpringBusFactory();
        bus = bf.createBus("/org/apache/cxf/systest/ws/rm/seqlength1.xml");
        // set the client retry interval much shorter than the slow processing delay
        RMManager manager = bus.getExtension(RMManager.class);
       
        AcknowledgementInterval ai
            = new org.apache.cxf.ws.rmp.v200502.ObjectFactory()
                .createRMAssertionAcknowledgementInterval();
        ai.setMilliseconds(new Long(5000));
        manager.getRMAssertion().setAcknowledgementInterval(ai);

        BusFactory.setDefaultBus(bus);
        GreeterService gs = new GreeterService();
        greeter = gs.getGreeterPort();
        updateAddressPort(greeter, PORT);
       
        LOG.fine("Invoking greeter");
        greeter.greetMeOneWay("one");
        Thread.sleep(3000);
       
        // invoked once
        assertEquals("not invoked once", 1, serverGreeter.getCount());
        assertTrue("still in retransmission", manager.getRetransmissionQueue().isEmpty());
       
        LOG.fine("Invoking greeter and raising a fault");
        serverGreeter.setThrowAlways(true);
       
        greeter.greetMeOneWay("two");
        Thread.sleep(3000);
       
        // still invoked once
        assertEquals("not invoked once", 1, serverGreeter.getCount());
        assertTrue("still in retransmission", manager.getRetransmissionQueue().isEmpty());
       
        LOG.fine("Invoking robust greeter and raising a fault");
        robustSetter.setRobust(true);
        greeter.greetMeOneWay("three");
        Thread.sleep(3000);
       
        // still invoked once
        assertEquals("not invoked once", 1, serverGreeter.getCount());
        assertFalse("no message in retransmission", manager.getRetransmissionQueue().isEmpty());
       
        LOG.fine("Stop raising a fault and let the retransmission succeeds");
        serverGreeter.setThrowAlways(false);
        Thread.sleep(8000);

        // invoked twice
        assertEquals("not invoked twice", 2, serverGreeter.getCount());
        assertTrue("still in retransmission", manager.getRetransmissionQueue().isEmpty());
    }
View Full Code Here


        if (!doTestTwowayNonAnonymousMaximumSequenceLength2) {
            return;
        }
        init("org/apache/cxf/systest/ws/rm/seqlength10.xml", true);
       
        RMManager manager = greeterBus.getExtension(RMManager.class);
        assertEquals("Unexpected maximum sequence length.", BigInteger.TEN,
            manager.getSourcePolicy().getSequenceTerminationPolicy().getMaxLength());
        manager.getSourcePolicy().getSequenceTerminationPolicy().setMaxLength(
            new BigInteger("2"));
       
        greeter.greetMe("one");
        greeter.greetMe("two");
        greeter.greetMe("three");
View Full Code Here

                    rmps.getSequence().setMessageNumber(BigInteger.ONE);
                }
            }
        }
        greeterBus.getOutInterceptors().add(new MessageNumberInterceptor());
        RMManager manager = greeterBus.getExtension(RMManager.class);
        manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new BigInteger("2000"));
       
        greeter.greetMe("one");
        try {
            greeter.greetMe("two");
            fail("Expected fault.");
View Full Code Here

                    rmps.getSequence().getIdentifier().setValue("UNKNOWN");
                }
            }
        }
        greeterBus.getOutInterceptors().add(new SequenceIdInterceptor());
        RMManager manager = greeterBus.getExtension(RMManager.class);
        manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new BigInteger("2000"));
      
        try {
            greeter.greetMe("one");
            fail("Expected fault.");
        } catch (WebServiceException ex) {
View Full Code Here

    private void testOnewayMessageLoss(Executor executor) throws Exception {

        init("org/apache/cxf/systest/ws/rm/message-loss.xml", false, executor);
       
        greeterBus.getOutInterceptors().add(new MessageLossSimulator());
        RMManager manager = greeterBus.getExtension(RMManager.class);
        manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new BigInteger("2000"));
       
        greeter.greetMeOneWay("one");
        greeter.greetMeOneWay("two");
        greeter.greetMeOneWay("three");
        greeter.greetMeOneWay("four");
View Full Code Here

    private void testTwowayMessageLoss(Executor executor) throws Exception {

        init("org/apache/cxf/systest/ws/rm/message-loss.xml", true, executor);
       
        greeterBus.getOutInterceptors().add(new MessageLossSimulator());
        RMManager manager = greeterBus.getExtension(RMManager.class);
        manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new BigInteger("2000"));

        greeter.greetMe("one");
        greeter.greetMe("two");
        greeter.greetMe("three");
        greeter.greetMe("four");
View Full Code Here

        mf.verifyAcknowledgements(new boolean[] {false, true, true}, false);       
    }
   
    void verifyStorePopulation() {
       
        RMManager manager = bus.getExtension(RMManager.class);
        assertNotNull(manager);
       
        RMStore store = manager.getStore();
        assertNotNull(store);
       
        Client client = ClientProxy.getClient(greeter);
        String id = RMUtils.getEndpointIdentifier(client.getEndpoint());
       
View Full Code Here

    }
   
    void verifyRecovery() throws Exception {
       
        RMManager manager = bus.getExtension(RMManager.class);
        assertNotNull(manager);
       
        RMStore store = manager.getStore();
        assertNotNull(store);
       
        Client client = ClientProxy.getClient(greeter);
        String id = RMUtils.getEndpointIdentifier(client.getEndpoint());
       
View Full Code Here

        if (!doTestTwowayNonAnonymousMaximumSequenceLength2) {
            return;
        }
        init("org/apache/servicemix/cxfbc/ws/rm/seqlength10.xml", true);
       
        RMManager manager = greeterBus.getExtension(RMManager.class);
        assertEquals("Unexpected maximum sequence length.", BigInteger.TEN,
            manager.getSourcePolicy().getSequenceTerminationPolicy().getMaxLength());
        manager.getSourcePolicy().getSequenceTerminationPolicy().setMaxLength(
            new BigInteger("2"));
       
        greeter.greetMe("one");
        greeter.greetMe("two");
        greeter.greetMe("three");
View Full Code Here

                    rmps.getSequence().setMessageNumber(BigInteger.ONE);
                }
            }
        }
        greeterBus.getOutInterceptors().add(new MessageNumberInterceptor());
        RMManager manager = greeterBus.getExtension(RMManager.class);
        manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new BigInteger("2000"));
       
        greeter.greetMe("one");
        try {
            greeter.greetMe("two");
            fail("Expected fault.");
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.rm.RMManager$DefaultSequenceIdentifierGenerator

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.