use of org.springframework.test.context.ContextConfiguration in project spring-framework by spring-projects.
the class MetaAnnotationUtilsTests method findAnnotationDescriptorForTypesWithMetaAnnotationWithOverriddenAttributes.
@Test
@SuppressWarnings("unchecked")
public void findAnnotationDescriptorForTypesWithMetaAnnotationWithOverriddenAttributes() throws Exception {
Class<?> startClass = MetaConfigWithOverriddenAttributesTestCase.class;
Class<ContextConfiguration> annotationType = ContextConfiguration.class;
UntypedAnnotationDescriptor descriptor = findAnnotationDescriptorForTypes(startClass, Service.class, ContextConfiguration.class, Order.class, Transactional.class);
assertNotNull(descriptor);
assertEquals(startClass, descriptor.getRootDeclaringClass());
assertEquals(annotationType, descriptor.getAnnotationType());
assertArrayEquals(new Class[] {}, ((ContextConfiguration) descriptor.getAnnotation()).value());
assertArrayEquals(new Class[] { MetaAnnotationUtilsTests.class }, descriptor.getAnnotationAttributes().getClassArray("classes"));
assertNotNull(descriptor.getComposedAnnotation());
assertEquals(MetaConfig.class, descriptor.getComposedAnnotationType());
}
use of org.springframework.test.context.ContextConfiguration in project Activiti by Activiti.
the class SpringActivitiTestCase method initializeProcessEngine.
@Override
protected void initializeProcessEngine() {
ContextConfiguration contextConfiguration = getClass().getAnnotation(ContextConfiguration.class);
String[] value = contextConfiguration.value();
boolean hasOneArg = value != null && value.length == 1;
String key = hasOneArg ? value[0] : ProcessEngine.class.getName();
ProcessEngine engine = this.cachedProcessEngines.containsKey(key) ? this.cachedProcessEngines.get(key) : this.applicationContext.getBean(ProcessEngine.class);
this.cachedProcessEngines.put(key, engine);
this.processEngine = engine;
}
Aggregations