• 大小: 30.92MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-22
  • 语言: Java
  • 标签: ssm  

资源简介

ssm框架 jsp 路由数据库 ehcahe缓存 二进制位权限管理 aop日志记录 序列化反序列化的对象复制 mysql数据库 highchart图形化 poi统计

资源截图

代码片段和文件信息

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.xml
     文件          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.xml
     目录           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.xml
     文件         258  2016-12-09 16:49  Survey_01_UI\src\main\resources\ehcache.xml
     文件         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.xml
     文件        5732  2016-12-07 14:08  Survey_01_UI\src\main\resources\springmvc-context.xml
     目录           0  2017-07-03 12:10  Survey_01_UI\src\main\webapp\
     目录           0  2017-07-03 12:10  Survey_01_UI\src\main\webapp\meta-INF\
     文件          39  2016-11-19 17:10  Survey_01_UI\src\main\webapp\meta-INF\MANIFEST.MF
     目录           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个文件信息

评论

共有 条评论