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: * @(#)TestServicelistReader.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 com.sun.jbi.engine.sequencing.util.*;
032:
033: import junit.framework.*;
034:
035: import org.w3c.dom.*;
036:
037: import java.io.File;
038:
039: import java.util.LinkedList;
040: import java.util.logging.Logger;
041:
042: import javax.xml.parsers.*;
043:
044: /**
045: * DOCUMENT ME!
046: *
047: * @author Sun Microsystems, Inc.
048: */
049: public class TestServicelistReader extends TestCase {
050: /**
051: *
052: */
053: private ServicelistReader mConfigReader;
054:
055: /**
056: *
057: */
058: private ServicelistValidator mValidator;
059:
060: /**
061: * Creates a new TestServicelistReader object.
062: *
063: * @param testName
064: */
065: public TestServicelistReader(java.lang.String testName) {
066: super (testName);
067: }
068:
069: /**
070: * DOCUMENT ME!
071: *
072: * @return NOT YET DOCUMENTED
073: */
074: public static Test suite() {
075: TestSuite suite = new TestSuite(TestServicelistReader.class);
076:
077: return suite;
078: }
079:
080: /**
081: * Sets up tests.
082: */
083: public void setUp() {
084: mConfigReader = new ServicelistReader();
085: System.out.println("testInit");
086:
087: String srcroot = System.getProperty("junit.srcroot");
088:
089: try {
090: mValidator = new ServicelistValidator(
091: srcroot
092: + "/engine/sequencing/schema/servicelist.xsd",
093: srcroot
094: + "/engine/sequencing/deploy/artifact/servicelist.xml");
095: mValidator.validate();
096: mConfigReader.init(mValidator.getDocument());
097: } catch (Exception jbiException) {
098: jbiException.printStackTrace();
099: fail("Cannot Init Config Reader");
100: }
101: }
102:
103: /**
104: * Test of getError method, of class
105: * com.sun.jbi.engine.sequencing.servicelist.ServicelistReader.
106: */
107: public void testGetError() {
108: // Add your test code below by replacing the default call to fail.
109: }
110:
111: /**
112: * Test of getServiceCount method, of class
113: * com.sun.jbi.engine.sequencing.servicelist.ServicelistReader.
114: */
115: public void testGetServiceCount() {
116: // Add your test code below by replacing the default call to fail.
117: }
118:
119: /**
120: * Test of getServiceListBean method, of class
121: * com.sun.jbi.engine.sequencing.servicelist.ServicelistReader.
122: */
123: public void testGetServiceListBean() {
124: // Add your test code below by replacing the default call to fail.
125: System.out.println("testGetBean");
126:
127: String ep = "servicelist:AdaptionService";
128: ServicelistBean eb = mConfigReader.getServicelistBean();
129: assertNotNull("Servicelist Bean is Null ", eb);
130: }
131:
132: /**
133: * Test of init method, of class
134: * com.sun.jbi.engine.sequencing.servicelist.ServicelistReader.
135: */
136: public void testInit() {
137: // Add your test code below by replacing the default call to fail.
138: }
139:
140: /**
141: * Test of loadServices method, of class
142: * com.sun.jbi.engine.sequencing.servicelist.ServicelistReader.
143: */
144: public void testLoadServices() {
145: // Add your test code below by replacing the default call to fail.
146: }
147:
148: // Add test methods here, they have to start with 'test' name.
149: // for example:
150: // public void testHello() {}
151: }
|