001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)TestServicelistValidator.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.engine.sequencing.servicelist;
030:
031: import junit.framework.*;
032:
033: import org.w3c.dom.Document;
034:
035: import org.xml.sax.ErrorHandler;
036: import org.xml.sax.SAXException;
037: import org.xml.sax.SAXParseException;
038: import org.xml.sax.helpers.DefaultHandler;
039:
040: import java.io.IOException;
041:
042: import java.util.logging.Logger;
043:
044: import javax.xml.parsers.DocumentBuilder;
045: import javax.xml.parsers.DocumentBuilderFactory;
046: import javax.xml.parsers.ParserConfigurationException;
047:
048: /**
049: * DOCUMENT ME!
050: *
051: * @author Sun Microsystems, Inc.
052: */
053: public class TestServicelistValidator extends TestCase {
054: /**
055: *
056: */
057: private ServicelistValidator mValidator;
058:
059: /**
060: * Creates a new TestServicelistValidator object.
061: *
062: * @param testName
063: */
064: public TestServicelistValidator(java.lang.String testName) {
065: super (testName);
066: }
067:
068: /**
069: * DOCUMENT ME!
070: *
071: * @return NOT YET DOCUMENTED
072: */
073: public static Test suite() {
074: TestSuite suite = new TestSuite(TestServicelistValidator.class);
075:
076: return suite;
077: }
078:
079: /**
080: * Sets up tests.
081: */
082: public void setUp() {
083: String srcroot = System.getProperty("junit.srcroot");
084: mValidator = new ServicelistValidator(srcroot
085: + "/engine/sequencing/schema/servicelist.xsd", srcroot
086: + "/engine/sequencing/deploy/artifact/servicelist.xml");
087: }
088:
089: /**
090: * Test of error method, of class
091: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
092: */
093: public void testError() {
094: // Add your test code below by replacing the default call to fail.
095: }
096:
097: /**
098: * Test of fatalError method, of class
099: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
100: */
101: public void testFatalError() {
102: // Add your test code below by replacing the default call to fail.
103: }
104:
105: /**
106: * Test of getDocument method, of class
107: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
108: */
109: public void testGetDocument() {
110: // Add your test code below by replacing the default call to fail.
111: System.out.println("testGetDocument");
112: mValidator.validate();
113: assertTrue("Failed validating XML config file", mValidator
114: .isValid());
115: assertNotNull("Document object is null", mValidator
116: .getDocument());
117: }
118:
119: /**
120: * Test of getError method, of class
121: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
122: */
123: public void testGetError() {
124: // Add your test code below by replacing the default call to fail.
125: }
126:
127: /**
128: * Test of isValid method, of class
129: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
130: */
131: public void testIsValid() {
132: // Add your test code below by replacing the default call to fail.
133: }
134:
135: /**
136: * Test of setValidating method, of class
137: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
138: */
139: public void testSetValidating() {
140: // Add your test code below by replacing the default call to fail.
141: }
142:
143: /**
144: * Test of validate method, of class
145: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
146: */
147: public void testValidate() {
148: // Add your test code below by replacing the default call to fail.
149: System.out.println("testValidate");
150: mValidator.validate();
151: assertTrue("Failed validating XML config file", mValidator
152: .isValid());
153: }
154:
155: /**
156: * Test of warning method, of class
157: * com.sun.jbi.engine.sequencing.servicelist.ServicelistValidator.
158: */
159: public void testWarning() {
160: // Add your test code below by replacing the default call to fail.
161: }
162:
163: // Add test methods here, they have to start with 'test' name.
164: // for example:
165: // public void testHello() {}
166: }
|