Examples of SamplePojo


Examples of org.apache.activemq.util.xstream.SamplePojo

        // send a message
        Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer producer = producerSession.createProducer(destination);

        ObjectMessage request = producerSession.createObjectMessage(new SamplePojo("James", "London"));
        producer.send(request);

        // lets consume it as an object message
        Message message = objectConsumer.receive(timeout);
        assertNotNull("Should have received a message!", message);
        assertTrue("Should be an ObjectMessage but was: " + message, message instanceof ObjectMessage);
        ObjectMessage objectMessage = (ObjectMessage)message;
        Object object = objectMessage.getObject();
        assertTrue("object payload of wrong type: " + object, object instanceof SamplePojo);
        SamplePojo body = (SamplePojo)object;
        assertEquals("name", "James", body.getName());
        assertEquals("city", "London", body.getCity());

        // lets consume it as a text message
        message = textConsumer.receive(timeout);
        assertNotNull("Should have received a message!", message);
        assertTrue("Should be a TextMessage but was: " + message, message instanceof TextMessage);
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      // inject InvocationContext
      cache.getInvocationContext().setTransaction(tx);
      cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx, true));

      SamplePojo pojo = new SamplePojo(21, "test");
      Map<Object, Object> temp = new HashMap<Object, Object>();
      temp.put("key1", pojo);
      cache.put("/one/two", temp);

      assertEquals(null, dummy.getCalledCommand());
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      // inject InvocationContext
      cache.getInvocationContext().setTransaction(tx);
      cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx, true));

      SamplePojo pojo = new SamplePojo(21, "test");
      Map<Object, Object> temp = new HashMap<Object, Object>();
      temp.put("key1", pojo);
      cache.put("/one/two", temp);

      assertEquals(null, dummy.getCalledCommand());
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      // inject InvocationContext
      cache.getInvocationContext().setTransaction(tx);
      cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx, true));

      Object pojo = new SamplePojo(21, "test");
      cache.put("/one/two", Collections.singletonMap((Object) "key1", pojo));

      assertEquals(null, dummy.getCalledCommand());
      TransactionTable table = cache.getTransactionTable();
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      // inject InvocationContext
      cache.getInvocationContext().setTransaction(tx);
      cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx, true));

      SamplePojo pojo = new SamplePojo(21, "test");
      Map<Object, Object> temp = new HashMap<Object, Object>();
      temp.put("key1", pojo);
      cache.put("/one/two", temp);

      assertEquals(null, dummy.getCalledCommand());
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      // inject InvocationContext
      cache.getInvocationContext().setTransaction(tx);
      cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx, true));

      SamplePojo pojo = new SamplePojo(21, "test");
      Map<Object, Object> temp = new HashMap<Object, Object>();
      temp.put("key1", pojo);
      cache.put("/one/two", temp);

      assertEquals(null, dummy.getCalledCommand());
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      mgr.begin();
      Transaction tx = mgr.getTransaction();

      setupTransactions(cache, tx);

      SamplePojo pojo = new SamplePojo(21, "test");
      Map temp = new HashMap();
      temp.put("key1", pojo);
      cache.put("/one/two", temp);

      assertEquals(null, dummy.getCalledCommand());
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      mgr.begin();
      Transaction tx = mgr.getTransaction();

      setupTransactions(cache, tx);

      SamplePojo pojo = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo);

      //overwrite the map we just put in
      SamplePojo pojo2 = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo2);

      assertEquals(null, dummy.getCalledCommand());
      TransactionTable table = cache.getTransactionTable();
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      mgr.begin();
      Transaction tx = mgr.getTransaction();

      setupTransactions(cache, tx);

      SamplePojo pojo = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo);


      cache.put("/one/two", "key1", null);
View Full Code Here

Examples of org.jboss.cache.loader.SamplePojo

      mgr.begin();
      Transaction tx = mgr.getTransaction();

      setupTransactions(cache, tx);

      SamplePojo pojo = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo);

      assertEquals(null, dummy.getCalledCommand());
      TransactionTable table = cache.getTransactionTable();
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.