Examples of ClassTransformation


Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);

        Retain retain = ct.getFieldAnnotation("_annotatedField", Retain.class);

        assertNotNull(retain);

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);

        // Field with annotation, but not that annotation
        assertNull(ct.getFieldAnnotation("_annotatedField", Override.class));

        // Field with no annotation
        assertNull(ct.getFieldAnnotation("_parentField", Override.class));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);

        List<String> fields = ct.findFieldsWithAnnotation(Retain.class);

        assertEquals(fields.size(), 1);
        assertEquals(fields.get(0), "_annotatedField");

        verify();
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(CheckFieldType.class, logger);

        assertEquals(ct.getFieldModifiers("_privateField"), Modifier.PRIVATE);
        assertEquals(ct.getFieldModifiers("_map"), Modifier.PRIVATE + Modifier.FINAL);
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(CheckFieldType.class, logger);

        assertTrue(ct.isField("_privateField"));
        assertFalse(ct.isField("_doesNotExist"));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);

        ct.claimField("_annotatedField", this);

        List<String> fields = ct.findFieldsWithAnnotation(Retain.class);

        assertTrue(fields.isEmpty());

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);

        List<String> fields = ct.findFieldsWithAnnotation(Documented.class);

        assertTrue(fields.isEmpty());

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ClaimedFields.class, logger);

        List<String> unclaimed = ct.findUnclaimedFields();

        assertEquals(unclaimed, asList("_field1", "_field4", "_zzfield"));

        ct.claimField("_field4", "Fred");

        unclaimed = ct.findUnclaimedFields();

        assertEquals(unclaimed, asList("_field1", "_zzfield"));

        try
        {
            ct.claimField("_field4", "Barney");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ClaimedFields.class, logger);

        ct.addField(Modifier.PRIVATE, "int", "newField");

        List<String> unclaimed = ct.findUnclaimedFields();

        assertEquals(unclaimed, asList("_field1", "_field4", "_zzfield"));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ClassTransformation

    {
        Logger logger = mockLogger();

        replay();

        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);

        Meta meta = ct.getAnnotation(Meta.class);

        assertNotNull(meta);

        // Try again (the annotation will be cached). Use an annotation
        // that will not be present.

        Target t = ct.getAnnotation(Target.class);

        assertNull(t);

        verify();
    }
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.