Solved

How do I run Spring JUnit tests in Eclipse?

Posted on 2013-06-11
3
432 Views
Last Modified: 2013-06-12
Hi,
How do I run Spring JUnit tests AbstractJUnit4SpringContextTests in Eclipse?

I have a spring unit test that runs fine commandline, but how do I run this in ecplise?
I run it as JUnit test in ecplise and it doesn't load the context configuration.

Thanks
Jamie
BindLdapAuthenticationHandlerTes.java
0
Comment
Question by:jamie_lynn
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39240000
What is in your 2 ldapContext-test.xml files?

Maybe I am missing something here but you are loading the context(s) but you aren't accessing anything within them. It looks as though you are trying to have the context files instantiate the Handler and Config objects, but they aren't marked as Autowired (or some other annotation) that would allow Spring to set those fields to objects from your contexts.

But you say that this IS working from the command line? What command are you using to invoke the test from the command line?
0
 

Author Comment

by:jamie_lynn
ID: 39242206
I ran the test via maven.

I see my mistake. I need to autowired the tests.

Thanks!
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39243555
Not a problem, glad to help!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wordmultiple challenge 12 141
groovy example issue 10 103
java jdbc batch example 8 41
java stored proc example 9 44
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question