1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.apache.commons.validator;
24
25 import junit.framework.Test;
26 import junit.framework.TestSuite;
27 import java.io.IOException;
28 import org.xml.sax.SAXException;
29 import java.util.Locale;
30 import java.net.URL;
31
32
33 /***
34 * Tests entity imports.
35 */
36 public class EntityImportTest extends TestCommon {
37
38 public EntityImportTest(String name) {
39 super(name);
40 }
41
42 /***
43 * Start the tests.
44 *
45 * @param theArgs the arguments. Not used
46 */
47 public static void main(String[] theArgs) {
48 junit.awtui.TestRunner.main(new String[]{EntityImportTest.class.getName()});
49 }
50
51 /***
52 * @return a test suite (<code>TestSuite</code>) that includes all methods
53 * starting with "test"
54 */
55 public static Test suite() {
56
57 return new TestSuite(EntityImportTest.class);
58 }
59
60 /***
61 * Tests the entity import loading the <code>byteForm</code> form.
62 */
63 public void testEntityImport() throws Exception {
64 URL url = getClass().getResource("EntityImportTest-config.xml");
65 ValidatorResources resources = new ValidatorResources(url.toExternalForm());
66 assertNotNull("Form should be found", resources.getForm(Locale.getDefault(), "byteForm"));
67 }
68 }