Package com.philip.journal.common.mock

Examples of com.philip.journal.common.mock.BeanUtilsSubject


     * Case 3.2: Primitive property type. <br/>
     * Case 3.3: Map property type.
     */
    @Test
    public void testConvertToMap3() {
        final BeanUtilsSubject inputX = new BeanUtilsSubject();
        inputX.setField2(TEST_INT);
        inputX.setField3(new HashMap<String, Class<?>>());

        final Map<String, Object> output3 = BeanUtils.convertToMap(inputX, null);
        Assert.assertNull("Case 3.1: String property type.", output3.get(BeanUtilsSubject.FIELD1));
        Assert.assertEquals("Case 3.2: Primitive property type.", TEST_INT, output3.get(BeanUtilsSubject.FIELD2));
        Assert.assertTrue("Case 3.3: Map property type.", output3.get(BeanUtilsSubject.FIELD3) instanceof Map);
View Full Code Here


     *
     * Case 2: All properties.
     */
    @Test
    public void testGetPropertiesObjectStringArray2() {
        final BeanUtilsSubject input1 = new BeanUtilsSubject();
        final String[] output1 = BeanUtils.getProperties(input1, null);
        final List<String> outputList1 = Arrays.asList(output1);
        final List<String> expected1 = Arrays.asList(new String[] {
                BeanUtilsSubject.FIELD1,
                BeanUtilsSubject.FIELD2,
View Full Code Here

     *
     * Case 3: With exclusion.
     */
    @Test
    public void testGetPropertiesObjectStringArray3() {
        final BeanUtilsSubject input2 = new BeanUtilsSubject();
        final String[] output2 = BeanUtils.getProperties(input2, new String[] { BeanUtilsSubject.FIELD2 });
        final List<String> outputList2 = Arrays.asList(output2);
        final List<String> expected2 = Arrays.asList(new String[] {
                BeanUtilsSubject.FIELD3,
                BeanUtilsSubject.FIELD1 });
View Full Code Here

    }

    /** Case 2: Null Property argument. */
    @Test(expected = IllegalArgumentException.class)
    public void testGetProperty2() {
        final BeanUtilsSubject input = new BeanUtilsSubject();
        input.setField1("test0");
        BeanUtils.getProperty(input, null);
        Assert.fail("Case 2: Null Property argument.");
    }
View Full Code Here

    }

    /** Case 3: Invalid property argument. */
    @Test(expected = IllegalArgumentException.class)
    public void testGetProperty3() {
        BeanUtils.getProperty(new BeanUtilsSubject(), "x412!");
        Assert.fail("Case 3: Invalid property argument.");
    }
View Full Code Here

TOP

Related Classes of com.philip.journal.common.mock.BeanUtilsSubject

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.