[jboss-cvs] JBossAS SVN: r76283 - in projects/ejb3/trunk/proxy/src/test: java/org/jboss/ejb3/test/proxy/spec_3_2_1 and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 28 00:55:38 EDT 2008
Author: ALRubinger
Date: 2008-07-28 00:55:38 -0400 (Mon, 28 Jul 2008)
New Revision: 76283
Added:
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_2_1/
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase.java
projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/spec_3_2_1/
projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/
projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase-beans.xml
Log:
[EJBTHREE-1401] Created test bootstrap and setup as a jump-off point for creating tests
Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase.java (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase.java 2008-07-28 04:55:38 UTC (rev 76283)
@@ -0,0 +1,160 @@
+/*
+ * 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.spec_3_2_1.unit;
+
+import org.jboss.aop.Dispatcher;
+import org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar;
+import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
+import org.jboss.ejb3.test.mc.bootstrap.EmbeddedTestMcBootstrap;
+import org.jboss.ejb3.test.proxy.common.Utils;
+import org.jboss.ejb3.test.proxy.common.container.StatefulContainer;
+import org.jboss.ejb3.test.proxy.common.container.StatelessContainer;
+import org.jboss.ejb3.test.proxy.common.ejb.sfsb.MyStatefulBean;
+import org.jboss.ejb3.test.proxy.common.ejb.slsb.MyStatelessBean;
+import org.jboss.logging.Logger;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * IntraJvmRemoteInvocationPassByValueTestCase
+ *
+ * Tests for EJB 3.0 Core Specification 3.2.1:
+ *
+ * "The arguments and results of the methods of
+ * the remote business interface are passed by value."
+ *
+ * EJBTHREE-1401
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class IntraJvmRemoteInvocationPassByValueTestCase
+{
+
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static final Logger log = Logger.getLogger(IntraJvmRemoteInvocationPassByValueTestCase.class);
+
+ /*
+ * Bootstrap (MC Abstraction)
+ */
+ private static EmbeddedTestMcBootstrap bootstrap;
+
+ /*
+ * SFSB Bean Implementation class to use for testing
+ */
+ //TODO Needs to be a bean implementation class that will support methods
+ // allowing us to test for pass-by-value; this is here as a stub
+ private static final Class<?> sfsbImplementationClass = MyStatefulBean.class;
+
+ /*
+ * SLSB Bean Implementation class to use for testing
+ */
+ //TODO Needs to be a bean implementation class that will support methods
+ // allowing us to test for pass-by-value; this is here as a stub
+ private static final Class<?> slsbImplementationClass = MyStatelessBean.class;
+
+ // --------------------------------------------------------------------------------||
+ // Tests --------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * This test is in place as an example only.
+ *
+ * All tests in this class should be documented for
+ * intent at the method-level, like so.
+ */
+ @Test
+ public void testExampleMethod() throws Throwable{
+
+ /*
+ * Show what were doing in the next code block
+ */
+
+ // Give line-specific information if necessary
+ log.warn("Needs Implementation");
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Lifecycle start, before the suite is executed
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ /*
+ * Setup the bootstrap environment
+ */
+
+ // Create and set a new MC Bootstrap
+ bootstrap = EmbeddedTestMcBootstrap.createEmbeddedMcBootstrap();
+
+ // Bind the Ejb3Registrar to the Locator
+ Ejb3RegistrarLocator.bindRegistrar(new Ejb3McRegistrar(bootstrap.getKernel()));
+
+ // Deploy Beans
+ bootstrap.deploy(IntraJvmRemoteInvocationPassByValueTestCase.class);
+
+ /*
+ * Create EJBs and Install
+ */
+
+ // Create a SFSB Container
+ StatefulContainer sfsb = Utils.createSfsb(sfsbImplementationClass);
+ log.info("Created SFSB Container: " + sfsb.getName());
+
+ // Create a SLSB Container
+ StatelessContainer slsb = Utils.createSlsb(slsbImplementationClass);
+ log.info("Created SLSB Container: " + slsb.getName());
+
+ // Register Containers w/ Remoting
+ Dispatcher.singleton.registerTarget(sfsb.getName(), sfsb);
+ Dispatcher.singleton.registerTarget(slsb.getName(), slsb);
+
+ // Install EJBs into MC
+ Ejb3RegistrarLocator.locateRegistrar().bind(sfsb.getName(), sfsb);
+ Ejb3RegistrarLocator.locateRegistrar().bind(slsb.getName(), slsb);
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Unbind the Ejb3Registrar from the Locator
+ Ejb3RegistrarLocator.unbindRegistrar();
+
+ // Shutdown MC
+ bootstrap.shutdown();
+
+ // Set Bootstrap to null
+ bootstrap = null;
+ }
+
+}
Added: projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase-beans.xml
===================================================================
--- projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase-beans.xml (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/resources/org/jboss/ejb3/test/proxy/spec_3_2_1/unit/IntraJvmRemoteInvocationPassByValueTestCase-beans.xml 2008-07-28 04:55:38 UTC (rev 76283)
@@ -0,0 +1,90 @@
+<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="NamingBeanImpl" class="org.jnp.server.NamingBeanImpl" />
+
+ <bean name="NameServer" class="org.jnp.server.Main">
+ <property name="namingInfo">
+ <inject bean="NamingBeanImpl" />
+ </property>
+ <property name="port">1099</property>
+ </bean>
+
+ <!--
+
+ 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>
+ org.jboss.ejb3.proxy.objectfactory.session.stateless.StatelessSessionProxyObjectFactory
+ </parameter>
+ </constructor>
+ <depends>NameServer</depends>
+ </bean>
+
+ <!-- SFSB JNDI Registrar -->
+ <bean name="org.jboss.ejb3.JndiRegistrar.Session.SFSBJndiRegistrar"
+ class="org.jboss.ejb3.proxy.jndiregistrar.JndiStatefulSessionRegistrar">
+ <constructor>
+ <parameter>
+ org.jboss.ejb3.proxy.objectfactory.session.stateful.StatefulSessionProxyObjectFactory
+ </parameter>
+ </constructor>
+ <depends>NameServer</depends>
+ </bean>
+
+ <!--
+
+ 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:3873</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