Java 类javax.ejb.embeddable.EJBContainer 实例源码
项目:testing_security_development_enterprise_systems
文件:UserBeanInEmbeddedContainerTest.java
@Before
public void initContainer() throws Exception {
/*
This will start an embedded container, which we ll save us
from having to start it as an external process and deploy
our WAR on it.
However, embedded containers only provide reduced functionalities,
see page 231 in Chapter 7 and
http://arquillian.org/blog/2012/04/13/the-danger-of-embedded-containers/
In generate, better to avoid the embedded containers,
although I will use them in some simple examples just to
simplify the execution of the tests
*/
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
}
项目:kandy
文件:EjbFactory.java
private EjbFactory() {
if (container == null) {
Properties properties = new Properties();
properties.put("myTransactionManager", "new://TransactionManager?type=TransactionManager");
properties.put("myTransactionManager.defaultTransactionTimeout", "3hr"); //hour
properties.put("jdbc/bankWorkTestResource", "new://Resource?type=DataSource");
properties.put("jdbc/bankWorkTestResource.JdbcDriver", "com.mysql.jdbc.Driver");
properties.put("jdbc/bankWorkTestResource.JdbcUrl", databaseUrl);
properties.put("jdbc/bankWorkTestResource.UserName", databaseUser);
properties.put("jdbc/bankWorkTestResource.Password", databasePass);
container = EJBContainer.createEJBContainer(properties);
}
}
项目:JEE7-Demo
文件:EJB31Runner.java
@Override
protected Statement withBeforeClasses(Statement statement) {
Properties p = new Properties();
// set the initial context factory
p.put("java.naming.factory.initial ",
"org.apache.openejb.client.LocalInitialContextFactory");
// create some resources
p.put("jdbc/StudentsDS", "new://Resource?type=DataSource");
p.put("jdbc/StudentsDS.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
p.put("jdbc/StudentsDS.JdbcUrl", "jdbc:derby:memory:studentDB;create=true");
// set some openejb flags
p.put("openejb.jndiname.format", "{ejbName}/{interfaceClass}");
p.put("openejb.descriptors.output", "true");
p.put("openejb.validation.output.level", "verbose");
p.put("JEE6DemoPersistence.eclipselink.target-database", "DERBY");
p.put("JEE6DemoPersistence.eclipselink.logging.level", "INFO");
p.put("JEE6DemoPersistence.eclipselink.ddl-generation", "create-tables");
ejbContainer = EJBContainer.createEJBContainer(p);
return super.withBeforeClasses(statement);
}
项目:TicketManorJava
文件:EventsEjbTest.java
@Test @Ignore("no provider found!")
public void test() throws Exception {
final Properties p = new Properties();
p.put("TicketManorDataSource", "new://Resource?type=DataSource");
p.put("TicketManorDataSource.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("TicketManorDataSource.JdbcUrl", "jdbc:hsqldb:mem:TicketManorDataSource");
final Context context = EJBContainer.createEJBContainer(p).getContext();
EventsEjb events = (EventsEjb) context.lookup("java:global/injection-of-entitymanager/EventsBean");
LocalDateTime today = LocalDateTime.now();
events.addEvent(new Event(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992), today, null));
events.addEvent(new Event(new Movie("Joel Coen", "Fargo", 1996), today, null));
events.addEvent(new Event(new Movie("Joel Coen", "The Big Lebowski", 1998), today, null));
List<Event> list = events.getAllEvents();
assertEquals("List.size()", 3, list.size());
for (Event event : list) {
events.deleteEvent(event);
}
}
项目:tomee
文件:EmbeddedTomEEContainerTest.java
@Test
public void classpath() throws Exception {
final Properties p = new Properties();
p.setProperty(EJBContainer.PROVIDER, EmbeddedTomEEContainer.class.getName());
p.setProperty(DeploymentsResolver.CLASSPATH_INCLUDE, ".*tomee-embedded.*");
p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, "-1");
EJBContainer container = null;
try {
container = EJBContainer.createEJBContainer(p);
assertNotNull(container);
assertNotNull(container.getContext());
final ABean bean = ABean.class.cast(container.getContext().lookup("java:global/tomee-embedded/ABean"));
assertNotNull(bean);
assertEquals("ok", bean.embedded());
} finally {
if (container != null) {
container.close();
}
}
}
项目:tomee
文件:MoviesHtmlUnitTest.java
@BeforeClass
public static void start() throws IOException {
// get a random unused port to use for http requests
ServerSocket server = new ServerSocket(0);
port = server.getLocalPort();
server.close();
webApp = createWebApp();
Properties p = new Properties();
p.setProperty(EJBContainer.APP_NAME, "moviefun");
p.setProperty(EJBContainer.PROVIDER, "tomee-embedded"); // need web feature
p.setProperty(EJBContainer.MODULES, webApp.getAbsolutePath());
p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, String.valueOf(port));
container = EJBContainer.createEJBContainer(p);
}
项目:tomee
文件:StratocasterTest.java
public void test() throws Exception {
EJBContainer.createEJBContainer().getContext().bind("inject", this);
Date date = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.US).parse("Mar 1, 1962");
assertEquals("Strat.getDateCreated()", date, strat.getDateCreated());
List<Pickup> pickups = asList(Pickup.SINGLE_COIL, Pickup.SINGLE_COIL, Pickup.SINGLE_COIL);
assertEquals("Strat.getPickups()", pickups, strat.getPickups());
assertEquals("Strat.getStyle()", Style.VINTAGE, strat.getStyle());
assertEquals("Strat.getStringGuage(\"E1\")", 0.052F, strat.getStringGuage("E1"), 1e-15);
assertEquals("Strat.getStringGuage(\"A\")", 0.042F, strat.getStringGuage("A"), 1e-15);
assertEquals("Strat.getStringGuage(\"D\")", 0.030F, strat.getStringGuage("D"), 1e-15);
assertEquals("Strat.getStringGuage(\"G\")", 0.017F, strat.getStringGuage("G"), 1e-15);
assertEquals("Strat.getStringGuage(\"B\")", 0.013F, strat.getStringGuage("B"), 1e-15);
assertEquals("Strat.getStringGuage(\"E\")", 0.010F, strat.getStringGuage("E"), 1e-15);
File file = new File("/tmp/strat-certificate.txt");
assertEquals("Strat.getCertificateOfAuthenticity()", file, strat.getCertificateOfAuthenticity());
}
项目:tomee
文件:DataSourceCipheredExampleTest.java
@Test
public void accessDatasourceWithMyImplementation() throws Exception {
// define the datasource
Properties properties = new Properties();
properties.setProperty("ProtectedDatasource", "new://Resource?type=DataSource");
properties.setProperty("ProtectedDatasource.JdbcDriver", "org.hsqldb.jdbcDriver");
properties.setProperty("ProtectedDatasource.JdbcUrl", "jdbc:hsqldb:mem:protected");
properties.setProperty("ProtectedDatasource.UserName", USER);
properties.setProperty("ProtectedDatasource.Password", "3MdniFr3v3NLLuoY");
properties.setProperty("ProtectedDatasource.PasswordCipher", "reverse");
properties.setProperty("ProtectedDatasource.JtaManaged", "true");
// start the context and makes junit test injections
EJBContainer container = EJBContainer.createEJBContainer(properties);
Context context = container.getContext();
context.bind("inject", this);
// test the datasource
assertNotNull(dataSource);
assertNotNull(dataSource.getConnection());
// closing the context
container.close();
}
项目:tomee
文件:MoviesTest.java
public void test() throws Exception {
System.setProperty("hsqldb.reconfig_logging", "false");
final Properties p = new Properties();
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
final Context context = EJBContainer.createEJBContainer(p).getContext();
Movies movies = (Movies) context.lookup("java:global/jpa-hibernate/Movies");
movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
List<Movie> list = movies.getMovies();
assertEquals("List.size()", 3, list.size());
for (Movie movie : list) {
movies.deleteMovie(movie);
}
assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
}
项目:tomee
文件:TransactionRollbackCauseTest.java
public void test() throws Exception {
final Map<String, Object> map = new HashMap<String, Object>();
map.put(EJBContainer.MODULES, new SingletonBean(Orange.class));
EJBContainer.createEJBContainer(map).getContext().bind("inject", this);
userTransaction.begin();
orange.exceptionRollback();
try {
userTransaction.commit();
fail("transaction should have been rolled back");
} catch (final RollbackException e) {
final Throwable throwable = e.getCause();
assertTrue(throwable instanceof UserException);
}
}
项目:tomee
文件:OpenEjbContainerNoRestartTest.java
@Test
public void noRestart() throws Exception {
final EJBContainer container1 = EJBContainer.createEJBContainer(new Properties() {{
put(EJBContainer.MODULES, new EjbJar());
put(OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE, OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE_SINGLE);
}});
container1.close();
final EJBContainer container2 = EJBContainer.createEJBContainer(new Properties() {{
put(EJBContainer.MODULES, new EjbJar());
}});
container2.close();
assertTrue(SystemInstance.isInitialized());
assertSame(container1, container2);
Reflections.invokeByReflection(container2, "doClose", new Class<?>[0], null);
assertFalse(SystemInstance.isInitialized());
}
项目:tomee
文件:DynamicUserDaoTest.java
@BeforeClass
public static void start() throws Exception {
final Properties p = new Properties();
p.setProperty("openejb.deployments.classpath.include", "spring-data-proxy");
p.setProperty("openejb.exclude-include.order", "exclude-include");
p.setProperty("jdbc/DynamicUserDaoTest", "new://Resource?type=DataSource");
p.setProperty("jdbc/DynamicUserDaoTest", "new://Resource?type=DataSource");
p.setProperty("jdbc/DynamicUserDaoTest.JdbcDriver", "org.hsqldb.jdbcDriver");
p.setProperty("jdbc/DynamicUserDaoTest.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
p.setProperty("jdbc/DynamicUserDaoTest.UserName", "sa");
p.setProperty("jdbc/DynamicUserDaoTest.Password", "");
container = EJBContainer.createEJBContainer(p);
}
项目:tomee
文件:GuessHowManyMBeanTest.java
@Test
public void play() throws Exception {
Properties properties = new Properties();
properties.setProperty(LocalMBeanServer.OPENEJB_JMX_ACTIVE, Boolean.TRUE.toString());
EJBContainer container = EJBContainer.createEJBContainer(properties);
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName objectName = new ObjectName(OBJECT_NAME);
assertEquals(0, server.getAttribute(objectName, "value"));
server.setAttribute(objectName, new Attribute("value", 3));
assertEquals(3, server.getAttribute(objectName, "value"));
assertEquals("winner", server.invoke(objectName, "tryValue", new Object[]{3}, null));
assertEquals("not the correct value, please have another try", server.invoke(objectName, "tryValue", new Object[]{2}, null));
container.close();
}
项目:tomee
文件:MoviesTest.java
public void test() throws Exception {
Properties p = new Properties();
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
Context context = EJBContainer.createEJBContainer(p).getContext();
Movies movies = (Movies) context.lookup("java:global/injection-of-datasource/Movies");
movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
List<Movie> list = movies.getMovies();
assertEquals("List.size()", 3, list.size());
for (Movie movie : list) {
movies.deleteMovie(movie);
}
assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
}
项目:tomee
文件:MoviesTest.java
public void test() throws Exception {
Properties p = new Properties();
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
final Context context = EJBContainer.createEJBContainer(p).getContext();
Movies movies = (Movies) context.lookup("java:global/jpa-eclipselink/Movies");
movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
List<Movie> list = movies.getMovies();
assertEquals("List.size()", 3, list.size());
for (Movie movie : list) {
movies.deleteMovie(movie);
}
assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
}
项目:tomee
文件:MoviesTest.java
public void test() throws Exception {
Properties p = new Properties();
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
final Context context = EJBContainer.createEJBContainer(p).getContext();
Movies movies = (Movies) context.lookup("java:global/jpa-eclipselink/Movies");
movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
List<Movie> list = movies.getMovies();
assertEquals("List.size()", 3, list.size());
for (Movie movie : list) {
movies.deleteMovie(movie);
}
assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
}
项目:testing_security_development_enterprise_systems
文件:TopUsersTest.java
@Before
public void initContainer() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
initDB();
}
项目:testing_security_development_enterprise_systems
文件:StatefulTest.java
@Before
public void initContainer() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
}
项目:testing_security_development_enterprise_systems
文件:CallbackTest.java
@Before
public void initContainer() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
}
项目:testing_security_development_enterprise_systems
文件:CounterTestBaseJEE.java
@Before
public void initContainer() throws Exception {
/*
Using an embedded JEE container...
recall, this is done just to simplify those examples, but
you will have to use Arquillian when testing an actual application
*/
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
}
项目:testing_security_development_enterprise_systems
文件:TestBase.java
@BeforeClass
public static void initContainer() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
queriesEJB = getEJB(QueriesEJB.class);
}
项目:TreasureHunting
文件:QaEJBTest.java
/**
* Test of getList method, of class QaEJB.
*/
@Test
public void testGetList() throws Exception {
System.out.println("getList");
EJBContainer container = javax.ejb.embeddable.EJBContainer.createEJBContainer();
QaEJB instance = (QaEJB)container.getContext().lookup("java:global/classes/QaEJB");
List expResult = null;
List result = instance.getList();
assertEquals(expResult, result);
container.close();
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
项目:pg6100
文件:UserEJBTest.java
@BeforeClass
public static void initContainer() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
//as it is @Stateless, can init just once before running the test suite
userEJB = (UserEJB) ctx.lookup("java:global/classes/"+UserEJB.class.getSimpleName()+"!"+UserEJB.class.getName());
}
项目:pg6100
文件:ContainerTestCase.java
@BeforeClass
public static void setupContainer() throws Exception {
HashMap<String, Object> config = new HashMap<>();
config.put( EJBContainer.MODULES, new File( "target/classes" ) );
container = EJBContainer.createEJBContainer( config );
context = container.getContext();
}
项目:pg6100
文件:TestBase.java
@BeforeClass
public static void initContainer() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
queriesEJB = getEJB(QueriesEJB.class);
}
项目:pg6100
文件:CounterTestBaseJEE.java
@Before
public void initContainer() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
ec = EJBContainer.createEJBContainer(properties);
ctx = ec.getContext();
}
项目:darceo
文件:GlassfishTestHelper.java
/**
* Creates a new EJB container.
*
* @return EJB container
* @throws Exception
* if something went wrong
*/
public static EJBContainer createContainer()
throws Exception {
Map<String, String> props = new HashMap<String, String>();
props.put("org.glassfish.ejb.embedded.glassfish.installation.root",
"../../wrdz-common/business/src/test/glassfish");
props.put("org.glassfish.ejb.embedded.glassfish.instance.root",
"../../wrdz-common/business/src/test/glassfish/domains/wrdz-domain");
props.put(EJBContainer.APP_NAME, APPLICATION_NAME);
return EJBContainer.createEJBContainer(props);
}
项目:darceo
文件:GlassfishTestHelper.java
/**
* Creates and initializes database for specific module.
*
* @param ejbContainer
* ejb container
* @param module
* module
* @throws Exception
* when some error occurs
*/
public static void createDatabase(EJBContainer ejbContainer, Module... modules)
throws Exception {
DataSource dataSource = (DataSource) ejbContainer.getContext().lookup("jdbc/__TimerPool");
for (Module module : modules) {
String moduleName = module.name().toLowerCase();
executeSqlFromFile(dataSource, "../../wrdz-" + moduleName + "/entity/src/main/config/" + moduleName
+ "-SQL-CREATE-ALL.sql");
executeSqlFromFile(dataSource, "../../wrdz-" + moduleName + "/entity/src/test/config/" + moduleName
+ "-SQL-update-test.sql");
}
}
项目:actionbazaar
文件:DiscountManagerBeanEmbeddedTest.java
@BeforeClass
public static void setUpClass() {
Map<String, Object> properties = new HashMap<>();
properties.put("org.glassfish.ejb.embedded.glassfish.instance.root",
"./src/test/domain");
ejbContainer = EJBContainer.createEJBContainer(properties);
ctx = ejbContainer.getContext();
}
项目:jcache-cdi
文件:ExtraJCacheExtensionTest.java
@Before
public void setUp() {
try {
container = EJBContainer.createEJBContainer();
container.getContext().bind("inject", this);
} catch (Exception e) {
e.printStackTrace();
}
}
项目:JavaIncrementalParser
文件:MyBeanTest.java
/**
* Test of sayHello method, of class MyBean.
*
* Commented for now as support for this API is optional
*/
// @Test
public void testSayHello() throws Exception {
System.out.println("sayHello");
String name = "Duke";
try (EJBContainer container = javax.ejb.embeddable.EJBContainer.createEJBContainer()) {
MyBean instance = (MyBean)container.getContext().lookup("java:global/classes/MyBean");
String expResult = "Hello " + name;
String result = instance.sayHello(name);
assertEquals(expResult, result);
}
}
项目:TestEJB
文件:Server.java
public static Object lookup(final String jndi)
throws Exception {
if (container == null) {
container = EJBContainer.createEJBContainer();
}
return container.getContext().lookup(jndi);
}
项目:Tinvention-training-JEE
文件:InContainerUtil.java
public synchronized static EJBContainer getEJBContainer() {
if (container == null) {
Map<String, Object> properties = new HashMap<String, Object>();
container = EJBContainer.createEJBContainer(properties);
}
return container;
}
项目:tomee
文件:EmbeddedTomEEContainerTest.java
@Test
public void containerTest() throws Exception {
final File war = createWar();
final Properties p = new Properties();
p.setProperty(EJBContainer.APP_NAME, "test");
p.setProperty(EJBContainer.PROVIDER, EmbeddedTomEEContainer.class.getName());
p.put(EJBContainer.MODULES, war.getAbsolutePath());
p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, "-1");
EJBContainer container = null;
try {
container = EJBContainer.createEJBContainer(p);
assertNotNull(container);
assertNotNull(container.getContext());
final URL url = new URL("http://127.0.0.1:" + System.getProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT) + "/test/index.html");
assertEquals("true", getOk(url, 2));
} finally {
if (container != null) {
container.close();
}
try {
FileUtils.forceDelete(war);
} catch (final IOException e) {
FileUtils.deleteQuietly(war);
}
}
}
项目:tomee
文件:SubjectServiceTest.java
@BeforeClass
public static void start() {
final Properties properties = new Properties();
properties.setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true");
properties.setProperty(EJBContainer.APP_NAME, "polling/api");
properties.setProperty(EJBContainer.PROVIDER, "openejb");
container = EJBContainer.createEJBContainer(properties);
}
项目:tomee
文件:MessagingBeanTest.java
public void test() throws Exception {
final Context context = EJBContainer.createEJBContainer().getContext();
Messages messages = (Messages) context.lookup("java:global/injection-of-connectionfactory/Messages");
messages.sendMessage("Hello World!");
messages.sendMessage("How are you?");
messages.sendMessage("Still spinning?");
assertEquals(messages.receiveMessage(), "Hello World!");
assertEquals(messages.receiveMessage(), "How are you?");
assertEquals(messages.receiveMessage(), "Still spinning?");
}
项目:tomee
文件:LoggerTest.java
@Before
public void setUp() {
try {
container = EJBContainer.createEJBContainer();
container.getContext().bind("inject", this);
} catch (Exception e) {
e.printStackTrace();
}
}
项目:tomee
文件:MovieTest.java
@Before
public void setUp() throws Exception {
// Uncomment this line to set the login/logout functionality on Debug
//System.setProperty("log4j.category.OpenEJB.security", "debug");
Properties p = new Properties();
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
this.container = EJBContainer.createEJBContainer(p);
this.container.getContext().bind("inject", this);
}
项目:tomee
文件:MoviesTest.java
protected void setUp() throws Exception {
final Properties p = new Properties();
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
}
项目:tomee
文件:MovieTest.java
@Before
public void setUp() throws Exception {
Properties p = new Properties();
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
this.container = EJBContainer.createEJBContainer(p);
this.container.getContext().bind("inject", this);
}