Package org.jboss.weld.test.util
Class Utils
- java.lang.Object
-
- org.jboss.weld.test.util.Utils
-
public class Utils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUtils.ARCHIVE_TYPE
-
Field Summary
Fields Modifier and Type Field Description static intMASK
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanannotationSetMatches(Set<? extends Annotation> annotations, Class<? extends Annotation>... annotationTypes)Checks if all annotations are in a given set of annotationsstatic <T> Tdeserialize(byte[] bytes)static <T> TevaluateValueExpression(BeanManagerImpl beanManager, String expression, Class<T> expectedType)static <T extends javax.enterprise.context.spi.Context>
TgetActiveContext(org.jboss.weld.manager.api.WeldManager beanManager, Class<T> type)static <T> javax.enterprise.inject.spi.Bean<T>getBean(javax.enterprise.inject.spi.BeanManager beanManager, Type beanType, Annotation... bindings)static <T> Set<javax.enterprise.inject.spi.Bean<T>>getBeans(javax.enterprise.inject.spi.BeanManager beanManager, Class<T> type, Annotation... bindings)static <T> Set<javax.enterprise.inject.spi.Bean<T>>getBeans(javax.enterprise.inject.spi.BeanManager beanManager, javax.enterprise.util.TypeLiteral<T> type, Annotation... bindings)static StringgetDeploymentNameAsHash(Class<?> testClass)static StringgetDeploymentNameAsHash(Class<?> testClass, Utils.ARCHIVE_TYPE archiveType)static StringgetHashOfTestClass(String testClassName)static <T> TgetReference(javax.enterprise.inject.spi.BeanManager beanManager, Class<T> beanType, Annotation... bindings)static <T> TgetReference(javax.enterprise.inject.spi.BeanManager beanManager, javax.enterprise.inject.spi.Bean<T> bean)static <T> TgetReference(javax.enterprise.inject.spi.BeanManager beanManager, javax.enterprise.inject.spi.Bean<T> bean, Type beanType)static Iterable<URL>getResources(Class<?> clazz, String name)static booleanisExceptionInHierarchy(Throwable exception, Class<? extends Throwable> expectedException)static booleanisProxy(Object proxy)static byte[]serialize(Object instance)static booleantypeSetMatches(Set<Type> types, Type... requiredTypes)
-
-
-
Field Detail
-
MASK
public static final int MASK
- See Also:
- Constant Field Values
-
-
Method Detail
-
annotationSetMatches
@SafeVarargs public static boolean annotationSetMatches(Set<? extends Annotation> annotations, Class<? extends Annotation>... annotationTypes)
Checks if all annotations are in a given set of annotations- Parameters:
annotations- The annotation setannotationTypes- The annotations to match- Returns:
- True if match, false otherwise
-
serialize
public static byte[] serialize(Object instance) throws IOException
- Throws:
IOException
-
deserialize
public static <T> T deserialize(byte[] bytes) throws IOException, ClassNotFoundException- Throws:
IOExceptionClassNotFoundException
-
isExceptionInHierarchy
public static boolean isExceptionInHierarchy(Throwable exception, Class<? extends Throwable> expectedException)
-
getBean
public static <T> javax.enterprise.inject.spi.Bean<T> getBean(javax.enterprise.inject.spi.BeanManager beanManager, Type beanType, Annotation... bindings)
-
getBeans
public static <T> Set<javax.enterprise.inject.spi.Bean<T>> getBeans(javax.enterprise.inject.spi.BeanManager beanManager, Class<T> type, Annotation... bindings)
-
getBeans
public static <T> Set<javax.enterprise.inject.spi.Bean<T>> getBeans(javax.enterprise.inject.spi.BeanManager beanManager, javax.enterprise.util.TypeLiteral<T> type, Annotation... bindings)
-
getReference
public static <T> T getReference(javax.enterprise.inject.spi.BeanManager beanManager, Class<T> beanType, Annotation... bindings)
-
getReference
public static <T> T getReference(javax.enterprise.inject.spi.BeanManager beanManager, javax.enterprise.inject.spi.Bean<T> bean)
-
getReference
public static <T> T getReference(javax.enterprise.inject.spi.BeanManager beanManager, javax.enterprise.inject.spi.Bean<T> bean, Type beanType)
-
evaluateValueExpression
public static <T> T evaluateValueExpression(BeanManagerImpl beanManager, String expression, Class<T> expectedType)
-
isProxy
public static boolean isProxy(Object proxy)
-
getActiveContext
public static <T extends javax.enterprise.context.spi.Context> T getActiveContext(org.jboss.weld.manager.api.WeldManager beanManager, Class<T> type)
-
getDeploymentNameAsHash
public static String getDeploymentNameAsHash(Class<?> testClass, Utils.ARCHIVE_TYPE archiveType)
-
-