Examples of RMMessage


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

        store.removeDestinationSequence(sid2);       
    }
   
    @Test
    public void testCreateDeleteMessages() throws IOException, SQLException  {
        RMMessage msg = control.createMock(RMMessage.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EasyMock.expect(msg.getMessageNumber()).andReturn(ONE).times(2);
        byte[] bytes = new byte[89];
        EasyMock.expect(msg.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg.getSize()).andReturn(bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
        store.commit();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg.getMessageNumber()).andReturn(ONE);
        EasyMock.expect(msg.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg.getSize()).andReturn(bytes.length);
       
        control.replay();
        store.beginTransaction();
        try {
            store.storeMessage(sid1, msg, true);
        } catch (SQLException ex) {
            assertEquals("23505", ex.getSQLState());
        }
        store.abort();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg.getMessageNumber()).andReturn(TEN).times(2);
        EasyMock.expect(msg.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg.getSize()).andReturn(bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
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 = control.createMock(RMMessage.class);
        EasyMock.expect(msg.getMessageNumber()).andReturn(mn);
        EasyMock.expect(msg.getTo()).andReturn(to);
        byte[] value = ("Message " + mn.longValue()).getBytes();
        EasyMock.expect(msg.getInputStream()).andReturn(new ByteArrayInputStream(value));
        EasyMock.expect(msg.getSize()).andReturn(value.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid, msg, outbound);       
        store.commit();
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

            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

            ResultSet res = stmt.executeQuery();
            while (res.next()) {
                long mn = res.getLong(1);
                String to = res.getString(2);
                Blob blob = res.getBlob(3);
                RMMessage msg = new RMMessage();
                msg.setMessageNumber(mn);
                msg.setTo(to);
                msg.setContent(blob.getBinaryStream());
                msgs.add(msg);               
            }           
        } catch (Exception 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

            throw sff.createUnknownSequenceFault(sequenceType.getIdentifier());
        }

        RMStore store = getReliableEndpoint().getManager().getStore();
        if (null != store) {
            RMMessage msg = null;
            if (!MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY))) {
                msg = new RMMessage();
                msg.setContent((CachedOutputStream)message.get(RMMessageConstants.SAVED_CONTENT));
                msg.setMessageNumber(sequenceType.getMessageNumber());
            }
            store.persistIncoming(seq, msg);
        }

    }
View Full Code Here

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

        RMStore store = getReliableEndpoint().getManager().getStore();
        if (null != store) {
            CachedOutputStream saved =
                (CachedOutputStream)message.get(RMMessageConstants.SAVED_CONTENT);
            RMMessage msg = new RMMessage();
            msg.setMessageNumber(sequenceType.getMessageNumber());
            msg.setContent(saved);
            store.persistIncoming(seq, msg);
        }

    }
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);
        EasyMock.expect(msg2.getMessageNumber()).andReturn(ONE);
        byte[] bytes = new byte[89];
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
        EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg1, true);
        store.storeMessage(sid1, msg2, false);
        store.commit();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE);
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        try {
            store.storeMessage(sid1, msg1, true);
        } catch (SQLException ex) {
            assertEquals("23505", ex.getSQLState());
        }
        store.abort();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(TEN);
        EasyMock.expect(msg2.getMessageNumber()).andReturn(TEN);
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
        EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg1, true);
        store.storeMessage(sid1, msg2, false);
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 = control.createMock(RMMessage.class);
        EasyMock.expect(msg.getMessageNumber()).andReturn(mn);
        EasyMock.expect(msg.getTo()).andReturn(to);
        byte[] value = ("Message " + mn.longValue()).getBytes();
        EasyMock.expect(msg.getInputStream()).andReturn(new ByteArrayInputStream(value));
        EasyMock.expect(msg.getSize()).andReturn((long)value.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid, msg, outbound);       
        store.commit();
View Full Code Here

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

            ResultSet res = stmt.executeQuery();
            while (res.next()) {
                long mn = res.getLong(1);
                String to = res.getString(2);
                Blob blob = res.getBlob(3);
                RMMessage msg = new RMMessage();
                msg.setMessageNumber(mn);
                msg.setTo(to);
                msg.setContent(blob.getBinaryStream());
                msgs.add(msg);               
            }           
        } catch (Exception 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
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.