User: starksm 
  Date: 01/12/28 14:50:22

  Modified:    src/main/org/jboss/test/spydermq/test Tag: Branch_2_4
                        Main.java
  Log:
  Cleanup formatting
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +31 -58    jbosstest/src/main/org/jboss/test/spydermq/test/Attic/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/spydermq/test/Attic/Main.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- Main.java 2001/03/01 13:23:21     1.2
  +++ Main.java 2001/12/28 22:50:22     1.2.2.1
  @@ -47,39 +47,22 @@
        static QueueConnection queueConnection; 
        static TopicConnection topicConnection;
        
  -     public Main(String name) throws Exception{
  +     public Main(String name) throws Exception
  +   {
                super(name);            
        }
   
  -
  -     
  -
  -     
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -     
  -
  -     
        // Emptys out all the messages in a queue 
  -     private void drainQueue() throws Exception {
  -             
  +     private void drainQueue() throws Exception
  +   { 
                QueueSession session = queueConnection.createQueueSession(false, 
Session.AUTO_ACKNOWLEDGE);
                Queue queue = (Queue)context.lookup(TEST_QUEUE);
   
                QueueReceiver receiver = session.createReceiver(queue);
                Message message = receiver.receive( 2000 );
                int c=0;
  -             while( message != null ) {
  +             while( message != null )
  +      {
                        message = receiver.receive( 2000 );
                        c++;
                }
  @@ -88,36 +71,25 @@
                        System.out.println("  Drained "+c+" messages from the queue");
                
                session.close();
  -             
        }
  -     
  -
  -     
  -
  -             
  -     static public void main ( String []args ) {
   
  +   static public void main ( String []args )
  +   {
                String newArgs[] = { "org.jboss.test.spydermq.test.Main" };
  -             junit.swingui.TestRunner.main(newArgs);
  -             
  -             
  +             junit.swingui.TestRunner.main(newArgs); 
        }
  -
  -     protected void setUp() throws Exception {
   
  -             if( context == null ) {
  -                     
  -                     context = new InitialContext();
  -                     
  +     protected void setUp() throws Exception
  +   {
  +             if( context == null )
  +      {      
  +                     context = new InitialContext();         
                        QueueConnectionFactory queueFactory = (QueueConnectionFactory) 
context.lookup(QUEUE_FACTORY);
                        queueConnection = queueFactory.createQueueConnection();
  -
                        TopicConnectionFactory topicFactory = 
(TopicConnectionFactory)context.lookup(TOPIC_FACTORY);
                        topicConnection = topicFactory.createTopicConnection();
  -
                        System.out.println("Connection to spyderMQ established.");
  -             }
  -                     
  +             }               
        }
   
        /**
  @@ -129,7 +101,8 @@
         *                      Sending PERSITENT and NON_PERSISTENT text messages.
         *              Using a QueueBrowser
         */
  -     public void testQueueMessageOrder()     throws Exception {
  +     public void testQueueMessageOrder()     throws Exception
  +   {
   
                System.out.println("Starting QueueMessageOrder test");
   
  @@ -179,18 +152,18 @@
         * this also tests that :
         *              temporary queues work.
         */
  -     public void testRequestReplyQueue() throws Exception {
  -             
  -             System.out.println("Starting RequestReplyQueue test");
  -             
  -             {
  -                     queueConnection.start();
  -                     drainQueue( );
  -             }
  -             
  -             Thread serverThread = new Thread() {
  -                     public void run() {
  -                             try {
  +     public void testRequestReplyQueue() throws Exception
  +   { 
  +             System.out.println("Starting RequestReplyQueue test");  
  +      queueConnection.start();
  +      drainQueue( );
  +
  +             Thread serverThread = new Thread()
  +      {
  +                     public void run()
  +         {
  +                             try
  +            {
                                        QueueSession session = 
queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                                        Queue queue = 
(Queue)context.lookup(TEST_QUEUE);
   
  @@ -228,8 +201,8 @@
                TextMessage message = session.createTextMessage();
                message.setText("Request Test");
                
  -             for( int i=0; i < 5; i ++ ) {
  -                     
  +             for( int i=0; i < 5; i ++ )
  +      {      
                        TextMessage reply = (TextMessage) 
queueRequestor.request(message);              
                        String replyID = new String(reply.getJMSCorrelationID());
                        if (!replyID.equals(message.getJMSMessageID())) 
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to