Package cat.quickdb.complexDataStructure.model

Examples of cat.quickdb.complexDataStructure.model.SonData


        Assert.assertTrue(((Buy)customer2.getBuy().get(0)).getCodes().size() > 1);
    }

    @Test
    public void complexDataStructureMainTest(){
        SonData son = new SonData();
        son.setName("son name");
        son.setSalary(5000.50);
        son.setParentValue("parent value");

        SonReference sonRef = new SonReference();
        sonRef.setDescription("description of son reference");
        sonRef.setValueReferenceParent("value from son reference parent");
        son.setReference(sonRef);

        ArrayList<Integer> phones = new ArrayList<Integer>();
        phones.add(2345543);
        phones.add(342356);
        phones.add(7564332);
        phones.add(546542168);
        son.setPhones(phones);

        ParentCollection p1 = new ParentCollection();
        p1.setNames("name1");
        ParentCollection p2 = new ParentCollection();
        p2.setNames("name2");
        ParentCollection p3 = new ParentCollection();
        p3.setNames("name3");
        ArrayList pcoll = new ArrayList();
        pcoll.add(p1);
        pcoll.add(p2);
        pcoll.add(p3);
        son.setParentCollection(pcoll);

        Assert.assertTrue(admin.save(son));

        SonData son2 = new SonData();
        admin.obtain(son2).If("name").equal("son name").find();

        Assert.assertTrue(son2.getName().equals("son name"));
        Assert.assertTrue(son2.getParentValue().equalsIgnoreCase("parent value"));
        Assert.assertTrue(son2.getParentCollection().size() == 3);
        Assert.assertTrue(son2.getPhones().size() == 4);
        Assert.assertTrue(son2.getReference().getValueReferenceParent().equals("value from son reference parent"));
    }
View Full Code Here

TOP

Related Classes of cat.quickdb.complexDataStructure.model.SonData

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.