Solved

How do I run Spring JUnit tests in Eclipse?

Posted on 2013-06-11
3
421 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
Comment Utility
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
Comment Utility
I ran the test via maven.

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

Thanks!
0
 
LVL 35

Expert Comment

by:mccarl
Comment Utility
Not a problem, glad to help!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

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.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now