public void testGetPrimitiveTypes() throws Exception { Destination destination = new Destination(); destination.setAString("this is my string"); destination.setABoolean(true); destination.setAByte((byte) 100); destination.setAShort((short) 20000); destination.setAnInteger(300000); destination.setALong(4000000L); destination.setAFloat(3.14f); destination.setADouble(0.654987); assertEquals("this is my string", PropertyUtils.getProperty(destination, "aString")); assertEquals(Boolean.TRUE, PropertyUtils.getProperty(destination, "aBoolean")); assertEquals(new Byte((byte) 100), PropertyUtils.getProperty(destination, "aByte")); assertEquals(new Short((short) 20000), PropertyUtils.getProperty(destination, "aShort")); assertEquals(new Integer(300000), PropertyUtils.getProperty(destination, "anInteger")); assertEquals(new Long(4000000L), PropertyUtils.getProperty(destination, "aLong")); assertEquals(new Float(3.14f), PropertyUtils.getProperty(destination, "aFloat")); assertEquals(new Double(0.654987), PropertyUtils.getProperty(destination, "aDouble")); }
public void testGetPrimitiveTypes() throws Exception { Destination destination = new Destination(); destination.setAString("this is my string"); destination.setABoolean(true); destination.setAByte((byte) 100); destination.setAShort((short) 20000); destination.setAnInteger(300000); destination.setALong(4000000L); destination.setAFloat(3.14f); destination.setADouble(0.654987); assertEquals("this is my string", PropertyUtils.getProperty(destination, "aString")); assertEquals(Boolean.TRUE, PropertyUtils.getProperty(destination, "aBoolean")); assertEquals(new Byte((byte) 100), PropertyUtils.getProperty(destination, "aByte")); assertEquals(new Short((short) 20000), PropertyUtils.getProperty(destination, "aShort")); assertEquals(new Integer(300000), PropertyUtils.getProperty(destination, "anInteger")); assertEquals(new Long(4000000L), PropertyUtils.getProperty(destination, "aLong")); assertEquals(new Float(3.14f), PropertyUtils.getProperty(destination, "aFloat")); assertEquals(new Double(0.654987), PropertyUtils.getProperty(destination, "aDouble")); }