[jboss-cvs] JBossAS SVN: r100277 - in projects/ejb3/components/nointerface/trunk/testsuite: src/test/java/org/jboss/ejb3/nointerface/integration/test and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 2 13:59:02 EST 2010
Author: jaikiran
Date: 2010-02-02 13:59:01 -0500 (Tue, 02 Feb 2010)
New Revision: 100277
Added:
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManager.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManagerBean.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Calculator.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Echo.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/InnerNoInterfaceSFSB.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/OuterSFSB.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/EarDeploymentUnitTestCase.java
Modified:
projects/ejb3/components/nointerface/trunk/testsuite/pom.xml
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/AbstractNoInterfaceTestCase.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/SimpleNoInterfaceDeploymentTestCase.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/descriptor/unit/DeploymentDescriptorBasedTestCase.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/equality/unit/NoInterfaceBeanEqualityTestCase.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/injection/unit/NoInterfaceBeanInjectionTestCase.java
projects/ejb3/components/nointerface/trunk/testsuite/src/test/resources/build-test.xml
Log:
EJBTHREE-2002 Added a testcase for testing nointerface view deployments through .ear files and also refactored the testsuite module to use package-manager to run the tests against the AS after applying the latest package of the no-interface component
Modified: projects/ejb3/components/nointerface/trunk/testsuite/pom.xml
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/pom.xml 2010-02-02 18:53:39 UTC (rev 100276)
+++ projects/ejb3/components/nointerface/trunk/testsuite/pom.xml 2010-02-02 18:59:01 UTC (rev 100277)
@@ -13,8 +13,8 @@
<groupId>org.jboss.ejb3.nointerface</groupId>
<artifactId>jboss-ejb3-nointerface-testsuite</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+
<name>JBoss EJB3.1 no-interface Testsuite</name>
<description>Testsuite for JBoss EJB3.1 no-interface component</description>
@@ -140,15 +140,15 @@
<outputDirectory>${project.build.directory}/dependencies/package-manager</outputDirectory>
</artifactItem>
<!--
- The no-interface package
+ The no-interface package -->
<artifactItem>
- <groupId>org.jboss.ejb3</groupId>
- <artifactId>jboss-ejb3-nointerface</artifactId>
+ <groupId>org.jboss.ejb3.nointerface</groupId>
+ <artifactId>jboss-ejb3-nointerface-impl</artifactId>
<classifier>package</classifier>
<type>jar</type>
<outputDirectory>${project.build.directory}/dependencies/package</outputDirectory>
</artifactItem>
- -->
+
</artifactItems>
<overWriteIfNewer>true</overWriteIfNewer>
<stripVersion>true</stripVersion>
@@ -161,16 +161,25 @@
<!--
Install no-interface package in pre-integration-test
- phase <plugin>
+ phase -->
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
- <executions> <execution>
- <id>install-nointerface-package</id>
- <phase>pre-integration-test</phase> <goals>
- <goal>run</goal> </goals> <configuration> <tasks> <ant
- antfile="build-test.xml"
- target="install-no-interface-package" /> </tasks>
- </configuration> </execution> </executions> </plugin>
- -->
+ <executions>
+ <execution>
+ <id>install-nointerface-package</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="${project.build.directory}/test-classes/build-test.xml" target="install-no-interface-package" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<!--
After installing the no-interface package, now start the
server in pre-integration-test phase
@@ -261,7 +270,7 @@
<dependency>
<groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-server</artifactId>
+ <artifactId>jboss-as-ejb3</artifactId>
<version>5.1.0.GA</version>
<scope>test</scope>
</dependency>
@@ -274,9 +283,17 @@
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3_1</artifactId>
<scope>test</scope>
- <version>1.0.0</version>
+ <version>1.0.2</version>
<type>pom</type>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3.nointerface</groupId>
+ <artifactId>jboss-ejb3-nointerface-impl</artifactId>
+ <version>${project.version}</version>
+ <classifier>package</classifier>
+ <scope>test</scope>
+ </dependency>
<!--
The package manager installer which we use to install the
Modified: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/AbstractNoInterfaceTestCase.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/AbstractNoInterfaceTestCase.java 2010-02-02 18:53:39 UTC (rev 100276)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/AbstractNoInterfaceTestCase.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -57,7 +57,7 @@
private final static String DEPLOYER_NAME = "jboss.system:service=MainDeployer";
protected MBeanServerConnection server;
-
+
private Context ctx;
/**
@@ -79,7 +79,7 @@
* The directory into which the deployments required by the tests will be placed
*/
protected static final File TEST_DEPLOYMENTS_FOLDER = new File(TARGET_DIRECTORY, "test-lib");
-
+
/**
* The <project>/src/test/resources folder
*/
@@ -152,7 +152,16 @@
return urls;
}
- protected static URL buildSimpleJar(String jarName, Package... testArtifactPackages) throws IOException
+ /**
+ * Creates a jar file with the name <code>jarName</code> including in that jar, the packages
+ * <code>testArtifactPackages</code>, and classes under those packages.
+ *
+ * @param jarName Name of the jar file (including the .jar extension)
+ * @param testArtifactPackages The test packages
+ * @return Returns the created jar file
+ * @throws IOException
+ */
+ protected static File buildSimpleJar(String jarName, Package... testArtifactPackages) throws IOException
{
JavaArchive jar = Archives.create(jarName, JavaArchive.class);
jar.addPackages(false, testArtifactPackages);
@@ -174,8 +183,40 @@
return writeToFileSystem(jar);
}
- protected static URL writeToFileSystem(JavaArchive javaArchive) throws IOException
+ /**
+ * Creates a ear file with the name <code>earName</code>. The .ear will include the
+ * (at the root) the files passed through the <code>deployments</code> param.
+ *
+ * @param earName Name of the ear file (including the .ear extension)
+ * @param deployments The files to be included in the .ear
+ * @return Returns the created ear file
+ * @throws IOException
+ */
+ protected static File buildSimpleEAR(String earName, File... deployments) throws IOException,
+ IllegalArgumentException
{
+ if (earName == null || deployments == null)
+ {
+ throw new IllegalArgumentException("earName and deployments are mandatory");
+ }
+ JavaArchive ear = Archives.create(earName, JavaArchive.class);
+
+ for (File deployment : deployments)
+ {
+ ear.addResource(deployment);
+ }
+ return writeToFileSystem(ear);
+ }
+
+ /**
+ * Writes out a {@link JavaArchive} to the file system
+ * @param javaArchive The {@link JavaArchive} which will be written out to the file system
+ * @return Returns the {@link File} corresponding to the {@link JavaArchive} which
+ * was written out to the file system
+ * @throws IOException
+ */
+ protected static File writeToFileSystem(JavaArchive javaArchive) throws IOException
+ {
InputStream inputStream = javaArchive.as(ZipExporter.class).exportZip();
String jarFileName = javaArchive.getName();
logger.debug("Writing out jar " + jarFileName + " : " + javaArchive.toString(true));
@@ -206,7 +247,7 @@
bis.close();
}
}
- return jarFile.toURI().toURL();
+ return jarFile;
}
/**
@@ -313,11 +354,10 @@
{"java.net.URL"};
invoke(getDeployerName(), "undeploy", args, sig);
}
-
+
protected Context getInitialContext()
{
return this.ctx;
}
-
-
+
}
Added: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManager.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManager.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManager.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.nointerface.integration.test.deployment;
+
+/**
+ * AccountManager
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface AccountManager
+{
+ int credit(int amount);
+
+ int getBalance();
+}
Added: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManagerBean.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManagerBean.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/AccountManagerBean.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.nointerface.integration.test.deployment;
+
+import javax.ejb.EJB;
+import javax.ejb.Remote;
+import javax.ejb.Stateful;
+
+
+
+/**
+ * AccountManagerBean
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateful
+ at Remote (AccountManager.class)
+public class AccountManagerBean implements AccountManager
+{
+
+ @EJB
+ private Calculator calculator;
+
+ private int currentBalance = 100;
+
+ public int getBalance()
+ {
+ return this.currentBalance;
+ }
+ /**
+ * @see org.jboss.ejb3.nointerface.integration.test.deployment.AccountManager#credit(int)
+ */
+ @Override
+ public int credit(int amount)
+ {
+ this.currentBalance = this.calculator.add(this.currentBalance, amount);
+ return this.currentBalance;
+ }
+
+}
Added: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Calculator.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Calculator.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Calculator.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.nointerface.integration.test.deployment;
+
+import javax.ejb.Stateless;
+
+/**
+ * Calculator
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateless
+public class Calculator
+{
+
+ public int add(int a, int b)
+ {
+ return a + b;
+ }
+}
Added: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Echo.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Echo.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/Echo.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.nointerface.integration.test.deployment;
+
+/**
+ * Echo
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface Echo
+{
+ String echo(String msg);
+}
Added: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/InnerNoInterfaceSFSB.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/InnerNoInterfaceSFSB.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/InnerNoInterfaceSFSB.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.nointerface.integration.test.deployment;
+
+import javax.ejb.Stateful;
+
+/**
+ * InnerNoInterfaceSFSB
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateful
+public class InnerNoInterfaceSFSB
+{
+
+ public String echo(String msg)
+ {
+ return msg;
+ }
+
+}
Added: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/OuterSFSB.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/OuterSFSB.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/OuterSFSB.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.nointerface.integration.test.deployment;
+
+import javax.ejb.EJB;
+import javax.ejb.Remote;
+import javax.ejb.Stateful;
+
+/**
+ * OuterSFSB
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateful
+ at Remote (Echo.class)
+public class OuterSFSB implements Echo
+{
+
+ @EJB
+ private InnerNoInterfaceSFSB innerBean;
+
+ /**
+ * @see org.jboss.ejb3.nointerface.integration.test.deployment.Echo#echo(java.lang.String)
+ */
+ @Override
+ public String echo(String msg)
+ {
+ return this.innerBean.echo(msg);
+ }
+
+}
Added: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/EarDeploymentUnitTestCase.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/EarDeploymentUnitTestCase.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/EarDeploymentUnitTestCase.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -0,0 +1,119 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.nointerface.integration.test.deployment.unit;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.net.URL;
+
+import org.jboss.ejb3.nointerface.integration.test.AbstractNoInterfaceTestCase;
+import org.jboss.ejb3.nointerface.integration.test.deployment.AccountManager;
+import org.jboss.ejb3.nointerface.integration.test.deployment.AccountManagerBean;
+import org.jboss.ejb3.nointerface.integration.test.deployment.Echo;
+import org.jboss.ejb3.nointerface.integration.test.deployment.OuterSFSB;
+import org.jboss.logging.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * EarDeploymentUnitTestCase
+ *
+ * Tests the deployment of no-interface view beans through a .ear file
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class EarDeploymentUnitTestCase extends AbstractNoInterfaceTestCase
+{
+
+ /**
+ * Logger
+ */
+ private static Logger logger = Logger.getLogger(EarDeploymentUnitTestCase.class);
+
+ private URL deployment;
+
+ private final String EAR_FILE_NAME_PREFIX = "ear-deployment-test";
+
+ private static final File TARGET_DIRECTORY = new File(BASEDIR, "target");
+
+ /**
+ *
+ * @return
+ * @throws Exception
+ */
+ @Before
+ public void before() throws Exception
+ {
+ String jarName = "ejb31-beans.jar";
+ File jar = buildSimpleJar(jarName, AccountManager.class.getPackage());
+ File ear = buildSimpleEAR(EAR_FILE_NAME_PREFIX + ".ear", jar);
+ this.deployment = ear.toURI().toURL();
+ this.redeploy(deployment);
+
+
+ }
+
+ @After
+ public void after() throws Exception
+ {
+ if (this.deployment != null)
+ {
+ this.undeploy(deployment);
+ }
+ }
+
+ /**
+ * Test that a SLSB with a no-interface view, deployed through an .ear
+ * deploys and works fine
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testNoInterfaceSLSBAccess() throws Exception
+ {
+ String jndiName = EAR_FILE_NAME_PREFIX + "/" + AccountManagerBean.class.getSimpleName() + "/remote";
+ AccountManager accountManager = (AccountManager) this.getInitialContext().lookup(jndiName);
+
+ int initialBalance = accountManager.getBalance();
+ // credit amount
+ int balance = accountManager.credit(100);
+ assertEquals("Bean returned unexpected balance amount", initialBalance + 100, balance);
+ }
+
+ /**
+ * Test that a SFSB with a no-interface view, deployed through an .ear
+ * deploys and works fine
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testNoInterfaceSFSBAccess() throws Exception
+ {
+ String jndiName = EAR_FILE_NAME_PREFIX + "/" + OuterSFSB.class.getSimpleName() + "/remote";
+ Echo echoBean = (Echo) this.getInitialContext().lookup(jndiName);
+ String msg = "Some message!";
+ assertEquals("Unexpected message returned by bean", msg, echoBean.echo(msg));
+ }
+}
Modified: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/SimpleNoInterfaceDeploymentTestCase.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/SimpleNoInterfaceDeploymentTestCase.java 2010-02-02 18:53:39 UTC (rev 100276)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/deployment/unit/SimpleNoInterfaceDeploymentTestCase.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -23,6 +23,7 @@
import static org.junit.Assert.assertEquals;
+import java.io.File;
import java.net.URL;
import org.jboss.ejb3.nointerface.integration.test.AbstractNoInterfaceTestCase;
@@ -61,7 +62,8 @@
public void before() throws Exception
{
String jarName = "simple-nointerface-beans.jar";
- deployment = buildSimpleJar(jarName, SimpleNoInterfaceSLSBean.class.getPackage());
+ File jar = buildSimpleJar(jarName, SimpleNoInterfaceSLSBean.class.getPackage());
+ this.deployment = jar.toURI().toURL();
this.redeploy(deployment);
}
Modified: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/descriptor/unit/DeploymentDescriptorBasedTestCase.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/descriptor/unit/DeploymentDescriptorBasedTestCase.java 2010-02-02 18:53:39 UTC (rev 100276)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/descriptor/unit/DeploymentDescriptorBasedTestCase.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -21,6 +21,7 @@
*/
package org.jboss.ejb3.nointerface.integration.test.descriptor.unit;
+import java.io.File;
import java.net.URL;
import javax.naming.Context;
@@ -62,7 +63,8 @@
public void before() throws Exception
{
String jarName = "dd-based-nointerface.jar";
- deployment = buildSimpleJar(jarName, DDBasedNoInterfaceViewSLSB.class.getPackage());
+ File jar = buildSimpleJar(jarName, DDBasedNoInterfaceViewSLSB.class.getPackage());
+ this.deployment = jar.toURI().toURL();
this.redeploy(deployment);
}
Modified: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/equality/unit/NoInterfaceBeanEqualityTestCase.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/equality/unit/NoInterfaceBeanEqualityTestCase.java 2010-02-02 18:53:39 UTC (rev 100276)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/equality/unit/NoInterfaceBeanEqualityTestCase.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -24,6 +24,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import java.io.File;
import java.net.URL;
import org.jboss.ejb3.nointerface.integration.test.AbstractNoInterfaceTestCase;
@@ -61,8 +62,9 @@
public void before() throws Exception
{
String jarName = "nointerface-bean-equality.jar";
- deployment = buildSimpleJar(jarName, SimpleNoInterfaceSLSBean.class.getPackage(), EqualityCheckerBeanRemote.class
+ File jar = buildSimpleJar(jarName, SimpleNoInterfaceSLSBean.class.getPackage(), EqualityCheckerBeanRemote.class
.getPackage());
+ this.deployment = jar.toURI().toURL();
this.redeploy(deployment);
}
Modified: projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/injection/unit/NoInterfaceBeanInjectionTestCase.java
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/injection/unit/NoInterfaceBeanInjectionTestCase.java 2010-02-02 18:53:39 UTC (rev 100276)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/java/org/jboss/ejb3/nointerface/integration/test/injection/unit/NoInterfaceBeanInjectionTestCase.java 2010-02-02 18:59:01 UTC (rev 100277)
@@ -23,6 +23,7 @@
import static org.junit.Assert.assertEquals;
+import java.io.File;
import java.net.URL;
import org.jboss.ejb3.nointerface.integration.test.AbstractNoInterfaceTestCase;
@@ -58,7 +59,8 @@
public void before() throws Exception
{
String jarName = NoInterfaceBeanInjectionTestCase.class.getSimpleName() + ".jar";
- deployment = buildSimpleJar(jarName, CalculatorBean.class.getPackage());
+ File jar = buildSimpleJar(jarName, CalculatorBean.class.getPackage());
+ this.deployment = jar.toURI().toURL();
this.redeploy(deployment);
}
Modified: projects/ejb3/components/nointerface/trunk/testsuite/src/test/resources/build-test.xml
===================================================================
--- projects/ejb3/components/nointerface/trunk/testsuite/src/test/resources/build-test.xml 2010-02-02 18:53:39 UTC (rev 100276)
+++ projects/ejb3/components/nointerface/trunk/testsuite/src/test/resources/build-test.xml 2010-02-02 18:59:01 UTC (rev 100277)
@@ -11,7 +11,7 @@
<property name="location.packagemanager" value="${location.dependencies}/package-manager"/>
<property name="location.packagemanager.zip.file" value="${location.packagemanager}/jboss-ejb3-package-manager-installer.zip"/>
<property name="location.nointerface.package" value="${location.dependencies}/package"/>
- <property name="location.nointerface.package.file" value="${location.nointerface.package}/jboss-ejb3-nointerface-package.jar"/>
+ <property name="location.nointerface.package.file" value="${location.nointerface.package}/jboss-ejb3-nointerface-impl-package.jar"/>
<property name="packagemanager.home" value="${location.packagemanager}/jboss-package-manager"/>
<path id="package.manager.classpath">
More information about the jboss-cvs-commits
mailing list