import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import junit.framework.TestCase;
import ejb.sessionBean.ShopService;
public class TestStatefulSessionBean extends TestCase {
static ShopService shopService = null;
public Context init() {
…………………………
}
public void test01() throws NamingException {
if (shopService == null) {
Context context = init();
shopService = (ShopService) context
.lookup("ShopServiceEAOImpl/remote");
}
shopService.addItem("素还真");
System.out.println(shopService.showItems());
}
public void test02() throws NamingException {
if (shopService == null) {
Context context = init();
shopService = (ShopService) context
.lookup("ShopServiceEAOImpl/remote");
}
shopService.addItem("素还真");
System.out.println(shopService.showItems());
}
public void test03() throws NamingException {
if (shopService == null) {
Context context = init();
shopService = (ShopService) context
.lookup("ShopServiceEAOImpl/remote");
}
shopService.addItem("叶小钗");
System.out.println(shopService.showItems());
}
public void test04() throws NamingException {
if (shopService == null) {
Context context = init();
shopService = (ShopService) context
.lookup("ShopServiceEAOImpl/remote");
}
System.out.println(shopService.showItems());
}
}
|
相关推荐
JavaEE5学习笔记05-EJB之会话Bean总结...
EJB之消息驱动Bean的总结。ejb 消息驱动Bean j2ee jms java
JavaEE5学习笔记07-Web层与EJB集成总结。
JavaEE5学习笔记09-将EJB发布成WebService总结。
JavaEE5学习笔记02-JNDI与RMI,
JavaEE5学习笔记04-JavaMail使用总结----
JavaEE5学习笔记01-JTA和数据库事务.
JavaEE5学习笔记12-JSF集成AJAX使用经验总结。
JavaEE5学习笔记03-JMS介绍与使用..
JavaEE5学习笔记13-JSF集成Facelets使用经验总结.
JavaEE5学习笔记11-JSF转换器验证器使用经验总结。
NULL 博文链接:https://suhuanzheng7784877.iteye.com/blog/909104
JavaEE源代码 struts2-core-2.0.11JavaEE源代码 struts2-core-2.0.11JavaEE源代码 struts2-core-2.0.11JavaEE源代码 struts2-core-2.0.11JavaEE源代码 struts2-core-2.0.11JavaEE源代码 struts2-core-2.0.11JavaEE源...
javaee-api-8.0-javadoc.jar,这是javaee1.8api的jar包,解压后可用javadoc2chm制作成chm帮助文档。
JavaEE源代码 struts2-spring-plugin-2.0.11JavaEE源代码 struts2-spring-plugin-2.0.11JavaEE源代码 struts2-spring-plugin-2.0.11JavaEE源代码 struts2-spring-plugin-2.0.11JavaEE源代码 struts2-spring-plugin-...
java javaee-api-6.0-5
JPA学习笔记-EJB-06JPA+Spring使用经验。
先电云计算软件服务-云存储网盘JavaEE网络应用开发手册-Cloud-SaaS-Web-v2.0先电云计算软件服务-云存储网盘JavaEE网络应用开发手册-Cloud-SaaS-Web-v2.0先电云计算软件服务-云存储网盘JavaEE网络应用开发手册-Cloud-...
JavaEE源代码 jaxen-1.1-beta-7JavaEE源代码 jaxen-1.1-beta-7JavaEE源代码 jaxen-1.1-beta-7JavaEE源代码 jaxen-1.1-beta-7JavaEE源代码 jaxen-1.1-beta-7JavaEE源代码 jaxen-1.1-beta-7JavaEE源代码 jaxen-1.1-...