Package org.apache.sandesha2.security

Examples of org.apache.sandesha2.security.SecurityToken


        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


    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

    }

    public void testRetrieve() throws SandeshaStorageException {
        assertNull(mgr.retrieve("MsgId5"));
        try {
            mgr.insert(new SenderBean("MsgId5", "Key5", false , 1001 , "TmpSeqId5", 1005));
        } catch (SandeshaException e) {
            fail("this should not throw an exception");
        }
        assertNotNull(mgr.retrieve("MsgId5"));
    }
View Full Code Here

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

    public void testUpdate() throws SandeshaStorageException {
        SenderBean bean = new SenderBean("MsgId6", "Key6", false , 1001 , "TmpSeqId6", 1006);
        try {
            mgr.insert(bean);
        } catch (SandeshaException e) {
            fail("should not throw an exception");
        }
        bean.setSend(true);
        mgr.update(bean);

        SenderBean tmp = mgr.retrieve("MsgId6");
        assertTrue(tmp.isSend());
    }
View Full Code Here

     
      //setting a dummy property been to stop Sandesha2 from throwing exceptions.
      SandeshaPolicyBean policyBean = new SandeshaPolicyBean ();
      axisConfiguration.addParameter(new Parameter (Sandesha2Constants.SANDESHA_PROPERTY_BEAN,policyBean));
     
      InMemoryStorageManager storageManager = new InMemoryStorageManager (configurationContext);
     
      Transaction transaction = storageManager.getTransaction();
     
      RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
     
      RMSBean rmsBean = new RMSBean ();
      RMSBean duplicateRMSBean = new RMSBean ();
     
      rmsBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
View Full Code Here

    rmdBean.setSequenceID(seqID);
    rmdBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setReplyToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmdBean.setServerCompletedMessages(new RangeString());
    // Flag that the sequence is closed.
    rmdBean.setClosed(true);
   
    // Create a transaction and insert the RMSBean
    Transaction tran = storageManager.getTransaction();
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.security.SecurityToken

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.