ContextConfiguration « Core « Spring Q&A





1. @ContextConfiguration in Spring 3.0 give me No default constructor found    stackoverflow.com

I have already do the test using AbstractDependencyInjectionSpringContextTests and it works but in spring 3 it is deprecated, so I decided to try @ContextConfiguration but spring say that default constructor is ...

2. JUnit with ContextConfiguration - run custom code before instantiation?    forum.springsource.org

JUnit with ContextConfiguration - run custom code before instantiation? Hi, My JUnit tests rely on spring injection (using "@ContextConfiguration"). However, I'd like to run some custom code *before* spring instantiates any ...

3. It's possible use @Configuration class in @ @ContextConfiguration    forum.springsource.org

Hi at all. I'm testing Junit with Spring and I try to configure @ContextConfiguration annotation with a class @Configuration location, but in @ContextConfiguration only defines a locations of an array of ...

4. Weird issues with test classes and using multiple @ContextConfiguration locations    forum.springsource.org

Weird issues with test classes and using multiple @ContextConfiguration locations I am writing some integration tests. I have a base test class like this Code: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath*:applicationContext.xml", "classpath*:applicationContext-test.xml", ...

5. Trouble with @ContextConfiguration and JUnit test    forum.springsource.org

Hi, I'm using Spring 3 and I have a class that has the annotation configuration ... Code: @Configuration public class Application { @Bean(name="sqlClient") public AnnotationSessionFactoryBean getSessionFactory(@Qualifier("dataSource") DataSource dataSource) { ... From ...

6. Problem with @ContextConfiguration and hierarchical container configuration    forum.springsource.org

Problem with @ContextConfiguration and hierarchical container configuration Hello! I wrote a Unittest where I tried to @Autowired a Service which is defined in /spring/service-context.xml. I get an "Caused by: org.springframework.beans.factory.BeanCreationExce ption: ...

7. Using @ContextConfiguration with new 2.1 test features    forum.springsource.org

Using @ContextConfiguration with new 2.1 test features Hello, We recently picked up spring 2.1 M4 in anticipation of the final 2.5 release. Our big attraction for 2.1 is the new API ...

8. Using @ContextConfiguration    forum.springsource.org

I'm using the ContextConfiguration annotation to test one of my controllers. I want to get access to the ApplicationContext from within my tests, but I can't figure out how. Should my ...

9. @ContextConfiguration and ServletContextAware    forum.springsource.org

@ContextConfiguration is a pretty neat little annotation and I'm trying to convert a class that loaded XML files manually to use @ContextConfiguration. However any class that implements ServletContextAware doesn't have the ...





10. @ContextConfiguration required Transactoins?    forum.springsource.org

@ContextConfiguration required Transactoins? Hello! During to migration from JUnit 3.8 to JUnit 4.4 I changed also definitions of my unit-test to use more annotations. I have quite small project - target ...

11. @ContextConfiguration with TestSuite    forum.springsource.org

@ContextConfiguration with TestSuite Hi, I have an application that has lots of tests. Basically I have service, repository tests. All of my test cases inherits one of these abstract classes: Code: ...

12. JUnit 4 ContextConfiguration Inheritance    forum.springsource.org

JUnit 4 ContextConfiguration Inheritance I'm running into a few issues trying to run some tests with the Spring 2.5 test framework and Maven2 (also have the same issue in eclipse when ...

13. JUnit - ContextConfiguration error: bug?    forum.springsource.org

JUnit - ContextConfiguration error: bug? Hello, I have a test class defined as @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"/beanDefinition-unittest.xml"}) public class MyTestClass {...} When I start the test, it gives me the exception NoSuchMethodError: org.springframework.core.OrderComparator.sort(java/util/List ...

14. @ContextConfiguration    forum.springsource.org

@ContextConfiguration Hi everyone Probably a simple question, so here we go: when writing unit tests, I can use @ContextConfiguration to set my spring context and have the load time weaver autowire ...

15. @ContextConfiguration    forum.springsource.org

@ContextConfiguration Hi everyone Probably a simple question, so here we go: when writing unit tests, I can use @ContextConfiguration to set my spring context and have the load time weaver autowire ...

16. @ContextConfiguration does not take a @Configuration class    forum.springsource.org

@ContextConfiguration does not take a @Configuration class I was hoping that I could pass in a class annotated with @Configuration into @ContextConfiguration and extending Spring's TestNG integration class which would be ...





17. ContextConfiguration classPath    forum.springsource.org

Hi i am using @contextconfiguration to load xml files but it is unable to recognize the class path .Is there anything to declare in web.xml or how can i give the ...

18. @contextconfiguration    forum.springsource.org

Hi I am wondering if the follwoing code is correct. I have an ApplicationContext on my local drive that I want to use when running a JUnit test. I have the ...