You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/07/15 23:55:19 UTC
svn commit: r1610862 [32/44] - in /tomee/tomee/trunk/itests: ./ failover-ejb/
failover-ejb/src/main/java/org/apache/openejb/itest/failover/ejb/ failover/
failover/src/main/java/org/apache/openejb/itest/failover/
failover/src/main/java/org/apache/openej...
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContainerTxTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContainerTxTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContainerTxTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContainerTxTests.java Tue Jul 15 21:55:09 2014
@@ -28,23 +28,22 @@ import org.apache.openejb.test.TestManag
/**
* [1] Should be run as the first test suite of the SingletonTestClients
- *
*/
-public class SingletonContainerTxTests extends org.apache.openejb.test.NamedTestCase{
+public class SingletonContainerTxTests extends org.apache.openejb.test.NamedTestCase {
public final static String jndiEJBHomeEntry = "client/tests/singleton/ContainerManagedTransactionTests/EJBHome";
- protected ContainerTxSingletonHome ejbHome;
+ protected ContainerTxSingletonHome ejbHome;
protected ContainerTxSingletonObject ejbObject;
- protected EJBMetaData ejbMetaData;
- protected HomeHandle ejbHomeHandle;
- protected Handle ejbHandle;
- protected Integer ejbPrimaryKey;
+ protected EJBMetaData ejbMetaData;
+ protected HomeHandle ejbHomeHandle;
+ protected Handle ejbHandle;
+ protected Integer ejbPrimaryKey;
protected InitialContext initialContext;
- public SingletonContainerTxTests(){
+ public SingletonContainerTxTests() {
super("Singleton.ContainerManagedTransaction.");
}
@@ -54,15 +53,15 @@ public class SingletonContainerTxTests e
*/
protected void setUp() throws Exception {
- Properties properties = TestManager.getServer().getContextEnvironment();
+ final Properties properties = TestManager.getServer().getContextEnvironment();
//properties.put(Context.SECURITY_PRINCIPAL, "SINGLETON_test00_CLIENT");
//properties.put(Context.SECURITY_CREDENTIALS, "SINGLETON_test00_CLIENT");
initialContext = new InitialContext(properties);
/*[1] Get bean */
- Object obj = initialContext.lookup(jndiEJBHomeEntry);
- ejbHome = (ContainerTxSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, ContainerTxSingletonHome.class);
+ final Object obj = initialContext.lookup(jndiEJBHomeEntry);
+ ejbHome = (ContainerTxSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, ContainerTxSingletonHome.class);
ejbObject = ejbHome.create();
/*[2] Create database table */
@@ -78,363 +77,363 @@ public class SingletonContainerTxTests e
TestManager.getDatabase().dropAccountTable();
}
- public void test01_txMandatory_withoutTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txMandatoryMethod( expected );
+ public void test01_txMandatory_withoutTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txMandatoryMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_txNever_withoutTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNeverMethod( expected );
+ public void test02_txNever_withoutTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNeverMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test03_txNotSupported_withoutTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNotSupportedMethod( expected );
+ public void test03_txNotSupported_withoutTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNotSupportedMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test04_txRequired_withoutTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiredMethod( expected );
+ public void test04_txRequired_withoutTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiredMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test05_txRequiresNew_withoutTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiresNewMethod( expected );
+ public void test05_txRequiresNew_withoutTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiresNewMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test06_txSupports_withoutTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txSupportsMethod( expected );
+ public void test06_txSupports_withoutTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txSupportsMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test07_txMandatory_withTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txMandatoryMethod( expected );
+ public void test07_txMandatory_withTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txMandatoryMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test08_txNever_withTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNeverMethod( expected );
+ public void test08_txNever_withTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNeverMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test09_txNotSupported_withTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNotSupportedMethod( expected );
+ public void test09_txNotSupported_withTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNotSupportedMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test10_txRequired_withTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiredMethod( expected );
+ public void test10_txRequired_withTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiredMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test11_txRequiresNew_withTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiresNewMethod( expected );
+ public void test11_txRequiresNew_withTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiresNewMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test12_txSupports_withTx(){
- try{
- String expected = "ping";
- String actual = ejbObject.txSupportsMethod( expected );
+ public void test12_txSupports_withTx() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txSupportsMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test01_txMandatory_withoutTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txMandatoryMethod( expected );
+ public void test01_txMandatory_withoutTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txMandatoryMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_txNever_withoutTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNeverMethod( expected );
+ public void test02_txNever_withoutTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNeverMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test03_txNotSupported_withoutTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNotSupportedMethod( expected );
+ public void test03_txNotSupported_withoutTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNotSupportedMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test04_txRequired_withoutTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiredMethod( expected );
+ public void test04_txRequired_withoutTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiredMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test05_txRequiresNew_withoutTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiresNewMethod( expected );
+ public void test05_txRequiresNew_withoutTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiresNewMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test06_txSupports_withoutTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txSupportsMethod( expected );
+ public void test06_txSupports_withoutTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txSupportsMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test07_txMandatory_withTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txMandatoryMethod( expected );
+ public void test07_txMandatory_withTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txMandatoryMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test08_txNever_withTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNeverMethod( expected );
+ public void test08_txNever_withTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNeverMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test09_txNotSupported_withTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNotSupportedMethod( expected );
+ public void test09_txNotSupported_withTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNotSupportedMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test10_txRequired_withTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiredMethod( expected );
+ public void test10_txRequired_withTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiredMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test11_txRequiresNew_withTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiresNewMethod( expected );
+ public void test11_txRequiresNew_withTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiresNewMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test12_txSupports_withTx_appException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txSupportsMethod( expected );
+ public void test12_txSupports_withTx_appException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txSupportsMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test01_txMandatory_withoutTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txMandatoryMethod( expected );
+ public void test01_txMandatory_withoutTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txMandatoryMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_txNever_withoutTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNeverMethod( expected );
+ public void test02_txNever_withoutTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNeverMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test03_txNotSupported_withoutTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNotSupportedMethod( expected );
+ public void test03_txNotSupported_withoutTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNotSupportedMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test04_txRequired_withoutTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiredMethod( expected );
+ public void test04_txRequired_withoutTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiredMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test05_txRequiresNew_withoutTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiresNewMethod( expected );
+ public void test05_txRequiresNew_withoutTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiresNewMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test06_txSupports_withoutTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txSupportsMethod( expected );
+ public void test06_txSupports_withoutTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txSupportsMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test07_txMandatory_withTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txMandatoryMethod( expected );
+ public void test07_txMandatory_withTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txMandatoryMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test08_txNever_withTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNeverMethod( expected );
+ public void test08_txNever_withTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNeverMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test09_txNotSupported_withTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txNotSupportedMethod( expected );
+ public void test09_txNotSupported_withTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txNotSupportedMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test10_txRequired_withTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiredMethod( expected );
+ public void test10_txRequired_withTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiredMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test11_txRequiresNew_withTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txRequiresNewMethod( expected );
+ public void test11_txRequiresNew_withTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txRequiresNewMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test12_txSupports_withTx_sysException(){
- try{
- String expected = "ping";
- String actual = ejbObject.txSupportsMethod( expected );
+ public void test12_txSupports_withTx_sysException() {
+ try {
+ final String expected = "ping";
+ final String actual = ejbObject.txSupportsMethod(expected);
assertEquals("The method invocation was invalid.", expected, actual);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContextLookupTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContextLookupTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContextLookupTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonContextLookupTests.java Tue Jul 15 21:55:09 2014
@@ -21,21 +21,20 @@ import org.apache.openejb.test.TestFailu
/**
* [4] Should be run as the fourth test suite of the EncSingletonTestClients
- *
*/
-public class SingletonContextLookupTests extends SingletonTestClient{
+public class SingletonContextLookupTests extends SingletonTestClient {
- protected EncSingletonHome ejbHome;
+ protected EncSingletonHome ejbHome;
protected EncSingletonObject ejbObject;
- public SingletonContextLookupTests(){
+ public SingletonContextLookupTests() {
super("JNDI_ENC.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/ContextLookupSingletonBean");
- ejbHome = (EncSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, EncSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/ContextLookupSingletonBean");
+ ejbHome = (EncSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, EncSingletonHome.class);
ejbObject = ejbHome.create();
/*[2] Create database table */
@@ -50,7 +49,7 @@ public class SingletonContextLookupTests
try {
/*[1] Drop database table */
TestManager.getDatabase().dropEntityTable();
- } catch (Exception e){
+ } catch (final Exception e) {
throw e;
} finally {
super.tearDown();
@@ -58,172 +57,172 @@ public class SingletonContextLookupTests
}
public void test01_lookupStringEntry() {
- try{
+ try {
ejbObject.lookupStringEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test02_lookupDoubleEntry() {
- try{
+ try {
ejbObject.lookupDoubleEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test03_lookupLongEntry() {
- try{
+ try {
ejbObject.lookupLongEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test04_lookupFloatEntry() {
- try{
+ try {
ejbObject.lookupFloatEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test05_lookupIntegerEntry() {
- try{
+ try {
ejbObject.lookupIntegerEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test06_lookupShortEntry() {
- try{
+ try {
ejbObject.lookupShortEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test07_lookupBooleanEntry() {
- try{
+ try {
ejbObject.lookupBooleanEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test08_lookupByteEntry() {
- try{
+ try {
ejbObject.lookupByteEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test09_lookupCharacterEntry() {
- try{
+ try {
ejbObject.lookupCharacterEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test10_lookupEntityBean() {
- try{
+ try {
ejbObject.lookupEntityBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test11_lookupStatefulBean() {
- try{
+ try {
ejbObject.lookupStatefulBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test12_lookupSingletonBean() {
- try{
+ try {
ejbObject.lookupSingletonBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test13_lookupResource() {
- try{
+ try {
ejbObject.lookupResource();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test14_lookupPersistenceUnit() {
- try{
+ try {
ejbObject.lookupPersistenceUnit();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
-
+
public void test15_lookupPersistenceContext() {
- try{
+ try {
ejbObject.lookupPersistenceContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test18_lookupSessionContext() {
- try{
+ try {
ejbObject.lookupSessionContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test23_lookupJMSConnectionFactory() {
- try{
+ try {
ejbObject.lookupJMSConnectionFactory();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbHomeTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbHomeTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbHomeTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbHomeTests.java Tue Jul 15 21:55:09 2014
@@ -21,38 +21,37 @@ import javax.ejb.RemoveException;
/**
* [3] Should be run as the third test suite of the BasicSingletonTestClients
- *
*/
public class SingletonEjbHomeTests extends BasicSingletonTestClient {
- public SingletonEjbHomeTests(){
+ public SingletonEjbHomeTests() {
super("EJBHome.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
- ejbHome = (BasicSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
+ ejbHome = (BasicSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicSingletonHome.class);
}
//===============================
// Test ejb home methods
//
- public void test01_getEJBMetaData(){
- try{
- EJBMetaData ejbMetaData = ejbHome.getEJBMetaData();
+ public void test01_getEJBMetaData() {
+ try {
+ final EJBMetaData ejbMetaData = ejbHome.getEJBMetaData();
assertNotNull("EJBMetaData is null", ejbMetaData);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_getHomeHandle(){
- try{
+ public void test02_getHomeHandle() {
+ try {
ejbHomeHandle = ejbHome.getHomeHandle();
- assertNotNull("The HomeHandle is null", ejbHomeHandle );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ assertNotNull("The HomeHandle is null", ejbHomeHandle);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
@@ -61,14 +60,14 @@ public class SingletonEjbHomeTests exten
* 5.3.2 Removing a session object
* A client may remove a session object using the remove() method on the javax.ejb.EJBObject
* interface, or the remove(Handle handle) method of the javax.ejb.EJBHome interface.
- *
+ * <p/>
* Because session objects do not have primary keys that are accessible to clients, invoking the
* javax.ejb.EJBHome.remove(Object primaryKey) method on a session results in the
* javax.ejb.RemoveException.
- *
+ * <p/>
* ------------------------------------
* 5.5 Session object identity
- *
+ * <p/>
* Session objects are intended to be private resources used only by the
* client that created them. For this reason, session objects, from the
* client's perspective, appear anonymous. In contrast to entity objects,
@@ -79,21 +78,21 @@ public class SingletonEjbHomeTests exten
* method is invoked on a EJBMetaData object for a Session bean, the method throws
* the java.lang.RuntimeException.
* ------------------------------------
- *
+ * <p/>
* Sections 5.3.2 and 5.5 conflict. 5.3.2 says to throw javax.ejb.RemoveException, 5.5 says to
* throw java.rmi.RemoteException.
- *
+ * <p/>
* For now, we are going with java.rmi.RemoteException.
*/
- public void test03_removeByPrimaryKey(){
- try{
+ public void test03_removeByPrimaryKey() {
+ try {
ejbHome.remove("primaryKey");
- } catch (RemoveException e){
+ } catch (final RemoveException e) {
return;
- } catch (Exception e){
+ } catch (final Exception e) {
fail("Received Exception " + e.getClass() + " instead of javax.ejb.RemoveException : " + e.getMessage());
}
- assertTrue("javax.ejb.RemoveException should have been thrown", false );
+ assertTrue("javax.ejb.RemoveException should have been thrown", false);
}
//
// Test ejb home methods
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbMetaDataTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbMetaDataTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbMetaDataTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbMetaDataTests.java Tue Jul 15 21:55:09 2014
@@ -20,46 +20,46 @@ import javax.ejb.EJBHome;
/**
* [8] Should be run as the eigth test suite of the BasicSingletonTestClients
- *
*/
-public class SingletonEjbMetaDataTests extends BasicSingletonTestClient{
+public class SingletonEjbMetaDataTests extends BasicSingletonTestClient {
- public SingletonEjbMetaDataTests(){
+ public SingletonEjbMetaDataTests() {
super("EJBMetaData.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
- ejbHome = (BasicSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
+ ejbHome = (BasicSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicSingletonHome.class);
ejbMetaData = ejbHome.getEJBMetaData();
}
//=================================
// Test meta data methods
//
- public void test01_getEJBHome(){
- try{
+ public void test01_getEJBHome() {
+ try {
- EJBHome home = ejbMetaData.getEJBHome();
- assertNotNull( "The EJBHome is null", home );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ final EJBHome home = ejbMetaData.getEJBHome();
+ assertNotNull("The EJBHome is null", home);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_getHomeInterfaceClass(){
- try{
- Class clazz = ejbMetaData.getHomeInterfaceClass();
- assertNotNull( "The Home Interface class is null", clazz );
- assertEquals(clazz , BasicSingletonHome.class);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test02_getHomeInterfaceClass() {
+ try {
+ final Class clazz = ejbMetaData.getHomeInterfaceClass();
+ assertNotNull("The Home Interface class is null", clazz);
+ assertEquals(clazz, BasicSingletonHome.class);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
+
/**
* 5.5 Session object identity
- *
+ * <p/>
* Session objects are intended to be private resources used only by the
* client that created them. For this reason, session objects, from the
* client's perspective, appear anonymous. In contrast to entity objects,
@@ -70,43 +70,43 @@ public class SingletonEjbMetaDataTests e
* method is invoked on a EJBMetaData object for a Session bean, the method throws
* the java.lang.RuntimeException.
*/
- public void test03_getPrimaryKeyClass(){
- try{
- Class clazz = ejbMetaData.getPrimaryKeyClass();
- assertNull("Should not return a primary key. Method should throw an java.lang.RuntimeException", clazz );
- } catch (UnsupportedOperationException e){
- assertTrue( true );
+ public void test03_getPrimaryKeyClass() {
+ try {
+ final Class clazz = ejbMetaData.getPrimaryKeyClass();
+ assertNull("Should not return a primary key. Method should throw an java.lang.RuntimeException", clazz);
+ } catch (final UnsupportedOperationException e) {
+ assertTrue(true);
return;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
- assertTrue( "Method should throw an java.lang.RuntimeException", false );
+ assertTrue("Method should throw an java.lang.RuntimeException", false);
}
- public void test04_getRemoteInterfaceClass(){
- try{
- Class clazz = ejbMetaData.getRemoteInterfaceClass();
- assertNotNull( "The Remote Interface class is null", clazz );
- assertEquals(clazz , BasicSingletonObject.class);
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test04_getRemoteInterfaceClass() {
+ try {
+ final Class clazz = ejbMetaData.getRemoteInterfaceClass();
+ assertNotNull("The Remote Interface class is null", clazz);
+ assertEquals(clazz, BasicSingletonObject.class);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test05_isSession(){
- try{
- assertTrue( "EJBMetaData says this is not a session bean", ejbMetaData.isSession() );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test05_isSession() {
+ try {
+ assertTrue("EJBMetaData says this is not a session bean", ejbMetaData.isSession());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test06_isSingletonSession(){
- try{
+ public void test06_isSingletonSession() {
+ try {
// TODO: hopefully an isSingletonSession() method will get added to the EJB 3.1 API
- assertTrue( "EJBMetaData says this is not a singleton session bean", !ejbMetaData.isStatelessSession() );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ assertTrue("EJBMetaData says this is not a singleton session bean", !ejbMetaData.isStatelessSession());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbObjectTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbObjectTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbObjectTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonEjbObjectTests.java Tue Jul 15 21:55:09 2014
@@ -22,25 +22,24 @@ import javax.ejb.EJBHome;
/**
* [4] Should be run as the fourth test suite of the BasicSingletonTestClients
- *
*/
-public class SingletonEjbObjectTests extends BasicSingletonTestClient{
+public class SingletonEjbObjectTests extends BasicSingletonTestClient {
- public SingletonEjbObjectTests(){
+ public SingletonEjbObjectTests() {
super("EJBObject.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
- ejbHome = (BasicSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
+ ejbHome = (BasicSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicSingletonHome.class);
ejbObject = ejbHome.createObject();
}
protected void tearDown() throws Exception {
try {
//ejbObject.remove();
- } catch (Exception e){
+ } catch (final Exception e) {
throw e;
} finally {
super.tearDown();
@@ -50,35 +49,35 @@ public class SingletonEjbObjectTests ext
//===============================
// Test ejb object methods
//
- public void test01_getHandle(){
- try{
+ public void test01_getHandle() {
+ try {
ejbHandle = ejbObject.getHandle();
- assertNotNull( "The Handle is null", ejbHandle );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ assertNotNull("The Handle is null", ejbHandle);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test02_isIdentical(){
- try{
- assertTrue( "The EJBObjects are not identical", ejbObject.isIdentical(ejbObject) );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test02_isIdentical() {
+ try {
+ assertTrue("The EJBObjects are not identical", ejbObject.isIdentical(ejbObject));
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- public void test03_getEjbHome(){
- try{
- EJBHome home = ejbObject.getEJBHome();
- assertNotNull( "The EJBHome is null", home );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test03_getEjbHome() {
+ try {
+ final EJBHome home = ejbObject.getEJBHome();
+ assertNotNull("The EJBHome is null", home);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* 5.5 Session object identity
- *
+ * <p/>
* Session objects are intended to be private resources used only by the
* client that created them. For this reason, session objects, from the
* client's perspective, appear anonymous. In contrast to entity objects,
@@ -89,38 +88,39 @@ public class SingletonEjbObjectTests ext
* method is invoked on a EJBMetaData object for a Session bean, the method throws
* the java.lang.RuntimeException.
*/
- public void test04_getPrimaryKey(){
- try{
- Object key = ejbObject.getPrimaryKey();
- } catch (java.rmi.RemoteException e){
+ public void test04_getPrimaryKey() {
+ try {
+ final Object key = ejbObject.getPrimaryKey();
+ } catch (final java.rmi.RemoteException e) {
assertTrue(true);
return;
- } catch (Exception e){
- fail("A RuntimeException should have been thrown. Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("A RuntimeException should have been thrown. Received Exception " + e.getClass() + " : " + e.getMessage());
}
fail("A RuntimeException should have been thrown.");
}
- public void test05_remove(){
- try{
+ public void test05_remove() {
+ try {
ejbObject.remove();
// you can't really remove a singleton handle
ejbObject.businessMethod("Should not throw an exception");
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
+
//
// Test ejb object methods
//===============================
- public void test06_remove(){
+ public void test06_remove() {
String str = null;
try {
str = ejbObject.remove("Hello");
- } catch (RemoteException e) {
+ } catch (final RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- assertEquals("Hello",str);
+ assertEquals("Hello", str);
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonFieldInjectionTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonFieldInjectionTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonFieldInjectionTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonFieldInjectionTests.java Tue Jul 15 21:55:09 2014
@@ -24,21 +24,20 @@ import org.apache.openejb.test.TestFailu
/**
* [4] Should be run as the fourth test suite of the StatefulTestClients
- *
*/
public class SingletonFieldInjectionTests extends StatefulTestClient {
- protected EncSingletonHome ejbHome;
+ protected EncSingletonHome ejbHome;
protected EncSingletonObject ejbObject;
- public SingletonFieldInjectionTests(){
+ public SingletonFieldInjectionTests() {
super("FieldInjection.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/FieldInjectionSingletonBean");
- ejbHome = (EncSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, EncSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/FieldInjectionSingletonBean");
+ ejbHome = (EncSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, EncSingletonHome.class);
ejbObject = ejbHome.create();
/*[2] Create database table */
@@ -53,7 +52,7 @@ public class SingletonFieldInjectionTest
try {
/*[1] Drop database table */
TestManager.getDatabase().dropEntityTable();
- } catch (Exception e){
+ } catch (final Exception e) {
throw e;
} finally {
super.tearDown();
@@ -61,232 +60,232 @@ public class SingletonFieldInjectionTest
}
public void test01_lookupStringEntry() {
- try{
+ try {
ejbObject.lookupStringEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test02_lookupDoubleEntry() {
- try{
+ try {
ejbObject.lookupDoubleEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test03_lookupLongEntry() {
- try{
+ try {
ejbObject.lookupLongEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test04_lookupFloatEntry() {
- try{
+ try {
ejbObject.lookupFloatEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test05_lookupIntegerEntry() {
- try{
+ try {
ejbObject.lookupIntegerEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test06_lookupShortEntry() {
- try{
+ try {
ejbObject.lookupShortEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test07_lookupBooleanEntry() {
- try{
+ try {
ejbObject.lookupBooleanEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test08_lookupByteEntry() {
- try{
+ try {
ejbObject.lookupByteEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test09_lookupCharacterEntry() {
- try{
+ try {
ejbObject.lookupCharacterEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test10_lookupEntityBean() {
- try{
+ try {
ejbObject.lookupEntityBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test11_lookupStatefulBean() {
- try{
+ try {
ejbObject.lookupStatefulBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test12_lookupSingletonBean() {
- try{
+ try {
ejbObject.lookupSingletonBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test13_lookupResource() {
- try{
+ try {
ejbObject.lookupResource();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test14_lookupPersistenceUnit() {
- try{
+ try {
ejbObject.lookupPersistenceUnit();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test15_lookupPersistenceContext() {
- try{
+ try {
ejbObject.lookupPersistenceContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test18_lookupSessionContext() {
- try{
+ try {
ejbObject.lookupSessionContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test19_lookupSingletonBusinessLocal() {
- try{
+ try {
ejbObject.lookupSingletonBusinessLocal();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test20_lookupSingletonBusinessRemote() {
- try{
+ try {
ejbObject.lookupSingletonBusinessRemote();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test21_lookupStatefulBusinessLocal() {
- try{
+ try {
ejbObject.lookupStatefulBusinessLocal();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test22_lookupStatefulBusinessRemote() {
- try{
+ try {
ejbObject.lookupStatefulBusinessRemote();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test23_lookupJMSConnectionFactory() {
- try{
+ try {
ejbObject.lookupJMSConnectionFactory();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test24_lookupStatefulBusinessLocalBean() {
- try{
+ try {
ejbObject.lookupStatefulBusinessLocalBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test25_lookupSingletonBusinessLocalBean() {
- try{
+ try {
ejbObject.lookupSingletonBusinessLocalBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHandleTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHandleTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHandleTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHandleTests.java Tue Jul 15 21:55:09 2014
@@ -20,26 +20,25 @@ import javax.ejb.EJBObject;
/**
* [7] Should be run as the seventh test suite of the BasicSingletonTestClients
- *
*/
-public class SingletonHandleTests extends BasicSingletonTestClient{
+public class SingletonHandleTests extends BasicSingletonTestClient {
- public SingletonHandleTests(){
+ public SingletonHandleTests() {
super("Handle.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
- ejbHome = (BasicSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
+ ejbHome = (BasicSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicSingletonHome.class);
ejbObject = ejbHome.createObject();
ejbHandle = ejbObject.getHandle();
}
- protected void tearDown() throws Exception{
+ protected void tearDown() throws Exception {
try {
//ejbObject.remove();
- } catch (Exception e){
+ } catch (final Exception e) {
throw e;
} finally {
super.tearDown();
@@ -49,39 +48,39 @@ public class SingletonHandleTests extend
//=================================
// Test handle methods
//
- public void test01_getEJBObject(){
+ public void test01_getEJBObject() {
- try{
- EJBObject object = ejbHandle.getEJBObject();
- assertNotNull( "The EJBObject is null", object );
+ try {
+ final EJBObject object = ejbHandle.getEJBObject();
+ assertNotNull("The EJBObject is null", object);
// Wait until isIdentical is working.
//assertTrue("EJBObjects are not identical", object.isIdentical(ejbObject));
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
/**
* <B>5.6 Client view of session object's life cycle</B>
- * <P>
+ * <p/>
* ....It is invalid to reference a session object that does
* not exist. Attempted invocations on a session object
* that does not exist result in java.rmi.NoSuchObjectException.
* </P>
- *
- * <P>
+ * <p/>
+ * <p/>
* This remove method of the EJBHome is placed hear as it
* is more a test on the handle then on the remove method
* itself.
* </P>
*/
- public void test02_EJBHome_remove(){
- try{
+ public void test02_EJBHome_remove() {
+ try {
ejbHome.remove(ejbHandle);
// you can't really remove a singleton handle
ejbObject.businessMethod("Should not throw an exception");
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeHandleTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeHandleTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeHandleTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeHandleTests.java Tue Jul 15 21:55:09 2014
@@ -20,30 +20,29 @@ import javax.ejb.EJBHome;
/**
* [6] Should be run as the sixth test suite of the BasicSingletonTestClients
- *
*/
-public class SingletonHomeHandleTests extends BasicSingletonTestClient{
+public class SingletonHomeHandleTests extends BasicSingletonTestClient {
- public SingletonHomeHandleTests(){
+ public SingletonHomeHandleTests() {
super("HomeHandle.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
- ejbHome = (BasicSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
+ ejbHome = (BasicSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicSingletonHome.class);
ejbHomeHandle = ejbHome.getHomeHandle();
}
-
+
//=================================
// Test home handle methods
//
- public void test01_getEJBHome(){
- try{
- EJBHome home = ejbHomeHandle.getEJBHome();
- assertNotNull( "The EJBHome is null", home );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ public void test01_getEJBHome() {
+ try {
+ final EJBHome home = ejbHomeHandle.getEJBHome();
+ assertNotNull("The EJBHome is null", home);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeIntfcTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeIntfcTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeIntfcTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonHomeIntfcTests.java Tue Jul 15 21:55:09 2014
@@ -19,29 +19,28 @@ package org.apache.openejb.test.singleto
/**
* [2] Should be run as the second test suite of the BasicSingletonTestClients
- *
*/
-public class SingletonHomeIntfcTests extends BasicSingletonTestClient{
+public class SingletonHomeIntfcTests extends BasicSingletonTestClient {
- public SingletonHomeIntfcTests(){
+ public SingletonHomeIntfcTests() {
super("HomeIntfc.");
}
-
- protected void setUp() throws Exception{
+
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
- ejbHome = (BasicSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicSingletonHome.class);
+ final Object obj = initialContext.lookup("client/tests/singleton/BasicSingletonHome");
+ ejbHome = (BasicSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicSingletonHome.class);
}
-
+
//===============================
// Test home interface methods
//
- public void test01_create(){
- try{
+ public void test01_create() {
+ try {
ejbObject = ejbHome.createObject();
- assertNotNull( "The EJBObject is null", ejbObject );
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ assertNotNull("The EJBObject is null", ejbObject);
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
//
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonInterceptorTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonInterceptorTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonInterceptorTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/singleton/SingletonInterceptorTests.java Tue Jul 15 21:55:09 2014
@@ -21,7 +21,6 @@ import java.util.Map;
import java.util.Arrays;
/**
- *
* @version $Rev: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
*/
public class SingletonInterceptorTests extends BasicSingletonLocalTestClient {
@@ -37,10 +36,10 @@ public class SingletonInterceptorTests e
protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("BasicSingletonInterceptedBusinessRemote");
+ final Object obj = initialContext.lookup("BasicSingletonInterceptedBusinessRemote");
assertNotNull("The BasicSingletonInterceptedBusinessRemote object is null", obj);
remoteInterceptor = (BasicSingletonInterceptedRemote) javax.rmi.PortableRemoteObject.narrow(obj,
- BasicSingletonInterceptedRemote.class);
+ BasicSingletonInterceptedRemote.class);
assertNotNull("Remote interceptor is null", remoteInterceptor);
}
@@ -48,17 +47,17 @@ public class SingletonInterceptorTests e
* Invokes a business method which is to be intercepted from a class, in-bean and at method level.
*/
public void test01_interceptorChaining() {
- String reverseMe = "Intercept";
- String reversedString = remoteInterceptor.reverse(reverseMe);
+ final String reverseMe = "Intercept";
+ final String reversedString = remoteInterceptor.reverse(reverseMe);
// verifying InvocationContext.procced()
assertEquals("tpecretnI", reversedString);
-
- Map contextData = remoteInterceptor.getContextData();
+
+ final Map contextData = remoteInterceptor.getContextData();
// verifying that inBeanInterceptor indeed intercepted this method. This cannot be excluded at all.
assertNotNull(contextData.containsKey("reverse"));
-
- Map innerMap = (Map) contextData.get("reverse");
- ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
+
+ final Map innerMap = (Map) contextData.get("reverse");
+ final ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
assertEquals("ddInterceptor", interceptorsList.get(0)); //specified in DD
assertEquals("secondClassInterceptor", interceptorsList.get(1)); //specified in DD
@@ -68,71 +67,70 @@ public class SingletonInterceptorTests e
assertEquals("superBeanInterceptor", interceptorsList.get(5)); //derived from bean extension
assertEquals("inBeanInterceptor", interceptorsList.get(6)); //in bean
}
-
+
/**
* Invokes just 1 business method on the bean. The interceptor method stores the intercepted method's name and
* params in a map that is returned by the <code>getContextData</code>
*/
public void test02_methodProfile() {
- String reverseMe = "Intercept";
- String reversedString = remoteInterceptor.reverse(reverseMe);
+ final String reverseMe = "Intercept";
+ final String reversedString = remoteInterceptor.reverse(reverseMe);
// verifying InvocationContext.procced()
assertEquals("tpecretnI", reversedString);
- Map contextData = remoteInterceptor.getContextData();
+ final Map contextData = remoteInterceptor.getContextData();
// verifying InvocationContext.getMethod().getName()
assertTrue(contextData.containsKey("reverse"));
- Map innerMap = (Map) contextData.get("reverse");
- Object[] params = (Object[]) innerMap.get("PARAMETERS");
+ final Map innerMap = (Map) contextData.get("reverse");
+ final Object[] params = (Object[]) innerMap.get("PARAMETERS");
// verifying that the parameters array was received from contextData and stored.
assertNotNull("value of PARAMETERS key is null", params);
// verifying InvocationContext.getParameters()
assertEquals(1, params.length);
assertEquals(reverseMe, params[0].toString());
}
-
+
/**
* Invokes a business method which is annotated to be excluded from interception.
* <code>getContextData()</code> has been annotated with <code>@ExcludesClassInterceptors</code>
*/
public void test03_excludeClassInterceptors() {
- Map contextData = remoteInterceptor.getContextData();
+ final Map contextData = remoteInterceptor.getContextData();
// verifying that inBeanInterceptor indeed intercepted this method. This cannot be excluded at all.
assertNotNull(contextData.containsKey("getContextData"));
-
- Map innerMap = (Map) contextData.get("getContextData");
- ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
+
+ final Map innerMap = (Map) contextData.get("getContextData");
+ final ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
// verifying @ExcludeClassInterceptors annotated method was not intercepted
assertFalse("getContextData() should not have been intercepted by classInterceptor()", interceptorsList.contains("classInterceptor"));
assertFalse("getContextData() should not have been intercepted by classInterceptor()", interceptorsList.contains("classInterceptor"));
assertFalse("getContextData() should not have been intercepted by secondClassInterceptor()", interceptorsList.contains("secondClassInterceptor"));
assertFalse("getContextData() should not have been intercepted by ddInterceptor()", interceptorsList.contains("ddInterceptor"));
}
-
+
/**
* Invokes a business method which is declared to be excluded from interception by the DD
* <code>concat()</code> has been annotated with <code>exclude-class-interceptors</code>
*/
public void test04_excludeClassInterceptors_02() {
- String catString = remoteInterceptor.concat("Inter", "cept");
+ final String catString = remoteInterceptor.concat("Inter", "cept");
// verifying InvocationContext.procced()
assertEquals("Intercept", catString);
-
- Map contextData = remoteInterceptor.getContextData();
+
+ final Map contextData = remoteInterceptor.getContextData();
// verifying that inBeanInterceptor indeed intercepted this method. This cannot be excluded at all.
assertNotNull(contextData.containsKey("concat"));
-
- Map innerMap = (Map) contextData.get("concat");
- ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
+
+ final Map innerMap = (Map) contextData.get("concat");
+ final ArrayList interceptorsList = (ArrayList) innerMap.get("INTERCEPTORS");
// verifying @ExcludeClassInterceptors annotated method was not intercepted
assertFalse("concat() should not have been intercepted by superClassInterceptor()", interceptorsList.contains("superClassInterceptor"));
assertFalse("concat() should not have been intercepted by classInterceptor()", interceptorsList.contains("classInterceptor"));
assertFalse("concat() should not have been intercepted by ddInterceptor()", interceptorsList.contains("ddInterceptor"));
assertFalse("concat() should not have been intercepted by secondClassInterceptor()", interceptorsList.contains("secondClassInterceptor"));
}
-
-
+
}