IN PROGRESS - issue BATCH-891: Create Annotations
http://jira.springframework.org/browse/BATCH-891 Forgot to remove some old test cases.
This commit is contained in:
@@ -11,6 +11,8 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
|||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|
||||||
|
import sun.reflect.generics.scope.Scope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Lucas Ward
|
* @author Lucas Ward
|
||||||
*
|
*
|
||||||
@@ -55,7 +57,7 @@ public class BatchComponentIntegrationTests {
|
|||||||
ConfigurableListableBeanFactory beanFactory = (ConfigurableListableBeanFactory)context.getAutowireCapableBeanFactory();
|
ConfigurableListableBeanFactory beanFactory = (ConfigurableListableBeanFactory)context.getAutowireCapableBeanFactory();
|
||||||
BeanDefinition beanDef = beanFactory.getBeanDefinition(beanNames[0]);
|
BeanDefinition beanDef = beanFactory.getBeanDefinition(beanNames[0]);
|
||||||
//Even though BatchComponent is annotated with StepScope, the scope will still be singleton without the resolver.
|
//Even though BatchComponent is annotated with StepScope, the scope will still be singleton without the resolver.
|
||||||
assertEquals("step", beanDef.getScope());
|
assertEquals(BeanDefinition.SCOPE_SINGLETON, beanDef.getScope());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -68,35 +70,6 @@ public class BatchComponentIntegrationTests {
|
|||||||
ConfigurableListableBeanFactory beanFactory = (ConfigurableListableBeanFactory)context.getAutowireCapableBeanFactory();
|
ConfigurableListableBeanFactory beanFactory = (ConfigurableListableBeanFactory)context.getAutowireCapableBeanFactory();
|
||||||
BeanDefinition beanDef = beanFactory.getBeanDefinition(beanNames[0]);
|
BeanDefinition beanDef = beanFactory.getBeanDefinition(beanNames[0]);
|
||||||
//Even though BatchComponent is annotated with StepScope, the scope will still be singleton without the resolver.
|
//Even though BatchComponent is annotated with StepScope, the scope will still be singleton without the resolver.
|
||||||
assertEquals("step", beanDef.getScope());
|
assertEquals(BeanDefinition.SCOPE_SINGLETON, beanDef.getScope());
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testWithPostProcessor(){
|
|
||||||
|
|
||||||
ApplicationContext context = new ClassPathXmlApplicationContext("org/springframework/batch/core/annotation/batch-component-context-postprocessor.xml");
|
|
||||||
String[] beanNames = context.getBeanNamesForType(TestComponent.class);
|
|
||||||
//There should be one instance of TextComponent in the Spring Container, because it's annotated with BatchComponent, and the filter
|
|
||||||
//is setup. However, the beanDefinition, should not have the scope on it, because there is no proxy set.
|
|
||||||
assertEquals(1, beanNames.length);
|
|
||||||
ConfigurableListableBeanFactory beanFactory = (ConfigurableListableBeanFactory)context.getAutowireCapableBeanFactory();
|
|
||||||
BeanDefinition beanDef = beanFactory.getBeanDefinition(beanNames[0]);
|
|
||||||
//Even though BatchComponent is annotated with StepScope, the scope will still be singleton without the resolver.
|
|
||||||
assertEquals("step", beanDef.getScope());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testWithPostProcessorScanned(){
|
|
||||||
|
|
||||||
ApplicationContext context = new ClassPathXmlApplicationContext("org/springframework/batch/core/annotation/batch-component-context-postprocessor-scanned.xml");
|
|
||||||
String[] beanNames = context.getBeanNamesForType(TestComponent.class);
|
|
||||||
//There should be one instance of TextComponent in the Spring Container, because it's annotated with BatchComponent, and the filter
|
|
||||||
//is setup. However, the beanDefinition, should not have the scope on it, because there is no proxy set.
|
|
||||||
assertEquals(1, beanNames.length);
|
|
||||||
ConfigurableListableBeanFactory beanFactory = (ConfigurableListableBeanFactory)context.getAutowireCapableBeanFactory();
|
|
||||||
BeanDefinition beanDef = beanFactory.getBeanDefinition(beanNames[0]);
|
|
||||||
//Even though BatchComponent is annotated with StepScope, the scope will still be singleton without the resolver.
|
|
||||||
assertEquals("step", beanDef.getScope());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user