01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.rewriter.test.util;
06:
07: import com.sun.portal.rewriter.Translator;
08: import com.sun.portal.rewriter.rom.InvalidXMLException;
09: import junit.framework.Test;
10:
11: import org.custommonkey.xmlunit.XMLTestCase;
12: import org.custommonkey.xmlunit.XMLUnit;
13:
14: import javax.xml.parsers.DocumentBuilderFactory;
15:
16: public class BasicXMLTestCase extends XMLTestCase {
17: private BasicTestCase basicTestCase;
18:
19: public BasicXMLTestCase(String aMethod) {
20: super (aMethod);
21: basicTestCase = new BasicTestCase(aMethod);
22: }//constructor
23:
24: protected void setUp() throws Exception {
25: DocumentBuilderFactory lDBFactory = DocumentBuilderFactory
26: .newInstance();
27: lDBFactory.setNamespaceAware(true);
28: lDBFactory.setValidating(false);
29: XMLUnit.setControlDocumentBuilderFactory(lDBFactory);
30: XMLUnit.setIgnoreWhitespace(true);
31: }//setUp()
32:
33: protected final Translator getDefaultTranslator() throws Exception {
34: return basicTestCase.getDefaultTranslator();
35: }//getDefaultTranslator()
36:
37: protected final Translator getDefaultXMLTranslator()
38: throws Exception {
39: return basicTestCase.getDefaultXMLTranslator();
40: }//getDefaultXMLTranslator()
41:
42: protected final String storeRandomRuleSet(String aRuleSetIDSeed)
43: throws InvalidXMLException {
44: return basicTestCase.storeRandomRuleSet(aRuleSetIDSeed);
45: }//storeRuleSet()
46:
47: public static final void run(Class aClass) {
48: BasicTestCase.run(aClass);
49: }//run()
50:
51: public static final void run(Test aSuite) {
52: BasicTestCase.run(aSuite);
53: }//run()
54: }//class BasicXMLTestCase
|