@Test public void test_valueOf_noProtocol() throws Exception {
  URL url=URL.valueOf("10.20.130.230");
  assertNull(url.getProtocol());
  assertNull(url.getUsername());
  assertNull(url.getPassword());
  assertEquals("10.20.130.230",url.getHost());
  assertEquals(0,url.getPort());
  assertEquals(null,url.getPath());
  assertEquals(0,url.getParameters().size());
  url=URL.valueOf("10.20.130.230:20880");
  assertNull(url.getProtocol());
  assertNull(url.getUsername());
  assertNull(url.getPassword());
  assertEquals("10.20.130.230",url.getHost());
  assertEquals(20880,url.getPort());
  assertEquals(null,url.getPath());
  assertEquals(0,url.getParameters().size());
  url=URL.valueOf("10.20.130.230/context/path");
  assertNull(url.getProtocol());
  assertNull(url.getUsername());
  assertNull(url.getPassword());
  assertEquals("10.20.130.230",url.getHost());
  assertEquals(0,url.getPort());
  assertEquals("context/path",url.getPath());
  assertEquals(0,url.getParameters().size());
  url=URL.valueOf("10.20.130.230:20880/context/path");
  assertNull(url.getProtocol());
  assertNull(url.getUsername());
  assertNull(url.getPassword());
  assertEquals("10.20.130.230",url.getHost());
  assertEquals(20880,url.getPort());
  assertEquals("context/path",url.getPath());
  assertEquals(0,url.getParameters().size());
  url=URL.valueOf("admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
  assertNull(url.getProtocol());
  assertEquals("admin",url.getUsername());
  assertEquals("hello1234",url.getPassword());
  assertEquals("10.20.130.230",url.getHost());
  assertEquals(20880,url.getPort());
  assertEquals("context/path",url.getPath());
  assertEquals(2,url.getParameters().size());
  assertEquals("1.0.0",url.getParameter("version"));
  assertEquals("morgan",url.getParameter("application"));
}
