?
Solved

How do I run Spring JUnit tests in Eclipse?

Posted on 2013-06-11
3
Medium Priority
?
454 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 36

Accepted Solution

by:
mccarl earned 2000 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 36

Expert Comment

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
A solution for Fortify Path Manipulation.
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.

765 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