Tidy up Spring config meta data to remove errors
This commit is contained in:
@@ -31,9 +31,11 @@ import org.springframework.batch.core.step.tasklet.TaskletStep;
|
||||
import org.springframework.batch.repeat.CompletionPolicy;
|
||||
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.interceptor.RollbackRuleAttribute;
|
||||
@@ -123,7 +125,7 @@ public class StepParserTests {
|
||||
|
||||
private void loadContextWithBadListener(String contextLocation) {
|
||||
try {
|
||||
new ClassPathXmlApplicationContext(contextLocation);
|
||||
new XmlBeanFactory(new ClassPathResource(contextLocation));
|
||||
fail("Context should not load!");
|
||||
} catch (BeanDefinitionParsingException e) {
|
||||
assertTrue(e.getMessage().contains("'ref' and 'class'"));
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
|
||||
<import resource="classpath:/org/springframework/batch/core/repository/dao/data-source-context.xml" />
|
||||
|
||||
<bean class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="transactionManager" ref="transactionManager"/>
|
||||
</bean>
|
||||
|
||||
<aop:config>
|
||||
<aop:advisor advice-ref="advice" pointcut="execution(* org.springframework.batch..JobRepository+.*(..))" />
|
||||
</aop:config>
|
||||
|
||||
<bean id="advice" class="org.springframework.batch.core.repository.support.SimpleJobRepositoryProxyTests$Advice" />
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
|
||||
<import resource="classpath:/org/springframework/batch/core/repository/dao/data-source-context.xml" />
|
||||
|
||||
<bean class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="transactionManager" ref="transactionManager"/>
|
||||
</bean>
|
||||
|
||||
<aop:config>
|
||||
<aop:advisor advice-ref="advice" pointcut="execution(* org.springframework.batch..JobRepository+.*(..))" />
|
||||
</aop:config>
|
||||
|
||||
<bean id="advice" class="org.springframework.batch.core.repository.support.SimpleJobRepositoryProxyTests$Advice" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user