Package com.google.gwt.dev.javac.typemodel.test

Examples of com.google.gwt.dev.javac.typemodel.test.PrimitiveValuesAnnotation


   * Ensures that we properly handle primitive value attributes on annotations.
   * (Special-cased, because of how JDT handles char/numeric literals)
   */
  public void testPrimitiveValuesAnnotations() throws NotFoundException {
    JClassType primitivesAnnotatedClass = typeOracle.getType(PrimitivesAnnotatedClass.class.getName());
    PrimitiveValuesAnnotation annotation = primitivesAnnotatedClass.getAnnotation(PrimitiveValuesAnnotation.class);

    boolean bool = annotation.bool();
    assertTrue(bool);

    byte b = annotation.b();
    assertTrue(b > 0);

    char c = annotation.c();
    assertTrue(c > 0);

    double d = annotation.d();
    assertTrue(d > 0);

    float f = annotation.f();
    assertTrue(f > 0);

    int i = annotation.i();
    assertTrue(i > 0);

    long l = annotation.l();
    assertTrue(l > 0);

    short s = annotation.s();
    assertTrue(s > 0);

    int[] ia = annotation.ia();
    assertEquals(3, ia.length);
    for (int it = 0; it < 3; ++it) {
      assertEquals(it, ia[it]);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.javac.typemodel.test.PrimitiveValuesAnnotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.