Package org.apache.sandesha2.client

Examples of org.apache.sandesha2.client.SequenceReport


    {
      timeNow = System.currentTimeMillis();

      try
      {                             
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
       
        if (sequenceReport.getCompletedMessages().contains(highestOutMsgKey))
          complete = true;
        else
          Thread.sleep(tickTime);
 
      }
View Full Code Here


    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
        //Check that the outgoing sequence is terminated
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
        assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
       
        lastError = null;
        break;
      } catch(Error e) {
        lastError = e;
View Full Code Here

    serviceClient.setOptions(clientOptions);
   
    serviceClient.fireAndForget(getPingOMBlock("echo1"));
   
    //assertions for the out sequence.
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().isEmpty());
   
    //assertions for the in sequence
    List inboundReports = SandeshaClient.getIncomingSequenceReports(configContext);
    assertTrue(inboundReports.isEmpty());
   
View Full Code Here

    // Check the response
    String echoStr = checkEchoOMBlock(result);
    assertEquals(echoStr, "echo1");
   
    //assertions for the out sequence.
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().isEmpty());
   
    //assertions for the in sequence
    List inboundReports = SandeshaClient.getIncomingSequenceReports(configContext);
    assertTrue(inboundReports.isEmpty());
   
View Full Code Here

    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
        //assertions for the out sequence.
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        assertTrue(sequenceReport.getCompletedMessages().isEmpty());
       
        assertTrue(callback1.isComplete());
        assertEquals(callback1.getResult(),"echo1");
       
        //assertions for the in sequence
View Full Code Here

    Error lastError = null;
    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        //System.out.println("Checking Outbound Sequence: " + sequenceReport.getSequenceID());
        assertTrue("Checking completed messages", sequenceReport.getCompletedMessages().contains(new Long(1)));
        assertEquals("Checking sequence terminated", SequenceReport.SEQUENCE_STATUS_TERMINATED, sequenceReport.getSequenceStatus());
        assertEquals("Checking sequence direction", SequenceReport.SEQUENCE_DIRECTION_OUT, sequenceReport.getSequenceDirection());

        lastError = null;
        break;
      } catch(Error e) {
        //System.out.println("Possible error:" + e);
View Full Code Here

      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
       
            //assertions for the out sequence.
        SequenceReport outgoingSequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        //System.out.println("Checking Outbound Sequence: " + outgoingSequenceReport.getSequenceID());
        assertTrue("Outbound message #1", outgoingSequenceReport.getCompletedMessages().contains(new Long(1)));
        assertTrue("Outbound message #2", outgoingSequenceReport.getCompletedMessages().contains(new Long(2)));
        assertTrue("Outbound message #3", outgoingSequenceReport.getCompletedMessages().contains(new Long(3)));
        assertEquals("Outbound sequence status: TERMINATED", SequenceReport.SEQUENCE_STATUS_TERMINATED, outgoingSequenceReport.getSequenceStatus());
        assertEquals("Outbound sequence direction: OUT", SequenceReport.SEQUENCE_DIRECTION_OUT, outgoingSequenceReport.getSequenceDirection());
       
        //assertions for the inbound sequence. The one we care about is a new sequence,
        //so it will not exist in the oldSequences list.
        List incomingSequences = SandeshaClient.getIncomingSequenceReports(configContext);
        SequenceReport incomingSequenceReport = getNewReport(incomingSequences, oldIncomingReports);
        //System.out.println("Checking Inbound Sequence: " + incomingSequenceReport.getSequenceID());
        String offer = (String) clientOptions.getProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID);
        if(offer != null) assertEquals("Inbound seq id", offer, incomingSequenceReport.getSequenceID());
        assertEquals ("Inbound message count", 3, incomingSequenceReport.getCompletedMessages().size());
        assertTrue("Inbound message #1", incomingSequenceReport.getCompletedMessages().contains(new Long(1)));
        assertTrue("Inbound message #2", incomingSequenceReport.getCompletedMessages().contains(new Long(2)));
        assertTrue("Inbound message #3", incomingSequenceReport.getCompletedMessages().contains(new Long(3)));
       
        if (checkInboundTermination)
          assertEquals("Inbound sequence status: TERMINATED", SequenceReport.SEQUENCE_STATUS_TERMINATED, incomingSequenceReport.getSequenceStatus());
       
        assertEquals("Inbound sequence direction: IN", SequenceReport.SEQUENCE_DIRECTION_IN, incomingSequenceReport.getSequenceDirection());
       
        assertTrue("Callback #1", callback1.isComplete());
        assertEquals("Callback #1 data", "echo1", callback1.getResult());
       
        assertTrue("Callback #2", callback2.isComplete());
View Full Code Here

  // Scan through lists of old and new incoming sequences, to find the sequence that
  // was established by this test. Note that some of the old sequences may have timed out.
  private SequenceReport getNewReport(List incomingSequences, List oldIncomingReports) {
    HashSet sequenceIds = new HashSet();
    for(Iterator oldSequences = oldIncomingReports.iterator(); oldSequences.hasNext(); ) {
      SequenceReport report = (SequenceReport) oldSequences.next();
      sequenceIds.add(report.getSequenceID());
    }
    for(Iterator currentSequences = incomingSequences.iterator(); currentSequences.hasNext(); ) {
      SequenceReport report = (SequenceReport) currentSequences.next();
      if(!sequenceIds.contains(report.getSequenceID())) {
        return report;
      }
    }
    throw new AssertionFailedError("Failed to find a new reply sequence");
  }
View Full Code Here

    serviceClient.fireAndForget(getPingOMBlock("ping2"));
   
    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

    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

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.