[jboss-cvs] JBossAS SVN: r74078 - in projects/ejb3/trunk/proxy/src/test: java/org/jboss/ejb3/test/proxy/common/ejb/slsb and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 4 01:57:35 EDT 2008


Author: ALRubinger
Date: 2008-06-04 01:57:34 -0400 (Wed, 04 Jun 2008)
New Revision: 74078

Added:
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulLocalOnlyBean.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulRemoteOnlyBean.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessLocalOnlyBean.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessRemoteOnlyBean.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase.java
   projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase-beans.xml
   projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase-beans.xml
   projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase-beans.xml
   projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase-beans.xml
Log:
[EJBTHREE-1397] Added Test Cases, all pass

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulLocalOnlyBean.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulLocalOnlyBean.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulLocalOnlyBean.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.common.ejb.sfsb;
+
+import javax.ejb.Local;
+import javax.ejb.LocalHome;
+import javax.ejb.Stateful;
+
+/**
+ * MyStatefulBean
+ * 
+ * A Mock SFSB with only Local Views
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at LocalHome(MyStatefulLocalHome.class)
+ at Local(MyStatefulLocalBusiness.class)
+public class MyStatefulLocalOnlyBean extends MyStatefulBeanBase implements MyStatefulLocalBusiness
+{
+   // Business Logic in Base
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulRemoteOnlyBean.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulRemoteOnlyBean.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/sfsb/MyStatefulRemoteOnlyBean.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.common.ejb.sfsb;
+
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Stateful;
+
+/**
+ * MyStatefulBean
+ * 
+ * A Mock SFSB with only Remote Views
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at RemoteHome(MyStatefulRemoteHome.class)
+ at Remote(MyStatefulRemoteBusiness.class)
+public class MyStatefulRemoteOnlyBean extends MyStatefulBeanBase implements MyStatefulRemoteBusiness
+{
+   // Business Logic in Base
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessLocalOnlyBean.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessLocalOnlyBean.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessLocalOnlyBean.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.common.ejb.slsb;
+
+import javax.ejb.Local;
+import javax.ejb.LocalHome;
+import javax.ejb.Stateless;
+
+/**
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at LocalHome(MyStatelessLocalHome.class)
+ at Local(MyStatelessLocal.class)
+public class MyStatelessLocalOnlyBean implements MyStatelessLocal
+{
+   public String sayHi(String name)
+   {
+      return "Hi " + name;
+   }
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessRemoteOnlyBean.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessRemoteOnlyBean.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/ejb/slsb/MyStatelessRemoteOnlyBean.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.common.ejb.slsb;
+
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Stateless;
+
+/**
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at RemoteHome(MyStatelessRemoteHome.class)
+ at Remote(MyStatelessRemote.class)
+public class MyStatelessRemoteOnlyBean implements MyStatelessRemote
+{
+   public String sayHi(String name)
+   {
+      return "Hi " + name;
+   }
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.session.unit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
+import org.jboss.ejb3.test.proxy.common.Utils;
+import org.jboss.ejb3.test.proxy.common.container.StatefulContainer;
+import org.jboss.ejb3.test.proxy.common.ejb.sfsb.MyStatefulLocalBusiness;
+import org.jboss.ejb3.test.proxy.common.ejb.sfsb.MyStatefulLocalHome;
+import org.jboss.ejb3.test.proxy.common.ejb.sfsb.MyStatefulLocalOnlyBean;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * ProxyStatefulSessionLocalOnlyTestCase
+ * 
+ * Test Cases to ensure proper invocation of SFSBs with 
+ * only Local Views Defined
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class ProxyStatefulSessionLocalOnlyTestCase extends ProxySessionTestCaseBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * JNDI Context
+    */
+   private static Context context;
+
+   // --------------------------------------------------------------------------------||
+   // Tests --------------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Test Local Business Binding and Invocation
+    * 
+    * @throws Exception
+    */
+   @Test
+   public void testLocalBusiness() throws Exception
+   {
+      // Obtain the Proxy
+      Object bean = ProxyStatefulSessionLocalOnlyTestCase.context.lookup("MyStatefulLocalOnlyBean/local");
+      assertTrue("Bean must be assignable to " + MyStatefulLocalBusiness.class.getSimpleName() + " but was instead "
+            + bean.getClass(), bean instanceof MyStatefulLocalBusiness);
+
+      // Invoke and Test Result
+      int result = ((MyStatefulLocalBusiness) bean).getNextCounter();
+      assertEquals(result, 0);
+   }
+
+   /**
+    * Test Local Business Binding and Invocation
+    * to a specific interface
+    * 
+    * @throws Exception
+    */
+   @Test
+   public void testLocalBusinessSpecificInterface() throws Exception
+   {
+      // Obtain the Proxy
+      Object bean = ProxyStatefulSessionLocalOnlyTestCase.context.lookup("MyStatefulLocalOnlyBean/local-"
+            + MyStatefulLocalBusiness.class.getName());
+      assertTrue("Bean must be assignable to " + MyStatefulLocalBusiness.class.getSimpleName() + " but was instead "
+            + bean.getClass(), bean instanceof MyStatefulLocalBusiness);
+
+      // Invoke and Test Result
+      int result = ((MyStatefulLocalBusiness) bean).getNextCounter();
+      assertEquals(result, 0);
+   }
+
+   /**
+    * Test Local Home Binding
+    * 
+    * @throws Exception
+    */
+   @Test
+   public void testLocalHome() throws Exception
+   {
+      Object bean = ProxyStatefulSessionLocalOnlyTestCase.context.lookup("MyStatefulLocalOnlyBean/localHome");
+      assertTrue(bean instanceof MyStatefulLocalHome);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Lifecycle Methods --------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Perform setup before any tests
+    * 
+    * @throws Throwable
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Throwable
+   {
+      // Create Bootstrap 
+      ProxySessionTestCaseBase.setUpBeforeClass();
+
+      // Deploy MC Beans
+      ProxyStatefulSessionLocalOnlyTestCase.bootstrap.deploy(ProxyStatefulSessionLocalOnlyTestCase.class);
+
+      // Create a SLSB
+      StatefulContainer container = Utils.createSfsb(MyStatefulLocalOnlyBean.class);
+
+      // Install
+      Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
+
+      // Create JNDI Context
+      ProxyStatefulSessionLocalOnlyTestCase.context = new InitialContext(); // Props from CP jndi.properties
+
+   }
+
+   @AfterClass
+   public static void tearDownAfterClass() throws Exception
+   {
+      if (bootstrap != null)
+         bootstrap.shutdown();
+      bootstrap = null;
+   }
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.session.unit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
+import org.jboss.ejb3.test.proxy.common.Utils;
+import org.jboss.ejb3.test.proxy.common.container.StatefulContainer;
+import org.jboss.ejb3.test.proxy.common.ejb.sfsb.MyStatefulRemoteBusiness;
+import org.jboss.ejb3.test.proxy.common.ejb.sfsb.MyStatefulRemoteHome;
+import org.jboss.ejb3.test.proxy.common.ejb.sfsb.MyStatefulRemoteOnlyBean;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * ProxyStatefulSessionRemoteOnlyTestCase
+ * 
+ * Test Cases to ensure proper invocation of SFSBs with 
+ * only Remote Views Defined
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class ProxyStatefulSessionRemoteOnlyTestCase extends ProxySessionTestCaseBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * JNDI Context
+    */
+   private static Context context;
+
+   // --------------------------------------------------------------------------------||
+   // Tests --------------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Test Remote Business Binding and Invocation
+    * 
+    * @throws Exception
+    */
+   @Test
+   public void testRemoteBusiness() throws Exception
+   {
+      // Obtain the Proxy
+      Object bean = ProxyStatefulSessionRemoteOnlyTestCase.context.lookup("MyStatefulRemoteOnlyBean/remote");
+      assertTrue("Bean must be assignable to " + MyStatefulRemoteBusiness.class.getSimpleName() + " but was instead "
+            + bean.getClass(), bean instanceof MyStatefulRemoteBusiness);
+
+      // Invoke and Test Result
+      int result = ((MyStatefulRemoteBusiness) bean).getNextCounter();
+      assertEquals(result, 0);
+   }
+
+   /**
+    * Test Remote Business Binding and Invocation
+    * to a specific interface
+    * 
+    * @throws Exception
+    */
+   @Test
+   public void testRemoteBusinessSpecificInterface() throws Exception
+   {
+      // Obtain the Proxy
+      Object bean = ProxyStatefulSessionRemoteOnlyTestCase.context.lookup("MyStatefulRemoteOnlyBean/remote-"
+            + MyStatefulRemoteBusiness.class.getName());
+      assertTrue("Bean must be assignable to " + MyStatefulRemoteBusiness.class.getSimpleName() + " but was instead "
+            + bean.getClass(), bean instanceof MyStatefulRemoteBusiness);
+
+      // Invoke and Test Result
+      int result = ((MyStatefulRemoteBusiness) bean).getNextCounter();
+      assertEquals(result, 0);
+   }
+
+   /**
+    * Test Remote Home Binding
+    * 
+    * @throws Exception
+    */
+   @Test
+   public void testRemoteHome() throws Exception
+   {
+      Object bean = ProxyStatefulSessionRemoteOnlyTestCase.context.lookup("MyStatefulRemoteOnlyBean/home");
+      assertTrue(bean instanceof MyStatefulRemoteHome);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Lifecycle Methods --------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Perform setup before any tests
+    * 
+    * @throws Throwable
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Throwable
+   {
+      // Create Bootstrap 
+      ProxySessionTestCaseBase.setUpBeforeClass();
+
+      // Deploy MC Beans
+      ProxyStatefulSessionRemoteOnlyTestCase.bootstrap.deploy(ProxyStatefulSessionRemoteOnlyTestCase.class);
+
+      // Create a SLSB
+      StatefulContainer container = Utils.createSfsb(MyStatefulRemoteOnlyBean.class);
+
+      // Install
+      Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
+
+      // Create JNDI Context
+      ProxyStatefulSessionRemoteOnlyTestCase.context = new InitialContext(); // Props from CP jndi.properties
+
+   }
+
+   @AfterClass
+   public static void tearDownAfterClass() throws Exception
+   {
+      if (bootstrap != null)
+         bootstrap.shutdown();
+      bootstrap = null;
+   }
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.session.unit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import javax.naming.InitialContext;
+
+import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
+import org.jboss.ejb3.test.proxy.common.Utils;
+import org.jboss.ejb3.test.proxy.common.container.StatelessContainer;
+import org.jboss.ejb3.test.proxy.common.ejb.slsb.MyStatelessLocal;
+import org.jboss.ejb3.test.proxy.common.ejb.slsb.MyStatelessLocalHome;
+import org.jboss.ejb3.test.proxy.common.ejb.slsb.MyStatelessLocalOnlyBean;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class ProxyStatelessSessionLocalOnlyTestCase extends ProxySessionTestCaseBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Tests --------------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @Test
+   public void testLocal() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+
+      Object bean = ctx.lookup("MyStatelessLocalOnlyBean/local");
+      assertTrue(bean instanceof MyStatelessLocal);
+
+      String result = ((MyStatelessLocal) bean).sayHi("testLocal");
+      assertEquals("Hi testLocal", result);
+   }
+
+   @Test
+   public void testLocalSpecificInterface() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+
+      Object bean = ctx.lookup("MyStatelessLocalOnlyBean/local-" + MyStatelessLocal.class.getName());
+      assertTrue(bean instanceof MyStatelessLocal);
+
+      String result = ((MyStatelessLocal) bean).sayHi("testLocal");
+      assertEquals("Hi testLocal", result);
+   }
+
+   @Test
+   public void testLocalHome() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+
+      Object bean = ctx.lookup("MyStatelessLocalOnlyBean/localHome");
+      assertTrue(bean instanceof MyStatelessLocalHome);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Lifecycle Methods --------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Perform setup before any tests
+    * 
+    * @throws Throwable
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Throwable
+   {
+      // Create Bootstrap and Deploy
+      ProxySessionTestCaseBase.setUpBeforeClass();
+
+      // Deploy MC Beans
+      ProxyStatelessSessionLocalOnlyTestCase.bootstrap.deploy(ProxyStatelessSessionLocalOnlyTestCase.class);
+
+      // Create a SLSB
+      StatelessContainer container = Utils.createSlsb(MyStatelessLocalOnlyBean.class);
+
+      // Install
+      Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
+
+   }
+
+   @AfterClass
+   public static void tearDownAfterClass() throws Exception
+   {
+      if (bootstrap != null)
+         bootstrap.shutdown();
+      bootstrap = null;
+   }
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase.java	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.proxy.session.unit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import javax.naming.InitialContext;
+
+import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
+import org.jboss.ejb3.test.proxy.common.Utils;
+import org.jboss.ejb3.test.proxy.common.container.StatelessContainer;
+import org.jboss.ejb3.test.proxy.common.ejb.slsb.MyStatelessRemote;
+import org.jboss.ejb3.test.proxy.common.ejb.slsb.MyStatelessRemoteHome;
+import org.jboss.ejb3.test.proxy.common.ejb.slsb.MyStatelessRemoteOnlyBean;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class ProxyStatelessSessionRemoteOnlyTestCase extends ProxySessionTestCaseBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Tests --------------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @Test
+   public void testRemote() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+
+      Object bean = ctx.lookup("MyStatelessRemoteOnlyBean/remote");
+      assertTrue(bean instanceof MyStatelessRemote);
+
+      String result = ((MyStatelessRemote) bean).sayHi("testRemote");
+      assertEquals("Hi testRemote", result);
+   }
+
+   @Test
+   public void testRemoteSpecificInterface() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+
+      Object bean = ctx.lookup("MyStatelessRemoteOnlyBean/remote-" + MyStatelessRemote.class.getName());
+      assertTrue(bean instanceof MyStatelessRemote);
+
+      String result = ((MyStatelessRemote) bean).sayHi("testRemote");
+      assertEquals("Hi testRemote", result);
+   }
+
+   @Test
+   public void testRemoteHome() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+
+      Object bean = ctx.lookup("MyStatelessRemoteOnlyBean/home");
+      assertTrue(bean instanceof MyStatelessRemoteHome);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Lifecycle Methods --------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Perform setup before any tests
+    * 
+    * @throws Throwable
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Throwable
+   {
+      // Create Bootstrap and Deploy
+      ProxySessionTestCaseBase.setUpBeforeClass();
+
+      // Deploy MC Beans
+      ProxyStatelessSessionRemoteOnlyTestCase.bootstrap.deploy(ProxyStatelessSessionRemoteOnlyTestCase.class);
+
+      // Create a SLSB
+      StatelessContainer container = Utils.createSlsb(MyStatelessRemoteOnlyBean.class);
+
+      // Install
+      Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
+
+   }
+
+   @AfterClass
+   public static void tearDownAfterClass() throws Exception
+   {
+      if (bootstrap != null)
+         bootstrap.shutdown();
+      bootstrap = null;
+   }
+}

Added: projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase-beans.xml
===================================================================
--- projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase-beans.xml	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionLocalOnlyTestCase-beans.xml	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,77 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+  xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- 
+    
+    JNDI 
+    
+    The requisite Naming Server
+    
+  -->
+  <bean name="NameServer" class="org.jnp.server.SingletonNamingServer" />
+
+  <!-- 
+    
+    JNDI Registrars
+    
+    
+    The JNDI Registrar is responsible for all JNDI Bindings for
+    an EJB.  Its constructor takes the following arguments, in order:
+    
+    javax.naming.Context (JNDI Context into which to bind objects)
+    org.jboss.ejb3.proxy.spi.registry.ProxyFactoryRegistry (Implementation of ProxyFactoryRegistry)
+    String statelessSessionProxyObjectFactoryType The JNDI ObjectFactory implementation to use for SLSB
+    ...more later when SFSB, @Service, MDB Implemented
+    
+  -->
+
+  <!-- SFSB JNDI Registrar -->
+  <bean name="org.jboss.ejb3.JndiRegistrar.Session.SFSBJndiRegistrar"
+    class="org.jboss.ejb3.proxy.jndiregistrar.JndiStatefulSessionRegistrar">
+    <constructor>
+      <parameter>
+        <inject bean="org.jboss.ejb3.JndiContext" />
+      </parameter>
+      <parameter>
+        org.jboss.ejb3.proxy.objectfactory.session.stateful.StatefulSessionProxyObjectFactory
+      </parameter>
+    </constructor>
+    <depends>NameServer</depends>
+  </bean>
+
+  <!-- JNDI Registrar Configuration -->
+  <bean name="org.jboss.ejb3.JndiContext"
+    class="javax.naming.InitialContext" />
+
+  <!-- 
+    
+    Remoting
+    
+  -->
+
+  <!-- Remoting  Configuration -->
+  <bean name="ServerConfiguration"
+    class="org.jboss.remoting.ServerConfiguration">
+    <property name="invocationHandlers">
+      <map keyClass="java.lang.String" valueClass="java.lang.String">
+        <entry>
+          <key>AOP</key>
+          <value>
+            org.jboss.aspects.remoting.AOPRemotingInvocationHandler
+          </value>
+        </entry>
+      </map>
+    </property>
+  </bean>
+
+  <!-- Remoting Connector -->
+  <bean name="Connector"
+    class="org.jboss.remoting.transport.Connector">
+    <property name="invokerLocator">socket://0.0.0.0:3874</property>
+    <property name="serverConfiguration">
+      <inject bean="ServerConfiguration" />
+    </property>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase-beans.xml
===================================================================
--- projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase-beans.xml	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionRemoteOnlyTestCase-beans.xml	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,77 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+  xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- 
+    
+    JNDI 
+    
+    The requisite Naming Server
+    
+  -->
+  <bean name="NameServer" class="org.jnp.server.SingletonNamingServer" />
+
+  <!-- 
+    
+    JNDI Registrars
+    
+    
+    The JNDI Registrar is responsible for all JNDI Bindings for
+    an EJB.  Its constructor takes the following arguments, in order:
+    
+    javax.naming.Context (JNDI Context into which to bind objects)
+    org.jboss.ejb3.proxy.spi.registry.ProxyFactoryRegistry (Implementation of ProxyFactoryRegistry)
+    String statelessSessionProxyObjectFactoryType The JNDI ObjectFactory implementation to use for SLSB
+    ...more later when SFSB, @Service, MDB Implemented
+    
+  -->
+
+  <!-- SFSB JNDI Registrar -->
+  <bean name="org.jboss.ejb3.JndiRegistrar.Session.SFSBJndiRegistrar"
+    class="org.jboss.ejb3.proxy.jndiregistrar.JndiStatefulSessionRegistrar">
+    <constructor>
+      <parameter>
+        <inject bean="org.jboss.ejb3.JndiContext" />
+      </parameter>
+      <parameter>
+        org.jboss.ejb3.proxy.objectfactory.session.stateful.StatefulSessionProxyObjectFactory
+      </parameter>
+    </constructor>
+    <depends>NameServer</depends>
+  </bean>
+
+  <!-- JNDI Registrar Configuration -->
+  <bean name="org.jboss.ejb3.JndiContext"
+    class="javax.naming.InitialContext" />
+
+  <!-- 
+    
+    Remoting
+    
+  -->
+
+  <!-- Remoting  Configuration -->
+  <bean name="ServerConfiguration"
+    class="org.jboss.remoting.ServerConfiguration">
+    <property name="invocationHandlers">
+      <map keyClass="java.lang.String" valueClass="java.lang.String">
+        <entry>
+          <key>AOP</key>
+          <value>
+            org.jboss.aspects.remoting.AOPRemotingInvocationHandler
+          </value>
+        </entry>
+      </map>
+    </property>
+  </bean>
+
+  <!-- Remoting Connector -->
+  <bean name="Connector"
+    class="org.jboss.remoting.transport.Connector">
+    <property name="invokerLocator">socket://0.0.0.0:3874</property>
+    <property name="serverConfiguration">
+      <inject bean="ServerConfiguration" />
+    </property>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase-beans.xml
===================================================================
--- projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase-beans.xml	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionLocalOnlyTestCase-beans.xml	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,77 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+  xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- 
+    
+    JNDI 
+    
+    The requisite Naming Server
+    
+  -->
+  <bean name="NameServer" class="org.jnp.server.SingletonNamingServer" />
+
+  <!-- 
+    
+    JNDI Registrars
+    
+    
+    The JNDI Registrar is responsible for all JNDI Bindings for
+    an EJB.  Its constructor takes the following arguments, in order:
+    
+    javax.naming.Context (JNDI Context into which to bind objects)
+    org.jboss.ejb3.proxy.spi.registry.ProxyFactoryRegistry (Implementation of ProxyFactoryRegistry)
+    String statelessSessionProxyObjectFactoryType The JNDI ObjectFactory implementation to use for SLSB
+    ...more later when SFSB, @Service, MDB Implemented
+    
+  -->
+
+  <!-- SLSB JNDI Registrar -->
+  <bean name="org.jboss.ejb3.JndiRegistrar.Session.SLSBJndiRegistrar"
+    class="org.jboss.ejb3.proxy.jndiregistrar.JndiStatelessSessionRegistrar">
+    <constructor>
+      <parameter>
+        <inject bean="org.jboss.ejb3.JndiContext" />
+      </parameter>
+      <parameter>
+        org.jboss.ejb3.proxy.objectfactory.session.stateless.StatelessSessionProxyObjectFactory
+      </parameter>
+    </constructor>
+    <depends>NameServer</depends>
+  </bean>
+
+  <!-- JNDI Registrar Configuration -->
+  <bean name="org.jboss.ejb3.JndiContext"
+    class="javax.naming.InitialContext" />
+
+  <!-- 
+    
+    Remoting
+    
+  -->
+
+  <!-- Remoting  Configuration -->
+  <bean name="ServerConfiguration"
+    class="org.jboss.remoting.ServerConfiguration">
+    <property name="invocationHandlers">
+      <map keyClass="java.lang.String" valueClass="java.lang.String">
+        <entry>
+          <key>AOP</key>
+          <value>
+            org.jboss.aspects.remoting.AOPRemotingInvocationHandler
+          </value>
+        </entry>
+      </map>
+    </property>
+  </bean>
+
+  <!-- Remoting Connector -->
+  <bean name="Connector"
+    class="org.jboss.remoting.transport.Connector">
+    <property name="invokerLocator">socket://0.0.0.0:3874</property>
+    <property name="serverConfiguration">
+      <inject bean="ServerConfiguration" />
+    </property>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase-beans.xml
===================================================================
--- projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase-beans.xml	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionRemoteOnlyTestCase-beans.xml	2008-06-04 05:57:34 UTC (rev 74078)
@@ -0,0 +1,77 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+  xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- 
+    
+    JNDI 
+    
+    The requisite Naming Server
+    
+  -->
+  <bean name="NameServer" class="org.jnp.server.SingletonNamingServer" />
+
+  <!-- 
+    
+    JNDI Registrars
+    
+    
+    The JNDI Registrar is responsible for all JNDI Bindings for
+    an EJB.  Its constructor takes the following arguments, in order:
+    
+    javax.naming.Context (JNDI Context into which to bind objects)
+    org.jboss.ejb3.proxy.spi.registry.ProxyFactoryRegistry (Implementation of ProxyFactoryRegistry)
+    String statelessSessionProxyObjectFactoryType The JNDI ObjectFactory implementation to use for SLSB
+    ...more later when SFSB, @Service, MDB Implemented
+    
+  -->
+
+  <!-- SLSB JNDI Registrar -->
+  <bean name="org.jboss.ejb3.JndiRegistrar.Session.SLSBJndiRegistrar"
+    class="org.jboss.ejb3.proxy.jndiregistrar.JndiStatelessSessionRegistrar">
+    <constructor>
+      <parameter>
+        <inject bean="org.jboss.ejb3.JndiContext" />
+      </parameter>
+      <parameter>
+        org.jboss.ejb3.proxy.objectfactory.session.stateless.StatelessSessionProxyObjectFactory
+      </parameter>
+    </constructor>
+    <depends>NameServer</depends>
+  </bean>
+
+  <!-- JNDI Registrar Configuration -->
+  <bean name="org.jboss.ejb3.JndiContext"
+    class="javax.naming.InitialContext" />
+
+  <!-- 
+    
+    Remoting
+    
+  -->
+
+  <!-- Remoting  Configuration -->
+  <bean name="ServerConfiguration"
+    class="org.jboss.remoting.ServerConfiguration">
+    <property name="invocationHandlers">
+      <map keyClass="java.lang.String" valueClass="java.lang.String">
+        <entry>
+          <key>AOP</key>
+          <value>
+            org.jboss.aspects.remoting.AOPRemotingInvocationHandler
+          </value>
+        </entry>
+      </map>
+    </property>
+  </bean>
+
+  <!-- Remoting Connector -->
+  <bean name="Connector"
+    class="org.jboss.remoting.transport.Connector">
+    <property name="invokerLocator">socket://0.0.0.0:3874</property>
+    <property name="serverConfiguration">
+      <inject bean="ServerConfiguration" />
+    </property>
+  </bean>
+
+</deployment>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list