@Test
    public void testUrlIllegal() throws RemotingException {
        Url btUrl = null;
        try {
            String url = "127.0.0.1";
            RpcAddressParser parser = new RpcAddressParser();
            btUrl = parser.parse(url);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
            logger.error("URL FORMAT ERROR!", e);
            Assert.assertNull(btUrl);
        }

        btUrl = null;
        try {
            String url = "127.0.0.1:";
            RpcAddressParser parser = new RpcAddressParser();
            btUrl = parser.parse(url);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
            logger.error("URL FORMAT ERROR!", e);
            Assert.assertNull(btUrl);
        }

        btUrl = null;
        try {
            String url = "127.0.0.1:1111?_CONNECTTIMEOUT";
            RpcAddressParser parser = new RpcAddressParser();
            btUrl = parser.parse(url);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
            logger.error("URL FORMAT ERROR!", e);
            Assert.assertNull(btUrl);
        }

        btUrl = null;
        try {
            String url = "127.0.0.1:100?";
            RpcAddressParser parser = new RpcAddressParser();
            btUrl = parser.parse(url);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
            logger.error("URL FORMAT ERROR!", e);
            Assert.assertNull(btUrl);
        }

        btUrl = null;
        try {
            String url = "127.0.1:100?A=B&";
            RpcAddressParser parser = new RpcAddressParser();
            btUrl = parser.parse(url);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
            logger.error("URL FORMAT ERROR!", e);
            Assert.assertNull(btUrl);
        }

        btUrl = null;
        try {
            String url = "127.0.1:100?A=B&C";
            RpcAddressParser parser = new RpcAddressParser();
            btUrl = parser.parse(url);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
            logger.error("URL FORMAT ERROR!", e);
            Assert.assertNull(btUrl);
        }

        btUrl = null;
        try {
            String url = "127.0.1:100?A=B&C=";
            RpcAddressParser parser = new RpcAddressParser();
            btUrl = parser.parse(url);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
            logger.error("URL FORMAT ERROR!", e);
            Assert.assertNull(btUrl);
        }
    }
rpc address parser test

@author jiangping
@version $Id: RpcAddressParserTest.java, v 0.1 2015-12-11 PM10:04:21 tao Exp $
src/test/java/com/alipay/remoting/rpc/addressargs/RpcAddressParserTest.java