Package org.apache.sling.models.testmodels.classes

Examples of org.apache.sling.models.testmodels.classes.DefaultWrappersModel


        ValueMap vm = new ValueMapDecorator(Collections.<String, Object>emptyMap());

        Resource res = mock(Resource.class);
        when(res.adaptTo(ValueMap.class)).thenReturn(vm);

        DefaultWrappersModel model = factory.getAdapter(res, DefaultWrappersModel.class);
        assertNotNull(model);

        assertEquals(Boolean.valueOf(true), model.getBooleanWrapperProperty());
        // we need to wait for JUnit 4.12 for this assertArrayEquals to be working on primitive boolean arrays, https://github.com/junit-team/junit/issues/86!
        assertTrue(Arrays.equals(new Boolean[] { Boolean.TRUE, Boolean.TRUE }, model.getBooleanWrapperArrayProperty()));

        assertEquals(Long.valueOf(1L), model.getLongWrapperProperty());
        assertArrayEquals(new Long[] { Long.valueOf(1L), Long.valueOf(1L) }, model.getLongWrapperArrayProperty());
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.models.testmodels.classes.DefaultWrappersModel

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.