Package org.jboss.test.annotation.factory.support

Examples of org.jboss.test.annotation.factory.support.Complex


      System.setProperty("enumVal", "org.jboss.test.annotation.factory.support.MyEnum.TWO");
      System.setProperty("primitiveArray", "{1, 2, 3}");
     
      Annotation annotation  = (Annotation)AnnotationCreator.createAnnotation(expr, Complex.class, true);
      assertEquals(Complex.class, annotation.annotationType());
      Complex complex = (Complex)annotation;
      assertEquals('a', complex.ch());
      assertEquals("Test123", complex.string());
      assertEquals(9,9, complex.flt());
      assertEquals(123456789.99, complex.dbl());
      assertEquals(1, complex.shrt());
      assertEquals(987654321, complex.lng());
      assertEquals(123, complex.integer());
      assertEquals(true, complex.bool());
      assertEquals(Long.class, complex.clazz());
      assertEquals("Yes", complex.annotation().value());
      assertEquals(new String[]{"Test", "123"}, complex.array());
      assertEquals(MyEnum.TWO, complex.enumVal());
      assertArrays(new int[]{1, 2, 3}, complex.primitiveArray());
   }
View Full Code Here


   public void testComplex() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.Complex(ch='a', string=\"Test123\", flt=9.9, dbl=123456789.99, shrt=1, lng=987654321, integer=123, bool=true, annotation=@org.jboss.test.annotation.factory.support.SimpleValue(\"Yes\"), array={\"Test\", \"123\"}, clazz=java.lang.Long.class, enumVal=org.jboss.test.annotation.factory.support.MyEnum.TWO, primitiveArray={1,2,3})";
      Annotation annotation  = (Annotation)AnnotationCreator.createAnnotation(expr, Complex.class);
      assertEquals(Complex.class, annotation.annotationType());
      Complex complex = (Complex)annotation;
      assertEquals('a', complex.ch());
      assertEquals("Test123", complex.string());
      assertEquals(9,9, complex.flt());
      assertEquals(123456789.99, complex.dbl());
      assertEquals(1, complex.shrt());
      assertEquals(987654321, complex.lng());
      assertEquals(123, complex.integer());
      assertEquals(true, complex.bool());
      assertEquals(Long.class, complex.clazz());
      assertEquals("Yes", complex.annotation().value());
      assertEquals(new String[]{"Test", "123"}, complex.array());
      assertEquals(MyEnum.TWO, complex.enumVal());
      assertArrays(new int[]{1, 2, 3}, complex.primitiveArray());
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.annotation.factory.support.Complex

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.