Package org.apache.sandesha2.client

Examples of org.apache.sandesha2.client.SequenceReport


    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
            //testing outgoing sequence reports
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
        assertTrue(sequenceReport.getCompletedMessages().contains(new Long(2)));
        assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_ESTABLISHED);
        assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
       
        //testing incoming sequence reports
        List incomingSequenceReports = SandeshaClient.getIncomingSequenceReports(configContext);
        assertEquals(incomingSequenceReports.size(),1);
        SequenceReport incomingSequenceReport = (SequenceReport) incomingSequenceReports.get(0);
        assertEquals(incomingSequenceReport.getCompletedMessages().size(),2);
        assertNotNull(incomingSequenceReport.getSequenceID());
        assertEquals(incomingSequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_IN);
        assertNotNull(incomingSequenceReport.getInternalSequenceID());
       
        assertEquals(incomingSequenceReport.getSequenceID(),incomingSequenceReport.getInternalSequenceID())//for the incoming side, internalSequenceID==sequenceID

        lastError = null;
        break;
      } catch(Error e) {
        lastError = e;
      }
    }
    if(lastError != null) throw lastError;

    SandeshaClient.terminateSequence(serviceClient, sequenceKey);
    SandeshaClient.waitUntilSequenceCompleted(serviceClient, sequenceKey);
   
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
   
    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here


      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
        SandeshaReport rmReport = SandeshaClient.getSandeshaReport(configContext);
       
         SequenceReport sequence1Report = null;
         SequenceReport sequence2Report = null;
        
         Iterator iterator = rmReport.getOutgoingSequenceList().iterator();
         while (iterator.hasNext()) {
           String sequenceID = (String) iterator.next();
          
            String internalSequenceID = rmReport.getInternalSequenceIdOfOutSequence(sequenceID);
           
            if (internalSequenceID.indexOf(sequenceKey1)>=0) {
              sequence1Report = SandeshaClient.getOutgoingSequenceReport(to,sequenceKey1,configContext);
            } else if (internalSequenceID.indexOf(sequenceKey2)>=0){
              sequence2Report = SandeshaClient.getOutgoingSequenceReport(to,sequenceKey2,configContext);
            }
         }
        
         assertNotNull(sequence1Report);
         assertNotNull(sequence2Report);
        
         assertEquals(sequence1Report.getCompletedMessages().size(),2);
         assertEquals(sequence2Report.getCompletedMessages().size(),1);
        
         assertEquals(sequence1Report.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
         assertEquals(sequence2Report.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_ESTABLISHED)

        lastError = null;
        break;
      } catch(Error e) {
        lastError = e;
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(15000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(15000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.MESSAGE_NUMBER,new Long(3));
    serviceClient.fireAndForget(getPingOMBlock("ping3"));
   
    boolean complete = false;
    while (!complete) {
      SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==2)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

      Thread.sleep(30000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
   
    serviceClient.finalizeInvoke();
  }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.client.SequenceReport

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.