1 21 package org.apache.commons.validator; 22 23 import java.io.IOException ; 24 import java.io.InputStream ; 25 26 import junit.framework.TestCase; 27 28 import org.xml.sax.SAXException ; 29 30 33 abstract public class TestCommon extends TestCase { 34 35 38 protected ValidatorResources resources = null; 39 40 public TestCommon(String string) { 41 super(string); 42 } 43 44 48 protected void loadResources(String file) throws IOException , SAXException { 49 InputStream in = null; 51 52 try { 53 in = this.getClass().getResourceAsStream(file); 54 resources = new ValidatorResources(in); 55 } finally { 56 if (in != null) { 57 in.close(); 58 } 59 } 60 } 61 } 62 | Popular Tags |