/** 测试根据企业名称和区县ID取得企业信息 */ @SuppressWarnings("unchecked") public void testGetCorpByName() { Corp corp = generateCorp("新龙公司", "时代方舟", county); corpManager.save(corp); Map corpRst = reportManager.getCorpMapByName("新龙公司", county.getId()); assertNotNull(corpRst); assertEquals("新龙公司", corpRst.get("name")); }
/** 测试根据区县ID取得该区县下所有的企业 */ public void testGetCorpOfCounty() { Corp corp1 = generateCorp("新龙公司", "时代方舟A座", county); corp1.setBusinessLicense("2010011089"); Corp corp2 = generateCorp("WIFI", "时代方舟B座", county); corpManager.save(corp1); corpManager.save(corp2); String[] corpRst = reportManager.getCorpOfCounty(county.getId()); assertNotNull(corpRst); assertTrue(corpRst.length >= 2); }
/** 测试保存部门上报事件 */ public void testSaveReportInfoOfCase() { Corp corp = generateCorp("测试企业", "石家庄大学", county); corpManager.save(corp); FsCase fsCase1 = generateFsCase("事件1", county); Task task1 = generateTask("任务1"); TaskDetail taskDetail1 = generateTaskDetail("成功的办他1"); FsCase fsCase2 = generateFsCase("事件2", county); Task task2 = generateTask("任务2"); TaskDetail taskDetail2 = generateTaskDetail("成功的办他2"); reportManager.saveReportInfoOfCase(fsCase1, task1, taskDetail1, corp, "企业1"); assertEquals("事件1", reportManager.get(fsCase1.getId()).getTitle()); assertEquals("任务1", taskManager.get(task1.getId()).getTitle()); Corp rstCorp = corpManager.findObject("from Corp c where c.name = ?", "企业1"); assertNotNull(rstCorp); reportManager.saveReportInfoOfCase(fsCase2, task2, taskDetail2, corp, "测试企业"); assertNotNull(reportManager.get(fsCase2.getId())); assertNotNull(taskManager.get(task2.getId())); }