📄 testmoduleservice.java
字号:
package org.operamasks.example.hr.test;import static org.junit.Assert.fail;import java.util.ArrayList;import java.util.List;import java.util.UUID;import org.junit.After;import org.junit.Before;import org.junit.Test;import org.operamasks.example.ejb.hr.entity.Module;import org.operamasks.example.ejb.hr.entity.ModuleItem;import org.operamasks.example.ejb.hr.service.IModuleService;public class TestModuleService { private IModuleService moduleService; @Test public void testCreateModule() { String[][] datas = {{"系统管理", "角色管理:roleManage:jsgl", "模块管理:moduleManage:mkgl", "用户管理:userManage:yhgl"}, {"数据维护", "培训数据:trainDataManage:pxsj"}, {"基础数据", "培训项目:trainSubjectManage:pxxm", "职员管理:employeeManage:zygl", "部门管理:departmentManage:bmgl", "职级管理:rankManage:zjgl", "培训类别:trainTypeManage:pxlb" }, {"统计报表", "职级培训统计:statisticsRank:zjpxtj", "部门培训统计:statisticsDepartment:bmpxtj"}, {"分析图表", "部门培训分析:analysisDepartment:bmpxfx", "职级培训分析:analysisRank:zjpxfx"}}; for(String[] data : datas) { Module module = new Module(); module.setId(UUID.randomUUID().toString()); module.setName(data[0]); List<ModuleItem> items = new ArrayList<ModuleItem>(); for(int i = 1; i < data.length; i++) { String[] itemdata = data[i].split(":"); ModuleItem item = new ModuleItem(); item.setId(UUID.randomUUID().toString()); item.setName(itemdata[0]); item.setUrl(itemdata[1] + ".faces"); item.setIcon("../resources/images/items/" + itemdata[2] + ".png"); item.setModule(module); items.add(item); } module.setModuleItems(items); moduleService.createModule(module); } // ModuleItem xxx = new ModuleItem();// xxx.setId("item0001");// Module m = moduleService.findById("257e00b2-2292-4c88-b775-3b4dad31a587");// m.getModuleItems().add(xxx);// moduleService.modifyModule(m); } @Test public void testModifyModule() { fail("Not yet implemented"); } @Test public void testRemoveModule() { fail("Not yet implemented"); } @Test public void testListModule() { fail("Not yet implemented"); } @Test public void testFindById() { 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.moduleService = (IModuleService) initCtx.lookup("org.operamasks.example.hr.service.ModuleService"); } @After public void tearDown() throws Exception { this.moduleService=null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -