資源簡介
ssm框架 jsp 路由數(shù)據(jù)庫 ehcahe緩存 二進制位權限管理 aop日志記錄 序列化反序列化的對象復制 mysql數(shù)據(jù)庫 highchart圖形化 poi統(tǒng)計
代碼片段和文件信息
package?junit.test;
import?java.sql.Connection;
import?java.sql.SQLException;
import?java.util.List;
import?java.util.Set;
import?javax.sql.DataSource;
import?org.junit.Test;
import?org.springframework.context.ApplicationContext;
import?org.springframework.context.support.ClassPathxmlApplicationContext;
import?com.atguigu.survey.component.dao.i.AdminMapper;
import?com.atguigu.survey.component.dao.i.BagMapper;
import?com.atguigu.survey.component.dao.i.LogMapper;
import?com.atguigu.survey.component.dao.i.SurveyMapper;
import?com.atguigu.survey.component.service.i.UserService;
import?com.atguigu.survey.component.service.m.UserServiceImpl;
import?com.atguigu.survey.entities.guest.Bag;
import?com.atguigu.survey.entities.guest.Question;
import?com.atguigu.survey.entities.guest.Survey;
import?com.atguigu.survey.entities.guest.User;
import?com.atguigu.survey.entities.manager.Auth;
import?com.atguigu.survey.entities.manager.Log;
import?com.atguigu.survey.entities.manager.Res;
import?com.atguigu.survey.entities.manager.Role;
import?com.atguigu.survey.log.thread.local.RoutingKeyBinder;
public?class?IOCTest?{
ApplicationContext?ioc?=?new?ClassPathxmlApplicationContext(“spring-context.xml“);
//DataSource?dataSource?=?ioc.getBean(DataSource.class);
UserService?userService?=?ioc.getBean(UserService.class);
//UserServiceImpl?userService?=?ioc.getBean(UserServiceImpl.class);
SurveyMapper?surveyMapper?=?ioc.getBean(SurveyMapper.class);
BagMapper?bagMapper?=?ioc.getBean(BagMapper.class);
AdminMapper?amdinMapper?=?ioc.getBean(AdminMapper.class);
LogMapper?logMapper?=??ioc.getBean(LogMapper.class);
@Test
public?void?testTotalCountLog(){
Set?logTables?=?logMapper.getLogTables();
RoutingKeyBinder.setKey(RoutingKeyBinder.DATA_SOURCE_LOG);
int?totalCountForLog?=?logMapper.getTotalCountForLog(logTables);
System.out.println(“totalCountForLog=“+totalCountForLog);
RoutingKeyBinder.setKey(RoutingKeyBinder.DATA_SOURCE_LOG);
List?logList?=?logMapper.getPage(logTables?0?5);
System.out.println(logList);
}
@Test
public?void?testGetLogTables(){
//RoutingKeyBinder.setKey(RoutingKeyBinder.DATA_SOURCE_LOG);
Set?logTables?=?logMapper.getLogTables();
for?(String?tableName?:?logTables)?{
System.out.println(tableName);
}
}
@Test
public?void?testGetRoleDeeply(){
Set?roleSet?=?amdinMapper.getDeeplyRoleSet(2);
for?(Role?role?:?roleSet)?{
System.out.println(role);
Set?authSet?=?role.getAuthSet();
for?(Auth?auth?:?authSet)?{
System.out.println(auth);
Set?resSet?=?auth.getResSet();
for?(Res?res?:?resSet)?{
System.out.println(res);
}
System.out.println(“-----------------“);
}
System.out.println(“-----------------“);
}
}
@Test
public?void?testGetSurveyDeeply(){
Survey?surveyDeeply?=?surveyMapper.getSurveyDeeply(80);
System.out.print
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\
?????文件????????1515??2016-12-01?09:30??Survey_01_UI\.classpath
?????文件????????1429??2016-11-21?19:05??Survey_01_UI\.project
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\.settings\
?????文件?????????508??2016-11-19?17:09??Survey_01_UI\.settings\.jsdtscope
?????文件?????????664??2016-11-23?19:26??Survey_01_UI\.settings\org.eclipse.jdt.core.prefs
?????文件??????????90??2016-11-19?17:09??Survey_01_UI\.settings\org.eclipse.m2e.core.prefs
?????文件????????1442??2016-11-21?19:05??Survey_01_UI\.settings\org.eclipse.wst.common.component
?????文件?????????252??2016-11-19?17:10??Survey_01_UI\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2016-11-19?17:09??Survey_01_UI\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2016-11-19?17:09??Survey_01_UI\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件??????????50??2016-11-19?17:09??Survey_01_UI\.settings\org.eclipse.wst.validation.prefs
?????文件??????????81??2016-11-23?19:26??Survey_01_UI\.settings\org.hibernate.eclipse.console.prefs
?????文件?????????503??2016-11-21?14:38??Survey_01_UI\.springBeans
?????文件????????1163??2016-11-21?16:19??Survey_01_UI\pom.xm
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\src\
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\src\main\
?????目錄???????????0??2017-09-06?10:11??Survey_01_UI\src\main\java\
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\src\main\resources\
?????文件?????????191??2016-11-21?10:52??Survey_01_UI\src\main\resources\MyBaits-config.xm
?????文件?????????258??2016-12-09?16:49??Survey_01_UI\src\main\resources\ehcache.xm
?????文件?????????441??2016-12-09?09:27??Survey_01_UI\src\main\resources\jdbc.properties
?????文件????????1108??2016-11-21?17:03??Survey_01_UI\src\main\resources\log4j.properties
?????文件????????9598??2016-12-09?17:04??Survey_01_UI\src\main\resources\spring-context.xm
?????文件????????5732??2016-12-07?14:08??Survey_01_UI\src\main\resources\springmvc-context.xm
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\src\main\webapp\
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\src\main\webapp\me
?????文件??????????39??2016-11-19?17:10??Survey_01_UI\src\main\webapp\me
?????目錄???????????0??2017-07-03?12:10??Survey_01_UI\src\main\webapp\WEB-INF\
?????文件?????????995??2016-12-06?14:44??Survey_01_UI\src\main\webapp\WEB-INF\atguigu.tld
?????文件?????????766??2016-11-28?11:30??Survey_01_UI\src\main\webapp\WEB-INF\error.jsp
............此處省略482個文件信息
評論
共有 條評論