use of org.apache.openejb.jee.Method$JAXB.writeMethod in project tomee by apache.
the class InterfaceTransactionTest method module.
@Module
public EjbJar module() throws Exception {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(OrangeBean.class));
final Method remoteMethod = new Method("OrangeBean", "isInTransaction").withInterface(MethodIntf.REMOTE);
final Method localMethod = new Method("OrangeBean", "isInTransaction").withInterface(MethodIntf.LOCAL);
final List<ContainerTransaction> transactions = ejbJar.getAssemblyDescriptor().getContainerTransaction();
transactions.add(new ContainerTransaction(TransAttribute.REQUIRED, remoteMethod));
transactions.add(new ContainerTransaction(TransAttribute.SUPPORTS, localMethod));
return ejbJar;
}
use of org.apache.openejb.jee.Method$JAXB.writeMethod in project tomee by apache.
the class CheckInvalidContainerTransactionTest method test.
@Keys({ @Key("containerTransaction.ejbNameRequired"), @Key("containerTransaction.noSuchEjbName") })
public EjbJar test() throws Exception {
final EjbJar ejbJar = new EjbJar();
final ContainerTransaction tx = new ContainerTransaction(TransAttribute.REQUIRED, new Method((String) null, (String) null));
ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx);
final ContainerTransaction tx1 = new ContainerTransaction(TransAttribute.REQUIRED, new Method("wrongEjbName", "wrongMethodName"));
ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx1);
return ejbJar;
}
Aggregations