Package booton.translator.annotation

Examples of booton.translator.annotation.PrimitiveMarker


        Annotation[] set = annotations[0];
        assert set.length == 1;
        assert set[0] instanceof PrimitiveMarker;

        PrimitiveMarker primitive = (PrimitiveMarker) set[0];
        assert primitive.intValue() == 2;

        set = annotations[1];
        assert set.length == 1;
        assert set[0] instanceof StringMarker;
View Full Code Here


        Annotation[] set = annotations[0];
        assert set.length == 1;
        assert set[0] instanceof PrimitiveMarker;

        PrimitiveMarker primitive = (PrimitiveMarker) set[0];
        assert primitive.intValue() == 2;

        set = annotations[1];
        assert set.length == 1;
        assert set[0] instanceof StringMarker;
View Full Code Here

        set = annotations[1];
        assert set.length == 1;
        assert set[0] instanceof PrimitiveMarker;

        PrimitiveMarker primitive = (PrimitiveMarker) set[0];
        assert primitive.intValue() == 1000;
    }
View Full Code Here

public class ConstructorAnnotationTest {

    @Test
    public void annotation() throws Exception {
        Constructor<?> constructor = Annotated.class.getDeclaredConstructors()[0];
        PrimitiveMarker annotation = constructor.getAnnotation(PrimitiveMarker.class);
        assert annotation != null;
        assert annotation.intValue() == 100;
    }
View Full Code Here

        assert !Child.class.isAnnotationPresent(PrimitiveMarker.class);
    }

    @Test
    public void getAnnotation() throws Exception {
        PrimitiveMarker annotation = Annotated.class.getAnnotation(PrimitiveMarker.class);
        assert annotation != null;
        assert annotation instanceof Annotation;
        assert annotation instanceof PrimitiveMarker;
        assert annotation.intValue() == 5;
        assert annotation.booleanValue();
        assert annotation.longValue() == 10;
        assert annotation.annotationType() == PrimitiveMarker.class;

        assert annotation == Annotated.class.getAnnotation(PrimitiveMarker.class);
    }
View Full Code Here

    public void getAnnotations() throws Exception {
        Annotation[] annotations = Annotated.class.getAnnotations();
        assert annotations instanceof Annotation[];
        assert annotations.length == 2;

        PrimitiveMarker a1;
        StringMarker a2;

        if (annotations[0] instanceof PrimitiveMarker) {
            a1 = (PrimitiveMarker) annotations[0];
            a2 = (StringMarker) annotations[1];
        } else {
            a1 = (PrimitiveMarker) annotations[1];
            a2 = (StringMarker) annotations[0];
        }

        assert a1.intValue() == 5;
        assert a2.value().equals("value");
    }
View Full Code Here

public class MethodAnnotationTest {

    @Test
    public void getAnnotation() throws Exception {
        Method method = Annotated.class.getMethod("method");
        PrimitiveMarker annotation = method.getAnnotation(PrimitiveMarker.class);
        assert annotation != null;
        assert annotation instanceof Annotation;
        assert annotation instanceof PrimitiveMarker;
        assert annotation.intValue() == 10;
        assert annotation.booleanValue();
        assert annotation.doubleValue() == 3.14;
        assert annotation.annotationType() == PrimitiveMarker.class;

        assert annotation == method.getAnnotation(PrimitiveMarker.class);
    }
View Full Code Here

TOP

Related Classes of booton.translator.annotation.PrimitiveMarker

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.