Yeah, I saw that in the docs and could see it in my error messages when
I didn't have a <test_class_name>-context.xml but I don't want to have
to create one of those files for each test class. Also, my main
applicationContext.xml file sucks in "sub" configuration files with
<import resource="..." />. Maybe I should rethink that and instead list
all of the configuration files in the web.xml file?
Stevo Slavi? wrote:
Hello Rusty,
Your question should have better been posted on some of the spring
forums<http://forum.springframework.org/>
.
Nevertheless, your problem is that you haven't configured locations
attribute of @ContextConfiguration annotation to your liking (see
this<http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/test/context/testng/AbstractTestNGSpringContextTests.html>).
With context locations not configured, default one obviously resolves to
"<test_class_name>-context.xml", which in your case is
"EduUserDetailsServiceTest-context.xml".
Regards,
Stevo.
On Tue, Sep 16, 2008 at 4:06 AM, Rusty Wright <[EMAIL PROTECTED]>wrote:
So I'm not doing something right.
I have a test class that looks like the following
[code]
@ContextConfiguration
public final class EduUserDetailsServiceTest extends
AbstractTestNGSpringContextTests {
private final transient Logger log =
LoggerFactory.getLogger(getClass());
@Autowired
EduUserDetailsService eduUserDetailsService;
...
[/code]
This file is in the usual place where maven expects it, down in
src/test/java, and the class it's testing, EduUserDetailsService is where
maven expects it, down in src/main/java.
When I run 'mvn test' it blows up with a file not found exception for the
file EduUserDetailsServiceTest-context.xml.
So that jibes with what the Spring Reference Guide says, but do I really
need to create a <whatever>-context.xml file for each <whatever>.java test
file I create? Can't I use my applicationContext.xml file that my main
application is using? But it's way over in src/main/webapp/WEB-INF.
I'm lost in a twisty little maze. I'm hoping there's some maven pixie dust
I'm missing that you maven wizards can share with me.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]