Class AbstractTest

    • Field Detail

      • beanManager

        @Inject
        protected jakarta.enterprise.inject.spi.BeanManager beanManager
    • Constructor Detail

      • AbstractTest

        public AbstractTest()
    • Method Detail

      • getCurrentManager

        protected jakarta.enterprise.inject.spi.BeanManager getCurrentManager()
        Note that TCK uses Arquillian Servlet protocol and so the test class is instantiated/enriched from within the WAR module. This affects most of the BeanManager methods functionality. For instance the method BeanContainer.getBeans(Type, Annotation...) returns the set of beans which are available for injection in the module or library containing the class into which the BeanManager was injected (simplified).
        Returns:
        the current BeanManager
      • getCurrentBeanContainer

        protected jakarta.enterprise.inject.spi.BeanContainer getCurrentBeanContainer()
        Note that TCK uses Arquillian Servlet protocol and so the test class is instantiated/enriched from within the WAR module. This affects most of the BeanContainer methods functionality. For instance the method BeanContainer.getBeans(Type, Annotation...) returns the set of beans which are available for injection in the module or library containing the class into which the BeanContainer was injected (simplified).
        Returns:
        the current BeanContainer
      • setContextActive

        protected void setContextActive​(jakarta.enterprise.context.spi.Context context)
      • setContextInactive

        protected void setContextInactive​(jakarta.enterprise.context.spi.Context context)
      • destroyContext

        protected void destroyContext​(jakarta.enterprise.context.spi.Context context)
      • getCurrentConfiguration

        protected Configuration getCurrentConfiguration()
      • annotationSetMatches

        protected boolean annotationSetMatches​(Set<? extends Annotation> annotations,
                                               Class<? extends Annotation>... requiredAnnotationTypes)
        Checks if all annotations are in a given set of annotations
        Parameters:
        annotations - The annotation set
        requiredAnnotationTypes - The annotations to match
        Returns:
        True if match, false otherwise
      • annotationSetMatches

        protected boolean annotationSetMatches​(Set<? extends Annotation> annotations,
                                               Annotation... requiredAnnotations)
        Parameters:
        annotations - The annotation set
        requiredAnnotationTypes - The required annotations
        Returns:
        true if the specified set matches required annotations, false otherwise
      • rawTypeSetMatches

        protected boolean rawTypeSetMatches​(Set<Type> types,
                                            Class<?>... requiredTypes)
      • typeSetMatches

        protected boolean typeSetMatches​(Collection<? extends Type> types,
                                         Type... requiredTypes)
      • getUniqueBean

        protected <T> jakarta.enterprise.inject.spi.Bean<T> getUniqueBean​(Class<T> type,
                                                                          Annotation... bindings)
      • getUniqueBean

        protected <T> jakarta.enterprise.inject.spi.Bean<T> getUniqueBean​(jakarta.enterprise.util.TypeLiteral<T> type,
                                                                          Annotation... bindings)
      • getBeans

        protected <T> Set<jakarta.enterprise.inject.spi.Bean<T>> getBeans​(Class<T> type,
                                                                          Annotation... bindings)
      • getBeans

        protected <T> Set<jakarta.enterprise.inject.spi.Bean<T>> getBeans​(jakarta.enterprise.util.TypeLiteral<T> type,
                                                                          Annotation... bindings)
      • getContextualReference

        protected <T> T getContextualReference​(Class<T> beanType,
                                               Annotation... qualifiers)
      • getContextualReference

        protected <T> T getContextualReference​(jakarta.enterprise.util.TypeLiteral<T> beanType,
                                               Annotation... qualifiers)
      • getContextualReference

        protected <T> T getContextualReference​(String name,
                                               Class<T> beanType)
      • isThrowablePresent

        protected boolean isThrowablePresent​(Class<? extends Throwable> throwableType,
                                             Throwable throwable)
        Extracted from test harness. We need this since testng expected exceptions feature is not working with exception cause - see org.testng.internal.Invoker.isExpectedException(Throwable, ExpectedExceptionsHolder).
        Parameters:
        throwableType -
        throwable -
        Returns:
        true if throwable type is assignable from specified throwable or any cause in stack (works recursively), false otherwise