use of org.apache.openejb.config.ConfigurationFactory in project tomee by apache.
the class EjbObjectInputStreamTest method setUp.
@Before
public void setUp() throws Exception {
oldWhitelist = System.getProperty("tomee.serialization.class.whitelist");
oldBlacklist = System.getProperty("tomee.serialization.class.blacklist");
System.setProperty("tomee.serialization.class.whitelist", "org.apache.openejb.,java.lang.SecurityException,java.lang.RuntimeException,java.lang.Exception," + "java.lang.Throwable,java.lang.StackTraceElement,java.util.Collections,java.util.ArrayList,java.util.Properties,java.util.Hashtable,java.util.HashSet," + "java.net.URI,java.util.TreeSet,java.util.LinkedHashSet,java.lang.String");
System.setProperty("tomee.serialization.class.blacklist", "-");
config = new ConfigurationFactory();
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 Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
context = new InitialContext(props);
}
use of org.apache.openejb.config.ConfigurationFactory in project tomee by apache.
the class OpenejbLookupTest method testPlainInitialContext.
public void testPlainInitialContext() throws Exception {
final Assembler assembler = new Assembler();
final ConfigurationFactory config = new ConfigurationFactory();
assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooBean.class));
assembler.createApplication(config.configureApplication(ejbJar));
final Context context = new InitialContext();
assertOpenejbUrlLookups(context);
}
use of org.apache.openejb.config.ConfigurationFactory in project tomee by apache.
the class ConcurrentMethodTest method test.
public void test() throws Exception {
final Assembler assembler = new Assembler();
final ConfigurationFactory config = new ConfigurationFactory();
assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new SingletonBean(Color.class));
final EjbJarInfo ejbJarInfo = config.configureApplication(ejbJar);
assembler.createApplication(ejbJarInfo);
loadAttributes(ejbJarInfo, "Color");
assertAccessTimeoutAttribute(1, TimeUnit.SECONDS, Color.class.getMethod("color", Object.class));
assertLockAttribute("Read", Color.class.getMethod("color", Object.class));
assertAccessTimeoutAttribute(1, TimeUnit.SECONDS, Color.class.getMethod("color", String.class));
assertLockAttribute("Write", Color.class.getMethod("color", String.class));
assertAccessTimeoutAttribute(2, TimeUnit.HOURS, Color.class.getMethod("color", Boolean.class));
assertLockAttribute("Read", Color.class.getMethod("color", Boolean.class));
}
use of org.apache.openejb.config.ConfigurationFactory in project tomee by apache.
the class EjbRefTest method setUp.
protected void setUp() throws Exception {
config = new ConfigurationFactory();
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));
System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName());
context = new InitialContext();
}
use of org.apache.openejb.config.ConfigurationFactory in project tomee by apache.
the class EjbSecurityRoleRefTest method setUp.
protected void setUp() throws Exception {
config = new ConfigurationFactory();
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 Properties props = new Properties();
props.setProperty(Context.SECURITY_PRINCIPAL, "jonathan");
props.setProperty(Context.SECURITY_CREDENTIALS, "secret");
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
context = new InitialContext(props);
}
Aggregations