[jboss-svn-commits] JBL Code SVN: r8284 - labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Dec 13 07:18:48 EST 2006


Author: ddegroff
Date: 2006-12-13 07:18:46 -0500 (Wed, 13 Dec 2006)
New Revision: 8284

Added:
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java
Log:


Added: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java	2006-12-13 11:56:00 UTC (rev 8283)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java	2006-12-13 12:18:46 UTC (rev 8284)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config;
+
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.jboss.soa.esb.listeners.config.XmlValidation;
+
+import junit.framework.TestCase;
+
+/**
+ * XmlValidator unit tests.
+ * @author <a href="mailto:ddegroff at ddegroff.com">ddegroff at ddegroff.com</a>
+ */
+public class XmlValidatorUnitTest extends TestCase {
+
+	private InputSource inputSource = null;
+	private XmlValidation xmlValidation = new XmlValidation();
+	
+	/* (non-Javadoc)
+	 * @see junit.framework.TestCase#setUp()
+	 */
+	@Override
+	protected void setUp() throws Exception {
+		inputSource = new InputSource("jbossesb.xml");
+	}
+
+	/* (non-Javadoc)
+	 * @see junit.framework.TestCase#tearDown()
+	 */
+	@Override
+	protected void tearDown() throws Exception {
+	}
+	
+	public void testXmlOnly() throws Exception {
+		boolean isValid = xmlValidation.validate(inputSource);
+		assertEquals(true, isValid);		
+	}
+
+	public void testGetDocument() throws Exception {
+		Document document = xmlValidation.getXMLDocument();
+		assertNotNull("XML document", document);
+		if (document != null) System.err.println(document.toString());
+	}
+}




More information about the jboss-svn-commits mailing list