Package org.apache.sandesha2.storage.beanmanagers

Examples of org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr


        mgr.delete("CreateSeqMsgId1");
        assertNull(mgr.retrieve("CreateSeqMsgId1"));
    }

    public void testFind() throws SandeshaStorageException {
      RMSBean createSeqBean1 = new RMSBean ();
      createSeqBean1.setInternalSequenceID("TmpSeqId1");
      createSeqBean1.setCreateSeqMsgID("CreateSeqMsgId1");
      createSeqBean1.setSequenceID("SeqId1");
     
      RMSBean createSeqBean2 = new RMSBean ();
      createSeqBean2.setInternalSequenceID("TmpSeqId1");
      createSeqBean2.setCreateSeqMsgID("CreateSeqMsgId2");
      createSeqBean2.setSequenceID("SeqId2");
     
        mgr.insert(createSeqBean1);
        mgr.insert(createSeqBean2);

        RMSBean target = new RMSBean();
        target.setInternalSequenceID("TmpSeqId1");

        Iterator iter = mgr.find(target).iterator();
        RMSBean tmp = (RMSBean) iter.next();
        if (tmp.getCreateSeqMsgID().equals("CreateSeqMsgId1")) {
            tmp = (RMSBean) iter.next();
            assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId2"));

        }   else {
            tmp = (RMSBean) iter.next();
            assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId1"));
        }
    }
View Full Code Here


            assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId1"));
        }
    }

    public void testInsert() throws SandeshaStorageException{
      RMSBean rMSBean = new RMSBean ();
      rMSBean.setInternalSequenceID("TmpSeqId4");
      rMSBean.setCreateSeqMsgID("CreateSeqMsgId4");
      rMSBean.setSequenceID("SeqId4");
        mgr.insert(rMSBean);
        RMSBean tmpbean = mgr.retrieve("CreateSeqMsgId4");
        assertTrue(tmpbean.getCreateSeqMsgID().equals("CreateSeqMsgId4"));
        assertTrue(tmpbean.getSequenceID().equals("SeqId4"));
        assertTrue(tmpbean.getInternalSequenceID().equals("TmpSeqId4"));
    }
View Full Code Here


    public void testRetrieve() throws SandeshaStorageException{
        assertNull(mgr.retrieve("CreateSeqMsgId5"));

      RMSBean rMSBean = new RMSBean ();
      rMSBean.setInternalSequenceID("TmpSeqId5");
      rMSBean.setCreateSeqMsgID("CreateSeqMsgId5");
      rMSBean.setSequenceID("SeqId5");
        mgr.insert(rMSBean);
        RMSBean tmp = mgr.retrieve("CreateSeqMsgId5");
        assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId5"));
    }
View Full Code Here

        RMSBean tmp = mgr.retrieve("CreateSeqMsgId5");
        assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId5"));
    }

    public void testUpdate() throws SandeshaStorageException {
      RMSBean rMSBean = new RMSBean ();
      rMSBean.setInternalSequenceID("TmpSeqId6");
      rMSBean.setCreateSeqMsgID("CreateSeqMsgId6");
      rMSBean.setSequenceID("SeqId6");
       
        mgr.insert(rMSBean);
        rMSBean.setInternalSequenceID("TmpSeqId7");
        mgr.update(rMSBean);
        RMSBean tmp = mgr.retrieve("CreateSeqMsgId6");
        assertTrue(tmp.getInternalSequenceID().equals("TmpSeqId7"));
    }
View Full Code Here

    RMDBeanMgr rmdMgr = storageManager.getRMDBeanMgr();
    RMDBean rmdBean = rmdMgr.retrieve(sequenceId);
    String outBoundInternalSequence = rmdBean.getOutboundInternalSequence();
   
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    RMSBean findBean = new RMSBean ();
    findBean.setInternalSequenceID(outBoundInternalSequence);
    RMSBean rmsBean = rmsBeanMgr.findUnique (findBean);
   
    if (rmsBean!=null && rmsBean.getLastOutMessage()<=0) {
      //there is a RMS sequence without a LastMsg entry
     
      MessageContext msgContext = rmMsgCtx.getMessageContext();
     
      AxisOperation operation = SpecSpecificConstants.getWSRMOperation(Sandesha2Constants.MessageTypes.LAST_MESSAGE,
View Full Code Here

    rmsBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmsBean.setClientCompletedMessages(new RangeString());
    rmsBean.setNextMessageNumber(4);
    rmsBean.setHighestOutMessageNumber(3);
   
    SenderBean bean1 = getSenderBean(seqID, 1, 1);
    SenderBean bean2 = getSenderBean(seqID, 0, 2);
    SenderBean bean3 = getSenderBean(seqID, 1, 3);   

    // Create a transaction and insert the RMSBean
    Transaction tran = storageManager.getTransaction();
   
    rmsBeanMgr.insert(rmsBean);
View Full Code Here

   
    return outputStream.toByteArray();
  }
 
  private static SenderBean getSenderBean(String seqID, int sendCount, int messageNo) {
    SenderBean bean = new SenderBean();
    bean.setInternalSequenceID(SandeshaUtil.getInternalSequenceID(seqID, null))
    bean.setSequenceID(seqID);
    bean.setMessageID(SandeshaUtil.getUUID());   
    bean.setSentCount(sendCount);
    bean.setSend(true);
    bean.setReSend(true);
    bean.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
    bean.setMessageNumber(messageNo);
   
    return bean;
  }
View Full Code Here

    }

    public void testDelete() throws SandeshaStorageException {
        assertNull(mgr.retrieve(""));
        try {
            mgr.insert(new SenderBean("MsgId1", "Key1", false , 1001 , "TmpSeqId1", 1001));
        } catch (Exception ex) {
            fail("should not throw an exception");
        }
        assertNotNull(mgr.retrieve("MsgId1"));
    }
View Full Code Here

        assertNotNull(mgr.retrieve("MsgId1"));
    }

    public void testFind() {
        try {
            mgr.insert(new SenderBean("MsgId2", "Key2", false , 1001 , "TmpSeqId2", 1002));
            mgr.insert(new SenderBean("MsgId3", "Key3", false , 1001 , "TmpSeqId2", 1003));

            SenderBean target = new SenderBean();
            target.setInternalSequenceID("TmpSeqId2");

            Iterator iterator = mgr.find(target).iterator();
            SenderBean tmp = (SenderBean) iterator.next();

            if (tmp.getMessageID().equals("MsgId2")) {
                tmp = (SenderBean) iterator.next();
                assertTrue(tmp.getMessageID().equals("MsgId3"));
            } else {
                tmp = (SenderBean) iterator.next();
                assertTrue(tmp.getMessageID().equals("MsgId2"));
            }


        } catch (SandeshaException e) {
            fail("should not throw an exception");
View Full Code Here

//
//        } catch (SandeshaException ex) {
//        }

        try {
            mgr.insert(new SenderBean("MsgId4","Key4", false , 1001 , "TmpSeqId4", 1004));
            SenderBean tmp = mgr.retrieve("MsgId4");
            assertTrue(tmp.getMessageContextRefKey().equals("Key4"));


        } catch (SandeshaException e) {
            fail("should not throw an exception");
        }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr

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.