使用说明
使用说明MockEJB3
使用junit测试时候
·只需要调用
org.knot.mockejb3.createors.SessionBeanFactory.getInstance().getEJB
/** * 获取SessionBean * * @param interfaceClazz 接口Class * @param implClass 实现类Class * @return * @throws Exception */public
T getEJB(Class interfaceClazz, Class implClass)
方法来获取SessionBean;
使用非常简单;
eg:
```
protected static TestMutilDs mutilDs;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
mutilDs = org.knot.mockejb3.createors.SessionBeanFactory.getInstance().getEJB(TestMutilDs.class, TestMutilDsImpl.class);
}
@AfterClass
public static void tearDown() throws Exception {
org.knot.mockejb3.createors.SessionBeanFactory.getInstance().preDestroyEJB();
}
```
·在classpath跟目录下,配置mockejb3.xml
文 件 列 表
src
.svn
com
dalHibernate.cfg.xml
META-INF
mockejb3.xml
oracleHibernate.cfg.xml
test
.svn
com