Hi

I am using Wicket with Spring and Hibernate. I am using Eclipse as IDE and
Maven 2 as build tool.
This is working fine.

Now, I want to use JUnit for unit testing. This is where I have some
problems.

1. I have set up a test specific spring context file in src/test/resources.
This should be copied to target/test-classes/.
If I do a build in Eclipse, this is done. However, when I do a Maven install
the resource files are not copied to the test-classes directory.
As I understand this should be done by default by maven.
Any suggestions?

2. Even if I get 1 above working (such as by just having Eclipse build
first) I still get an error with spring:
"java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?"
I might have set things up wrong, I've used a Struts 2 project as template
and this might have something to do with it.
What I basically want is a setup where I can test (using junit) an
application with wicket, spring, hibernate (and a hibernate's in-memory
database, hsqldb).
The spring context for the tests should be different from the "real" spring
context.
Some help on this would be greatly appreciated.

Best regards,

Per-Olof Vallin

Reply via email to