Package org.xmlBlaster.test

Examples of org.xmlBlaster.test.Msg


      for(int i=0; i<n; i++) {
         log.info("TEST " + (i+1) + " - publishing 5 messages, expecting No.3");
         doPublish();
         assertEquals("numReceived after publishing", 1, this.updateInterceptor.waitOnUpdate(2000L, "3", Constants.STATE_OK));
         assertEquals("", 1, this.updateInterceptor.getMsgs().length);
         Msg msg = this.updateInterceptor.getMsgs()[0];
         assertEquals("Corrupt content", senderName, msg.getUpdateQos().getSender().getLoginName());
         assertEquals("Corrupt content", "Content: message_3", msg.getContentStr());
         assertEquals("Message contentMime is corrupted", contentMime, msg.getUpdateKey().getContentMime());
         assertEquals("engine.qos.update.subscriptionId: Wrong subscriptionId", subscribeOid, msg.getUpdateQos().getSubscriptionId());
         this.updateInterceptor.clear();
      }

      String xmlKey = "<key oid='' queryType='XPATH'>\n" +
                      "   /xmlBlaster/key/AGENT" +
View Full Code Here


                  assertEquals(text, 1, this.update.waitOnUpdate(sleep, msgOid, Constants.STATE_OK));
                  int count = expectsNotify ? 2 : 1;
                  assertEquals(text, count, this.update.count());
                  if (expectsNotify) {
                     String expectedState = "send,notifySender";
                     Msg msg = this.update.getMsg(msgOid, expectedState); // PtP notification
                     assertTrue("send,notifySender PtP not arrived", msg != null);
                  }
               }
               else if (action.startsWith("queue")) {
                  publish(msgOid, priority);
View Full Code Here

                     log.info("Receiving update of a message oid=" + updateKey.getOid() +
                         " priority=" + updateQos.getPriority() +
                         " state=" + updateQos.getState() +
                         " content=" + cont);
                     if (!updateQos.isErased()) {
                        updateMsgs.add(new Msg(cbSessionId, updateKey, content, updateQos));
                     }
                  }
                  catch (Throwable e) {
                     log.severe("Error in update method: " + e.toString());
                     e.printStackTrace();
View Full Code Here

      assertEquals("numReceived after subscribe", 0, this.updateInterceptor.waitOnUpdate(1000L, 0)); // no message arrived?
     
      {
         publish();
         assertEquals("numReceived after sending", 1, this.updateInterceptor.waitOnUpdate(1500L, oidExact, Constants.STATE_OK, 1));
         Msg msg = this.updateInterceptor.getMsg(oidExact, Constants.STATE_OK);
         assertTrue("Wrong update state", msg.getUpdateQos().isOk());

         msg.compareMsg(msgUnit);
         assertEquals("Message contentMime is corrupted", contentMime, msg.getUpdateKey().getContentMime());

         this.updateInterceptor.clear();
      }

      {
         this.updateInterceptor.countErased(true);
         erase();
         assertEquals("erase event is missing", 1, this.updateInterceptor.waitOnUpdate(2500L, oidExact, Constants.STATE_ERASED, 1));
         Msg msg = this.updateInterceptor.getMsg(oidExact, Constants.STATE_ERASED);
         assertEquals("wrong subscriptionId expected=" + subscribeId, subscribeId, msg.getUpdateQos().getSubscriptionId());
         assertTrue("wrong update state", msg.getUpdateQos().isErased());
        
         this.updateInterceptor.clear();
      }

      log.info("testEraseEvent SUCCESS");
View Full Code Here

      assertEquals("numReceived after subscribe", 0, this.updateInterceptor.waitOnUpdate(1000L, 0)); // no message arrived?

      {
         publish();
         assertEquals("numReceived after sending", 1, this.updateInterceptor.waitOnUpdate(1500L, oidExact, Constants.STATE_OK, 1));
         Msg msg = this.updateInterceptor.getMsg(oidExact, Constants.STATE_OK);
         assertTrue("Wrong update state", msg.getUpdateQos().isOk());

         msg.compareMsg(msgUnit);
         assertEquals("Message contentMime is corrupted", contentMime, msg.getUpdateKey().getContentMime());

         this.updateInterceptor.clear();
      }

      {
         log.info("Erasing now ...");
         this.updateInterceptor.countErased(true);

         erase();
         assertEquals("erase event is missing", 1, this.updateInterceptor.waitOnUpdate(2500L, oidExact, Constants.STATE_ERASED, 1));
         Msg msg = this.updateInterceptor.getMsg(oidExact, Constants.STATE_ERASED);
         assertEquals("wrong subscriptionId expected=" + subscribeId, subscribeId, msg.getUpdateQos().getSubscriptionId());
         assertTrue("wrong update state", msg.getUpdateQos().isErased());
        
         this.updateInterceptor.clear();
      }

      log.info("testXPathEraseEvent SUCCESS");
View Full Code Here

      assertEquals("", 1, this.updateInterceptor.waitOnUpdate(2000L, publishOid, Constants.STATE_OK));
      //this.updateInterceptor.compareToReceived(sentArr, null);
      //this.updateInterceptor.compareToReceived(sentQos);

      Msg msg = this.updateInterceptor.getMsgs()[0];

      assertEquals("Wrong sender", senderName, msg.getUpdateQos().getSender().getLoginName());
      assertEquals("Wrong oid of message returned", publishOid, msg.getUpdateKey().getOid());
      assertEquals("Wrong mime of message returned", "text/plain", msg.getUpdateKey().getContentMime());
      assertEquals("Wrong extended mime of message returned", "2.0", msg.getUpdateKey().getContentMimeExtended());
      assertEquals("Wrong domain of message returned", "RUGBY", msg.getUpdateKey().getDomain());
      assertEquals("Message content is corrupted", new String(senderContent), msg.getContentStr());

      this.updateInterceptor.clear();
      //checkContent(true);
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.test.Msg

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.