Package org.apache.sandesha2.client

Examples of org.apache.sandesha2.client.SequenceReport


       
        Thread.sleep(10000);
   
        //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_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
   
    //testing incoming sequence reports
    ArrayList 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);
    assertEquals(incomingSequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertNotNull(incomingSequenceReport.getInternalSequenceID());
   
    assertEquals(incomingSequenceReport.getSequenceID(),incomingSequenceReport.getInternalSequenceID())//for the incoming side, internalSequenceID==sequenceID
   
    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here


    }
   
   
    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)
 
    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here

      Thread.sleep(10000);
    } 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);

    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping1"));
   
    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);
 

    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getTestOperationOMBlock("ping2"));
   
    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(2)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here

    serviceClient.fireAndForget(getPingOMBlock("ping2"));
   
   
    Thread.sleep(10000);
 
    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_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here

   
       
        Thread.sleep(10000);
   
        //assertions for the out sequence.
    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);
   
    assertEquals(callback1.getResult(),"echo1");
   
    configContext.getListenerManager().stop();
    serviceClient.cleanup();
View Full Code Here

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

   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");

    serviceClient.fireAndForget(getPingOMBlock("ping3"));
   
    SequenceReport sequenceReport = null;
     
    boolean complete = false;
    while (!complete) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e) {
View Full Code Here

    if (messageContext != null) {
      SandeshaListener listener = (SandeshaListener) messageContext
          .getProperty(SandeshaClientConstants.SANDESHA_LISTENER);
      if (listener != null) {
        SequenceReport report = SandeshaClient.getOutgoingSequenceReport(internalSequenceID, configurationContext, false);
        listener.onTimeOut(report);
      }
    }
  }
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.