[jboss-cvs] JBossAS SVN: r104401 - in projects/embedded/examples/trunk: src/main/java/org/jboss and 10 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 3 17:29:05 EDT 2010
Author: ALRubinger
Date: 2010-05-03 17:29:05 -0400 (Mon, 03 May 2010)
New Revision: 104401
Added:
projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/
projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/
projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/
projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb/
projects/embedded/examples/trunk/src/test/java/org/
projects/embedded/examples/trunk/src/test/java/org/jboss/
projects/embedded/examples/trunk/src/test/java/org/jboss/jbossas/
projects/embedded/examples/trunk/src/test/java/org/jboss/jbossas/examples/
projects/embedded/examples/trunk/src/test/java/org/jboss/jbossas/examples/EchoBeanIntegrationTest.java
Removed:
projects/embedded/examples/trunk/src/main/java/org/jboss/embedded/examples/slsb/
projects/embedded/examples/trunk/src/test/java/EchoBeanIntegrationTest.java
Modified:
projects/embedded/examples/trunk/pom.xml
projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb/EchoBean.java
projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb/EchoLocalBusiness.java
Log:
[EMB-89] Update the Embedded API Examples for JBoss Application Server to match M3 configuration
Modified: projects/embedded/examples/trunk/pom.xml
===================================================================
--- projects/embedded/examples/trunk/pom.xml 2010-05-03 21:23:14 UTC (rev 104400)
+++ projects/embedded/examples/trunk/pom.xml 2010-05-03 21:29:05 UTC (rev 104401)
@@ -16,8 +16,8 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <groupId>org.jboss.eembedded.examples</groupId>
- <artifactId>examples-slsb</artifactId>
+ <groupId>org.jboss.jbossas.embedded.examples</groupId>
+ <artifactId>jbossas-embedded-examples-slsb</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>JBoss Embedded AS Examples - SLSB</name>
<description>Example for EmbeddedAS for testing EJB 3.x Stateless Session Beans</description>
@@ -25,7 +25,7 @@
<!-- Properties -->
<properties>
- <version.org.jboss.jbossas>6.0.0-SNAPSHOT</version.org.jboss.jbossas>
+ <version.org.jboss.jbossas>6.0.0.20100429-M3</version.org.jboss.jbossas>
<JBOSS_HOME>${project.build.directory}/jboss-${version.org.jboss.jbossas}</JBOSS_HOME>
<version.junit>4.7</version.junit>
@@ -145,7 +145,7 @@
data like classes, methods, etc. EMB-41. Endorsed
required for things like WS support (EMB-61)
-->
- <argLine>-Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Djava.endorsed.dirs=${JBOSS_HOME}/lib/endorsed -Djboss.home=${JBOSS_HOME}</argLine>
+ <argLine>-Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Djava.endorsed.dirs=${JBOSS_HOME}/lib/endorsed -Djboss.home=${JBOSS_HOME} -Djboss.boot.server.log.dir=${JBOSS_HOME}</argLine>
</configuration>
</execution>
</executions>
Copied: projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb (from rev 104399, projects/embedded/examples/trunk/src/main/java/org/jboss/embedded/examples/slsb)
Modified: projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb/EchoBean.java
===================================================================
--- projects/embedded/examples/trunk/src/main/java/org/jboss/embedded/examples/slsb/EchoBean.java 2010-05-03 20:50:38 UTC (rev 104399)
+++ projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb/EchoBean.java 2010-05-03 21:29:05 UTC (rev 104401)
@@ -19,7 +19,7 @@
* 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.embedded.examples.slsb;
+package org.jboss.jbossas.embedded.examples.slsb;
import javax.ejb.Local;
import javax.ejb.Stateless;
@@ -44,7 +44,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.embedded.examples.slsb.EchoLocalBusiness#echo(java.lang.String)
+ * @see org.jboss.jbossas.embedded.examples.slsb.EchoLocalBusiness#echo(java.lang.String)
*/
public String echo(final String message)
{
Modified: projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb/EchoLocalBusiness.java
===================================================================
--- projects/embedded/examples/trunk/src/main/java/org/jboss/embedded/examples/slsb/EchoLocalBusiness.java 2010-05-03 20:50:38 UTC (rev 104399)
+++ projects/embedded/examples/trunk/src/main/java/org/jboss/jbossas/embedded/examples/slsb/EchoLocalBusiness.java 2010-05-03 21:29:05 UTC (rev 104401)
@@ -19,7 +19,7 @@
* 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.embedded.examples.slsb;
+package org.jboss.jbossas.embedded.examples.slsb;
/**
* Local business interface of an EJB capable of
Deleted: projects/embedded/examples/trunk/src/test/java/EchoBeanIntegrationTest.java
===================================================================
--- projects/embedded/examples/trunk/src/test/java/EchoBeanIntegrationTest.java 2010-05-03 21:23:14 UTC (rev 104400)
+++ projects/embedded/examples/trunk/src/test/java/EchoBeanIntegrationTest.java 2010-05-03 21:29:05 UTC (rev 104401)
@@ -1,163 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.
- */
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import org.jboss.bootstrap.api.lifecycle.LifecycleState;
-import org.jboss.embedded.api.server.JBossASEmbeddedServer;
-import org.jboss.embedded.api.server.JBossASEmbeddedServerFactory;
-import org.jboss.embedded.examples.slsb.EchoBean;
-import org.jboss.embedded.examples.slsb.EchoLocalBusiness;
-import org.jboss.logging.Logger;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test to ensure that the {@link EchoBean}
- * is working as contracted
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class EchoBeanIntegrationTest
-{
- //-------------------------------------------------------------------------------------||
- // Class Members ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Logger
- */
- private static final Logger log = Logger.getLogger(EchoBeanIntegrationTest.class);
-
- /**
- * AS instance
- */
- private static JBossASEmbeddedServer server;
-
- /**
- * JNDI Context
- */
- private static Context jndiContext;
-
- /**
- * Creates the deployment; much like Arquillian will eventually use
- * @return
- */
- private static JavaArchive createDeployment()
- {
- return Archives.create("slsb.jar", JavaArchive.class).addClasses(EchoBean.class, EchoLocalBusiness.class);
- }
-
- //-------------------------------------------------------------------------------------||
- // Instance Members -------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- private JavaArchive deployment;
-
- //-------------------------------------------------------------------------------------||
- // Lifecycle --------------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Creates and starts the server, setting the JNDI Context
- */
- @BeforeClass
- public static void createAndStartServer() throws Exception
- {
- // Will pick up configuration of $JBOSS_HOME from sysprops
- server = JBossASEmbeddedServerFactory.createServer();
-
- // Start
- server.start();
-
- // Set JNDI Context
- jndiContext = new InitialContext();
- }
-
- /**
- * Creates and deploys the EJB JAR
- */
- @Before
- public void deploy() throws Exception
- {
- deployment = createDeployment();
- log.info(deployment.toString(true));
- server.deploy(deployment);
- }
-
- /**
- * Undeploys the EJB
- * @throws Exception
- */
- @After
- public void undeploy() throws Exception
- {
- if (server != null && server.getState().equals(LifecycleState.STARTED))
- {
- server.undeploy(deployment);
- }
- }
-
- /**
- * Brings down the server
- * @throws Exception
- */
- @AfterClass
- public static void stopServer() throws Exception
- {
- if (server != null && server.getState().equals(LifecycleState.STARTED))
- {
- server.shutdown();
- }
- }
-
- //-------------------------------------------------------------------------------------||
- // Tests ------------------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Ensures the EJB is working as expected
- */
- @Test
- public void testSlsb() throws Exception
- {
- // Get a proxy
- final EchoLocalBusiness slsb = (EchoLocalBusiness) jndiContext.lookup(EchoLocalBusiness.JNDI_NAME);
-
- // Invoke
- final String expected = "Testing EmbeddedAS";
- final String received = slsb.echo(expected);
-
- // Ensure equal
- Assert.assertEquals("Expected result was not as received", expected, received);
- Assert.assertTrue("Expected result was not the same reference as received", expected == received);
- }
-
-}
Copied: projects/embedded/examples/trunk/src/test/java/org/jboss/jbossas/examples/EchoBeanIntegrationTest.java (from rev 104399, projects/embedded/examples/trunk/src/test/java/EchoBeanIntegrationTest.java)
===================================================================
--- projects/embedded/examples/trunk/src/test/java/org/jboss/jbossas/examples/EchoBeanIntegrationTest.java (rev 0)
+++ projects/embedded/examples/trunk/src/test/java/org/jboss/jbossas/examples/EchoBeanIntegrationTest.java 2010-05-03 21:29:05 UTC (rev 104401)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbossas.examples;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jboss.bootstrap.api.lifecycle.LifecycleState;
+import org.jboss.embedded.api.server.JBossASEmbeddedServer;
+import org.jboss.embedded.api.server.JBossASEmbeddedServerFactory;
+import org.jboss.jbossas.embedded.examples.slsb.EchoBean;
+import org.jboss.jbossas.embedded.examples.slsb.EchoLocalBusiness;
+import org.jboss.logging.Logger;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test to ensure that the {@link EchoBean}
+ * is working as contracted. Shows usage of the Embedded
+ * APIs for JBoss Application Server. Look to
+ * the POM configuration for further setup
+ * which may be required for proper test execution; to
+ * run inside the IDE, configure the JVM startup parameters
+ * to match those in the Surefire runtime configuration.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class EchoBeanIntegrationTest
+{
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(EchoBeanIntegrationTest.class);
+
+ /**
+ * AS instance
+ */
+ private static JBossASEmbeddedServer server;
+
+ /**
+ * JNDI Context
+ */
+ private static Context jndiContext;
+
+ /**
+ * Creates the deployment; much like Arquillian will eventually use
+ * @return
+ */
+ private static JavaArchive createDeployment()
+ {
+ return ShrinkWrap.create("slsb.jar", JavaArchive.class).addClasses(EchoBean.class, EchoLocalBusiness.class);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Instance Members -------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Our test JAR
+ */
+ private JavaArchive deployment;
+
+ //-------------------------------------------------------------------------------------||
+ // Lifecycle --------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Creates and starts the server, setting the JNDI Context
+ */
+ @BeforeClass
+ public static void createAndStartServer() throws Exception
+ {
+ // Will pick up configuration of $JBOSS_HOME from sysprops
+ server = JBossASEmbeddedServerFactory.createServer();
+
+ // Start
+ server.start();
+
+ // Set JNDI Context
+ jndiContext = new InitialContext();
+ }
+
+ /**
+ * Creates and deploys the EJB JAR
+ */
+ @Before
+ public void deploy() throws Exception
+ {
+ // Create the deployment
+ deployment = createDeployment();
+
+ // Log out the contents of the test JAR
+ log.info(deployment.toString(true));
+
+ // Deploy
+ server.deploy(deployment);
+ }
+
+ /**
+ * Undeploys the EJB
+ * @throws Exception
+ */
+ @After
+ public void undeploy() throws Exception
+ {
+ // If we're up and running, undeploy
+ if (server != null && server.getState().equals(LifecycleState.STARTED))
+ {
+ server.undeploy(deployment);
+ }
+ }
+
+ /**
+ * Brings down the server
+ * @throws Exception
+ */
+ @AfterClass
+ public static void stopServer() throws Exception
+ {
+ if (server != null && server.getState().equals(LifecycleState.STARTED))
+ {
+ server.shutdown();
+ }
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Tests ------------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Ensures the EJB is working as expected
+ */
+ @Test
+ public void testSlsb() throws Exception
+ {
+ // Get a proxy
+ final EchoLocalBusiness slsb = (EchoLocalBusiness) jndiContext.lookup(EchoLocalBusiness.JNDI_NAME);
+
+ // Invoke
+ final String expected = "Testing Embedded APIs for JBoss Application Server";
+ final String received = slsb.echo(expected);
+
+ // Ensure equal
+ Assert.assertEquals("Expected result was not as received", expected, received);
+ Assert.assertTrue("Expected result was not the same reference as received", expected == received);
+ }
+
+}
More information about the jboss-cvs-commits
mailing list