assertEquals(roles, rolesAllowed.getRoles());
// Validate the MyStateless @Interceptors
InterceptorBindingsMetaData interceptorBindings = assembly.getInterceptorBindings();
assertEquals(2, interceptorBindings.size());
InterceptorBindingMetaData ib0 = interceptorBindings.get(0);
InterceptorBindingMetaData ib1 = interceptorBindings.get(1);
assertEquals("MyStatelessBean", ib0.getEjbName());
NamedMethodMetaData ib0Method = ib0.getMethod();
if(ib0Method == null)
{
// The class level @Interceptors
assertFalse(ib0.isExcludeClassInterceptors());
assertTrue(ib0.isExcludeDefaultInterceptors());
assertEquals(TestClassInterceptor.class.getName(),
ib0.getInterceptorClasses().iterator().next());
}
else
{
// The method level @Interceptors
assertTrue(ib0.isExcludeClassInterceptors());
assertTrue(ib0.isExcludeDefaultInterceptors());
assertEquals(TestMethodInterceptor.class.getName(),
ib0.getInterceptorClasses().iterator().next());
assertEquals("intercept2", ib0Method.getMethodName());
}
assertEquals("MyStatelessBean", ib1.getEjbName());
NamedMethodMetaData ib1Method = ib1.getMethod();
if(ib1Method == null)
{
// The class level @Interceptors
assertFalse(ib1.isExcludeClassInterceptors());
assertTrue(ib1.isExcludeDefaultInterceptors());
assertEquals(TestClassInterceptor.class.getName(),
ib1.getInterceptorClasses().iterator().next());
}
else
{
// The method level @Interceptors
assertTrue(ib1.isExcludeClassInterceptors());
assertTrue(ib1.isExcludeDefaultInterceptors());
assertEquals(TestMethodInterceptor.class.getName(),
ib1.getInterceptorClasses().iterator().next());
assertEquals("intercept2", ib1Method.getMethodName());
}
JBossSessionBeanMetaData secureBean = (JBossSessionBeanMetaData)metaData.getEnterpriseBean("SecureBean");
assertNotNull(secureBean);