2
* $Header: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/TestCommon.java,v 1.6 2004/02/21 17:10:30 rleland Exp $
4
* $Date: 2004/02/21 17:10:30 $
6
* ====================================================================
7
* Copyright 2001-2004 The Apache Software Foundation
9
* Licensed under the Apache License, Version 2.0 (the "License");
10
* you may not use this file except in compliance with the License.
11
* You may obtain a copy of the License at
13
* http://www.apache.org/licenses/LICENSE-2.0
15
* Unless required by applicable law or agreed to in writing, software
16
* distributed under the License is distributed on an "AS IS" BASIS,
17
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
* See the License for the specific language governing permissions and
19
* limitations under the License.
21
package org.apache.commons.validator;
23
import java.io.IOException;
24
import java.io.InputStream;
26
import junit.framework.TestCase;
28
import org.apache.commons.logging.Log;
29
import org.apache.commons.logging.LogFactory;
30
import org.xml.sax.SAXException;
33
* Consolidates reading in XML config file into parent class.
35
abstract public class TestCommon extends TestCase {
38
* Resources used for validation tests.
40
protected ValidatorResources resources = null;
43
* Commons Logging instance.
45
protected Log log = LogFactory.getLog(this.getClass());
47
public TestCommon(String string) {
52
* Load <code>ValidatorResources</code> from
53
* validator-numeric.xml.
55
protected void loadResources(String file) throws IOException, SAXException {
57
InputStream in = null;
60
in = this.getClass().getResourceAsStream(file);
61
resources = new ValidatorResources(in);
63
} catch (IOException e) {
64
log.error(e.getMessage(), e);
71
} catch (IOException e) {
72
log.error(e.getMessage(), e);