Package org.openengsb.core.util.beans

Examples of org.openengsb.core.util.beans.SimpleBeanWithStrings


public class BeanUtilsExtendedTest {

    @Test
    public void testBuildAttributeMapFromSimpleStringBean_shouldReturnMapThatContainsProperties() throws Exception {
        SimpleBeanWithStrings testBean = new SimpleBeanWithStrings("foo", "bar");
        Map<String, String> attributeMap = BeanUtilsExtended.buildStringAttributeMap(testBean);
        assertThat(attributeMap.get("value1"), is("foo"));
        assertThat(attributeMap.get("value2"), is("bar"));
    }
View Full Code Here


        assertThat(attributeMap.get("value2"), is("bar"));
    }

    @Test
    public void testBuildAttributeMapAndBuildNewBean_shouldBeEqualToOriginalBean() throws Exception {
        SimpleBeanWithStrings testBean = new SimpleBeanWithStrings("foo", "bar");
        Map<String, String> attributeMap = BeanUtilsExtended.buildStringAttributeMap(testBean);
        SimpleBeanWithStrings bean2 =
            BeanUtilsExtended.createBeanFromAttributeMap(SimpleBeanWithStrings.class, attributeMap);
        assertThat(bean2, is(testBean));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.util.beans.SimpleBeanWithStrings

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.