ReliableTransportChannelFactoryTest xref

    1   /***
    2    *
    3    * Copyright 2004 Protique Ltd
    4    *
    5    * Licensed under the Apache License, Version 2.0 (the "License");
    6    * you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    *
    9    * http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   *
    17   **/
    18  package org.codehaus.activemq.transport.reliable;
    19
    20  import junit.framework.TestCase;
    21
    22  import java.net.URI;
    23  import java.net.URISyntaxException;
    24  import java.util.ArrayList;
    25  import java.util.List;
    26
    27  /***
    28   * ReliableTransportChannelFactoryTest
    29   *
    30   * @version $Revision: 1.2 $
    31   */
    32  public class ReliableTransportChannelFactoryTest extends TestCase {
    33      public static void main(String[] args) {
    34      }
    35
    36      /*
    37       * @see TestCase#setUp()
    38       */
    39      protected void setUp() throws Exception {
    40          super.setUp();
    41      }
    42
    43      /*
    44       * @see TestCase#tearDown()
    45       */
    46      protected void tearDown() throws Exception {
    47          super.tearDown();
    48      }
    49
    50      /***
    51       * Constructor for ReliableTransportChannelFactoryTest.
    52       *
    53       * @param arg0
    54       */
    55      public ReliableTransportChannelFactoryTest(String arg0) {
    56          super(arg0);
    57      }
    58
    59
    60      public void testRandomizeURIs() throws URISyntaxException {
    61          List test = new ArrayList();
    62          for (int i = 0; i < 4; i++) {
    63              test.add(new URI("tcp://localhost:" + i));
    64          }
    65
    66
    67          ReliableTransportChannelFactory fac = new ReliableTransportChannelFactory();
    68          List result = fac.randomizeURIs(test);
    69          assertTrue(result != test);
    70          assertEquals(test.size(), result.size());
    71          /*
    72          for (int i =0; i < result.length; i++){
    73              System.out.println(result[i]);
    74          }
    75          */
    76
    77
    78      }
    79  }