@Override public Set<Type> getDecoratedTypes() { return delegate().getDecoratedTypes(); }
@Override public Set<Type> getDecoratedTypes() { return delegate().getDecoratedTypes(); }
@Override public Set<Type> getDecoratedTypes() { return delegate().getDecoratedTypes(); }
@Override public Set<Type> getDecoratedTypes() { return delegate().getDecoratedTypes(); }
@Override public Set<Type> getDecoratedTypes() { return delegate().getDecoratedTypes(); }
@Override public Set<Type> getDecoratedTypes() { return delegate().getDecoratedTypes(); }
protected void checkDecorator(Decorator<?> decorator, Class<?> beanClass, Set<Type> decoratedTypes, Type delegateType) { assertEquals(decorator.getBeanClass(), beanClass); assertEquals(decorator.getDecoratedTypes(), decoratedTypes); assertEquals(decorator.getDelegateType(), delegateType); }
/** * @throws DefinitionException if {@link javax.enterprise.inject.spi.Decorator#getDecoratedTypes()} isEmpty */ private void validateDecoratorDecoratedTypes() { for (Decorator decorator : decoratorsManager.getDecorators()) { if (decorator.getDecoratedTypes().isEmpty()) { throw new WebBeansConfigurationException("Decorator must implement at least one interface (java.io.Serializeable will be ignored)"); } } }
@Test @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "ack") }) public void testDecoratorIsResolved() { List<Decorator<?>> decorators = getCurrentManager().resolveDecorators( Collections.<Type> singleton(ServletContext.class)); assertEquals(2, decorators.size()); for (Decorator<?> decorator : decorators) { assertEquals(decorator.getDecoratedTypes(), Collections.singleton(ServletContext.class)); assertEquals(decorator.getDelegateType(), ServletContext.class); } }
@SuppressWarnings("unchecked") @Test @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "aci") }) public void testDecoratorIsResolved() { List<Decorator<?>> decorators = getCurrentManager().resolveDecorators( Collections.<Type> singleton(HttpServletRequest.class)); assertEquals(2, decorators.size()); for (Decorator<?> decorator : decorators) { assertEquals(decorator.getDecoratedTypes(), new HashSet<Type>(Arrays.asList(HttpServletRequest.class, ServletRequest.class))); assertEquals(decorator.getDelegateType(), HttpServletRequest.class); } }
@Test(groups = INTEGRATION) @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "acj"), @SpecAssertion(section = DECORATOR_RESOLUTION, id = "aa") }) public void testDecoratorIsResolved() { List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(Collections.<Type> singleton(HttpSession.class)); assertEquals(2, decorators.size()); for (Decorator<?> decorator : decorators) { assertEquals(decorator.getDecoratedTypes(), Collections.<Type> singleton(HttpSession.class)); assertEquals(decorator.getDelegateType(), HttpSession.class); } }
/** * Check whether the delegate type implements or extends all decorated types. * * @param decorator * @throws DefinitionException If the delegate type doesn't implement or extend all decorated types */ public static void checkDelegateType(Decorator<?> decorator) { Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure(); for (Type decoratedType : decorator.getDecoratedTypes()) { if(!types.contains(decoratedType)) { throw BeanLogger.LOG.delegateMustSupportEveryDecoratedType(decoratedType, decorator); } } }
/** * Check whether the delegate type implements or extends all decorated types. * * @param decorator * @throws DefinitionException If the delegate type doesn't implement or extend all decorated types */ public static void checkDelegateType(Decorator<?> decorator) { Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure(); for (Type decoratedType : decorator.getDecoratedTypes()) { if(!types.contains(decoratedType)) { throw BeanLogger.LOG.delegateMustSupportEveryDecoratedType(decoratedType, decorator); } } }
/** * Check whether the delegate type implements or extends all decorated types. * * @param decorator * @throws DefinitionException If the delegate type doesn't implement or extend all decorated types */ public static void checkDelegateType(Decorator<?> decorator) { Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure(); for (Type decoratedType : decorator.getDecoratedTypes()) { if(!types.contains(decoratedType)) { throw BeanLogger.LOG.delegateMustSupportEveryDecoratedType(decoratedType, decorator); } } }
private void validateDecorator(Decorator<?> decorator) { Set<Annotation> qualifiers = decorator.getDelegateQualifiers(); if (decorator.getDelegateType() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator); } Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers"); if (decorator.getDecoratedTypes() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator); } }
private void validateDecorator(Decorator<?> decorator) { Set<Annotation> qualifiers = decorator.getDelegateQualifiers(); if (decorator.getDelegateType() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator); } Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers"); if (decorator.getDecoratedTypes() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator); } }
private void validateDecorator(Decorator<?> decorator) { Set<Annotation> qualifiers = decorator.getDelegateQualifiers(); if (decorator.getDelegateType() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator); } Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers"); if (decorator.getDecoratedTypes() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator); } }
private void validateDecorator(Decorator<?> decorator) { Set<Annotation> qualifiers = decorator.getDelegateQualifiers(); if (decorator.getDelegateType() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator); } Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers"); if (decorator.getDecoratedTypes() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator); } }
private void validateDecorator(Decorator<?> decorator) { Set<Annotation> qualifiers = decorator.getDelegateQualifiers(); if (decorator.getDelegateType() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator); } Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers"); if (decorator.getDecoratedTypes() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator); } }
private void validateDecorator(Decorator<?> decorator) { Set<Annotation> qualifiers = decorator.getDelegateQualifiers(); if (decorator.getDelegateType() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator); } Bindings.validateQualifiers(qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers"); if (decorator.getDecoratedTypes() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator); } }