Package javax.jms

Examples of javax.jms.Topic


  
   public void testRelay() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
     
      Topic topic = (Topic)ic.lookup("/topic/StressTestTopic");
     
      final int numMessages = 20000;
     
      final int numRelayers = 5;
     
View Full Code Here


    * Test durable subscription state survives a server crash
    */
   public void testDurableSubscriptionPersistence_1() throws Exception
   {
      ServerManagement.deployTopic("YetAnotherTopic");
      Topic thisTopic = (Topic)initialContext.lookup("/topic/YetAnotherTopic");

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

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

   }


   public void testGetTopic() throws Exception
   {
      Topic t = ((TopicSubscriber)topicConsumer).getTopic();
      assertEquals(topic, t);
   }
View Full Code Here

         config = "<security><role name=\"def\" read=\"false\" write=\"false\" create=\"false\"/></security>";
         on = new ObjectName("jboss.messaging.destination:service=Topic,name=Accounting");
         ServerManagement.setAttribute(on, "SecurityConfig", config);

         Queue queue = (Queue)ic.lookup("/queue/Accounting");
         Topic topic = (Topic)ic.lookup("/topic/Accounting");

         conn = cf.createConnection("john", "needle");

         assertTrue(canReadDestination(conn, queue));
         assertFalse(canReadDestination(conn, topic));
View Full Code Here

    * cleaned-up.
    */
   public void testClientCrashWithTwoConnections() throws Exception
   {
      InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
      Topic topic = (Topic)ic.lookup("/topic/Topic");
     
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
     
      CreateTwoClientOnServerCommand command = new CreateTwoClientOnServerCommand(cf, topic, true);
     
View Full Code Here

   /**
    * 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

      }
   }

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

   /*
    * 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

   }

   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

   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

TOP

Related Classes of javax.jms.Topic

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.