[jboss-cvs] JBossAS SVN: r73850 - in projects/ejb3/trunk/core: src/test/java/org/jboss/ejb3 and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 30 11:40:53 EDT 2008
Author: wolfc
Date: 2008-05-30 11:40:53 -0400 (Fri, 30 May 2008)
New Revision: 73850
Added:
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/MetaDataHelper.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleClassLoaderDeployer.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleTransactionService.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStateless.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStatelessBean.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/unit/
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/unit/StatelessContainerTestCase.java
projects/ejb3/trunk/core/src/test/resources/basicbootstrap-beans.xml
projects/ejb3/trunk/core/src/test/resources/jndi.properties
projects/ejb3/trunk/core/src/test/resources/log4j.xml
Modified:
projects/ejb3/trunk/core/
projects/ejb3/trunk/core/pom.xml
Log:
EJBTHREE-1384: a simple local call
Property changes on: projects/ejb3/trunk/core
___________________________________________________________________
Name: svn:ignore
- build.log
target
output
eclipse-target
run.tstamp
release.properties
temp
+ build.log
target
output
eclipse-target
run.tstamp
release.properties
temp
ObjectStore
Modified: projects/ejb3/trunk/core/pom.xml
===================================================================
--- projects/ejb3/trunk/core/pom.xml 2008-05-30 15:37:25 UTC (rev 73849)
+++ projects/ejb3/trunk/core/pom.xml 2008-05-30 15:40:53 UTC (rev 73850)
@@ -57,30 +57,12 @@
</plugin>
<plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-banned-dependencies</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- </execution>
- </executions>
+ <artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <rules>
- <bannedDependencies>
- <excludes>
- <exclude>org.jboss:javassist</exclude>
- <exclude>org.jboss:jboss-metadata</exclude>
- <exclude>org.jboss.microcontainer:jboss-container</exclude>
- </excludes>
- <!--searchTransitive>true</searchTransitive-->
- </bannedDependencies>
- </rules>
- <fail>true</fail>
+ <!-- To make sure any static variables are flushed -->
+ <forkMode>always</forkMode>
</configuration>
</plugin>
-
</plugins>
</build>
@@ -111,6 +93,21 @@
</dependency>
<dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossjta</artifactId>
+ <version>4.3.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- To actually run SimpleTransactionService -->
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossts-common</artifactId>
+ <version>4.3.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version> <!-- Only used here, for Unit Tests -->
@@ -205,7 +202,15 @@
<artifactId>jboss-aop-aspects</artifactId>
</dependency>
+ <!-- used in the basicbootstrap-beans.xml -->
<dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop-deployer-jdk50</artifactId>
+ <version>2.0.0.CR10</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<!-- not used anywhere else -->
@@ -220,6 +225,13 @@
<dependency>
<groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-aspects-test</artifactId>
+ <version>1.0.0.Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
<artifactId>jboss-remoting-aspects</artifactId>
<version>1.0.0.Beta1</version>
</dependency>
@@ -322,6 +334,13 @@
<dependency>
<groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-test</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-transactions</artifactId>
<version>0.13.0</version>
</dependency>
@@ -377,8 +396,20 @@
</exclusion>
<exclusion>
<groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-container</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -386,6 +417,28 @@
<artifactId>jboss-as-system-jmx</artifactId>
<version>${version.org.jboss.jboss-as}</version>
<scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-container</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/MetaDataHelper.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/MetaDataHelper.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/MetaDataHelper.java 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,50 @@
+/*
+ * 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.core.test.common;
+
+import org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class MetaDataHelper
+{
+ /**
+ * Create an empty JBossSessionBeanMetaData to satisfy BeanInterceptorMetaDataBridge.
+ *
+ * @return
+ */
+ public static JBossSessionBeanMetaData createMockBeanMetaData()
+ {
+ JBossMetaData metaData = new JBossMetaData();
+ JBossEnterpriseBeansMetaData enterpriseBeans = new JBossEnterpriseBeansMetaData();
+ metaData.setEnterpriseBeans(enterpriseBeans);
+ metaData.setAssemblyDescriptor(new JBossAssemblyDescriptorMetaData());
+ JBossSessionBeanMetaData sessionBeanMetaData = new JBossSessionBeanMetaData();
+ sessionBeanMetaData.setEnterpriseBeansMetaData(enterpriseBeans);
+ return sessionBeanMetaData;
+ }
+}
Property changes on: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/MetaDataHelper.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleClassLoaderDeployer.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleClassLoaderDeployer.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleClassLoaderDeployer.java 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,40 @@
+/*
+ * 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.core.test.common;
+
+import org.jboss.deployers.spi.deployer.helpers.AbstractTopLevelClassLoaderDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * TODO: Consilidate with org.jboss.ejb3.test.tx.common.SimpleClassLoaderDeployer
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class SimpleClassLoaderDeployer extends AbstractTopLevelClassLoaderDeployer
+{
+ @Override
+ protected ClassLoader createTopLevelClassLoader(DeploymentUnit unit) throws Exception
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+}
Property changes on: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleClassLoaderDeployer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleTransactionService.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleTransactionService.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleTransactionService.java 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,49 @@
+/*
+ * 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.core.test.common;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import com.arjuna.ats.jta.utils.JNDIManager;
+
+/**
+ * Bind a JTA TransactionManager into JNDI.
+ *
+ * TODO: Consilidate with org.jboss.ejb3.tx.test.common.SimpleTransactionService
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class SimpleTransactionService
+{
+ public void start() throws Exception
+ {
+ JNDIManager.bindJTAImplementation();
+ }
+
+ public void stop() throws NamingException
+ {
+ InitialContext ctx = new InitialContext();
+ ctx.unbind("java:/TransactionManager");
+ }
+}
Property changes on: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/common/SimpleTransactionService.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStateless.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStateless.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStateless.java 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,34 @@
+/*
+ * 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.core.test.stateless;
+
+import javax.ejb.Local;
+
+/**
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Local
+public interface MyStateless
+{
+ String sayHi(String name);
+}
Property changes on: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStateless.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStatelessBean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStatelessBean.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStatelessBean.java 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,39 @@
+/*
+ * 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.core.test.stateless;
+
+import javax.ejb.Stateless;
+
+/**
+ * Just a dummy stateless bean.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class MyStatelessBean implements MyStateless
+{
+ public String sayHi(String name)
+ {
+ return "Hi " + name;
+ }
+}
Property changes on: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/MyStatelessBean.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/unit/StatelessContainerTestCase.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/unit/StatelessContainerTestCase.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/unit/StatelessContainerTestCase.java 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,131 @@
+/*
+ * 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.core.test.stateless.unit;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.URL;
+import java.util.Hashtable;
+
+import javax.naming.InitialContext;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aop.Domain;
+import org.jboss.aop.DomainDefinition;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ejb3.InitialContextFactory;
+import org.jboss.ejb3.core.test.common.MetaDataHelper;
+import org.jboss.ejb3.core.test.stateless.MyStateless;
+import org.jboss.ejb3.core.test.stateless.MyStatelessBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.ejb3.test.cachepassivation.MockDeploymentUnit;
+import org.jboss.ejb3.test.cachepassivation.MockEjb3Deployment;
+import org.jboss.ejb3.test.mc.bootstrap.EmbeddedTestMcBootstrap;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This test is just to get some coverage in StatelessContainer.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class StatelessContainerTestCase
+{
+ private static EmbeddedTestMcBootstrap bootstrap;
+
+ @AfterClass
+ public static void afterClass() throws Exception
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource("ejb3-interceptors-aop.xml");
+ AspectXmlLoader.undeployXML(url);
+
+ if(bootstrap != null)
+ bootstrap.shutdown();
+ bootstrap = null;
+ }
+
+ @BeforeClass
+ public static void beforeClass() throws Exception
+ {
+ // FIXME: weirdness in InitialContextFactory (see EJBTHREE-1097)
+ InitialContextFactory.close(null, null);
+
+ bootstrap = EmbeddedTestMcBootstrap.createEmbeddedMcBootstrap();
+ deploy("basicbootstrap-beans.xml");
+
+ // TODO: AspectDeployment
+ URL url = Thread.currentThread().getContextClassLoader().getResource("ejb3-interceptors-aop.xml");
+ AspectXmlLoader.deployXML(url);
+ }
+
+ private static void deploy(String resourceName)
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName);
+ if(url == null)
+ throw new IllegalArgumentException("Can't find a resource named '" + resourceName + "'");
+ assert bootstrap != null : "Can't deploy a resource, bootstrap is null";
+ bootstrap.deploy(url);
+ }
+
+ private static Domain getDomain(String domainName)
+ {
+ DomainDefinition domainDef = AspectManager.instance().getContainer(domainName);
+ if(domainDef == null) throw new IllegalArgumentException("No such domain '" + domainName + "'");
+ return (Domain) domainDef.getManager();
+ }
+
+ @Test
+ public void test1() throws Throwable
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ System.out.println(cl.getResource("jndi.properties"));
+ String beanClassname = MyStatelessBean.class.getName();
+ String ejbName = "MyStatelessBean";
+ Domain domain = getDomain("Stateless Bean");
+ Hashtable ctxProperties = null;
+ Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit(), null);
+ JBossSessionBeanMetaData beanMetaData = MetaDataHelper.createMockBeanMetaData();
+ StatelessContainer container = new StatelessContainer(cl, beanClassname, ejbName, domain, ctxProperties, deployment, beanMetaData);
+
+ // TODO: wickedness
+ container.instantiated();
+
+ String serviceName = "jboss.ejb3:name=MyStatelessBean,service=EJB3";
+ AbstractBeanMetaData bmd = new AbstractBeanMetaData(serviceName, StatelessContainer.class.getName());
+ bootstrap.getKernel().getController().install(bmd, container);
+
+ InitialContext ctx = new InitialContext();
+ System.out.println("ctx = " + ctx);
+ //System.out.println(" " + container.getInitialContext().list("MyStatelessBean").next());
+ MyStateless bean = (MyStateless) ctx.lookup("MyStatelessBean/local");
+
+ String actual = bean.sayHi("Me");
+ assertEquals("Hi Me", actual);
+
+ bootstrap.getKernel().getController().uninstall(serviceName);
+ }
+}
Property changes on: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/stateless/unit/StatelessContainerTestCase.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/core/src/test/resources/basicbootstrap-beans.xml
===================================================================
--- projects/ejb3/trunk/core/src/test/resources/basicbootstrap-beans.xml (rev 0)
+++ projects/ejb3/trunk/core/src/test/resources/basicbootstrap-beans.xml 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="SimpleClassLoaderDeployer" class="org.jboss.ejb3.core.test.common.SimpleClassLoaderDeployer"/>
+
+ <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+ <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+ </bean>
+
+ <bean name="AspectAppParsingDeployer" class="org.jboss.aop.deployers.AspectAppParsingDeployer"/>
+ <bean name="AspectDeployer" class="org.jboss.aop.deployers.AspectDeployer">
+ <property name="type">aop</property>
+ <property name="aspectManager"><inject bean="AspectManager"/></property>
+ </bean>
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ <!--property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property-->
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- File Structure -->
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure"/>
+
+ <!-- JNDI -->
+ <bean name="NameServer" class="org.jnp.server.SingletonNamingServer"/>
+
+ <bean name="JavaCompInitializer" class="org.jboss.naming.JavaCompInitializer"/>
+
+ <bean name="TransactionManager" class="org.jboss.ejb3.core.test.common.SimpleTransactionService">
+ <depends>NameServer</depends>
+ </bean>
+
+ <!--
+ <bean name="AspectDeployment" class="org.jboss.ejb3.test.tx.common.AspectDeployment">
+ <property name="mainDeployer"><inject bean="MainDeployer"/></property>
+ <property name="resource">instance/jboss-aop.xml</property>
+ <depends>TransactionManager</depends>
+ </bean>
+
+ <bean name="TestContainer" class="org.jboss.ejb3.test.tx.common.SimpleContainer">
+ <constructor>
+ <parameter>TestContainer</parameter>
+ <parameter>Stateful Container</parameter>
+ <parameter>org.jboss.ejb3.test.tx.instance.InstanceTestBean</parameter>
+ </constructor>
+ <depends>AspectDeployment</depends>
+ <depends>TransactionManager</depends>
+ </bean>
+ -->
+</deployment>
\ No newline at end of file
Property changes on: projects/ejb3/trunk/core/src/test/resources/basicbootstrap-beans.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/core/src/test/resources/jndi.properties
===================================================================
--- projects/ejb3/trunk/core/src/test/resources/jndi.properties (rev 0)
+++ projects/ejb3/trunk/core/src/test/resources/jndi.properties 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,2 @@
+java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Added: projects/ejb3/trunk/core/src/test/resources/log4j.xml
===================================================================
--- projects/ejb3/trunk/core/src/test/resources/log4j.xml (rev 0)
+++ projects/ejb3/trunk/core/src/test/resources/log4j.xml 2008-05-30 15:40:53 UTC (rev 73850)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 68671 2008-01-08 10:04:25Z wolfc $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+ <param name="File" value="target/test.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- A size based file rolling appender
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <param name="File" value="${jboss.server.home.dir}/log/server.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="DEBUG"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit JBoss categories to INFO
+ <category name="org.jboss">
+ <priority value="INFO" class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <!-- Increase the priority threshold for the DefaultDS category
+ <category name="DefaultDS">
+ <priority value="FATAL"/>
+ </category>
+ -->
+
+ <!-- Decrease the priority threshold for the org.jboss.varia category
+ <category name="org.jboss.varia">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <!--
+ | An example of enabling the custom TRACE level priority that is used
+ | by the JBoss internals to diagnose low level details. This example
+ | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
+ | subpackages. This will produce A LOT of logging output.
+ <category name="org.jboss.system">
+ <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <category name="org.jboss.aop">
+ <priority value="WARN"/>
+ </category>
+
+ <category name="org.jboss">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.jboss.ejb3.interceptors.aop.DomainClassLoader">
+ <priority value="DEBUG"/>
+ </category>
+
+ <category name="org.jboss.ejb3">
+ <priority value="DEBUG"/>
+ </category>
+
+ <category name="org.jboss.ejb3.test">
+ <priority value="DEBUG"/>
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: projects/ejb3/trunk/core/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list