Package flexjson.model

Examples of flexjson.model.Account


public class JSONDeserializerObjectFactoryTest {

    @Test
    public void testOverrideEnumObjectFactory() {
        Account account = new JSONDeserializer<Account>().use(Enum.class, new OrdinalObjectFactory()).deserialize("{'id': '5', 'accountNumber': '1234567-123', 'accountType': " + AccountType.Savings.ordinal() + "}", Account.class);
        assertEquals( AccountType.Savings, account.getAccountType() );
    }
View Full Code Here


    /**
     *  https://sourceforge.net/tracker/?func=detail&atid=947844&aid=3004785&group_id=194042
     */
    @Test
    public void testAutoTypeConvertToNumerical() {
        Account account = new JSONDeserializer<Account>().deserialize("{'id': '5', 'accountNumber': '1234567-123'}", Account.class);
        assertEquals( new Integer(5), account.getId() );

        XRayVision xray = new JSONDeserializer<XRayVision>().deserialize("{ 'power': '2.3' }", XRayVision.class);
        assertEquals( 2.3f, xray.getPower(), DELTA);
    }
View Full Code Here

TOP

Related Classes of flexjson.model.Account

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.