[jboss-svn-commits] JBL Code SVN: r5478 - in labs/jbossesb/branches/ejb3/product: core/common/src/org/jboss/soa/esb/helpers core/common/tests core/common/tests/src/org/jboss/soa/esb/common/tests core/services core/services/tests core/services/tests/src/org/jboss/soa/esb/services/EJB/test lib lib/deploy lib/ejb3 lib/ejb3_embedded lib/ext

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Aug 4 17:44:57 EDT 2006


Author: kurt.stam at jboss.com
Date: 2006-08-04 17:39:28 -0400 (Fri, 04 Aug 2006)
New Revision: 5478

Added:
   labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
   labs/jbossesb/branches/ejb3/product/lib/deploy/
   labs/jbossesb/branches/ejb3/product/lib/deploy/postgresql-8.1-407.jdbc3.jar
   labs/jbossesb/branches/ejb3/product/lib/ejb3/
   labs/jbossesb/branches/ejb3/product/lib/ejb3/jboss-annotations-ejb3.jar
   labs/jbossesb/branches/ejb3/product/lib/ejb3/jboss-ejb3x.jar
   labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/
   labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/hibernate-all.jar
   labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/jboss-ejb3-all.jar
   labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/thirdparty-all.jar
Removed:
   labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
   labs/jbossesb/branches/ejb3/product/lib/ext/hibernate-all.jar
   labs/jbossesb/branches/ejb3/product/lib/ext/jboss-ejb3-all.jar
   labs/jbossesb/branches/ejb3/product/lib/ext/postgresql-8.1-407.jdbc3.jar
   labs/jbossesb/branches/ejb3/product/lib/ext/thirdparty-all.jar
Modified:
   labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/helpers/AppServerContext.java
   labs/jbossesb/branches/ejb3/product/core/common/tests/build.xml
   labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java
   labs/jbossesb/branches/ejb3/product/core/services/build.xml
   labs/jbossesb/branches/ejb3/product/core/services/tests/build.xml
   labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java
   labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java
Log:
Adding ejb3 support

Modified: labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/helpers/AppServerContext.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/helpers/AppServerContext.java	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/helpers/AppServerContext.java	2006-08-04 21:39:28 UTC (rev 5478)
@@ -80,7 +80,7 @@
 		oPr.setProperty(Context.INITIAL_CONTEXT_FACTORY,
 				"org.jnp.interfaces.NamingContextFactory");
 		oPr.setProperty(Context.URL_PKG_PREFIXES,
-				"jboss.naming:org.jnp.interfaces");
+				"org.jboss.naming:org.jnp.interfaces");
 
 		boolean bCtxOK = false;
 		Context oCtx = null;

Modified: labs/jbossesb/branches/ejb3/product/core/common/tests/build.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/build.xml	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/build.xml	2006-08-04 21:39:28 UTC (rev 5478)
@@ -8,7 +8,7 @@
     <property name="org.jboss.esb.tests.report.dir" value="${org.jboss.esb.internal.dest}/tests/junit"/>
     <property name="org.jboss.esb.root.dir" value="../.."/>
     <property environment="env"/>
-
+	<property name="org.jboss.esb.ejb3.lib.dir" value="../${org.jboss.esb.root.dir}/lib/ejb3_embedded"/>
     <property name="org.jboss.esb.ext.lib.dir" value="${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"/>
@@ -17,6 +17,8 @@
     <path id="org.jboss.esb.tests.base.classpath">
         <fileset dir="../${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
         <pathelement location="${org.jboss.esb.module.classes.dir}"/>
+    	<fileset dir="${org.jboss.esb.ejb3.lib.dir}" includes="jboss-ejb3-all.jar hibernate-all.jar thirdparty-all"/>
+
     </path>
 
     <target name="org.jboss.esb.tests.init">

Modified: labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java	2006-08-04 21:39:28 UTC (rev 5478)
@@ -21,8 +21,11 @@
 */
 package org.jboss.soa.esb.common.tests;
 
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+
 import junit.framework.TestCase;
-import org.jboss.logging.Logger;
 
 /**
  * Base test class for esb test classes, uses jboss logging.
@@ -32,24 +35,60 @@
  * $Id:$
  */
 public class BaseTest extends TestCase {
+	
+	/** The Database driver used for unit tests */
+	public static String DB_DRIVER = "org.jboss.esb.db.driver";
 
-    /**
-     * The Logger.
-     */
-   protected Logger log = Logger.getLogger(getClass());
+	/** The Database connection url used for unit tests */
+	public static String DB_URL = "org.jboss.esb.db.url";
 
+	/** The Database user name used for unit tests */
+	public static String DB_USERNAME = "org.jboss.esb.db.username";
+
+	/** The Database password used for unit tests */
+	public static String DB_PASSWORD = "org.jboss.esb.db.password";
+
+	/** The Logger. */
+    protected Logger log = Logger.getLogger(getClass());
+   
+    /** Contains user and or deployment specific paramater */
+    private static HashMap<String,String> SYSTEM_PARAMETERS;
     /**
      * Default class constructor.
      */
-   public BaseTest() {
-   }
+    public BaseTest() {
+    	SYSTEM_PARAMETERS = readSystemParameters();
+    }
 
     /**
      * Utility constructor.
       * @param name The test name.
      */
-   public BaseTest(String name) {
+    public BaseTest(String name) {
       super(name);
-   }
+      SYSTEM_PARAMETERS = readSystemParameters();
+    }
 
+   /**
+    * Reading system parameter that are set by the ant build when 
+    * invoking the junit call. The parameter values should be set in 
+    * the deployment.properties file. If the particular parameter is not
+    * found it will receive a default value.
+    */
+    private HashMap<String,String> readSystemParameters()
+    {
+    	//Reading system parameter
+	    String dbDriver   = System.getProperty(DB_DRIVER  , "org.postgresql.Driver");
+	    String dbUrl      = System.getProperty(DB_PASSWORD, "jdbc:postgresql://localhost:5432/jbossesb");
+	    String dbUsername = System.getProperty(DB_USERNAME, "postgres");
+	    String dbPassword = System.getProperty(DB_PASSWORD, "postgres");
+	    //Setting the paremeters in the HashMap
+	    HashMap<String,String> systemParameters = new HashMap<String,String>();
+	    systemParameters.put(DB_DRIVER, dbDriver);
+	    systemParameters.put(DB_URL, dbUrl);
+	    systemParameters.put(DB_USERNAME, dbUsername);
+	    systemParameters.put(DB_PASSWORD, dbPassword);
+	   
+	    return systemParameters;
+    }
 }

Deleted: labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java	2006-08-04 21:39:28 UTC (rev 5478)
@@ -1,163 +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.common.tests;
-
-/**
- * Special Setup class to invoke the JBoss microcontainer for testing ejb
- * code. Based a class provided by John Gilbert.
- *
- * @author kstam
- */
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NameClassPair;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-import org.apache.log4j.Logger;
-import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
-
-public class EJBContainerSetup extends TestSetup {
-
-	private static final Logger log = Logger.getLogger(EJBContainerSetup.class);
-
-	private static InitialContext initialContext;
-
-	private static boolean initialized = false;
-
-	public EJBContainerSetup(Test test) {
-		super(test);
-	}
-
-	protected void setUp() {
-		startupEmbeddedJboss();
-	}
-
-	protected void tearDown() {
-		// shutdownEmbeddedJboss();
-	}
-
-	public static void shutdownEmbeddedJboss() {
-		EJB3StandaloneBootstrap.shutdown();
-	}
-
-	public static void startupEmbeddedJboss() {
-		try {
-			if (initialized)
-				return;
-
-			// TODO should not have to do this....
-			System.setProperty(
-					"javax.security.jacc.PolicyConfigurationFactory.provider",
-					"org.jboss.security.jacc.JBossPolicyConfigurationFactory");
-
-			// Boot the JBoss Microcontainer with EJB3 settings, loads
-			// ejb3-interceptors-aop.xml
-			EJB3StandaloneBootstrap.boot(null);
-
-			// Deploy CaveatEmptor beans (datasource, mostly)
-			EJB3StandaloneBootstrap.deployXmlResource("jboss-jms-beans.xml");
-			//EJB3StandaloneBootstrap.deployXmlResource("ejb3-deployment.xml");
-			EJB3StandaloneBootstrap.deployXmlResource("security-beans.xml");
-			log.info("scanClasspath: "
-							+ System.getProperty("java.class.path"));
-			EJB3StandaloneBootstrap.scanClasspath();
-
-			// Create InitialContext from jndi.properties
-			System.setProperty("java.naming.factory.initial",
-					"org.jnp.interfaces.LocalOnlyContextFactory");
-			System.setProperty("java.naming.factory.url.pkgs",
-					"org.jboss.naming:org.jnp.interfaces");
-			initialContext = new InitialContext();
-
-			printJndiTree();
-
-			initialized = true;
-
-		} catch (Exception ex) {
-			log.error("EJB3 Container Startup Error", ex);
-			throw new RuntimeException(ex);
-		}
-	}
-
-	static private void printJndiTree() throws Exception {
-		
-		log.info("JNDI Tree");
-		NamingEnumeration e = initialContext.list("");
-		while (e.hasMore()) {
-			NameClassPair element = (NameClassPair) e.next();
-			print(element, "");
-		}
-		e = initialContext.list("java:");
-		while (e.hasMore()) {
-			NameClassPair element = (NameClassPair) e.next();
-			print(element, "");
-		}
-	}
-
-	static private void print(NameClassPair ctx, String tab) {
-		log.info(tab + ctx);
-		try {
-			NamingEnumeration e = initialContext.list(ctx.getName());
-			while (e.hasMore()) {
-				NameClassPair element = (NameClassPair) e.next();
-				print(element, tab + "--> ");
-			}
-		} catch (NamingException e1) {
-		}
-	}
-
-	public static Object lookup(String beanName) {
-		try {
-			return initialContext.lookup(beanName);
-		} catch (NamingException ex) {
-			throw new RuntimeException("Couldn't lookup: " + beanName, ex);
-		}
-	}
-
-	public static Object lookup(String beanName, String user, String password) {
-		InitialContext ctx = null;
-		try {
-			Properties env = new Properties();
-			env.setProperty(Context.SECURITY_PRINCIPAL, user);
-			env.setProperty(Context.SECURITY_CREDENTIALS, password);
-			env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
-					"org.jboss.security.jndi.JndiLoginInitialContextFactory");
-			ctx = new InitialContext(env);
-
-			return ctx.lookup(beanName);
-		} catch (NamingException ex) {
-			throw new RuntimeException("Couldn't lookup: " + beanName, ex);
-		} finally {
-			try {
-				ctx.close();
-			} catch (Exception e) {
-				throw new RuntimeException(e);
-			}
-		}
-	}
-}

Added: labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java	2006-08-04 21:39:28 UTC (rev 5478)
@@ -0,0 +1,163 @@
+/*
+* 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.common.tests;
+
+/**
+ * Special Setup class to invoke the JBoss microcontainer for testing ejb
+ * code. Based a class provided by John Gilbert.
+ *
+ * @author kstam
+ */
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NameClassPair;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.apache.log4j.Logger;
+import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
+
+public class EJBContainerSetup extends TestSetup {
+
+	private static final Logger log = Logger.getLogger(EJBContainerSetup.class);
+
+	private static InitialContext initialContext;
+
+	private static boolean initialized = false;
+
+	public EJBContainerSetup(Test test) {
+		super(test);
+	}
+
+	protected void setUp() {
+		startupEmbeddedJboss();
+	}
+
+	protected void tearDown() {
+		// shutdownEmbeddedJboss();
+	}
+
+	public static void shutdownEmbeddedJboss() {
+		EJB3StandaloneBootstrap.shutdown();
+	}
+
+	public static void startupEmbeddedJboss() {
+		try {
+			if (initialized)
+				return;
+
+			// TODO should not have to do this....
+			System.setProperty(
+					"javax.security.jacc.PolicyConfigurationFactory.provider",
+					"org.jboss.security.jacc.JBossPolicyConfigurationFactory");
+
+			// Boot the JBoss Microcontainer with EJB3 settings, loads
+			// ejb3-interceptors-aop.xml
+			EJB3StandaloneBootstrap.boot(null);
+
+			// Deploy CaveatEmptor beans (datasource, mostly)
+			EJB3StandaloneBootstrap.deployXmlResource("jboss-jms-beans.xml");
+			//EJB3StandaloneBootstrap.deployXmlResource("ejb3-deployment.xml");
+			EJB3StandaloneBootstrap.deployXmlResource("security-beans.xml");
+			log.info("scanClasspath: "
+							+ System.getProperty("java.class.path"));
+			EJB3StandaloneBootstrap.scanClasspath();
+
+			// Create InitialContext from jndi.properties
+			System.setProperty("java.naming.factory.initial",
+					"org.jnp.interfaces.LocalOnlyContextFactory");
+			System.setProperty("java.naming.factory.url.pkgs",
+					"org.jboss.naming:org.jnp.interfaces");
+			initialContext = new InitialContext();
+
+			printJndiTree();
+
+			initialized = true;
+
+		} catch (Exception ex) {
+			log.error("EJB3 Container Startup Error", ex);
+			throw new RuntimeException(ex);
+		}
+	}
+
+	static private void printJndiTree() throws Exception {
+		
+		log.info("JNDI Tree");
+		NamingEnumeration e = initialContext.list("");
+		while (e.hasMore()) {
+			NameClassPair element = (NameClassPair) e.next();
+			print(element, "");
+		}
+		e = initialContext.list("java:");
+		while (e.hasMore()) {
+			NameClassPair element = (NameClassPair) e.next();
+			print(element, "");
+		}
+	}
+
+	static private void print(NameClassPair ctx, String tab) {
+		log.info(tab + ctx);
+		try {
+			NamingEnumeration e = initialContext.list(ctx.getName());
+			while (e.hasMore()) {
+				NameClassPair element = (NameClassPair) e.next();
+				print(element, tab + "--> ");
+			}
+		} catch (NamingException e1) {
+		}
+	}
+
+	public static Object lookup(String beanName) {
+		try {
+			return initialContext.lookup(beanName);
+		} catch (NamingException ex) {
+			throw new RuntimeException("Couldn't lookup: " + beanName, ex);
+		}
+	}
+
+	public static Object lookup(String beanName, String user, String password) {
+		InitialContext ctx = null;
+		try {
+			Properties env = new Properties();
+			env.setProperty(Context.SECURITY_PRINCIPAL, user);
+			env.setProperty(Context.SECURITY_CREDENTIALS, password);
+			env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+					"org.jboss.security.jndi.JndiLoginInitialContextFactory");
+			ctx = new InitialContext(env);
+
+			return ctx.lookup(beanName);
+		} catch (NamingException ex) {
+			throw new RuntimeException("Couldn't lookup: " + beanName, ex);
+		} finally {
+			try {
+				ctx.close();
+			} catch (Exception e) {
+				throw new RuntimeException(e);
+			}
+		}
+	}
+}

Modified: labs/jbossesb/branches/ejb3/product/core/services/build.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/build.xml	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/services/build.xml	2006-08-04 21:39:28 UTC (rev 5478)
@@ -23,6 +23,7 @@
 	</condition>
 	
 	<property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/>
+	<property name="org.jboss.esb.ejb3.dir" value="${org.jboss.esb.root.dir}/lib/ejb3"/>
 	<condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/lib">
 		<equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
 	</condition>
@@ -38,6 +39,9 @@
 	        <fileset dir="${org.jboss.esb.ext.lib.dir}"  
 			includes="jboss-jmx.jar"
 			/>
+	    	<fileset dir="${org.jboss.esb.ejb3.dir}"  
+				includes="*.jar"
+			/>
 	    </path>
 
 	    <!-- =================================================================== -->

Modified: labs/jbossesb/branches/ejb3/product/core/services/tests/build.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/tests/build.xml	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/services/tests/build.xml	2006-08-04 21:39:28 UTC (rev 5478)
@@ -22,6 +22,7 @@
 
         <pathelement location="${org.jboss.esb.module.classes.dir}"/>
         <pathelement location="${org.jboss.esb.internal.dest}/classes/common"/>
+    	
     </path>
 
     <target name="org.jboss.esb.tests.init">
@@ -105,6 +106,7 @@
             	<!-- Need the tests src folder because there may be non-compiled test resources -->
                 <pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
                 <path refid="org.jboss.esb.tests.base.classpath"/>
+            	<pathelement location="${org.jboss.esb.ejb3.lib.dir}"/>
             </classpath>
 			<!-- emma jvm args -->
 			<jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />

Modified: labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java	2006-08-04 21:39:28 UTC (rev 5478)
@@ -40,7 +40,6 @@
 import org.jboss.soa.esb.notification.NotificationList;
 import org.jboss.soa.esb.notification.NotificationTarget;
 import org.jboss.soa.esb.notification.NotifySqlTable;
-import org.jboss.soa.esb.services.InotificationHandler;
 import org.jboss.soa.esb.services.EJB.NotificationHandler;
 
 
@@ -53,11 +52,8 @@
 	    	logger.log(Priority.INFO, "Notification Test");
 	    	InitialContext ctx = getInitialContext();
 	        NotificationHandler local = (NotificationHandler ) ctx.lookup("NotificationHandlerBean/local");
-	        
-	        
-
-	         DomElement oEl = new DomElement("MyFileList");
-	         oEl.setAttr(NotificationList.TYPE,"OK");
+	        DomElement oEl = new DomElement("MyFileList");
+	        oEl.setAttr(NotificationList.TYPE,"OK");
 			
 	 //		oEl.addElemChild(fileListTarget());
 	 //		oEl.addElemChild(emailTarget());
@@ -78,7 +74,7 @@
 	         StringBuilder sb = new StringBuilder(oStamp.format(oNow))
 	             .append(" This message from Notification test");
 			
-	         local.sendNotifications(oNL.toString(),sb.toString());
+	         //KS local.sendNotifications(oNL.toString(),sb.toString());
 	        
     	} catch (Exception e) {
     		logger.log(Priority.ERROR, e.getMessage(), e);
@@ -202,9 +198,9 @@
         oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifySqlTable");
 
         oTgt.setAttr(SimpleDataSource.DRIVER,"org.postgresql.Driver");
-        oTgt.setAttr(SimpleDataSource.URL,"jdbc:postgresql://lavasca:5432/rosetta");
+        oTgt.setAttr(SimpleDataSource.URL,"jdbc:postgresql://localhost:5432/jbossesb");
         oTgt.setAttr(SimpleDataSource.USER,"postgres");
-        oTgt.setAttr(SimpleDataSource.PASSWORD,"");
+        oTgt.setAttr(SimpleDataSource.PASSWORD,"postgres");
 		
         // Table name for insert - must exist in database (URL)
         oTgt.setAttr(NotifySqlTable.ATT_TABLE,"test_notif_table");

Modified: labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java	2006-08-04 19:05:51 UTC (rev 5477)
+++ labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java	2006-08-04 21:39:28 UTC (rev 5478)
@@ -21,11 +21,6 @@
 */
 package org.jboss.soa.esb.services.EJB.test;
 
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -33,9 +28,6 @@
 import org.apache.log4j.Priority;
 import org.jboss.soa.esb.common.tests.BaseTest;
 import org.jboss.soa.esb.common.tests.EJBContainerSetup;
-import org.jboss.soa.esb.helpers.AppServerContext;
-import org.jboss.soa.esb.services.IpersistHandler;
-import org.jboss.soa.esb.services.PersistHandlerFactory;
 import org.jboss.soa.esb.services.EJB.PersistHandler;
 
 
@@ -43,17 +35,11 @@
 {
 	private Logger logger = Logger.getLogger(PersistHandlerTest.class);
 	
-    public void testPersistHandler()  {
+    public void testConnectivityToPersistHandler()  {
     	try {
 	    	logger.log(Priority.INFO, "PersistHandler Test");
-	    	//InitialContext ctx = getInitialContext();
-	    	Context ctx = AppServerContext.getServerContext(AppServerContext.CTX_JBOSS, "localhost:1099"); 
-	        IpersistHandler esbHandler = PersistHandlerFactory.getPersistHandler(ctx);
-	        logger.log(Priority.INFO, "esbHandler=" + esbHandler);
-	    	//InitialContext ctx = getInitialContext();
-	    	//PersistHandler local = (PersistHandler ) ctx.lookup("PersistHandlerBean/remote");
-	 	    //local.addDTO(null);
-	    	//logger.log(Priority.INFO, "esbHandler=" + local);
+	    	PersistHandler persistHandlerLocal = (PersistHandler ) EJBContainerSetup.lookup("PersistHandlerBean/remote");
+	    	logger.log(Priority.INFO, "persistHandlerLocal=" + persistHandlerLocal);
     	} catch (Exception e) {
     		logger.log(Priority.ERROR, e.getMessage(), e);
     	}
@@ -69,20 +55,8 @@
     	return new EJBContainerSetup(suite);
     }
     
-    public static InitialContext getInitialContext() throws Exception
-    {
-       Hashtable props = getInitialContextProperties();
-       return new InitialContext(props);
-    }
+
     
-    private static Hashtable getInitialContextProperties()
-    {
-       Hashtable props = new Hashtable();
-       props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
-       props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
-       return props;
-    }
-    
 }
 
    

Copied: labs/jbossesb/branches/ejb3/product/lib/deploy/postgresql-8.1-407.jdbc3.jar (from rev 5461, labs/jbossesb/branches/ejb3/product/lib/ext/postgresql-8.1-407.jdbc3.jar)

Added: labs/jbossesb/branches/ejb3/product/lib/ejb3/jboss-annotations-ejb3.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/branches/ejb3/product/lib/ejb3/jboss-annotations-ejb3.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/branches/ejb3/product/lib/ejb3/jboss-ejb3x.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/branches/ejb3/product/lib/ejb3/jboss-ejb3x.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/hibernate-all.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/hibernate-all.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/jboss-ejb3-all.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/jboss-ejb3-all.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/thirdparty-all.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/branches/ejb3/product/lib/ejb3_embedded/thirdparty-all.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/branches/ejb3/product/lib/ext/hibernate-all.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/branches/ejb3/product/lib/ext/jboss-ejb3-all.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/branches/ejb3/product/lib/ext/postgresql-8.1-407.jdbc3.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/branches/ejb3/product/lib/ext/thirdparty-all.jar
===================================================================
(Binary files differ)




More information about the jboss-svn-commits mailing list