JUnit与Spring的整合
package com.business.service;import org.junit.Test;import org.springframework.test.AbstractDependencyInjectionSpringContextTests;import com.business.service.BrokerManagerService;public class DeployManagerActionTestCase extends AbstractDependencyInjectionSpringContextTests{ private BrokerManagerService brokerManagerService; public BrokerManagerService getBrokerManagerService() { return brokerManagerService; } public void setBrokerManagerService(BrokerManagerService brokerManagerService) { this.brokerManagerService = brokerManagerService; } @Override protected String[] getConfigLocations() { return new String[]{"file:F:\\wmba\\src\\applicationContext.xml","file:F:\\wmba\\src\\applicationContext-wmba.xml"}; } public void testDeployManagerMethod(){ System.out.println("--->"+brokerManagerService); }}