Examples of DestinationSequence


Examples of org.apache.cxf.ws.rm.DestinationSequence

                SequenceAcknowledgement ack = null;
                if (null != is) {
                    ack = PersistenceUtils.getInstance()
                        .deserialiseAcknowledgment(is);
                }
                DestinationSequence seq = new DestinationSequence(sid, acksTo,
                                                                  lm == null ? null : lm.toBigInteger(), ack);
                seqs.add(seq);                                                
            }
        } catch (SQLException ex) {
            LOG.log(Level.WARNING, new Message("SELECT_DEST_SEQ_FAILED_MSG", LOG).toString(), ex);
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

        store.removeMessages(sid2, messageNrs, true);
    }
   
    @Test
    public void testUpdateDestinationSequence() throws SQLException, IOException {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
        EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
       
        control.replay();
        store.createDestinationSequence(seq);  
        control.verify();
       
        control.reset();
        EasyMock.expect(seq.getLastMessageNumber()).andReturn(Long.valueOf(0));
        EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
       
        control.replay();
       
        Connection con = getConnection();
        try {
            store.beginTransaction();
            store.updateDestinationSequence(con, seq);
            store.abort(con);
        } finally {
            releaseConnection(con);
        }
       
        control.reset();
        EasyMock.expect(seq.getLastMessageNumber()).andReturn(TEN);
        EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
       
        control.replay();
        con = getConnection();
        try {
            store.beginTransaction();
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

    public void testGetDestinationSequence() throws SQLException, IOException {
       
        Identifier sid1 = null;
        Identifier sid2 = null;
       
        DestinationSequence seq =
            store.getDestinationSequence(new Identifier());
        assertNull(seq);

        try {
            sid1 = setupDestinationSequence("sequence1");
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

    @Test
    public void testCreateSequenceStoreInboundMessage() throws SQLException, IOException {
        Identifier sid1 = null;
        try {
            DestinationSequence seq = control.createMock(DestinationSequence.class);
            sid1 = new Identifier();
            sid1.setValue("sequence1");
            EndpointReferenceType epr = RMUtils.createAnonymousReference();
            EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
            EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
            EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
            EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
       
            control.replay();
            store.createDestinationSequence(seq);  

           
            Collection<DestinationSequence> seqs = store.getDestinationSequences(SERVER_ENDPOINT_ID);
            assertEquals(1, seqs.size());
            DestinationSequence rseq = seqs.iterator().next();
            assertFalse(rseq.isAcknowledged(1));
           
            Collection<RMMessage> in = store.getMessages(sid1, false);
            assertEquals(0, in.size());
           
            control.reset();           
            EasyMock.expect(seq.getIdentifier()).andReturn(sid1).anyTimes();
            EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);       
            EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
           
            setupInboundMessage(seq, 1L, null);
            in = store.getMessages(sid1, false);
            assertEquals(1, in.size());
            checkRecoveredMessages(in);
           
            seqs = store.getDestinationSequences(SERVER_ENDPOINT_ID);
            assertEquals(1, seqs.size());
            rseq = seqs.iterator().next();
            assertTrue(rseq.isAcknowledged(1));
            assertFalse(rseq.isAcknowledged(10));
           
            EasyMock.expect(seq.getIdentifier()).andReturn(sid1).anyTimes();
            EasyMock.expect(seq.getAcknowledgment()).andReturn(ack2);       
            EasyMock.expect(seq.getAcksTo()).andReturn(epr);       

            control.replay();
            store.persistIncoming(seq, null);
            control.reset();

            seqs = store.getDestinationSequences(SERVER_ENDPOINT_ID);
            assertEquals(1, seqs.size());
            rseq = seqs.iterator().next();
            assertTrue(rseq.isAcknowledged(10));
           
        } finally {
            if (null != sid1) {
                store.removeDestinationSequence(sid1);
            }
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

            store.removeMessages(sid1, msgNrs, false);
        }
    }

    private Identifier setupDestinationSequence(String s) throws IOException, SQLException {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
       
        Identifier sid = new Identifier();
        sid.setValue(s);
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
       
        SequenceAcknowledgement ack = ack1;
        Long lmn = ZERO;
        ProtocolVariation pv = ProtocolVariation.RM10WSA200408;
        
        if ("sequence2".equals(s)) {
            ack = ack2;
            lmn = TEN;
            pv = ProtocolVariation.RM11WSA200508;
        }
       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
        EasyMock.expect(seq.getLastMessageNumber()).andReturn(lmn);
        EasyMock.expect(seq.getAcknowledgment()).andReturn(ack);
        EasyMock.expect(seq.getIdentifier()).andReturn(sid);
        EasyMock.expect(seq.getProtocol()).andReturn(pv);

        control.replay();
        store.createDestinationSequence(seq);
        Connection con = getConnection();
        try {
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

        store.removeSourceSequence(sid2);      
    }
   
    @Test
    public void testCreateDeleteDestSequences() {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
        EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);

        control.replay();
        store.createDestinationSequence(seq);  
        control.verify();
       
        control.reset();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
        EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
       
        control.replay();
        try {
            store.createDestinationSequence(seq)
            fail("Expected RMStoreException was not thrown.");
        } catch (RMStoreException ex) {
            SQLException se = (SQLException)ex.getCause();
            // duplicate key value
            assertEquals("23505", se.getSQLState());
        }
        control.verify();
       
        control.reset();
        Identifier sid2 = new Identifier();
        sid2.setValue("sequence2");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid2);
        epr = RMUtils.createReference(NON_ANON_ACKS_TO);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
        EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
       
        control.replay();
        store.createDestinationSequence(seq);  
        control.verify();
           
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

                SequenceAcknowledgement ack = null;
                if (null != is) {
                    ack = PersistenceUtils.getInstance()
                        .deserialiseAcknowledgment(is);
                }
                return new DestinationSequence(sid, acksTo, lm, ack, pv);
            }
        } catch (SQLException ex) {
            conex = ex;
            LOG.log(Level.WARNING, new Message("SELECT_DEST_SEQ_FAILED_MSG", LOG).toString(), ex);
        } finally {
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

                SequenceAcknowledgement ack = null;
                if (null != is) {
                    ack = PersistenceUtils.getInstance()
                        .deserialiseAcknowledgment(is);
                }
                DestinationSequence seq = new DestinationSequence(sid, acksTo, lm, ack, pv);
                seqs.add(seq);                                                
            }
        } catch (SQLException ex) {
            conex = ex;
            LOG.log(Level.WARNING, new Message("SELECT_DEST_SEQ_FAILED_MSG", LOG).toString(), ex);
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

        store.removeSourceSequence(sid2);      
    }
   
    @Test
    public void testCreateDeleteDestSequences() {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
        control.replay();
        store.createDestinationSequence(seq);  
        control.verify();
       
        control.reset();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
        control.replay();
        try {
            store.createDestinationSequence(seq)
            fail("Expected RMStoreException was not thrown.");
        } catch (RMStoreException ex) {
            SQLException se = (SQLException)ex.getCause();
            // duplicate key value
            assertEquals("23505", se.getSQLState());
        }
        control.verify();
       
        control.reset();
        Identifier sid2 = new Identifier();
        sid2.setValue("sequence2");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid2);
        epr = RMUtils.createReference(NON_ANON_ACKS_TO);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
       
        control.replay();
        store.createDestinationSequence(seq);  
        control.verify();
           
View Full Code Here

Examples of org.apache.cxf.ws.rm.DestinationSequence

        store.removeMessages(sid2, messageNrs, true);
    }
   
    @Test
    public void testUpdateDestinationSequence() throws SQLException, IOException {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
        control.replay();
        store.createDestinationSequence(seq);  
        control.verify();
       
        control.reset();
        EasyMock.expect(seq.getLastMessageNumber()).andReturn(null);
        EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
       
        control.replay();
        store.beginTransaction();
        store.updateDestinationSequence(seq);
        store.abort();
       
        control.reset();
        EasyMock.expect(seq.getLastMessageNumber()).andReturn(TEN);
        EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
       
        control.replay();
        store.beginTransaction();
        store.updateDestinationSequence(seq);
        store.abort();
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.