2 * License : The MIT License
3 * Copyright(c) 2009 olyutorskii
6 package jp.sourceforge.jindolf.parser;
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.*;
17 public class HtmlParseExceptionTest {
19 public HtmlParseExceptionTest() {
23 public static void setUpClass() throws Exception{
27 public static void tearDownClass() throws Exception{
35 public void tearDown() {
39 * Test of getCharPos method, of class HtmlParseException.
42 public void testGetCharPos(){
43 System.out.println("getCharPos");
45 HtmlParseException ex;
47 ex = new HtmlParseException();
48 assertTrue(0 > ex.getCharPos());
50 ex = new HtmlParseException("abc");
51 assertTrue(0 > ex.getCharPos());
53 ex = new HtmlParseException(99);
54 assertEquals(99, ex.getCharPos());
56 ex = new HtmlParseException("abc", 99);
57 assertEquals(99, ex.getCharPos());
63 * Test of getMessage method, of class HtmlParseException.
66 public void testGetMessage(){
67 System.out.println("getMessage");
69 HtmlParseException ex;
71 ex = new HtmlParseException();
72 assertEquals("charPos=-1", ex.getMessage());
74 ex = new HtmlParseException("abc");
75 assertEquals("abc charPos=-1", ex.getMessage());
77 ex = new HtmlParseException(99);
78 assertEquals("charPos=99", ex.getMessage());
80 ex = new HtmlParseException("abc", 99);
81 assertEquals("abc charPos=99", ex.getMessage());