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: * @(#)TestConfigFileValidator.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.binding.file.util;
030:
031: import junit.framework.Test;
032: import junit.framework.TestCase;
033: import junit.framework.TestSuite;
034:
035: import org.w3c.dom.Document;
036:
037: /**
038: * DOCUMENT ME!
039: *
040: * @author Sun Microsystems, Inc.
041: */
042: public class TestConfigFileValidator extends TestCase {
043: /**
044: * Creates a new TestConfigFileValidator object.
045: */
046: private ConfigFileValidator mValidator;
047:
048: /**
049: * Creates a new TestConfigFileValidator object.
050: *
051: * @param testName DOCUMENT ME!
052: */
053: public TestConfigFileValidator(java.lang.String testName) {
054: super (testName);
055: }
056:
057: /**
058: * DOCUMENT ME!
059: *
060: * @return DOCUMENT ME!
061: */
062: public static Test suite() {
063: TestSuite suite = new TestSuite(TestConfigFileValidator.class);
064:
065: return suite;
066: }
067:
068: /**
069: * Sets up tests.
070: */
071: public void setUp() {
072: String srcroot = System.getProperty("junit.srcroot");
073: mValidator = new ConfigFileValidator(srcroot
074: + "/binding/file/schema/endpoints.xsd", srcroot
075: + "/binding/file/config/endpoints.xml");
076: }
077:
078: /**
079: * Test of getDocument method, of class
080: * com.sun.jbi.binding.file.util.ConfigFileValidator.
081: */
082: public void testGetDocument() {
083: System.out.println("testGetDocument");
084: mValidator.validate();
085: assertTrue("Failed validating XML config file", mValidator
086: .isValid());
087: assertNotNull("Document object is null", mValidator
088: .getDocument());
089: }
090:
091: /**
092: * Test of validate method, of class
093: * com.sun.jbi.binding.file.util.ConfigFileValidator.
094: */
095: public void testValidate() {
096: System.out.println("testValidate");
097: mValidator.validate();
098: assertTrue("Failed validating XML config file", mValidator
099: .isValid());
100: }
101: }
|