Package org.objectweb.celtix.ws.rm.persistence

Examples of org.objectweb.celtix.ws.rm.persistence.RMMessage


      
    }
   
    public void testCreateDeleteMessages() throws IOException, SQLException  {
        IMocksControl control = EasyMock.createNiceControl();
        RMMessage msg = control.createMock(RMMessage.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EasyMock.expect(msg.getMessageNr()).andReturn(BigInteger.ONE).times(2);
        InputStream is = new ByteArrayInputStream(new byte[89]);
        EasyMock.expect(msg.getContextAsStream()).andReturn(is).times(2);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
        store.commit();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg.getMessageNr()).andReturn(BigInteger.ONE);
        EasyMock.expect(msg.getContextAsStream()).andReturn(is);
       
        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.getMessageNr()).andReturn(BigInteger.TEN).times(2);
        EasyMock.expect(msg.getContextAsStream()).andReturn(is).times(2);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
View Full Code Here


    }
   
    public void setupMessage(Identifier sid, BigInteger mn, boolean outbound)
        throws IOException, SQLException, SOAPException  {
        IMocksControl control = EasyMock.createNiceControl();
        RMMessage msg = control.createMock(RMMessage.class);
        EasyMock.expect(msg.getMessageNr()).andReturn(mn);
             
        MessageContext ctx = new GenericMessageContext();
        ctx.put("a", "astring");
        ctx.put("b", Boolean.TRUE);
        ctx.put("c", new Integer(Integer.MIN_VALUE));
        ctx.put("d", mn);
        ctx.put("e", this);
        InputStream mis = RMHandlerTest.class.getResourceAsStream("resources/GreetMeDocLiteralRequest.xml");
        SOAPBindingImpl binding = new SOAPBindingImpl(false);
        SOAPMessage smsg = binding.getMessageFactory().createMessage(null, mis);
        ctx.put(SOAP_MSG_KEY, smsg);
        InputStream cis = RMUtils.getPersistenceUtils().getContextAsInputStream(ctx);
        EasyMock.expect(msg.getContextAsStream()).andReturn(cis);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid, msg, outbound);       
        store.commit();
View Full Code Here

        SequenceType seq = control.createMock(SequenceType.class);
        Identifier sid = control.createMock(Identifier.class);
        rmps.setSequence(seq);
        RMContextUtils.storeRMProperties(ctx, rmps, true);  
        SourceSequence ss = control.createMock(SourceSequence.class);
        RMMessage msg = control.createMock(RMMessage.class);
        AbstractClientBinding binding = control.createMock(AbstractClientBinding.class);
        handler.getBinding();
        expectLastCall().andReturn(binding);
        ObjectMessageContext clonedCtx =  new ObjectMessageContextImpl();
        binding.createObjectContext();
        expectLastCall().andReturn(clonedCtx);
        msg.getContext();       
        expectLastCall().andReturn(ctx);
        seq.getIdentifier();
        expectLastCall().andReturn(sid);
        RMStore store = control.createMock(RMStore.class);
        handler.getStore();
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.ws.rm.persistence.RMMessage

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.