use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.
the class CheckInvalidMethodPermissionsTest method test.
@Keys({ @Key("methodPermission.ejbNameRequired"), @Key("methodPermission.noSuchEjbName") })
public EjbJar test() throws Exception {
final EjbJar ejbJar = new EjbJar();
final MethodPermission permission = new MethodPermission(new Method((String) null, (String) null));
ejbJar.getAssemblyDescriptor().getMethodPermission().add(permission);
final MethodPermission permission1 = new MethodPermission(new Method("wrongEjbName", "wrongMethodName"));
ejbJar.getAssemblyDescriptor().getMethodPermission().add(permission1);
return ejbJar;
}
use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.
the class CheckInvalidSecurityAnnotationsTest method test.
@Keys({ @Key("conflictingSecurityAnnotations"), @Key("permitAllAndRolesAllowedOnClass") })
public EjbJar test() throws Exception {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooBean.class));
return ejbJar;
}
use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.
the class CheckInvalidTransactionAttributeTest method xml.
@Keys(@Key(value = "xml.invalidTransactionAttribute", type = KeyType.WARNING))
public EjbJar xml() throws SecurityException, NoSuchMethodException {
final EjbJar ejbJar = new EjbJar();
final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(CheeseEjb.class));
bean.setTransactionType(TransactionType.BEAN);
final ContainerTransaction tx = new ContainerTransaction();
tx.getMethod().add(new Method(bean.getEjbName(), CheeseEjb.class.getMethod("sayCheesePlease", null)));
tx.setTransAttribute(TransAttribute.REQUIRED);
ejbJar.getAssemblyDescriptor().getContainerTransaction().add(tx);
return ejbJar;
}
use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.
the class CdiDecoratorMultipleDelegateCallsTest method classes.
@Module
@Classes({ ServiceImpl.class })
public EjbModule classes() {
final Beans beans = new Beans();
beans.addDecorator(ServiceDecorator.class);
final EjbModule jar = new EjbModule(new EjbJar());
jar.setBeans(beans);
return jar;
}
use of org.apache.openejb.jee.EjbJar$JAXB in project tomee by apache.
the class CdiDecoratorTest method setUp.
@Before
public void setUp() throws Exception {
final ConfigurationFactory config = new ConfigurationFactory();
final Assembler assembler = new Assembler();
assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
assembler.createContainer(config.configureService(StatelessSessionContainerInfo.class));
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean("HelloOne", RedBean.class));
ejbJar.addEnterpriseBean(new StatelessBean("HelloTwo", RedBean.class));
ejbJar.addEnterpriseBean(new StatelessBean(OrangeBean.class));
final Beans beans = new Beans();
beans.addInterceptor(OrangeCdiInterceptor.class);
beans.addDecorator(OrangeOneDecorator.class);
beans.addDecorator(OrangeTwoDecorator.class);
beans.addManagedClass(YellowBean.class);
final EjbModule module = new EjbModule(ejbJar);
module.setBeans(beans);
assembler.createApplication(config.configureApplication(module));
final Properties properties = new Properties(System.getProperties());
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName());
ctx = new InitialContext(properties);
}
Aggregations