[jboss-svn-commits] JBL Code SVN: r12737 - in labs/jbossesb/workspace/dbevenius/trunk/product: core and 27 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jun 21 07:56:20 EDT 2007


Author: beve
Date: 2007-06-21 07:56:19 -0400 (Thu, 21 Jun 2007)
New Revision: 12737

Added:
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/mock/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java
Removed:
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/dependencies/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/mock/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/util/XPathUtil.java
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/testutils/test/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
   labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java
   labs/jbossesb/workspace/dbevenius/trunk/product/core/rosetta/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/soa/esb/services/registry/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/soa/esb/services/routing/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/services/tests/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/services/tests/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/workspace/dbevenius/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/
Modified:
   labs/jbossesb/workspace/dbevenius/trunk/product/.classpath
   labs/jbossesb/workspace/dbevenius/trunk/product/build.xml
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/build.xml
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/build.xml
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java
   labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java
   labs/jbossesb/workspace/dbevenius/trunk/product/samples/quickstarts/conf/base-build.xml
Log:
moved core/rosetta -> rosetta. Moved all classes from core/listeneres -> rosetta. Moved all classes from core/services -> rosetta. Updated build.xml and rosetta/build.xml to reflect these changed

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/.classpath
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/.classpath	2007-06-21 08:37:30 UTC (rev 12736)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/.classpath	2007-06-21 11:56:19 UTC (rev 12737)
@@ -1,12 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/src"/>
+	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/tests/src"/>
 	<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/rosetta/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/rosetta/tests/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/listeners/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/listeners/tests/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/services/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/services/tests/src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="lib" path="lib/ext/activation.jar"/>
 	<classpathentry kind="lib" path="lib/ext/antlr-2.7.6.jar"/>
@@ -58,8 +54,6 @@
 	<classpathentry kind="lib" path="lib/ext/jgroups-all.jar"/>
 	<classpathentry kind="lib" path="lib/ext/cache.jar"/>
 	<classpathentry kind="lib" path="lib/ext/standalone/c3p0-0.9.1-pre9.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss-jaxws.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossws-spi.jar"/>
 	<classpathentry kind="lib" path="lib/ext/antlr-3.0b7.jar"/>
 	<classpathentry kind="lib" path="lib/ext/asm.jar"/>
 	<classpathentry kind="lib" path="lib/ext/cglib-2.1_3.jar"/>
@@ -73,6 +67,5 @@
 	<classpathentry kind="lib" path="lib/ext/jbossweb.jar"/>
 	<classpathentry kind="lib" path="lib/ext/stringtemplate-3.0.jar"/>
 	<classpathentry kind="lib" path="lib/ext/trove.jar"/>
-	<classpathentry kind="lib" path="lib/ext/wstx-lgpl-3.2.1.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/build.xml	2007-06-21 08:37:30 UTC (rev 12736)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/build.xml	2007-06-21 11:56:19 UTC (rev 12737)
@@ -97,8 +97,8 @@
 		</sequential>
 	</macrodef>
 
-	<target name="generate-config-model">
-		<ant dir="core/listeners" target="generate-config-model"/>
+	<target name="generate-config-model" description="generates the xmlbeans config model">
+		<ant dir="rosetta" target="generate-config-model"/>
 	</target>
 	
 	<!-- Initialisation -->
@@ -121,7 +121,7 @@
 
 	<target name="org.jboss.esb.core.compile" depends="org.jboss.esb.internal.init">
 		<echo message="Compiling modules"/>
-		<ant dir="core"/>
+		<ant dir="rosetta"/>
 	</target>
 
     <!-- Test targets -->
@@ -141,7 +141,7 @@
         <antcall target="assert-build-available" />
 
         <echo message="Testing of modules, using unit and functional tests"/>
-        <ant dir="core" target="org.jboss.esb.core.test"/>
+        <ant dir="rosetta" target="org.jboss.esb.rosetta.test"/>
     	<ant dir="services" target="test"/>
     </target>
 
@@ -157,15 +157,13 @@
     <!-- Integration test targets -->
     <target name="org.jboss.esb.integration.test" depends="org.jboss.esb.compile">
         <echo message="Testing of modules, using unit, functional and integration tests"/>
-        <ant dir="core" target="org.jboss.esb.core.integration.test"/>
+        <ant dir="rosetta" target="org.jboss.esb.core.integration.test"/>
     </target>
 
     <!-- javadocs paths -->
 	<path id="org.jboss.esb.javadocs.path">
 		<pathelement path="build/schema-model/src"/>
-		<pathelement path="core/rosetta/src"/>
-		<pathelement path="core/listeners/src"/>
-		<pathelement path="core/services/src/"/>
+		<pathelement path="rosetta/src"/>
 	</path>
 	
 
@@ -178,7 +176,7 @@
 	<!-- Jar targets -->
 	<target name="org.jboss.esb.core.jar">
 		<echo message="Building jar file"/>
-		<ant dir="core" target="jar"/>
+		<ant dir="rosetta" target="jar"/>
 	</target>
 	
 	<target name="org.jboss.soa.esb.services.jar">
@@ -383,7 +381,7 @@
 		<echo message="Cleaning modules"/>
 		
 		<echo message="Cleaning core"/>
-		<ant dir="core" target="clean"/>
+		<ant dir="rosetta" target="clean"/>
 		<ant dir="${console.dir}" target="clean"/>
         <ant dir="services" target="clean"/>
 
@@ -449,13 +447,11 @@
          <ant antfile="build-distr.xml"/>
     </target>
 
-	<target name="deploy" depends="jar" description="deploys the ESB .sar to an application server">
-		<ant antfile="build-distr.xml" target="build.sar" />
-		<copy  todir="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy">
-		    <fileset dir="build" includes="jbossesb.sar/**"/></copy>
+	<target name="deploy" depends="dist" description="deploys the ESB .sar to an application server">
+		<ant dir="install" target="deploy"/>
 	</target>
 
 	<target name="instr-report">
-		<ant dir="core" target="instr-report"/>
+		<ant dir="rosetta" target="instr-report"/>
 	</target>
 </project>

Deleted: labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/util/XPathUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/util/XPathUtil.java	2007-06-21 08:37:30 UTC (rev 12736)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/util/XPathUtil.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -1,155 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of individual
- * contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY 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
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.Closeable;
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * Util methods for XPath related operations.
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- * @since 4.2
- *
- */
-public class XPathUtil
-{
-	private static Logger log = Logger.getLogger( XPathUtil.class );
-	
-	/**
-	 * Parses the passed in xml and creates a Dom Document
-	 * 
-	 * @param xml
-	 * @return Document
-	 * @throws SAXException
-	 * @throws IOException
-	 * @throws ParserConfigurationException
-	 */
-	public static org.w3c.dom.Document getDocument( String xml ) throws SAXException, IOException, ParserConfigurationException
-	{
-		if (xml == null) 
-			throw new IllegalArgumentException( "xml must not be null" );
-		
-		ByteArrayInputStream inputStream = null;
-		try
-		{
-			DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-			inputStream = new ByteArrayInputStream( xml.getBytes() );
-			return documentBuilder.parse( inputStream );
-		} 
-		finally
-		{
-			close( inputStream );
-		}
-	}
-	
-	/**
-	 * Will compile the passed in XPath expression and evalutate it
-	 * against the passed in doument.
-	 * 
-	 * @param document			Document that the XPath expression should evaluate upon.
-	 * @param xPathExpression	XPath expression
-	 * @return Element			The Element found
-	 * @throws XPathExpressionException
-	 */
-	public static Element getNodeFromXPathExpression( Document document, String xPathExpression ) throws XPathExpressionException
-	{
-		if (document == null)
-			throw new IllegalArgumentException( "document must not be null" );
-		
-		if ( xPathExpression == null )
-			return document.getDocumentElement();
-		
-		Node rootNode = (Node) getQNameFromXPathExpression( document, xPathExpression, XPathConstants.NODE );
-		
-		return (Element) rootNode;
-	}
-	
-	/**
-	 * @param xml				XML string that will be the target of the XPath evaluation
-	 * @param xPathExpression	XPath expression
-	 * @return Element			The Element found
-	 * 
-	 * @throws XPathExpressionException
-	 * @throws SAXException
-	 * @throws IOException
-	 * @throws ParserConfigurationException
-	 */
-	public static Element getNodeFromXPathExpression( String xml, String xPathExpression ) throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
-	{
-		return getNodeFromXPathExpression( getDocument( xml ), xPathExpression );
-	}
-	
-	/**
-	 * All public methods should be able to delegate the actual XPath evaluation
-	 * to this method.
-	 * 
-	 * @param document			Document that the XPath expression should evaluate upon.
-	 * 							Must not be null. This caller is responsible for checking for null.
-	 * @param xPathExpression	XPath expression
-	 * 							Must not be null. This caller is responsible for checking for null.
-	 * @param type				The XPathConstant type to use. The affects the type returned from the evaluate method.
-	 * 
-	 * @return Object			of type specified in the passed in <code>type</code> argument
-	 * 
-	 * @throws XPathExpressionException
-	 */
-	private static Object getQNameFromXPathExpression( Document document, String xPathExpression, QName type ) throws XPathExpressionException
-	{
-		XPath xpath = XPathFactory.newInstance().newXPath();
-		XPathExpression expression = xpath.compile( xPathExpression );
-		
-		return expression.evaluate( document.getDocumentElement(), type );
-	}
-
-	private static void close (Closeable c )
-	{
-		try
-		{
-			if ( c != null )
-				c.close();
-		} 
-		catch (IOException e)
-		{
-			log.error(  "Error when closing IOStream", e );
-		}
-	}
-
-}

Deleted: labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	2007-06-21 08:37:30 UTC (rev 12736)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -1,113 +0,0 @@
-/*
- * 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, JBoss Inc.
- */
-package org.jboss.soa.esb.testutils;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.config.Generator;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * Utility class for working with the ESB configuration.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ESBConfigUtil {
-
-    private Document listenerConfig;
-    private Document gatewayConfig;
-
-    public ESBConfigUtil(InputStream esbXsdConfig) {
-        AssertArgument.isNotNull(esbXsdConfig, "esbXsdConfig");
-        ByteArrayOutputStream listenerConfigStream = new ByteArrayOutputStream();
-        ByteArrayOutputStream gatewayConfigStream = new ByteArrayOutputStream();
-        Generator generator = null;
-
-        try {
-            generator = new Generator(esbXsdConfig, listenerConfigStream, gatewayConfigStream);
-            generator.generate();
-            listenerConfig = YADOMUtil.parseStream(new ByteArrayInputStream(listenerConfigStream.toByteArray()), false, false);
-            gatewayConfig = YADOMUtil.parseStream(new ByteArrayInputStream(gatewayConfigStream.toByteArray()), false, false);
-        } catch(Exception e) {
-            e.printStackTrace();
-            TestCase.fail(e.getMessage());
-        }
-    }
-
-    public ConfigTree getListenerConfig(String listenerName) {
-        AssertArgument.isNotNull(listenerName, "listenerName");
-        return ConfigTree.fromElement(getListenerConfig(listenerName, listenerConfig));
-    }
-
-    public ConfigTree getGatewayConfig(String gatewayName) {
-        AssertArgument.isNotNull(gatewayName, "gatewayName");
-        return ConfigTree.fromElement(getListenerConfig(gatewayName, gatewayConfig));
-    }
-
-    private Element getListenerConfig(String name, Document config) {
-        NodeList listenerConfigElements = config.getDocumentElement().getElementsByTagName(name);
-
-        if(listenerConfigElements == null || listenerConfigElements.getLength() == 0) {
-            return null;
-        }
-
-        return (Element) listenerConfigElements.item(0);
-    }
-
-    public ConfigTree getActionConfig(String listenerName, String actionName) {
-        AssertArgument.isNotNull(listenerName, "listenerName");
-        AssertArgument.isNotNull(actionName, "actionName");
-
-        Element listener = getListenerConfig(listenerName, listenerConfig);
-        NodeList actions = listener.getElementsByTagName("action");
-
-        if(actions == null || actions.getLength() == 0) {
-            return null;
-        }
-
-        for(int i = 0; i < actions.getLength(); i++) {
-            Element action = (Element) actions.item(i);
-
-            if(actionName.equals(action.getAttribute("action"))) {
-                return ConfigTree.fromElement(action);
-            }
-        }
-        
-        return null;
-    }
-
-
-    public Document getListenerConfig() {
-        return listenerConfig;
-    }
-
-    public Document getGatewayConfig() {
-        return gatewayConfig;
-    }
-}

Deleted: labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-06-21 08:37:30 UTC (rev 12736)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -1,82 +0,0 @@
-package org.jboss.soa.esb.util;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.notification.NotificationException;
-import org.jboss.soa.esb.notification.NotificationTarget;
-
-/**
- * Mock NotificationTarget Implementation. <p/> Configured by giving the target
- * output list a 'name'. Notifications are statically accessed via the static
- * {@link #getTargetList(String)} method, supplying the target list name. <p/>
- * Sample config:
- * 
- * <pre>
- *  &lt;NotificationList type=&quot;OK&quot;&gt;
- *  	&lt;target class=&quot;org.jboss.soa.esb.util.MockNotificationTarget&quot; &lt;b&gt;name=&quot;ok-target&quot;&lt;/b&gt; /&gt;
- *  &lt;/NotificationList&gt;
- * </pre>
- * 
- * @author tfennelly
- */
-public class MockNotificationTarget extends NotificationTarget
-{
-
-	private static Hashtable<String, List<Serializable>> targetLists = new Hashtable<String, List<Serializable>>();
-
-	private List<Serializable> targetList;
-
-	public MockNotificationTarget (ConfigTree config)
-	{
-		super(config);
-
-		String name = config.getAttribute("name");
-
-		if (name == null || name.trim().equals(""))
-		{
-			TestCase
-					.fail("Mock NotificationTarget configured incorrectly.  Must specify a 'name' attribute on the NotificationList/target element.");
-		}
-
-		targetList = getTargetList(name);
-	}
-
-	public static List<Serializable> getTargetList (String name)
-	{
-		synchronized (targetLists)
-		{
-			List<Serializable> notificationList = targetLists.get(name);
-
-			// Never return a null list.
-			if (notificationList == null)
-			{
-				notificationList = new ArrayList<Serializable>();
-				targetLists.put(name, notificationList);
-			}
-
-			return notificationList;
-		}
-	}
-
-	public static void clearNotifications ()
-	{
-		synchronized (targetLists)
-		{
-			targetLists.clear();
-		}
-	}
-
-	@Override
-	public void sendNotification (Message notificationObject)
-			throws NotificationException
-	{
-		targetList.add(notificationObject);
-	}
-}

Deleted: labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	2007-06-21 08:37:30 UTC (rev 12736)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of individual
- * contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY 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
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * Tests the XPathUtil class
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- * @since 4.2
- *
- */
-public class XPathUtilTest
-{
-	private String xml = "<someNode><childnode><name>Daniel</name></childnode></someNode>";
-	
-	@Test( expected= IllegalArgumentException.class )
-	public void getDocumentNegative() throws SAXException, IOException, ParserConfigurationException
-	{
-		XPathUtil.getDocument( null );
-	}
-	
-	@Test
-	public void getDocument() throws SAXException, IOException, ParserConfigurationException
-	{
-		Document document = XPathUtil.getDocument( xml );
-		assertNotNull( document );
-	}
-	
-	@Test( expected= IllegalArgumentException.class )
-	public void getNodeFromXPathExpressionNegative_null_document( ) throws XPathExpressionException
-	{
-		Document document = null;
-		XPathUtil.getNodeFromXPathExpression( document, "/some/path[0]" );
-	}
-	
-	@Test
-	public void getNodeFromXPathExpression( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
-	{
-		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode" );
-		assertEquals( "childnode", node.getNodeName() );
-	}
-	
-	@Test
-	public void getNodeFromXPathExpression_sibling( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
-	{
-		String xml = "<someNode><childnode><name>Daniel</name></childnode><childnode><name>Bevenius</name></childnode></someNode>";
-		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode[2]" );
-		assertEquals( "childnode", node.getNodeName() );
-		Node nameNode = node.getElementsByTagName( "name" ).item( 0 );
-		assertNotNull( nameNode );
-		assertEquals( "Bevenius", nameNode.getTextContent() );
-	}
-	
-	@Test
-	public void getNodeFromXPathExpression_StringXml_and_XPathExpression() throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
-	{
-		Element node = XPathUtil.getNodeFromXPathExpression( xml, "/someNode/childnode" );
-		assertEquals( "childnode", node.getNodeName() );
-	}
-
-}

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/rosetta)

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/rosetta/build.xml	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/build.xml	2007-06-21 11:56:19 UTC (rev 12737)
@@ -5,9 +5,11 @@
 	<property name="org.jboss.esb.rosetta.distrib.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
 	<property name="org.jboss.esb.rosetta.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
     <property name="org.jboss.esb.rosetta.src.dir" location="src"/>
-	<property name="org.jboss.esb.root.dir" location="../.."/>
+	<property name="org.jboss.esb.root.dir" location="../"/>
+	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
     <property environment="env"/>
 
+
 	<property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
 	<condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/client">
 		<equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
@@ -16,8 +18,15 @@
 	<path id="org.jboss.esb.rosetta.base.classpath">
         <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
         <fileset dir="${org.jboss.esb.ext.lib.dir}/standalone" includes="*.jar"/>
+		<pathelement location="${gendir}/classes"/>
 	</path>
 
+	<path id="emma.libs">
+        <fileset dir="../lib/ext" includes="emma*.jar"/>
+    </path>
+    <taskdef resource="emma_ant.properties" classpathref="emma.libs" />
+
+
     <target name="org.jboss.esb.rosetta.init">
         <tstamp>
             <format property="TODAY" pattern="dd-MM-yy"/>
@@ -36,6 +45,8 @@
     </target>
 
     <target name="org.jboss.esb.rosetta.compile">
+		<!-- generate config model -->
+        <antcall target="generate-config-model"/>
         <!-- Compile common -->
         <antcall target="org.jboss.esb.rosetta.internal.compile"/>
         <!-- Compile common tests -->
@@ -71,7 +82,7 @@
     	                includes="org/jboss/soa/esb/testutils/**/*.class"/>
     </target>
 
-    <target name="org.jboss.esb.rosetta.test" description="Run tests for this module">
+    <target name="org.jboss.esb.rosetta.test" depends="org.jboss.esb.rosetta.compile" description="Run tests for this module">
         <!-- Compile rosetta tests -->
         <ant dir="tests" target="org.jboss.esb.rosetta.internal.test"/>
     </target>
@@ -83,4 +94,28 @@
 
     <target name="all" depends="recompile,jar" />
 
+	<target name="generate-config-model" depends="org.jboss.esb.rosetta.prepare">
+
+        <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="xbeans-classpath" />
+        <delete dir="${gendir}" /><mkdir dir="${gendir}" />
+
+        <xmlbean
+            classgendir="${gendir}/classes"
+            javasource="1.5"
+            srcgendir="${gendir}/src"
+            destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar"
+            classpathref="xbeans-classpath">
+            <fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.0.1.xsd,jbossesb-1.0.1.xsdconfig"/>
+        </xmlbean>
+        <!-- now add the xsd to it -->
+        <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar" update="true"
+            basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/"
+            includes="jbossesb-1.0.1.xsd"/>
+    </target>
+
+    <path id="xbeans-classpath">
+        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
+    </path>
+
+
 </project>

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/dependencies)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/internal/soa/esb/publish)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/internal/soa/esb/services)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/actions)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/mock (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/mock)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/soa/esb/services/registry)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/services/src/org/jboss/soa/esb/services/routing)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/src/org/jboss/soa/esb/util/XPathUtil.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY 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
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.Closeable;
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * Util methods for XPath related operations.
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ * @since 4.2
+ *
+ */
+public class XPathUtil
+{
+	private static Logger log = Logger.getLogger( XPathUtil.class );
+	
+	/**
+	 * Parses the passed in xml and creates a Dom Document
+	 * 
+	 * @param xml
+	 * @return Document
+	 * @throws SAXException
+	 * @throws IOException
+	 * @throws ParserConfigurationException
+	 */
+	public static org.w3c.dom.Document getDocument( String xml ) throws SAXException, IOException, ParserConfigurationException
+	{
+		if (xml == null) 
+			throw new IllegalArgumentException( "xml must not be null" );
+		
+		ByteArrayInputStream inputStream = null;
+		try
+		{
+			DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+			inputStream = new ByteArrayInputStream( xml.getBytes() );
+			return documentBuilder.parse( inputStream );
+		} 
+		finally
+		{
+			close( inputStream );
+		}
+	}
+	
+	/**
+	 * Will compile the passed in XPath expression and evalutate it
+	 * against the passed in doument.
+	 * 
+	 * @param document			Document that the XPath expression should evaluate upon.
+	 * @param xPathExpression	XPath expression
+	 * @return Element			The Element found
+	 * @throws XPathExpressionException
+	 */
+	public static Element getNodeFromXPathExpression( Document document, String xPathExpression ) throws XPathExpressionException
+	{
+		if (document == null)
+			throw new IllegalArgumentException( "document must not be null" );
+		
+		if ( xPathExpression == null )
+			return document.getDocumentElement();
+		
+		Node rootNode = (Node) getQNameFromXPathExpression( document, xPathExpression, XPathConstants.NODE );
+		
+		return (Element) rootNode;
+	}
+	
+	/**
+	 * @param xml				XML string that will be the target of the XPath evaluation
+	 * @param xPathExpression	XPath expression
+	 * @return Element			The Element found
+	 * 
+	 * @throws XPathExpressionException
+	 * @throws SAXException
+	 * @throws IOException
+	 * @throws ParserConfigurationException
+	 */
+	public static Element getNodeFromXPathExpression( String xml, String xPathExpression ) throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
+	{
+		return getNodeFromXPathExpression( getDocument( xml ), xPathExpression );
+	}
+	
+	/**
+	 * All public methods should be able to delegate the actual XPath evaluation
+	 * to this method.
+	 * 
+	 * @param document			Document that the XPath expression should evaluate upon.
+	 * 							Must not be null. This caller is responsible for checking for null.
+	 * @param xPathExpression	XPath expression
+	 * 							Must not be null. This caller is responsible for checking for null.
+	 * @param type				The XPathConstant type to use. The affects the type returned from the evaluate method.
+	 * 
+	 * @return Object			of type specified in the passed in <code>type</code> argument
+	 * 
+	 * @throws XPathExpressionException
+	 */
+	private static Object getQNameFromXPathExpression( Document document, String xPathExpression, QName type ) throws XPathExpressionException
+	{
+		XPath xpath = XPathFactory.newInstance().newXPath();
+		XPathExpression expression = xpath.compile( xPathExpression );
+		
+		return expression.evaluate( document.getDocumentElement(), type );
+	}
+
+	private static void close (Closeable c )
+	{
+		try
+		{
+			if ( c != null )
+				c.close();
+		} 
+		catch (IOException e)
+		{
+			log.error(  "Error when closing IOStream", e );
+		}
+	}
+
+}

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/rosetta/tests/build.xml	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/build.xml	2007-06-21 11:56:19 UTC (rev 12737)
@@ -13,15 +13,18 @@
     <property environment="env"/>
     <property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
 	<!-- Set deployment properties filename -->
-	<property name="org.jboss.esb.deployment.properties" location="../../../install/deployment.properties"/>
+	<property name="org.jboss.esb.deployment.properties" location="../../install/deployment.properties"/>
 	<!-- Load deployment properties File -->
 	<property file="${org.jboss.esb.deployment.properties}"/>
+	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
+
 	
-        <property name="org.jboss.esb.test.ftp.hostname" value="localhost"/>
-        <property name="org.jboss.esb.test.ftp.user" value="ftpuser"/>
-        <property name="org.jboss.esb.test.ftp.pwd" value="ftppassword"/>
-        <property name="org.jboss.esb.test.ftp.dir" value="/tmp"/>
-        <property name="org.jboss.esb.test.persistdb.dir" location="${org.jboss.esb.internal.dest}/testdb"/>
+	<property name="org.jboss.esb.test.ftp.hostname" value="localhost"/>
+	<property name="org.jboss.esb.test.ftp.user" value="ftpuser"/>
+	<property name="org.jboss.esb.test.ftp.pwd" value="ftppassword"/>
+	<property name="org.jboss.esb.test.ftp.dir" value="/tmp"/>
+	<property name="org.jboss.esb.test.persistdb.dir" location="${org.jboss.esb.internal.dest}/testdb"/>
+
     <condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/client">
         <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
     </condition>
@@ -31,8 +34,12 @@
     <path id="org.jboss.esb.tests.base.classpath">
         <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
         <fileset dir="${org.jboss.esb.ftp.lib.dir}" includes="*.jar"/>
-    	<pathelement location="${org.jboss.esb.root.dir}/core/rosetta/tests/resources/etc"/>
+		<pathelement location="${org.jboss.esb.module.classes.root.dir}/rosetta"/>
+		<pathelement location="${gendir}/classes"/>
         <pathelement location="${org.jboss.esb.module.classes.dir}"/>
+    	<pathelement location="${org.jboss.esb.root.dir}/rosetta/tests/resources/etc"/>
+		<pathelement location="${org.jboss.esb.module.tests.conf.dir}"/>
+        <pathelement location="${org.jboss.esb.root.dir}/etc/schemas/xml"/>
     </path>
 
     <target name="org.jboss.esb.tests.init">
@@ -100,7 +107,9 @@
         <copy todir="${org.jboss.esb.test.persistdb.dir}">
             <fileset dir="resources/etc/" includes="persistUnitTestDB*"/>
         </copy>
+		<copy file="${org.jboss.esb.root.dir}/etc/schemas/xml/jbossesb-1.0.1.xsd" todir="${org.jboss.esb.tests.classes.dir}"/>
 
+
         <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
             <formatter type="plain" usefile="false"/>
             <formatter type="xml"/>
@@ -123,11 +132,12 @@
 			<!-- emma jvm args -->
 			<jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
 			<jvmarg value="-Demma.coverage.out.merge=true" />
-        	
+        	<!--	
         	<sysproperty key="org.jboss.esb.test.db.driver" value="${org.jboss.esb.test.db.driver}"/>
         	<sysproperty key="org.jboss.esb.test.db.url" value="${org.jboss.esb.test.db.url}"/>
         	<sysproperty key="org.jboss.esb.test.db.user" value="${org.jboss.esb.test.db.user}"/>
         	<sysproperty key="org.jboss.esb.test.db.password" value="${org.jboss.esb.test.db.password}"/>
+			-->
         	<sysproperty key="org.jboss.esb.test.ftp.hostname" value="${org.jboss.esb.test.ftp.hostname}"/>
         	<sysproperty key="org.jboss.esb.test.ftp.user" value="${org.jboss.esb.test.ftp.user}"/>
         	<sysproperty key="org.jboss.esb.test.ftp.pwd" value="${org.jboss.esb.test.ftp.pwd}"/>

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/services/tests/src/org/jboss/internal/soa/esb/publish)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/services/tests/src/org/jboss/internal/soa/esb/services)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions)

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -119,7 +119,7 @@
     {
         String pathToFile = new StringBuilder()
                 .append(TestEnvironmentUtil.getUserDir("product"))
-                .append("core/listeners/tests/src/org/jboss/soa/esb/actions/")
+                .append("rosetta/tests/src/org/jboss/soa/esb/actions/")
                 .append(fileName).toString();
 
         logger.debug("Determining If the File Exists - " + fileName);

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -44,7 +44,7 @@
 {
 
     private static final String PERSIST_DB_DIR = System.getProperty("org.jboss.esb.test.persistdb.dir",
-    		"./core/rosetta/tests/resources/etc") ;
+    		"./rosetta/tests/resources/etc") ;
     private static String mDbDriver ="org.hsqldb.jdbcDriver";
     private static String mDbUrl = "jdbc:hsqldb:file:" + PERSIST_DB_DIR + "/persistUnitTestDB";
     private static String mDbUsername = "sa";

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -48,7 +48,7 @@
 {
 
     private static final String PERSIST_DB_DIR = System.getProperty("org.jboss.esb.test.persistdb.dir",
-    		"./core/rosetta/tests/resources/etc") ;
+    		"./rosetta/tests/resources/etc") ;
     private static String mDbDriver ="org.hsqldb.jdbcDriver";
     private static String mDbUrl = "jdbc:hsqldb:file:" + PERSIST_DB_DIR + "/persistUnitTestDB";
     private static String mDbUsername = "sa";

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners)

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -52,6 +52,7 @@
 		_logger.info("Writing temp files to " + TMP_DIR);
 
 		clearMessages() ;
+		
 
 		try
 		{
@@ -68,7 +69,7 @@
 
 			stmt.executeUpdate("CREATE TABLE esb_messages (message_id varchar NOT NULL, message varchar, status varchar, insert_timestamp bigint, CONSTRAINT pkey_esb_messages PRIMARY KEY (message_id))");
 		}
-		catch (SQLException ex)
+	catch (SQLException ex)
 		{
 			_logger.error(ex);
 

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -48,7 +48,7 @@
 	public void readAndGenerateConfig() throws Exception
 	{
 		String configFileName = TestEnvironmentUtil.getUserDir("product") 
-			+ "core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml";
+			+ "rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml";
 		//Make sure this file exists
 		File configFile = new File(configFileName);
 		if (!configFile.exists()){

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -16,6 +16,7 @@
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java	2007-06-20 14:56:45 UTC (rev 12715)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -43,8 +43,7 @@
 	public static String getCacheConfigFile()
 	{
 		String configFile = TestEnvironmentUtil.getBaseDir() + File.separator + 
-							"core" + File.separator + 
-							"listeners" + File.separator + 
+							"rosetta" + File.separator + 
 							"tests" + File.separator + 
 							"src" + File.separator + 
 							"org" + File.separator + 

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/services/tests/src/org/jboss/soa/esb/services)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -0,0 +1,113 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.testutils;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.config.Generator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * Utility class for working with the ESB configuration.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ESBConfigUtil {
+
+    private Document listenerConfig;
+    private Document gatewayConfig;
+
+    public ESBConfigUtil(InputStream esbXsdConfig) {
+        AssertArgument.isNotNull(esbXsdConfig, "esbXsdConfig");
+        ByteArrayOutputStream listenerConfigStream = new ByteArrayOutputStream();
+        ByteArrayOutputStream gatewayConfigStream = new ByteArrayOutputStream();
+        Generator generator = null;
+
+        try {
+            generator = new Generator(esbXsdConfig, listenerConfigStream, gatewayConfigStream);
+            generator.generate();
+            listenerConfig = YADOMUtil.parseStream(new ByteArrayInputStream(listenerConfigStream.toByteArray()), false, false);
+            gatewayConfig = YADOMUtil.parseStream(new ByteArrayInputStream(gatewayConfigStream.toByteArray()), false, false);
+        } catch(Exception e) {
+            e.printStackTrace();
+            TestCase.fail(e.getMessage());
+        }
+    }
+
+    public ConfigTree getListenerConfig(String listenerName) {
+        AssertArgument.isNotNull(listenerName, "listenerName");
+        return ConfigTree.fromElement(getListenerConfig(listenerName, listenerConfig));
+    }
+
+    public ConfigTree getGatewayConfig(String gatewayName) {
+        AssertArgument.isNotNull(gatewayName, "gatewayName");
+        return ConfigTree.fromElement(getListenerConfig(gatewayName, gatewayConfig));
+    }
+
+    private Element getListenerConfig(String name, Document config) {
+        NodeList listenerConfigElements = config.getDocumentElement().getElementsByTagName(name);
+
+        if(listenerConfigElements == null || listenerConfigElements.getLength() == 0) {
+            return null;
+        }
+
+        return (Element) listenerConfigElements.item(0);
+    }
+
+    public ConfigTree getActionConfig(String listenerName, String actionName) {
+        AssertArgument.isNotNull(listenerName, "listenerName");
+        AssertArgument.isNotNull(actionName, "actionName");
+
+        Element listener = getListenerConfig(listenerName, listenerConfig);
+        NodeList actions = listener.getElementsByTagName("action");
+
+        if(actions == null || actions.getLength() == 0) {
+            return null;
+        }
+
+        for(int i = 0; i < actions.getLength(); i++) {
+            Element action = (Element) actions.item(i);
+
+            if(actionName.equals(action.getAttribute("action"))) {
+                return ConfigTree.fromElement(action);
+            }
+        }
+        
+        return null;
+    }
+
+
+    public Document getListenerConfig() {
+        return listenerConfig;
+    }
+
+    public Document getGatewayConfig() {
+        return gatewayConfig;
+    }
+}

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/testutils/test)

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -0,0 +1,82 @@
+package org.jboss.soa.esb.util;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.notification.NotificationException;
+import org.jboss.soa.esb.notification.NotificationTarget;
+
+/**
+ * Mock NotificationTarget Implementation. <p/> Configured by giving the target
+ * output list a 'name'. Notifications are statically accessed via the static
+ * {@link #getTargetList(String)} method, supplying the target list name. <p/>
+ * Sample config:
+ * 
+ * <pre>
+ *  &lt;NotificationList type=&quot;OK&quot;&gt;
+ *  	&lt;target class=&quot;org.jboss.soa.esb.util.MockNotificationTarget&quot; &lt;b&gt;name=&quot;ok-target&quot;&lt;/b&gt; /&gt;
+ *  &lt;/NotificationList&gt;
+ * </pre>
+ * 
+ * @author tfennelly
+ */
+public class MockNotificationTarget extends NotificationTarget
+{
+
+	private static Hashtable<String, List<Serializable>> targetLists = new Hashtable<String, List<Serializable>>();
+
+	private List<Serializable> targetList;
+
+	public MockNotificationTarget (ConfigTree config)
+	{
+		super(config);
+
+		String name = config.getAttribute("name");
+
+		if (name == null || name.trim().equals(""))
+		{
+			TestCase
+					.fail("Mock NotificationTarget configured incorrectly.  Must specify a 'name' attribute on the NotificationList/target element.");
+		}
+
+		targetList = getTargetList(name);
+	}
+
+	public static List<Serializable> getTargetList (String name)
+	{
+		synchronized (targetLists)
+		{
+			List<Serializable> notificationList = targetLists.get(name);
+
+			// Never return a null list.
+			if (notificationList == null)
+			{
+				notificationList = new ArrayList<Serializable>();
+				targetLists.put(name, notificationList);
+			}
+
+			return notificationList;
+		}
+	}
+
+	public static void clearNotifications ()
+	{
+		synchronized (targetLists)
+		{
+			targetLists.clear();
+		}
+	}
+
+	@Override
+	public void sendNotification (Message notificationObject)
+			throws NotificationException
+	{
+		targetList.add(notificationObject);
+	}
+}

Copied: labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java (from rev 12715, labs/jbossesb/workspace/dbevenius/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	2007-06-21 11:56:19 UTC (rev 12737)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY 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
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * Tests the XPathUtil class
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ * @since 4.2
+ *
+ */
+public class XPathUtilTest
+{
+	private String xml = "<someNode><childnode><name>Daniel</name></childnode></someNode>";
+	
+	@Test( expected= IllegalArgumentException.class )
+	public void getDocumentNegative() throws SAXException, IOException, ParserConfigurationException
+	{
+		XPathUtil.getDocument( null );
+	}
+	
+	@Test
+	public void getDocument() throws SAXException, IOException, ParserConfigurationException
+	{
+		Document document = XPathUtil.getDocument( xml );
+		assertNotNull( document );
+	}
+	
+	@Test( expected= IllegalArgumentException.class )
+	public void getNodeFromXPathExpressionNegative_null_document( ) throws XPathExpressionException
+	{
+		Document document = null;
+		XPathUtil.getNodeFromXPathExpression( document, "/some/path[0]" );
+	}
+	
+	@Test
+	public void getNodeFromXPathExpression( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
+	{
+		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode" );
+		assertEquals( "childnode", node.getNodeName() );
+	}
+	
+	@Test
+	public void getNodeFromXPathExpression_sibling( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
+	{
+		String xml = "<someNode><childnode><name>Daniel</name></childnode><childnode><name>Bevenius</name></childnode></someNode>";
+		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode[2]" );
+		assertEquals( "childnode", node.getNodeName() );
+		Node nameNode = node.getElementsByTagName( "name" ).item( 0 );
+		assertNotNull( nameNode );
+		assertEquals( "Bevenius", nameNode.getTextContent() );
+	}
+	
+	@Test
+	public void getNodeFromXPathExpression_StringXml_and_XPathExpression() throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
+	{
+		Element node = XPathUtil.getNodeFromXPathExpression( xml, "/someNode/childnode" );
+		assertEquals( "childnode", node.getNodeName() );
+	}
+
+}

Modified: labs/jbossesb/workspace/dbevenius/trunk/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/samples/quickstarts/conf/base-build.xml	2007-06-21 08:37:30 UTC (rev 12736)
+++ labs/jbossesb/workspace/dbevenius/trunk/product/samples/quickstarts/conf/base-build.xml	2007-06-21 11:56:19 UTC (rev 12737)
@@ -169,6 +169,9 @@
 			<!-- spring config -->
 			<fileset dir="${base.jbossesb}/lib/spring.esb" includes="*.jar"/>
 			<pathelement location="${base.jbossesb}/lib/spring.esb"/>
+			<!-- soap config -->
+			<fileset dir="${base.jbossesb}/lib/soap.esb" includes="*.jar"/>
+			<pathelement location="${base.jbossesb}/lib/soap.esb"/>
 		</path>
 	</target>
 
@@ -195,6 +198,9 @@
 			<!-- spring config -->
 			<fileset dir="${product.dir}/server/default/deploy/spring.esb" includes="*.jar"/>
 			<pathelement location="${product.dir}/server/default/deploy/spring.esb"/>
+			<!-- soap config -->
+			<fileset dir="${product.dir}/server/default/deploy/soap.esb" includes="*.jar"/>
+			<pathelement location="${product.dir}/server/default/deploy/soap.esb"/>
 			<!-- general libs -->
 			<pathelement location="${product.dir}/server/default/lib/commons-logging.jar"/>
 			<pathelement location="${product.dir}/lib/jboss-system.jar"/>




More information about the jboss-svn-commits mailing list