Examples of Topic


Examples of javax.jms.Topic

   /**
    * The simplest possible topic test.
    */
   public void testTopic() throws Exception
   {
      Topic topic = (Topic)ic.lookup("/topic/TestTopic");

      Connection conn = cf.createConnection();

      try
      {
View Full Code Here

Examples of javax.jms.Topic

      }
   }

   public void testTopicName() throws Exception
   {
      Topic topic = (Topic)ic.lookup("/topic/TestTopic");
      assertEquals("TestTopic", topic.getTopicName());
   }
View Full Code Here

Examples of javax.jms.Topic

   /*
    * See http://jira.jboss.com/jira/browse/JBMESSAGING-399
    */
   public void testRace() throws Exception
   {
      Topic topic = (Topic)ic.lookup("/topic/TestTopic");

      Connection conn = cf.createConnection();
     
      Session sSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
     
View Full Code Here

Examples of javax.jms.Topic

   }

   public void testSimplestDurableSubscription() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");
      Connection conn = cf.createConnection();

      conn.setClientID("brookeburke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

Examples of javax.jms.Topic

   public void testDurableSubscriptionOnNewTopic() throws Exception
   {
      ServerManagement.deployTopic("CompletelyNewTopic");

      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/CompletelyNewTopic");
      Connection conn = cf.createConnection();

      conn.setClientID("brookeburke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = s.createProducer(topic);
      prod.setDeliveryMode(DeliveryMode.PERSISTENT);

      s.createDurableSubscriber(topic, "monicabelucci");

      prod.send(s.createTextMessage("one"));

      conn.close();

      ServerManagement.deployTopic("CompletelyNewTopic2");

      Topic topic2 = (Topic)ic.lookup("/topic/CompletelyNewTopic2");
      conn = cf.createConnection();

      conn.setClientID("brookeburke");

      s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

Examples of javax.jms.Topic

   public void testDurableSubscriptionDifferentSelector() throws Exception
   {
      ServerManagement.deployTopic("CompletelyNewTopic2");
     
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");
      Connection conn = cf.createConnection();

      conn.setClientID("brookeburke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

Examples of javax.jms.Topic

   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Connection conn = cf.createConnection();
      conn.setClientID("doesn't actually matter");
      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      Topic temporaryTopic = s.createTemporaryTopic();

      try
      {
         s.createDurableSubscriber(temporaryTopic, "mySubscription");
         fail("this should throw exception");
View Full Code Here

Examples of javax.jms.Topic

      }

      ServerManagement.deployTopic("TopicToBeRedeployed");

      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/TopicToBeRedeployed");

      Connection conn = cf.createConnection();
      conn.setClientID("brookeburke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

Examples of javax.jms.Topic

   }

   public void testUnsubscribeDurableSubscription() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");

      Connection conn = cf.createConnection();
      conn.setClientID("ak47");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

Examples of javax.jms.Topic

   }

   public void testInvalidSelectorException() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");
      Connection c = cf.createConnection();
      c.setClientID("sofiavergara");
      Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);

      try
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.