0

2

回答

3364 浏览

Hibernate使用双向多对多,延迟加载返回List(PersistentBag)怎样进行单元测试[已解决]5

class User { List<Group> groupList } //groupList立即加载 class Group { List<User>} userList } //userList延迟加载 重写了equals方法,先用eclipse自动生成,然后因为hibernate返回的list是代理对象(PersistentBag),所以改了equals方法一点 ...

2014年12月30日 09:36
0

1

回答

1958 浏览

关于Spring+Junit+Groovy进行单元测试一些问题[已解决]10

spring 负责注入,junit测试,groovy简化测试代码。 但是问题出现了,我只用spring+junit时,测试运行正常,集成groovy后就报了一个错误,如下: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: OrderDimensional is not mapped [s ...

2014年9月22日 15:18
0

2

回答

371 浏览

莫名其妙的JAVA EXCEPTION[已解决]5

DBPower.on(Map map){ .... .... String implType = props.getProperty("type", "ralasafe"); if (implType.equalsIgnoreCase("ralasafe")) { DataSourceProviderDbcpImpl impl = ...

2014年9月17日 17:36
0

2

回答

24923 浏览

junit测试报Failed to load ApplicationContext[已解决]5

需要测试src里面的service、action等;新建了个src文件夹命名为“testCase”,和src同级;applicationContext.xml文件在src里面,不太清楚除了需要加载这个配置文件还需要啥,看了网上例子用了如下的代码: @ContextConfiguration(locations={"classpath:applicationContext.xml" ...

2013年9月24日 17:02
0

3

回答

1066 浏览

jmockit 0.999.18+JUnit 3.8.2+jdk5 javaagent问题[已解决]0

eclipse 插件单元测试遇到一些问题。 方法参考下面的文章: http://eclipsesource.com/blogs/2010/09/09/an-almost-perfect-test-suite/ 有多个插件A,B,C,每个插件中有一些单元测试,然后有另外一个插件D遍历前面说的所有插件,如果有测试用例就运行。 public class AngelTestSuite extends T ...

2013年8月17日 17:02
0

4

回答

2018 浏览

junit可以自动注入,tomcat下报空指针[已解决]5

我在junit下debug可以看到自动注入是成功的,但是整个项目放到tomcat下的时候自动注入的对象都为null,请问这是什么原因

2013年8月01日 11:09
0

4

回答

1941 浏览

SpringMVC JUnit单元测试问题[已解决]5

package test; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; impor ...

0

1

回答

6333 浏览

spring/mybatis整合,junit测试报BeanCreationException[已解决]10

昨天想整合下springmvc和mybatis,用junit写了个测试,测试过程中,mybatis的mapper无法注入,报BeanCreationException,相关信息大家看下,帮小弟解决下 1 错误堆栈信息 org.springframework.beans.factory.BeanCreationException: Error creating bean with name ' ...

2013年7月04日 16:11
0

0

回答

1717 浏览

如何从Eclipse里面的SpringJunit4ClassRunner访问TOMCAT目录下的项目application-context.xml[已解决]0

大家好, 我打算从本地工作空间(Eclipse)里面的一个JUnit 测试类访问一个运行在TOMCAT环境的项目的application-context.xml文件。 我的初始代码如下: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/WEB-INF ...

2013年5月30日 06:24
0

0

回答

3125 浏览

用junit测试获取spring bean 报No Scope registered for scope 'session'错[已解决]5

public class UserTest { private BulltinService bulltinService; private BeanFactory beanFactory; @Before public void setUp() throws Exception { beanFactory = new FileSystemXmlApplicationContext(new Str ...

2013年3月14日 15:12
0

3

回答

3544 浏览

PowerMock mock 静态方法的问题[已解决]0

我的问题是,一个类A中有静态方法,这个方法被另外一个类B的一个方法调用,那么我们如何在类B中实现mock A的静态方法的返回值?代码如下,method2总是过不去,因为mock的A的静态方法返回值在testB里面没有生效。 package com.od.junit.test.powermock; import org.junit.Assert; import org.junit.Test; imp ...

2012年11月20日 11:57
0

0

回答

145 浏览

可否为一个test类指定多个runner,在不定义新的runner的情况下[已解决]5

例如 @RunWith(SpringJUnit4ClassRunner.class) @RunWith(Categories.class) @ContextConfiguration public class FakeTest { } 当然duplicate的runwith是通不过编译的,那么该怎么做

2012年10月29日 16:30
0

0

回答

749 浏览

Spring 测试 自动回滚,跨bean查询障碍[已解决]25

在spring测试中, 配置事务处理为自动回滚,结果也符合,测试过程中对数据库的操作并没有被提交。 问题为: Bean A, B,测试类T T中通过A 插入数据,在T/A中可以查询到这条记录, 但是A通过ApplicationContext.publishEvent触发B的行为,此时B无法查询结果为空。 不知道是事务配置问题,还是测试设置有问题,还请各位大侠不吝指教 //测试配置如下 ...

2012年10月26日 16:51
0

2

回答

9487 浏览

Spring junit测试问题[已解决]5

java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157) at org.springframework.test.context.supp ...

2012年7月24日 15:33
0

2

回答

136 浏览

请问大家在做项目的时候,是怎么做测试的?[已解决]0

目前个人只是使用Junit来做功能测试,还有一些什么测试是需要的? 虽然有专门的测试人员来测试,但是如果在做项目的时候,尽可能的把会出现的问题解决了,后面也会很轻松,不然一直返工,确实很烦!

2012年7月12日 11:24
0

0

回答

1814 浏览

ant+junit+cobertura生成覆盖率报告时,出现好多错误[已解决]5

overage-report-html: [cobertura-report] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-report] Cobertura: Loaded information on 26 classes. [cobertura-report] net.sou ...

2012年4月25日 10:15
0

0

回答

1219 浏览

ant整合junit生成测试报告问题[已解决]3

相应文件都能生成,但是运行生成的junit报告文件时候出错。 下面是ant中的代码,附件是出错截图,大牛们给点力吧。 我没分了。。。。。有分一定补。 <?xml version="1.0" encoding="utf-8"?> <project name="Test" basedir="."> ...

2012年2月05日 16:38

本周活跃投票用户

最新评论

Global site tag (gtag.js) - Google Analytics