Skip to content

Commit

Permalink
URL加一个UT , DUBBO-502 URL类对特殊字符处理统一约定
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Jul 18, 2012
1 parent 93c668a commit ab16b9f
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ public void test_valueOf_WithProtocolHost() throws Exception {
assertEquals("noValue", url.getParameter("noValue"));
}

// TODO 不希望空格? 详见: DUBBO-502 URL类对特殊字符处理统一约定
@Test
public void test_valueOf_spaceSafe() throws Exception {
URL url = URL.valueOf("http://1.2.3.4:8080/path?key=value1 value2");
assertEquals("http://1.2.3.4:8080/path?key=value1 value2", url.toString());
assertEquals("value1 value2", url.getParameter("key"));
}

@Test
public void test_valueOf_Exception_noProtocol() throws Exception {
try {
Expand Down Expand Up @@ -376,7 +384,7 @@ public void test_set_methods() throws Exception {
assertEquals("path", url.getPath());
assertEquals(2, url.getParameters().size());
assertEquals("1.0.0", url.getParameter("version"));
assertEquals("morgan", url.getParameter("application"));
assertEquals("morgan", url.getParameter("application"));
}

@Test
Expand Down

0 comments on commit ab16b9f

Please sign in to comment.