[jboss-svn-commits] JBL Code SVN: r5476 - labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Aug 4 13:00:38 EDT 2006
Author: kurt.stam at jboss.com
Date: 2006-08-04 13:00:31 -0400 (Fri, 04 Aug 2006)
New Revision: 5476
Added:
labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java
Log:
Adding ejb3 support
Added: 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 14:54:28 UTC (rev 5475)
+++ labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/PersistHandlerTest.java 2006-08-04 17:00:31 UTC (rev 5476)
@@ -0,0 +1,88 @@
+/*
+* 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.services.EJB.test;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.log4j.Logger;
+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;
+
+
+public class PersistHandlerTest extends BaseTest
+{
+ private Logger logger = Logger.getLogger(PersistHandlerTest.class);
+
+ public void testPersistHandler() {
+ 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);
+ } catch (Exception e) {
+ logger.log(Priority.ERROR, e.getMessage(), e);
+ }
+ }
+
+ public void testKurt() {
+ logger.log(Priority.INFO, "Test Kurt");
+
+ }
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(PersistHandlerTest.class);
+ 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;
+ }
+
+}
+
+
More information about the jboss-svn-commits
mailing list