Solved

How do I run Spring JUnit tests in Eclipse?

Posted on 2013-06-11
3
426 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
twoTwo  challenge 35 93
upcasting down casting object remains same but refernece changes 8 60
endX challenge 2 63
where is session ID cache stored 1 47
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

920 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

17 Experts available now in Live!

Get 1:1 Help Now