OSDN Git Service

改行コード指定
[jindolf/JinParser.git] / src / test / java / jp / sourceforge / jindolf / parser / HtmlParseExceptionTest.java
1 /*
2  * License : The MIT License
3  * Copyright(c) 2009 olyutorskii
4  */
5
6 package jp.sourceforge.jindolf.parser;
7
8 import org.junit.After;
9 import org.junit.AfterClass;
10 import org.junit.Before;
11 import org.junit.BeforeClass;
12 import org.junit.Test;
13 import static org.junit.Assert.*;
14
15 /**
16  */
17 public class HtmlParseExceptionTest {
18
19     public HtmlParseExceptionTest() {
20     }
21
22     @BeforeClass
23     public static void setUpClass() throws Exception{
24     }
25
26     @AfterClass
27     public static void tearDownClass() throws Exception{
28     }
29
30     @Before
31     public void setUp() {
32     }
33
34     @After
35     public void tearDown() {
36     }
37
38     /**
39      * Test of getCharPos method, of class HtmlParseException.
40      */
41     @Test
42     public void testGetCharPos(){
43         System.out.println("getCharPos");
44
45         HtmlParseException ex;
46
47         ex = new HtmlParseException();
48         assertTrue(0 > ex.getCharPos());
49
50         ex = new HtmlParseException("abc");
51         assertTrue(0 > ex.getCharPos());
52
53         ex = new HtmlParseException(99);
54         assertEquals(99, ex.getCharPos());
55
56         ex = new HtmlParseException("abc", 99);
57         assertEquals(99, ex.getCharPos());
58
59         return;
60     }
61
62     /**
63      * Test of getMessage method, of class HtmlParseException.
64      */
65     @Test
66     public void testGetMessage(){
67         System.out.println("getMessage");
68
69         HtmlParseException ex;
70
71         ex = new HtmlParseException();
72         assertEquals("charPos=-1", ex.getMessage());
73
74         ex = new HtmlParseException("abc");
75         assertEquals("abc charPos=-1", ex.getMessage());
76
77         ex = new HtmlParseException(99);
78         assertEquals("charPos=99", ex.getMessage());
79
80         ex = new HtmlParseException("abc", 99);
81         assertEquals("abc charPos=99", ex.getMessage());
82
83         return;
84     }
85
86 }