testdepartmentservice.java

来自「HR系统模拟企业对内部职员的管理」· Java 代码 · 共 59 行

JAVA
59
字号
package org.operamasks.example.hr.test;import static org.junit.Assert.fail;import java.util.UUID;import org.junit.After;import org.junit.Before;import org.junit.Test;import org.operamasks.example.ejb.hr.entity.Department;import org.operamasks.example.ejb.hr.service.IDepartmentService;public class TestDepartmentService {	private IDepartmentService departmentService;	@Test	public void testCreateDepartment() {		String[] datas = {"行政部门", "研发部门", "销售部门", "人力资源部门"};				for(String data : datas) {			Department department = new Department();			department.setId(UUID.randomUUID().toString());			department.setName(data);			departmentService.createDepartment(department);		}	}	@Test	public void testModifyDepartment() {		fail("Not yet implemented");	}	@Test	public void testRemoveDepartment() {		fail("Not yet implemented");	}	@Test	public void testListDepartment() {		fail("Not yet implemented");	}	@Before	public void setUp() throws Exception {		java.util.Properties p = new java.util.Properties();		p.put(javax.naming.Context.PROVIDER_URL, "iiop://127.0.0.1:6888");		p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.apusic.naming.jndi.CNContextFactory");		javax.naming.InitialContext initCtx = new javax.naming.InitialContext(p);		this.departmentService = (IDepartmentService) initCtx.lookup("org.operamasks.example.hr.service.DepartmentService");	}	@After	public void tearDown() throws Exception {		this.departmentService=null;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?