[GR-Jug] Spring

Kyle Adams kadams at gfs.com
Mon Dec 11 14:56:31 EST 2006


I should also note that the easiest way I've seen of dealing with the
long name is to handle it with inheritance.  The projects that I'm
currently working on have a BaseDAOTest.java:

package com.foobar;

import
org.springframework.test.AbstractDependencyInjectionSpringContextTests;

public class BaseDAOTest extends
AbstractDependencyInjectionSpringContextTests {
    protected String[] getConfigLocations() {
        setAutowireMode(AUTOWIRE_BY_NAME);
        return new String[] {"*Context.xml"};
    }
}

Assuming you follow a naming standard of always suffixing your Spring
config files with "Context.xml", this makes it as easy as extending
BaseDAOTest (much shorter) to get your DAO unit tests up and running.

Kyle A.


More information about the Jug mailing list