[jboss-cvs] JBossAS SVN: r74067 - projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 3 22:48:45 EDT 2008
Author: ALRubinger
Date: 2008-06-03 22:48:45 -0400 (Tue, 03 Jun 2008)
New Revision: 74067
Modified:
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionTestCase.java
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionTestCase.java
Log:
[EJBTHREE-1393] Added tests for invocation of interface-specific Proxies
Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionTestCase.java 2008-06-04 02:47:19 UTC (rev 74066)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatefulSessionTestCase.java 2008-06-04 02:48:45 UTC (rev 74067)
@@ -84,6 +84,26 @@
}
/**
+ * Test Local Business Binding and Invocation
+ * to a specific interface
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testLocalBusinessSpecificInterface() throws Exception
+ {
+ // Obtain the Proxy
+ Object bean = ProxyStatefulSessionTestCase.context.lookup("MyStatefulBean/local-"
+ + MyStatefulLocalBusiness.class.getName());
+ assertTrue("Bean must be assignable to " + MyStatefulLocalBusiness.class.getSimpleName() + " but was instead "
+ + bean.getClass(), bean instanceof MyStatefulLocalBusiness);
+
+ // Invoke and Test Result
+ int result = ((MyStatefulLocalBusiness) bean).getNextCounter();
+ assertEquals(result, 0);
+ }
+
+ /**
* Test Remote Business Binding and Invocation
*
* @throws Exception
@@ -102,6 +122,26 @@
}
/**
+ * Test Remote Business Binding and Invocation
+ * to a specific interface
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testRemoteBusinessSpecificInterface() throws Exception
+ {
+ // Obtain the Proxy
+ Object bean = ProxyStatefulSessionTestCase.context.lookup("MyStatefulBean/remote-"
+ + MyStatefulRemoteBusiness.class.getName());
+ assertTrue("Bean must be assignable to " + MyStatefulRemoteBusiness.class.getSimpleName() + " but was instead "
+ + bean.getClass(), bean instanceof MyStatefulRemoteBusiness);
+
+ // Invoke and Test Result
+ int result = ((MyStatefulRemoteBusiness) bean).getNextCounter();
+ assertEquals(result, 0);
+ }
+
+ /**
* Test Local Home Binding
*
* @throws Exception
Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionTestCase.java 2008-06-04 02:47:19 UTC (rev 74066)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/session/unit/ProxyStatelessSessionTestCase.java 2008-06-04 02:48:45 UTC (rev 74067)
@@ -62,6 +62,18 @@
}
@Test
+ public void testLocalSpecificInterface() throws Exception
+ {
+ InitialContext ctx = new InitialContext();
+
+ Object bean = ctx.lookup("MyStatelessBean/local-" + MyStatelessLocal.class.getName());
+ assertTrue(bean instanceof MyStatelessLocal);
+
+ String result = ((MyStatelessLocal) bean).sayHi("testLocal");
+ assertEquals("Hi testLocal", result);
+ }
+
+ @Test
public void testLocalHome() throws Exception
{
InitialContext ctx = new InitialContext();
@@ -77,9 +89,24 @@
Object bean = ctx.lookup("MyStatelessBean/remote");
assertTrue(bean instanceof MyStatelessRemote);
+
+ String result = ((MyStatelessRemote) bean).sayHi("testRemote");
+ assertEquals("Hi testRemote", result);
}
@Test
+ public void testRemoteSpecificInterface() throws Exception
+ {
+ InitialContext ctx = new InitialContext();
+
+ Object bean = ctx.lookup("MyStatelessBean/remote-" + MyStatelessRemote.class.getName());
+ assertTrue(bean instanceof MyStatelessRemote);
+
+ String result = ((MyStatelessRemote) bean).sayHi("testRemote");
+ assertEquals("Hi testRemote", result);
+ }
+
+ @Test
public void testRemoteHome() throws Exception
{
InitialContext ctx = new InitialContext();
@@ -113,7 +140,7 @@
Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
}
-
+
@AfterClass
public static void tearDownAfterClass() throws Exception
{
More information about the jboss-cvs-commits
mailing list