}
public void testShouldAddTransactionManagementAttributes() throws Exception {
// setup
final IJDTFacade facade = context.mock(IJDTFacade.class);
SessionBeanConverter converter = new SessionBeanConverter(facade);
// expectations
context.checking(new Expectations(){{
one(facade).addClassAnnotation("test.TestBean", TransactionManagement.class, createNameValuePair("value", TransactionManagementType.BEAN)); //$NON-NLS-1$ //$NON-NLS-2$
// one(facade).addClassAnnotation("test.TestBean", TransactionAttribute.class, createNameValuePair("value", TransactionAttributeType.MANDATORY)); //$NON-NLS-1$ //$NON-NLS-2$
// one(facade).addMethodAnnotation("test.TestBean", "test", new String[] { "java.lang.String" }, TransactionAttribute.class, createNameValuePair("value", TransactionAttributeType.MANDATORY)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}});
EnterpriseBean enterpriseBean = new StatefulBean();
enterpriseBean.setEjbName("TestBean"); //$NON-NLS-1$
enterpriseBean.setEjbClass("test.TestBean"); //$NON-NLS-1$
enterpriseBean.setTransactionType(TransactionType.BEAN);
AssemblyDescriptor descriptor = new AssemblyDescriptor();
addMethodTransactionToDescriptor(descriptor, "TestBean", "*", new String[0]); //$NON-NLS-1$ //$NON-NLS-2$
addMethodTransactionToDescriptor(descriptor, "TestBean", "test", new String[] { "java.lang.String" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// execute
converter.processTransactionManagement(enterpriseBean, descriptor);
// verify
context.assertIsSatisfied();
}