??????????????У??????????log4j????????????????????????????????????????????????????????????????
????????????????log4j???????????
???????????????£?
?????????????£?

 

import java.io.FileNotFoundException;
import org.junit.runners.model.InitializationError;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Log4jConfigurer;
public class JUnit4ClassRunner extends SpringJUnit4ClassRunner {
static {
try {
Log4jConfigurer.initLogging("classpath:conf/log4j.xml");
} catch (FileNotFoundException ex) {
System.err.println("Cannot Initialize log4j");
}
}
public JUnit4ClassRunner(Class<?> clazz) throws InitializationError {
super(clazz);
}
}

???????????????????£?

 

@RunWith(JUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:conf/app-test.xml"})
@TransactionConfiguration(transactionManager="transactionManager"?? defaultRollback=false)
@Transactional
public class BaseTestCase {
}

????????????????????BaseTestCase  ??????????????????????