-/*\r
- * HttpUtils Test\r
- *\r
- * Copyright(c) 2009 olyutorskii\r
- */\r
-\r
-package jp.sourceforge.jindolf;\r
-\r
-import org.junit.After;\r
-import org.junit.AfterClass;\r
-import org.junit.Before;\r
-import org.junit.BeforeClass;\r
-import org.junit.Test;\r
-import static org.junit.Assert.*;\r
-\r
-/**\r
- *\r
- *\r
- */\r
-public class HttpUtilsTest {\r
-\r
- public HttpUtilsTest() {\r
- }\r
-\r
- @BeforeClass\r
- public static void setUpClass() throws Exception {\r
- }\r
-\r
- @AfterClass\r
- public static void tearDownClass() throws Exception {\r
- }\r
-\r
- @Before\r
- public void setUp() {\r
- }\r
-\r
- @After\r
- public void tearDown() {\r
- }\r
-\r
- /**\r
- * Test of getHTMLCharset method, of class HttpUtils.\r
- */\r
- @Test\r
- public void getHTMLCharset() {\r
- System.out.println("getHTMLCharset");\r
- String contentType;\r
-\r
- contentType = "text/html;charset = Shift_JIS";\r
- String result = HttpUtils.getHTMLCharset(contentType);\r
- assertEquals("Shift_JIS", result);\r
-\r
- contentType = "text/html ; charset=Shift_JIS ; a = b ; d=\"xyz\" ";\r
- result = HttpUtils.getHTMLCharset(contentType);\r
- assertEquals("Shift_JIS", result);\r
-\r
- return;\r
- }\r
-\r
- /**\r
- * Test of escapeHttpComment method, of class HttpUtils.\r
- */\r
- @Test\r
- public void testEscapeHttpComment(){\r
- System.out.println("escapeHttpComment");\r
-\r
- CharSequence comment;\r
- String expResult;\r
- String result;\r
-\r
- comment = "abc";\r
- expResult = "(abc)";\r
- result = HttpUtils.escapeHttpComment(comment);\r
- assertEquals(expResult, result);\r
-\r
- comment = "abc(pqr)xyz";\r
- expResult = "(abc\\(pqr\\)xyz)";\r
- result = HttpUtils.escapeHttpComment(comment);\r
- assertEquals(expResult, result);\r
-\r
- comment = "a\nb";\r
- expResult = "(a?b)";\r
- result = HttpUtils.escapeHttpComment(comment);\r
- assertEquals(expResult, result);\r
-\r
- comment = "a狼b";\r
- expResult = "(a?b)";\r
- result = HttpUtils.escapeHttpComment(comment);\r
- assertEquals(expResult, result);\r
-\r
- return;\r
- }\r
-}\r
+/*
+ * HttpUtils Test
+ *
+ * Copyright(c) 2009 olyutorskii
+ */
+
+package jp.sourceforge.jindolf;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ *
+ */
+public class HttpUtilsTest {
+
+ public HttpUtilsTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of getHTMLCharset method, of class HttpUtils.
+ */
+ @Test
+ public void getHTMLCharset() {
+ System.out.println("getHTMLCharset");
+ String contentType;
+
+ contentType = "text/html;charset = Shift_JIS";
+ String result = HttpUtils.getHTMLCharset(contentType);
+ assertEquals("Shift_JIS", result);
+
+ contentType = "text/html ; charset=Shift_JIS ; a = b ; d=\"xyz\" ";
+ result = HttpUtils.getHTMLCharset(contentType);
+ assertEquals("Shift_JIS", result);
+
+ return;
+ }
+
+ /**
+ * Test of escapeHttpComment method, of class HttpUtils.
+ */
+ @Test
+ public void testEscapeHttpComment(){
+ System.out.println("escapeHttpComment");
+
+ CharSequence comment;
+ String expResult;
+ String result;
+
+ comment = "abc";
+ expResult = "(abc)";
+ result = HttpUtils.escapeHttpComment(comment);
+ assertEquals(expResult, result);
+
+ comment = "abc(pqr)xyz";
+ expResult = "(abc\\(pqr\\)xyz)";
+ result = HttpUtils.escapeHttpComment(comment);
+ assertEquals(expResult, result);
+
+ comment = "a\nb";
+ expResult = "(a?b)";
+ result = HttpUtils.escapeHttpComment(comment);
+ assertEquals(expResult, result);
+
+ comment = "a狼b";
+ expResult = "(a?b)";
+ result = HttpUtils.escapeHttpComment(comment);
+ assertEquals(expResult, result);
+
+ return;
+ }
+}