Examples of RMMessage


Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();
       
        control.reset();
        setUpEndpointForRecovery(endpoint, ei, si, bi, ii)
        RMMessage m = control.createMock(RMMessage.class);
        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, m);       
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();       
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

            while (res.next()) {
                BigInteger mn = res.getBigDecimal(1).toBigInteger();
                String to = res.getString(2);
                Blob blob = res.getBlob(3);
                byte[] bytes = blob.getBytes(1, (int)blob.length());    
                RMMessage msg = new RMMessage();
                msg.setMessageNumber(mn);
                msg.setTo(to);
                msg.setContent(bytes);
                msgs.add(msg);               
            }           
        } catch (SQLException ex) {
            LOG.log(Level.WARNING, new Message(outbound ? "SELECT_OUTBOUND_MSGS_FAILED_MSG"
                : "SELECT_INBOUND_MSGS_FAILED_MSG", LOG).toString(), ex);
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        if (null != store) {
            Source s = manager.getSource(message);
            RMProperties rmps = RMContextUtils.retrieveRMProperties(message, true);
            Identifier sid = rmps.getSequence().getIdentifier();
            SourceSequence ss = s.getSequence(sid);
            RMMessage msg = new RMMessage();
            msg.setMessageNumber(rmps.getSequence().getMessageNumber());
            if (!MessageUtils.isRequestor(message)) {
                AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, true);
                if (null != maps && null != maps.getTo()) {
                    msg.setTo(maps.getTo().getValue());
                }
            }
            msg.setContent(bytes);
            store.persistOutgoing(ss, msg);
        }
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();
       
        control.reset();
        setUpEndpointForRecovery(endpoint, ei, si, bi, ii)
        RMMessage m = control.createMock(RMMessage.class);
        setUpRecoverReliableEndpoint(endpoint, conduit, ss, m);       
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();       
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();
       
        control.reset();
        setUpEndpointForRecovery(endpoint, ei, si, bi, ii)
        RMMessage m = control.createMock(RMMessage.class);
        Capture<Message> mc = new Capture<Message>();
        setUpRecoverReliableEndpoint(endpoint, conduit, ss, ds, m, mc);       
        control.replay();
        manager.recoverReliableEndpoint(endpoint, conduit);
        control.verify();
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        store.removeDestinationSequence(sid2);       
    }
   
    @Test
    public void testCreateDeleteMessages() throws IOException, SQLException  {
        RMMessage msg1 = control.createMock(RMMessage.class);
        RMMessage msg2 = control.createMock(RMMessage.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
       
        EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE).anyTimes();
        EasyMock.expect(msg2.getMessageNumber()).andReturn(ONE).anyTimes();
        byte[] bytes = new byte[89];
        EasyMock.expect(msg1.getContent()).andReturn(new ByteArrayInputStream(bytes)).anyTimes();
        EasyMock.expect(msg2.getContent()).andReturn(new ByteArrayInputStream(bytes)).anyTimes();
        EasyMock.expect(msg1.getAttachments()).andReturn(new ArrayList<InputStream>()).anyTimes();
        EasyMock.expect(msg2.getAttachments()).andReturn(new ArrayList<InputStream>()).anyTimes();
       
        control.replay();

        Connection con = getConnection();
        try {
            store.beginTransaction();
            store.storeMessage(con, sid1, msg1, true);
            store.storeMessage(con, sid1, msg2, false);
            store.commit(con);
        } finally {
            releaseConnection(con);
        }
       
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE);
        EasyMock.expect(msg1.getContent()).andReturn(new ByteArrayInputStream(bytes));
       
        control.replay();
        con = getConnection();
        try {
            store.beginTransaction();
            store.storeMessage(con, sid1, msg1, true);
        } catch (SQLException ex) {
            assertEquals("23505", ex.getSQLState());
            store.abort(con);
        } finally {
            releaseConnection(con);
        }
       
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(TEN).anyTimes();
        EasyMock.expect(msg2.getMessageNumber()).andReturn(TEN).anyTimes();
        EasyMock.expect(msg1.getContent()).andReturn(new ByteArrayInputStream(bytes)).anyTimes();
        EasyMock.expect(msg2.getContent()).andReturn(new ByteArrayInputStream(bytes)).anyTimes();
        EasyMock.expect(msg1.getAttachments()).andReturn(new ArrayList<InputStream>()).anyTimes();
        EasyMock.expect(msg2.getAttachments()).andReturn(new ArrayList<InputStream>()).anyTimes();
       
        control.replay();
        con = getConnection();
        try {
            store.beginTransaction();
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        }
    }
   
    private void setupMessage(Identifier sid, Long mn, String to, boolean outbound)
        throws IOException, SQLException  {
        RMMessage msg = createRMMessage(mn, to);
       
        control.replay();
        Connection con = getConnection();
        try {
            store.beginTransaction();
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        control.reset();
    }

    private void setupOutboundMessage(SourceSequence seq, long mn, String to)
        throws IOException, SQLException  {
        RMMessage msg = createRMMessage(ONE, to);
        control.replay();
        store.persistOutgoing(seq, msg);
        control.reset();
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        control.reset();
    }

    private void setupInboundMessage(DestinationSequence seq, long mn, String to)
        throws IOException, SQLException  {
        RMMessage msg = createRMMessage(ONE, to);
        control.replay();
        store.persistIncoming(seq, msg);
        control.reset();
    }
View Full Code Here

Examples of org.apache.cxf.ws.rm.persistence.RMMessage

        store.persistIncoming(seq, msg);
        control.reset();
    }
   
    private RMMessage createRMMessage(Long mn, String to) throws IOException {
        RMMessage msg = control.createMock(RMMessage.class);
        EasyMock.expect(msg.getMessageNumber()).andReturn(mn).anyTimes();
        EasyMock.expect(msg.getTo()).andReturn(to).anyTimes();
        EasyMock.expect(msg.getAttachments()).andReturn(new ArrayList<InputStream>()).anyTimes();
        byte[] value = ("Message " + mn.longValue()).getBytes();
        EasyMock.expect(msg.getContent()).andReturn(new ByteArrayInputStream(value)).anyTimes();
        return msg;
    }
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.