爱折腾的Albert 2018-05-14 10:04 采纳率: 0%
浏览 509
已结题

ssm整合Junit4 报 绑定异常

这个测试我之前是可以用的。然后我重新装系统了。重新git下来就是这样了。

package com.komlin.modular.mapper;
import Model.ClassArrangeData;
import com.komlin.component.Junit.JUnit4ClassRunner;
import com.komlin.component.utils.PoiUtil;
import com.komlin.component.utils.UUIDUtils;
import com.komlin.modular.education.mapper.*;
import com.komlin.modular.education.model.ClassInfo;
import com.komlin.modular.education.model.Course;
import com.komlin.modular.education.model.StudentScore;
import com.komlin.modular.education.pojo.dto.*;
import com.komlin.modular.education.pojo.vo.response.StudentCouserArrangeResponse;
import com.komlin.modular.system.mapper.MenuMapper;
import com.komlin.modular.system.mapper.RoleMenuMapper;
import com.komlin.modular.system.mapper.UserInfoMapper;
import com.komlin.modular.system.model.Menu;
import com.komlin.modular.system.model.RoleMenu;
import com.komlin.modular.system.model.UserInfo;
import com.komlin.modular.system.DTO.SelectProfessionInfoByUserIdDTO;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.*;

/**

  • @author huzhengxing
  • @description:
  • @date 2017/11/6 15:46
    /
    @RunWith(JUnit4ClassRunner.class)
    @ContextConfiguration(locations = "classpath:spring/applicationContext-
    .xml")
    public class EducationMapperTest {

    private Logger logger = Logger.getLogger(EducationMapperTest.class);

    @Autowired
    private UserInfoMapper userInfoMapper;

    @Autowired
    private ClassInfoMapper classInfoMapper;

    @Autowired
    private CourseArrangeMapper courseArrangeMapper;

    @Autowired
    private TutorTeacherMapper tutorTeacherMapper;

    @Autowired
    private ProfessionArrangeMapper professionArrangeMapper;

    @Autowired
    private StudentScoreMapper studentScoreMapper;

    @Autowired
    private CourseMapper courseMapper;

    @Autowired
    private MenuMapper menuMapper;

    @Autowired
    private RoleMenuMapper roleMenuMapper;

    @Test
    public void insertRoleMenu() {
    List

    menus = menuMapper.selectMenuList();
    for (Menu menu : menus) {
    RoleMenu record = new RoleMenu();
    record.setRmId(UUIDUtils.getUniquekey());
    record.setRmRId(4);
    record.setRmMId(menu.getMenuId());
    roleMenuMapper.insertSelective(record);
    }
    }

    @Test
    public void listCourseArrange() {
    List courseArrangeDTOS = courseArrangeMapper.listCourseArrange(null, null, null, null, null, null);
    System.out.println(courseArrangeDTOS);
    }

    @Test
    public void listStudentInfo() {
    System.out.println(JSONArray.fromObject(userInfoMapper.listStudentInfo()));
    }
    }

异常

ocking Pass-Through Statistic: LOCAL_DISK_SIZE_BYTES>
2018-05-14 17:39:16,952 DEBUG [net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl] -
2018-05-14 17:39:16,952 DEBUG [net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl] -
2018-05-14 17:39:16,952 DEBUG [net.sf.ehcache.statistics.extended.ExtendedStatipl] -
2018-05-14 17:39:16,953 DEBUG [net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl] -
2018-05-14 17:39:16,995 DEBUG [net.sf.ehcache.statistics.extended.ExtendedStati9:16,997 DEBUG [net.sf.ehcache.statistics.extended.ExtendedStati

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.komlin.modular.education.mapper.StudentScoreMapper.listStudentInfo

at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
at com.sun.proxy.$Proxy31.listStudentInfo(Unknown Source)
at com.komlin.modular.mapper.EducationMapperTest.insertStudentScore(EducationMapperTest.java:273)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Disconnected from the target VM, address: '127.0.0.1:39803', transport: 'socket'

Process finished with exit code 255

  • 写回答

5条回答 默认 最新

  • 奶儿 2018-05-14 10:08
    关注

    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

    评论

报告相同问题?

悬赏问题

  • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号
  • ¥15 算法使用了tf-idf,用手肘图确定k值确定不了,第四轮廓系数又太小才有0.006088746097507285,如何解决?(相关搜索:数据处理)
  • ¥15 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决