Package org.objectweb.celtix.ws.rm.SequenceAcknowledgement

Examples of org.objectweb.celtix.ws.rm.SequenceAcknowledgement.AcknowledgementRange


        List<AcknowledgementRange> ranges = seq.getAcknowledgment().getAcknowledgementRange();
        assertEquals(0, ranges.size());
             
        seq.acknowledge(new BigInteger("1"));       
        assertEquals(1, ranges.size());
        AcknowledgementRange r1 = ranges.get(0);
        assertEquals(1, r1.getLower().intValue());
        assertEquals(1, r1.getUpper().intValue());
       
        seq.acknowledge(new BigInteger("2"));
        assertEquals(1, ranges.size());
        r1 = ranges.get(0);
        assertEquals(1, r1.getLower().intValue());
        assertEquals(2, r1.getUpper().intValue());
    }
View Full Code Here


        seq.acknowledge(new BigInteger("2"))
        seq.acknowledge(new BigInteger("5"));
        seq.acknowledge(new BigInteger("4"));
        seq.acknowledge(new BigInteger("6"));
        assertEquals(2, ranges.size());
        AcknowledgementRange r = ranges.get(0);
        assertEquals(1, r.getLower().intValue());
        assertEquals(2, r.getUpper().intValue());
        r = ranges.get(1);
        assertEquals(4, r.getLower().intValue());
        assertEquals(6, r.getUpper().intValue())
    }
View Full Code Here

        seq.acknowledge(new BigInteger("4"));
        seq.acknowledge(new BigInteger("9"));
        seq.acknowledge(new BigInteger("2"));
       
        assertEquals(3, ranges.size());
        AcknowledgementRange r = ranges.get(0);
        assertEquals(1, r.getLower().intValue());
        assertEquals(2, r.getUpper().intValue());
        r = ranges.get(1);
        assertEquals(4, r.getLower().intValue());
        assertEquals(4, r.getUpper().intValue());
        r = ranges.get(2);
        assertEquals(9, r.getLower().intValue());
        assertEquals(10, r.getUpper().intValue())
    }
View Full Code Here

        seq.acknowledge(new BigInteger("6"));
        seq.acknowledge(new BigInteger("4"));
        seq.acknowledge(new BigInteger("2"));
        seq.acknowledge(new BigInteger("2"));
        assertEquals(2, ranges.size());
        AcknowledgementRange r = ranges.get(0);
        assertEquals(2, r.getLower().intValue());
        assertEquals(2, r.getUpper().intValue());
        r = ranges.get(1);
        assertEquals(4, r.getLower().intValue());
        assertEquals(6, r.getUpper().intValue());     
    }
View Full Code Here

        sid.setValue(s);
        EndpointReferenceType epr = RMUtils.createReference(Names.WSA_ANONYMOUS_ADDRESS);
       
           
        SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        AcknowledgementRange range =
            RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        range.setLower(BigInteger.ONE);
        range.setUpper(BigInteger.ONE);
        ack.getAcknowledgementRange().add(range);
        BigInteger lmn = null;
       
        if ("sequence2".equals(s)) {
            range =
                RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
            range.setLower(new BigInteger("3"));
            range.setUpper(BigInteger.TEN);
            ack.getAcknowledgementRange().add(range);
            lmn = BigInteger.TEN;
        }
       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid);
View Full Code Here

            assertEquals(Names.WSA_ANONYMOUS_ADDRESS, recovered.getAcksTo().getAddress().getValue());
            assertNull(recovered.getEndpointIdentifier());
            if ("sequence1".equals(recovered.getIdentifier().getValue())) {                     
                assertNull(recovered.getLastMessageNr());               
                assertEquals(1, recovered.getAcknowledgment().getAcknowledgementRange().size());
                AcknowledgementRange r = recovered.getAcknowledgment().getAcknowledgementRange().get(0);
                assertEquals(BigInteger.ONE, r.getLower());
                assertEquals(BigInteger.ONE, r.getUpper());
            } else {
                assertEquals(BigInteger.TEN, recovered.getLastMessageNr());
                assertEquals(2, recovered.getAcknowledgment().getAcknowledgementRange().size());
                AcknowledgementRange r = recovered.getAcknowledgment().getAcknowledgementRange().get(0);
                assertEquals(BigInteger.ONE, r.getLower());
                assertEquals(BigInteger.ONE, r.getUpper());
                r = recovered.getAcknowledgment().getAcknowledgementRange().get(1);
                assertEquals(new BigInteger("3"), r.getLower());
                assertEquals(BigInteger.TEN, r.getUpper());               
            }
        }
    }
View Full Code Here

   
    public void testSetAcknowledged() {
        SourceSequence seq = new SourceSequence(id);
        SequenceAcknowledgement ack = seq.getAcknowledgement();
        ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        AcknowledgementRange r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new BigInteger("1"));
        r.setUpper(new BigInteger("2"));
        ack.getAcknowledgementRange().add(r);
        r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new BigInteger("4"));
        r.setUpper(new BigInteger("6"));
        ack.getAcknowledgementRange().add(r);
        r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(new BigInteger("8"));
        r.setUpper(new BigInteger("10"));
        ack.getAcknowledgementRange().add(r);
        seq.setAcknowledged(ack);
        assertSame(ack, seq.getAcknowledgement());
        assertEquals(3, ack.getAcknowledgementRange().size());
        assertTrue(!seq.isAcknowledged(new BigInteger("3")))
View Full Code Here

       
        assertTrue(!seq.allAcknowledged());
        seq.setLastMessage(true);
        assertTrue(!seq.allAcknowledged());
        SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        AcknowledgementRange r = RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
        r.setLower(BigInteger.ONE);
        r.setUpper(new BigInteger("2"));
        ack.getAcknowledgementRange().add(r);
        seq.setAcknowledged(ack);
        assertTrue(!seq.allAcknowledged());
        r.setUpper(new BigInteger("4"));
        assertTrue(seq.allAcknowledged());
    }
View Full Code Here

    // would report it as an 'unused private method'
    protected void acknowledge(SourceSequence seq, int... messageNumbers) {
        SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
        int i = 0;
        while (i < messageNumbers.length) {
            AcknowledgementRange r = factory.createSequenceAcknowledgementAcknowledgementRange();
            Integer li = new Integer(messageNumbers[i]);
            BigInteger l = new BigInteger(li.toString());
            r.setLower(l);
            i++;
           
            while (i < messageNumbers.length && (messageNumbers[i] - messageNumbers[i - 1]) == 1) {
                i++;
            }
            Integer ui = new Integer(messageNumbers[i - 1]);
            BigInteger u = new BigInteger(ui.toString());
            r.setUpper(u);
            ack.getAcknowledgementRange().add(r);
        }
        seq.setAcknowledged(ack);
    }
View Full Code Here

       
        control.reset();
  
        ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
        ack.setIdentifier(sid1);
        AcknowledgementRange range =
            RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();

        range.setLower(BigInteger.ONE);
        range.setUpper(BigInteger.TEN);
        ack.getAcknowledgementRange().add(range);
       
        RMProxy proxy = control.createMock(RMProxy.class);   
        handler.getProxy();
        expectLastCall().andReturn(proxy);
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.ws.rm.SequenceAcknowledgement.AcknowledgementRange

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.