Package models

Examples of models.PropertyEnhancerModel$DefaultClass


public class PropertyEnhancerTest extends UnitTest {

    @Test
    public void checkForSyntheticMethods() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        Method getter = model.getClass().getMethod("getText");
        assertFalse(getter.isSynthetic());
        Method setter = model.getClass().getMethod("setText", String.class);
        assertTrue(setter.isSynthetic());
    }
View Full Code Here


public class PropertyEnhancerTest extends UnitTest {

    @Test
    public void checkForPlayFrameworkEnhancerMethods() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        Method getter = model.getClass().getMethod("getText");
        assertFalse(getter.isAnnotationPresent(PlayPropertyAccessor.class));
        Method setter = model.getClass().getMethod("setText", String.class);
        assertTrue(setter.isAnnotationPresent(PlayPropertyAccessor.class));
    }
View Full Code Here

        assertTrue(setter.isAnnotationPresent(PlayPropertyAccessor.class));
    }

    @Test
    public void checkGetterCreatedForFinal() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        Method getter = model.getClass().getMethod("getFinalText");
        assertNotNull(getter);
        try {
            Method setter = model.getClass().getMethod("setFinalText", String.class);
            fail("Expected no setter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
    }
View Full Code Here

        }
    }

    @Test
    public void checkNothingCreatedForStatic() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        try {
            Method setter = model.getClass().getMethod("getStaticText", String.class);
            fail("Expected no getter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
        try {
            Method setter = model.getClass().getMethod("setStaticText", String.class);
            fail("Expected no setter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
    }
View Full Code Here

        }
    }

    @Test
    public void checkNothingCreatedForPrivate() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        try {
            Method setter = model.getClass().getMethod("getPrivateText", String.class);
            fail("Expected no getter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
        try {
            Method setter = model.getClass().getMethod("setPrivateText", String.class);
            fail("Expected no setter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
    }
View Full Code Here

        }
    }

    @Test
    public void checkOnlyPublicProtectedDeclaredClassesEnhanced() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        for (Class clazz : model.getClass().getDeclaredClasses()) {
            int modifiers = clazz.getModifiers();
            boolean shouldEnhance = Modifier.isPublic(modifiers) ||
                Modifier.isProtected(modifiers);
            try {
                Method getter = clazz.getMethod("getPublicField");
View Full Code Here

public class PropertyEnhancerTest extends UnitTest {

    @Test
    public void checkForSyntheticMethods() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        Method getter = model.getClass().getMethod("getText");
        assertFalse(getter.isSynthetic());
        Method setter = model.getClass().getMethod("setText", String.class);
        assertTrue(setter.isSynthetic());
    }
View Full Code Here

        assertTrue(setter.isSynthetic());
    }

    @Test
    public void checkGetterCreatedForFinal() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        Method getter = model.getClass().getMethod("getFinalText");
        assertNotNull(getter);
        try {
            Method setter = model.getClass().getMethod("setFinalText", String.class);
            fail("Expected no setter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
    }
View Full Code Here

        }
    }

    @Test
    public void checkNothingCreatedForStatic() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        try {
            Method setter = model.getClass().getMethod("getStaticText", String.class);
            fail("Expected no getter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
        try {
            Method setter = model.getClass().getMethod("setStaticText", String.class);
            fail("Expected no setter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
    }
View Full Code Here

        }
    }

    @Test
    public void checkNothingCreatedForPrivate() throws Exception {
        PropertyEnhancerModel model = new PropertyEnhancerModel();
        try {
            Method setter = model.getClass().getMethod("getPrivateText", String.class);
            fail("Expected no getter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
        try {
            Method setter = model.getClass().getMethod("setPrivateText", String.class);
            fail("Expected no setter method");
        } catch (NoSuchMethodException e) {
            // expected
        }
    }
View Full Code Here

TOP

Related Classes of models.PropertyEnhancerModel$DefaultClass

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.