Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.apache.openejb.test.singleton.SingletonContainerTxTests Maven / Gradle / Ivy
package org.apache.openejb.test.singleton;
import java.util.Properties;
import javax.ejb.EJBMetaData;
import javax.ejb.Handle;
import javax.ejb.HomeHandle;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.apache.openejb.test.TestManager;
public class SingletonContainerTxTests extends org .apache .openejb .test .NamedTestCase {
public final static String jndiEJBHomeEntry = "client/tests/singleton/ContainerManagedTransactionTests/EJBHome" ;
protected ContainerTxSingletonHome ejbHome;
protected ContainerTxSingletonObject ejbObject;
protected EJBMetaData ejbMetaData;
protected HomeHandle ejbHomeHandle;
protected Handle ejbHandle;
protected Integer ejbPrimaryKey;
protected InitialContext initialContext;
public SingletonContainerTxTests () {
super ("Singleton.ContainerManagedTransaction." );
}
protected void setUp () throws Exception {
final Properties properties = TestManager.getServer().getContextEnvironment();
initialContext = new InitialContext(properties);
final Object obj = initialContext.lookup(jndiEJBHomeEntry);
ejbHome = (ContainerTxSingletonHome) javax.rmi.PortableRemoteObject.narrow(obj, ContainerTxSingletonHome.class);
ejbObject = ejbHome.create();
TestManager.getDatabase().createAccountTable();
}
protected void tearDown () throws Exception {
TestManager.getDatabase().dropAccountTable();
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
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 (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
}