Solved

How do I run Spring JUnit tests in Eclipse?

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Core Java. What output will be and why ? 6 68
numbers ascending pyramid 101 240
sites similar to codingbat to improve coding hanson skills 3 66
session migration servlets 2 51
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 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…
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.

733 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