Exemple #1
0
 @SuppressWarnings("unchecked")
 @Test(expectedExceptions = AssertionError.class)
 public void testAnnotationSetDoesNotMatchB() {
   Set<Annotation> annotations = new HashSet<Annotation>();
   annotations.add(InjectLiteral.INSTANCE);
   Assert.assertAnnotationSetMatches(annotations, Any.class, Inject.class);
 }
Exemple #2
0
 @SuppressWarnings("serial")
 @Test(expectedExceptions = AssertionError.class)
 public void testTypeSetDoeNotMatch() {
   Assert.assertTypeSetMatches(
       new HashSet<Type>(
           Arrays.asList(String.class, new TypeLiteral<List<Integer>>() {}.getType())),
       String.class);
 }
Exemple #3
0
 @SuppressWarnings("unchecked")
 @Test
 public void testAnnotationSetMatches() {
   Set<Annotation> annotations = new HashSet<Annotation>();
   annotations.add(AnyLiteral.INSTANCE);
   annotations.add(InjectLiteral.INSTANCE);
   Assert.assertAnnotationSetMatches(annotations, Any.class, Inject.class);
 }
Exemple #4
0
 @SuppressWarnings("serial")
 @Test
 public void testTypeSetMatches() {
   Assert.assertTypeSetMatches(
       new HashSet<Type>(
           Arrays.asList(
               Integer.class, String.class, new TypeLiteral<List<Boolean>>() {}.getType())),
       String.class,
       Integer.class,
       new TypeLiteral<List<Boolean>>() {}.getType());
 }
Exemple #5
0
 @SuppressWarnings("unchecked")
 @Test(expectedExceptions = NullPointerException.class)
 public void testAnnotationSetIsNull() {
   Assert.assertAnnotationSetMatches(null);
 }
Exemple #6
0
 @SuppressWarnings("unchecked")
 @Test(expectedExceptions = AssertionError.class)
 public void testAnnotationSetIsEmpty() {
   Assert.assertAnnotationSetMatches(new HashSet<Annotation>(), Any.class);
 }
Exemple #7
0
 @SuppressWarnings("unchecked")
 @Test
 public void testAnnotationSetIsEmptyAndRequiredAnnotationsEmpty() {
   Assert.assertAnnotationSetMatches(new HashSet<Annotation>());
 }