[jboss-cvs] JBossAS SVN: r109065 - in trunk: component-matrix and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Nov 2 05:37:04 EDT 2010
Author: jaikiran
Date: 2010-11-02 05:37:03 -0400 (Tue, 02 Nov 2010)
New Revision: 109065
Added:
trunk/testsuite/imports/sections/managed-beans.xml
trunk/testsuite/src/main/org/jboss/test/managed/
trunk/testsuite/src/main/org/jboss/test/managed/bean/
trunk/testsuite/src/main/org/jboss/test/managed/bean/DelegateSLSB.java
trunk/testsuite/src/main/org/jboss/test/managed/bean/Echo.java
trunk/testsuite/src/main/org/jboss/test/managed/bean/SimpleManagedBean.java
trunk/testsuite/src/main/org/jboss/test/managed/bean/test/
trunk/testsuite/src/main/org/jboss/test/managed/bean/test/ManagedBeanUnitTestCase.java
Modified:
trunk/build/build.xml
trunk/component-matrix/pom.xml
trunk/depchain/pom.xml
trunk/testsuite/imports/test-jars.xml
Log:
JBAS-8593 Integrate Java EE6 Managed Bean support in AS
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2010-11-02 08:09:17 UTC (rev 109064)
+++ trunk/build/build.xml 2010-11-02 09:37:03 UTC (rev 109065)
@@ -199,7 +199,8 @@
module-resteasy,
module-hibernate-int,
module-hornetq-int,
- module-console">
+ module-console,
+ module-managed-beans">
</target>
<target name="install" depends="partition-build, jboss-all-client"
@@ -777,6 +778,19 @@
</fileset>
</copy>
</target>
+
+
+ <!-- Managed Beans -->
+ <target name="module-managed-beans">
+ <mkdir dir="${install.all.deployers}/managed-beans"/>
+
+ <unjar src="${org.jboss.managed.beans:managed-beans-mc-int:jar}" dest="${install.all.deployers}/managed-beans">
+ <patternset>
+ <include name="META-INF/*.xml"/>
+ </patternset>
+ </unjar>
+ </target>
+
<!-- ====== -->
<!-- System -->
@@ -2077,6 +2091,14 @@
<fileset refid="org.jboss.ejb3.vfs:jboss-ejb3-vfs-impl-vfs3:jar"/>
<fileset refid="org.jboss.embedded:jboss-embedded-api:jar" />
<fileset refid="org.jboss.embedded:jboss-embedded-core:jar" />
+ <!-- Managed beans -->
+ <fileset refid="org.jboss.managed.beans:managed-beans-impl:jar"/>
+ <fileset refid="org.jboss.managed.beans:managed-beans-mc-int:jar"/>
+ <fileset refid="org.jboss.managed.beans:managed-beans-metadata:jar"/>
+ <fileset refid="org.jboss.managed.beans:managed-beans-metadata-impl:jar"/>
+ <fileset refid="org.jboss.managed.beans:managed-beans-metadata-jbmeta:jar"/>
+ <fileset refid="org.jboss.managed.beans:managed-beans-proxy-impl:jar"/>
+ <fileset refid="org.jboss.managed.beans:managed-beans-spi:jar"/>
<fileset refid="org.jboss.reloaded.naming:jboss-reloaded-naming-deployers:jar"/>
<fileset refid="org.jboss.reloaded.naming:jboss-reloaded-naming-impl:jar"/>
<fileset refid="org.jboss.reloaded.naming:jboss-reloaded-naming-spi:jar"/>
Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml 2010-11-02 08:09:17 UTC (rev 109064)
+++ trunk/component-matrix/pom.xml 2010-11-02 09:37:03 UTC (rev 109065)
@@ -105,6 +105,7 @@
<version.org.jboss.logging-service-metadata>1.0.0.CR9</version.org.jboss.logging-service-metadata>
<version.org.jboss.logmanager>1.2.0.CR6</version.org.jboss.logmanager>
<version.org.jboss.man>2.1.1.SP2</version.org.jboss.man>
+ <version.managed.beans.depchain>1.0.0-alpha-1</version.managed.beans.depchain>
<version.org.jboss.marshalling>1.3.0.CR3</version.org.jboss.marshalling>
<version.org.jboss.mc-int>2.2.0.Alpha3</version.org.jboss.mc-int>
<version.org.jboss.mdr>2.2.0.Alpha3</version.org.jboss.mdr>
@@ -3194,6 +3195,14 @@
</dependency>
<dependency>
+ <groupId>org.jboss.managed.beans.depchain</groupId>
+ <artifactId>managed-beans-depchain-as6</artifactId>
+ <version>${version.managed.beans.depchain}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.marshalling</groupId>
<artifactId>jboss-marshalling</artifactId>
<version>${version.org.jboss.marshalling}</version>
Modified: trunk/depchain/pom.xml
===================================================================
--- trunk/depchain/pom.xml 2010-11-02 08:09:17 UTC (rev 109064)
+++ trunk/depchain/pom.xml 2010-11-02 09:37:03 UTC (rev 109065)
@@ -943,6 +943,12 @@
<artifactId>jboss-logmanager-log4j</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.managed.beans.depchain</groupId>
+ <artifactId>managed-beans-depchain-as6</artifactId>
+ <type>pom</type>
+ <version>${version.managed.beans.depchain}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.marshalling</groupId>
<artifactId>jboss-marshalling</artifactId>
</dependency>
Added: trunk/testsuite/imports/sections/managed-beans.xml
===================================================================
--- trunk/testsuite/imports/sections/managed-beans.xml (rev 0)
+++ trunk/testsuite/imports/sections/managed-beans.xml 2010-11-02 09:37:03 UTC (rev 109065)
@@ -0,0 +1,24 @@
+<project name="tests-managed-bean-jars">
+ <!--
+ when adding new targets, do not forget to add it to
+ _jars-managed-beans (see bottom)
+ -->
+
+
+ <target name="simple" depends="compile">
+ <mkdir dir="${build.lib}" />
+
+ <jar destfile="${build.lib}/javaee6-managed-bean.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/managed/bean/**" />
+ </fileset>
+ </jar>
+ </target>
+
+
+ <!-- The main target which will called through the AS testsuite build -->
+ <target name="_jars-managed-beans" depends="simple">
+
+ </target>
+
+</project>
Modified: trunk/testsuite/imports/test-jars.xml
===================================================================
--- trunk/testsuite/imports/test-jars.xml 2010-11-02 08:09:17 UTC (rev 109064)
+++ trunk/testsuite/imports/test-jars.xml 2010-11-02 09:37:03 UTC (rev 109065)
@@ -50,6 +50,7 @@
<import file="sections/kernel.xml"/>
<import file="sections/load.xml"/>
<import file="sections/lock.xml"/>
+ <import file="sections/managed-beans.xml"/>
<import file="sections/marathon.xml"/>
<import file="sections/marshal.xml"/>
<import file="sections/marshaliiop.xml"/>
@@ -145,6 +146,7 @@
_jars-kernel,
_jars-load,
_jars-lock,
+ _jars-managed-beans,
_jars-marathon,
_jars-marshal,
_jars-marshaliiop,
Added: trunk/testsuite/src/main/org/jboss/test/managed/bean/DelegateSLSB.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/managed/bean/DelegateSLSB.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/managed/bean/DelegateSLSB.java 2010-11-02 09:37:03 UTC (rev 109065)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.managed.bean;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+import org.jboss.logging.Logger;
+
+/**
+ * DelegateSLSB
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(Echo.class)
+ at RemoteBinding(jndiBinding = DelegateSLSB.JNDI_NAME)
+public class DelegateSLSB implements Echo
+{
+
+ public static final String JNDI_NAME = "DelegateSLSBToManagedBean";
+
+ private static Logger logger = Logger.getLogger(DelegateSLSB.class);
+
+ @Override
+ public String echo(String msg)
+ {
+ Context ctx;
+ try
+ {
+ ctx = new InitialContext();
+ String jndiName = "java:module/" + SimpleManagedBean.class.getSimpleName();
+ logger.info("Looking up Managed bean at: " + jndiName);
+ // lookup the managed bean
+ SimpleManagedBean managedBean = (SimpleManagedBean) ctx.lookup(jndiName);
+ // invoke on the managed bean
+ return managedBean.echo(msg);
+ }
+ catch (NamingException ne)
+ {
+ throw new RuntimeException(ne);
+ }
+
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/managed/bean/Echo.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/managed/bean/Echo.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/managed/bean/Echo.java 2010-11-02 09:37:03 UTC (rev 109065)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.managed.bean;
+
+/**
+ * Echo
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface Echo
+{
+
+ String echo(String msg);
+}
Added: trunk/testsuite/src/main/org/jboss/test/managed/bean/SimpleManagedBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/managed/bean/SimpleManagedBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/managed/bean/SimpleManagedBean.java 2010-11-02 09:37:03 UTC (rev 109065)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.managed.bean;
+
+import javax.annotation.ManagedBean;
+
+/**
+ * SimpleManagedBean
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at ManagedBean
+public class SimpleManagedBean
+{
+
+ public String echo(String msg)
+ {
+ return msg;
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/managed/bean/test/ManagedBeanUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/managed/bean/test/ManagedBeanUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/managed/bean/test/ManagedBeanUnitTestCase.java 2010-11-02 09:37:03 UTC (rev 109065)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.managed.bean.test;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.managed.bean.DelegateSLSB;
+import org.jboss.test.managed.bean.Echo;
+
+/**
+ * Tests Managed bean deployments
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class ManagedBeanUnitTestCase extends JBossTestCase
+{
+
+ public ManagedBeanUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(ManagedBeanUnitTestCase.class, "javaee6-managed-bean.jar");
+ }
+
+ /**
+ * Tests that invocation on a Managed bean works without issues.
+ * @throws Exception
+ */
+ public void testManagedBeanInvocation() throws Exception
+ {
+ // get hold of the bean which internally invokes on the managed bean
+ Echo bean = (Echo) this.getInitialContext().lookup(DelegateSLSB.JNDI_NAME);
+ String message = "No new message!";
+ String echoedMessage = bean.echo(message);
+ Assert.assertEquals("Unexpected message returned", message, echoedMessage);
+ }
+}
More information about the jboss-cvs-commits
mailing list