Examples of MSG


Examples of org.xmlBlaster.test.Msg

      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

Examples of org.xmlBlaster.test.Msg

      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

Examples of zmq.Msg

        //  Earliest offset
        sock.sendMore("OFFSET");
        sock.send(ByteBuffer.allocate(8).putLong(-2).array());

        Msg status = sock.base().recv(0);
        assertTrue(status.hasMore());
        assertEquals(100, status.data()[0]);

        Msg oldest = sock.base().recv(0);
        assertFalse(oldest.hasMore());
        assertEquals(infos[0].start(), oldest.buf().getLong());

        //  Latest offset
        sock.sendMore("OFFSET");
        sock.send(ByteBuffer.allocate(8).putLong(-1).array());

        status = sock.base().recv(0);
        assertTrue(status.hasMore());
        assertEquals(100, status.data()[0]);

        Msg latest = sock.base().recv(0);
        assertTrue(latest.hasMore());
        assertEquals(infos[infos.length - 1].start(), latest.buf().getLong());

        Msg last = sock.base().recv(0);
        assertFalse(last.hasMore());
        assertEquals(infos[infos.length - 1].offset(), last.buf().getLong());

        //  Modified before
        sock.sendMore("OFFSET");
        sock.send(ByteBuffer.allocate(8).putLong(System.currentTimeMillis()).array());

        status = sock.base().recv(0);
        assertTrue(status.hasMore());
        assertEquals(100, status.data()[0]);

        List<Long> offsetList = new ArrayList<Long>();

        while (true) {
            Msg msg = sock.base().recv(0);
            offsetList.add(msg.buf().getLong());
            if (!msg.hasMore())
                break;
        }
        assertEquals(infos.length + 1, offsetList.size());
        for (int i = 0; i < infos.length; i++) {
            assertEquals(infos[i].start(), (long) offsetList.get(i));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.