[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/binding ...

Tom Elrod tom.elrod at jboss.com
Wed Jan 24 11:55:08 EST 2007


  User: telrod  
  Date: 07/01/24 11:55:08

  Added:       src/tests/org/jboss/test/remoting/binding 
                        BindingTestCase.java
  Log:
  JBREM-687 - allow binding to 0.0.0.0
  
  Revision  Changes    Path
  1.1      date: 2007/01/24 16:55:08;  author: telrod;  state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/binding/BindingTestCase.java
  
  Index: BindingTestCase.java
  ===================================================================
  /*
  * JBoss, a division of Red Hat
  * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
  * This is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as
  * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
  package org.jboss.test.remoting.binding;
  
  import junit.framework.TestCase;
  import org.jboss.remoting.transport.Connector;
  
  import java.net.InetAddress;
  
  /**
   * @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
   */
  public class BindingTestCase extends TestCase
  {
     public void testBindings() throws Exception
     {
        String locatorUrl = "socket://0.0.0.0:5600";
  
        Connector connector = new Connector(locatorUrl);
  
        connector.create();
        connector.start();
  
        String connectorLocatorUrl = connector.getInvokerLocator();
  
        System.out.println("connector locator = " + connectorLocatorUrl);
  
        String hostName = InetAddress.getLocalHost().getHostName();
  
        assertTrue(connectorLocatorUrl.contains(hostName));
  
        connector.stop();
        connector.destroy();
     }
  
     public static void main(String[] args)
     {
        BindingTestCase test = new BindingTestCase();
        try
        {
           test.testBindings();
        }
        catch (Exception e)
        {
           e.printStackTrace();
        }
     }
  }
  
  



More information about the jboss-cvs-commits mailing list