Package org.codehaus.backport175.reader

Examples of org.codehaus.backport175.reader.Annotation.annotationType()


    public void testFloat() {
        Annotation annotation = Annotations.getAnnotation(
                Target.Float.class, Target.class
        );
        assertEquals(Target.Float.class, annotation.annotationType());
        Target.Float ann = (Target.Float)annotation;
        assertEquals(1.0F, ann.v(), 0);
        assertEquals(1.1F, ann.arr()[0], 0);
        assertEquals(2.3455F, ann.arr()[1], 0);
        assertEquals(3.0F, ann.arr()[2], 0);
View Full Code Here


    public void testBoolean() {
        Annotation annotation = Annotations.getAnnotation(
                Target.Boolean.class, Target.class
        );
        assertEquals(Target.Boolean.class, annotation.annotationType());
        Target.Boolean ann = (Target.Boolean)annotation;
        assertTrue(ann.v());
        assertTrue(ann.arr()[0]);
        assertFalse(ann.arr()[1]);
        assertTrue(ann.arr()[2]);
View Full Code Here

    public void testChar() {
        Annotation annotation = Annotations.getAnnotation(
                Target.Char.class, Target.class
        );
        assertEquals(Target.Char.class, annotation.annotationType());
        Target.Char ann = (Target.Char)annotation;
        assertEquals('a', ann.v());
        assertEquals('b', ann.arr()[0]);
        assertEquals('C', ann.arr()[1]);
        assertEquals('D', ann.arr()[2]);
View Full Code Here

    }

    public void testClassAnn1() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
        Annotation annotation = reader.getAnnotation("test.TestAnnotations$VoidTyped");
        Class type = annotation.annotationType();
        assertEquals(TestAnnotations.VoidTyped.class, type);
    }

    public void testClassAnn2() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
View Full Code Here

    }

    public void testClassAnn2() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
        Annotation annotation = reader.getAnnotation("test.TestAnnotations$DefaultString");
        Class type = annotation.annotationType();
        assertEquals(TestAnnotations.DefaultString.class, type);

        TestAnnotations.DefaultString ann = (TestAnnotations.DefaultString)annotation;
        assertEquals("hello", ann.value());
    }
View Full Code Here

    }

    public void testClassAnn3() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
        Annotation annotation = reader.getAnnotation("test.TestAnnotations$Simple");
        Class type = annotation.annotationType();
        assertEquals(TestAnnotations.Simple.class, type);

        TestAnnotations.Simple ann = (TestAnnotations.Simple)annotation;
        assertEquals("foo", ann.val());
        assertEquals("bar", ann.s());
View Full Code Here

    }

    public void testClassAnn4() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
        Annotation annotation = reader.getAnnotation("test.TestAnnotations$StringArray");
        Class type = annotation.annotationType();
        assertEquals(TestAnnotations.StringArray.class, type);

        TestAnnotations.StringArray ann = (TestAnnotations.StringArray)annotation;
        String[] ss = ann.ss();
        assertEquals("hello", ss[0]);
View Full Code Here

    }

    public void testClassAnn5() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
        Annotation annotation = reader.getAnnotation("test.TestAnnotations$LongArray");
        Class type = annotation.annotationType();
        assertEquals(TestAnnotations.LongArray.class, type);

        TestAnnotations.LongArray ann = (TestAnnotations.LongArray)annotation;
        long[] longArr = ann.l();
        assertEquals(1l, longArr[0]);
View Full Code Here

    }

    public void testClassAnn6() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
        Annotation annotation = reader.getAnnotation("test.TestAnnotations$Complex");
        Class type = annotation.annotationType();
        assertEquals(TestAnnotations.Complex.class, type);

        TestAnnotations.Complex ann = (TestAnnotations.Complex)annotation;
        assertEquals(3, ann.i());
View Full Code Here

    }

    public void testClassAnn7() {
        final AnnotationReader reader = AnnotationReader.getReaderFor(Target.class);
        Annotation annotation = reader.getAnnotation("test.TestAnnotations$NestedAnnotation");
        Class type = annotation.annotationType();
        assertEquals(TestAnnotations.NestedAnnotation.class, type);

        TestAnnotations.NestedAnnotation ann = (TestAnnotations.NestedAnnotation)annotation;
        TestAnnotations.Simple simple = ann.ann();
        assertEquals("foo", simple.val());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.