@@ -0,0 +1,2964 @@
+package com.episode6.hackit.mockspresso.reflect;%0A%0Aimport com.episode6.hackit.mockspresso.DefaultTestRunner;%0Aimport com.episode6.hackit.mockspresso.annotation.TestQualifierAnnotation;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport javax.inject.Named;%0Aimport java.lang.annotation.Annotation;%0Aimport java.lang.reflect.Field;%0A%0Aimport static org.fest.assertions.api.Assertions.assertThat;%0A%0A/**%0A * Some basic tests for %7B@link AnnotationLiteral%7D%0A * I'm not too worried about testing that code since we didn't write it, but%0A * felt that some basic sanity checking was appropriate.%0A */%0A@RunWith(DefaultTestRunner.class)%0Apublic class AnnotationLiteralTest %7B%0A%0A  public static abstract class TestNamedAnnotationLiteral extends AnnotationLiteral%3CNamed%3E implements Named %7B%7D%0A  public static class TestQualifierAnnotationLiteral extends AnnotationLiteral%3CTestQualifierAnnotation%3E implements TestQualifierAnnotation %7B%7D%0A%0A  @Named(%22test1%22) String testProp1;%0A  @Named String testProp2;%0A  @TestQualifierAnnotation Integer testProp3;%0A%0A  @Test%0A  public void testNamedAnnotationLiterals() %7B%0A    Annotation namedTest1Annot = annotationFromProp(%22testProp1%22);%0A    Annotation namedDefaultAnnot = annotationFromProp(%22testProp2%22);%0A%0A    Annotation manualNamedTest1 = new NamedAnnotationLiteral(%22test1%22);%0A    Annotation manualNamedDefault = new NamedAnnotationLiteral();%0A%0A    assertThat(namedTest1Annot)%0A        .isEqualTo(manualNamedTest1)%0A        .isNotEqualTo(manualNamedDefault);%0A%0A    assertThat(namedDefaultAnnot)%0A        .isEqualTo(manualNamedDefault)%0A        .isNotEqualTo(manualNamedTest1);%0A  %7D%0A%0A  @Test%0A  public void testOnTheFlyAnnotationLiterals() %7B%0A    Annotation namedTest1Annot = annotationFromProp(%22testProp1%22);%0A    Annotation namedDefaultAnnot = annotationFromProp(%22testProp2%22);%0A    Annotation testQualiAnnot = annotationFromProp(%22testProp3%22);%0A%0A    Annotation manualNamedTest1 = new TestNamedAnnotationLiteral() %7B%0A      @Override%0A      public String value() %7B%0A        return %22test1%22;%0A      %7D%0A    %7D;%0A    Annotation manualNamedDefault = new TestNamedAnnotationLiteral() %7B%0A      @Override%0A      public String value() %7B%0A        return %22%22;%0A      %7D%0A    %7D;%0A    Annotation manualTestQuali = new TestQualifierAnnotationLiteral();%0A%0A    assertThat(namedTest1Annot)%0A        .isEqualTo(manualNamedTest1)%0A        .isNotEqualTo(manualNamedDefault)%0A        .isNotEqualTo(manualTestQuali);%0A%0A    assertThat(namedDefaultAnnot)%0A        .isEqualTo(manualNamedDefault)%0A        .isNotEqualTo(manualNamedTest1)%0A        .isNotEqualTo(manualTestQuali);%0A%0A    assertThat(testQualiAnnot)%0A        .isEqualTo(manualTestQuali)%0A        .isNotEqualTo(manualNamedDefault)%0A        .isNotEqualTo(manualNamedTest1);%0A  %7D%0A%0A  private static Annotation annotationFromProp(String name) %7B%0A    try %7B%0A      Field field = AnnotationLiteralTest.class.getDeclaredField(name);%0A      return field.getDeclaredAnnotations()%5B0%5D;%0A    %7D catch (NoSuchFieldException e) %7B%0A      throw new RuntimeException(e);%0A    %7D%0A  %7D%0A%7D%0A

Add some basic sanity checking for AnnotationLiteral