Java Code Examples for javax.ejb.TransactionAttributeType#NEVER

The following examples show how to use javax.ejb.TransactionAttributeType#NEVER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransactionInvocationHandlersTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetHandlerForBeanClass1() {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean {
    }
    assertSame(TransactionInvocationHandlers.TX_NEVER,
            TransactionInvocationHandlers.getHandlerFor(Bean.class));
}
 
Example 2
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test
public void testCall() throws Exception {
    final Object value = new Object();
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Callable<Object> {
        public Object call() {
            return value;
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    assertSame(value, bean.getInterfaceOrClass(Callable.class).call());
}
 
Example 3
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test(expected = EJBException.class)
public void testCallWithSystemException() {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Runnable {
        public void run() {
            throw new RuntimeException();
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    bean.getInterfaceOrClass(Runnable.class).run();
}
 
Example 4
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test(expected = AppException.class)
public void testCallWithApplicationException1() {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Runnable {
        public void run() {
            throw new AppException();
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    bean.getInterfaceOrClass(Runnable.class).run();
}
 
Example 5
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test(expected = IOException.class)
public void testCallWithApplicationException2() throws Exception {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Callable<Void> {
        public Void call() throws Exception {
            throw new IOException();
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    bean.getInterfaceOrClass(Callable.class).call();
}
 
Example 6
Source File: TransactionInvocationHandlersTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetHandlerForBeanClass1() {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean {
    }
    assertSame(TransactionInvocationHandlers.TX_NEVER,
            TransactionInvocationHandlers.getHandlerFor(Bean.class));
}
 
Example 7
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test
public void testCall() throws Exception {
    final Object value = new Object();
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Callable<Object> {
        public Object call() {
            return value;
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    assertSame(value, bean.getInterfaceOrClass(Callable.class).call());
}
 
Example 8
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test(expected = EJBException.class)
public void testCallWithSystemException() {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Runnable {
        public void run() {
            throw new RuntimeException();
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    bean.getInterfaceOrClass(Runnable.class).run();
}
 
Example 9
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test(expected = AppException.class)
public void testCallWithApplicationException1() {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Runnable {
        public void run() {
            throw new AppException();
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    bean.getInterfaceOrClass(Runnable.class).run();
}
 
Example 10
Source File: DeployedSessionBeanTest.java    From development with Apache License 2.0 5 votes vote down vote up
@Test(expected = IOException.class)
public void testCallWithApplicationException2() throws Exception {
    @TransactionAttribute(TransactionAttributeType.NEVER)
    class Bean implements Callable<Void> {
        public Void call() throws Exception {
            throw new IOException();
        }
    }
    DeployedSessionBean bean = new DeployedSessionBean(tmStub,
            sessionContext, new Bean());
    bean.getInterfaceOrClass(Callable.class).call();
}
 
Example 11
Source File: EJB_09_NEVER.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.NEVER)
public boolean getTrue(){
    return true;
}
 
Example 12
Source File: EJB_09_NEVER.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.NEVER)
public boolean getTrue(){
    return true;
}
 
Example 13
Source File: StatefulTransactionAttributesTest.java    From tomee with Apache License 2.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.NEVER)
public String color() {
    return attribute();
}
 
Example 14
Source File: GetAllTimersTest.java    From tomee with Apache License 2.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.NEVER)
public Collection<Timer> list() {
    return ts.getAllTimers();
}