PR target/27599
[official-gcc.git] / libjava / classpath / testsuite / javax.swing.text.html.parser / test / gnu / javax / swing / text / html / parser / TestCase.java
blob84c160367d963dbe501540663a2fe3bb36bcbd20
1 /* TestCase.java --
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package test.gnu.javax.swing.text.html.parser;
42 /**
43 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
45 public class TestCase
47 public TestCase()
49 try
51 setUp();
53 catch (Exception ex)
55 throw new RuntimeException(ex);
59 public void assertEquals(String msg, Object a, Object b)
61 if (a == b)
62 return;
63 if (!a.equals(b))
64 throw new RuntimeException(msg);
67 public void assertEquals(Object a, Object b)
69 if (a == b)
70 return;
71 if (!a.equals(b))
72 throw new RuntimeException("Objects must be equal");
75 public void assertEquals(int a, int b)
77 if (a != b)
78 throw new RuntimeException(a + "!=" + b);
81 public void assertEquals(String msg, int a, int b)
83 if (a != b)
84 throw new RuntimeException(msg + ":" + a + "!=" + b);
87 public void assertEquals(boolean a, boolean b)
89 if (a != b)
90 throw new RuntimeException(a + "!=" + b);
93 public void assertFalse(String msg, boolean a)
95 if (a)
96 throw new RuntimeException(msg);
99 public void assertFalse(boolean a)
101 if (a)
102 throw new RuntimeException("Must be false");
105 public void assertNotNull(String msg, Object a)
107 if (a == null)
108 throw new RuntimeException(msg);
111 public void assertNull(String msg, Object a)
113 if (a != null)
114 throw new RuntimeException(msg);
117 public void assertTrue(String msg, boolean a)
119 if (!a)
120 throw new RuntimeException(msg);
123 public void assertTrue(boolean a)
125 if (!a)
126 throw new RuntimeException("Must be true");
129 protected void setUp()
130 throws Exception
134 protected void tearDown()
135 throws Exception