@@ -0,0 +1,1328 @@
+package org.onetwo.common.test.spring;%0A%0A%0Aimport org.onetwo.common.spring.context.SpringConfigApplicationContext;%0Aimport org.onetwo.common.utils.LangUtils;%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.context.ConfigurableApplicationContext;%0Aimport org.springframework.test.context.MergedContextConfiguration;%0Aimport org.springframework.test.context.support.AbstractContextLoader;%0A%0Aabstract public class SpringConfigApplicationContextLoader extends AbstractContextLoader %7B%0A%0A%09abstract protected Class%3C?%3E%5B%5D getClassArray();%0A%09abstract protected String getAppEnvironment();%0A%09%0A%09public final ConfigurableApplicationContext loadContext(String... locations) throws Exception %7B%0A%09%09SpringConfigApplicationContext context = createContext();%0A%09%09return context;%0A%09%7D%0A%0A%09protected SpringConfigApplicationContext createContext()%7B%0A%09%09SpringConfigApplicationContext context = new SpringConfigApplicationContext();%0A%09%09context.setAppEnvironment(getAppEnvironment());%0A%09%09if(!LangUtils.isEmpty(getClassArray()))%0A%09%09%09context.register(getClassArray());%0A%09%09context.refresh();%0A%09%09return context;%0A%09%7D%0A%09%0A%09@Override%0A%09public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception %7B%0A%09%09return createContext();%0A%09%7D%0A%0A%09@Override%0A%09protected String getResourceSuffix() %7B%0A%09%09return %22-context-test.xml%22;%0A%09%7D%0A%09%0A%7D%0A

add spring config loader