Package cat.quickdb.date200912.model

Examples of cat.quickdb.date200912.model.Collection1


    public void testInheritanceQuery(){
        Son2 son = new Son2();
        son.setDescriptionSon("description - son");
        son.setDescription2("description2");
        son.setDescription1("description1");
        Reference2 test = new Reference2();
        test.setValue("value test reference");
        son.setReferenceTest(test);

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

        Assert.assertTrue(admin.obtain(son, "referenceTest.value = 'value test reference'"));
View Full Code Here


        Assert.assertEquals("name binding2", bind2.getName());
    }

    @Test
    public void testDeleteParent(){
        Son1 s = new Son1();
        s.setData("data che delete");
        s.setDescription("description of son delete");
        s.setSonName("son name delete");

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

        Son1 son = new Son1();
        admin.obtain(son, "data = 'data che delete'");
        Assert.assertEquals("data che delete", son.getData());

        Assert.assertTrue(admin.delete(son));
    }
View Full Code Here

    @Test
    public void testQuerySystemWithInheritance(){
        Reference1 ref = new Reference1();
        ref.setValue("house");

        Son1 son = new Son1();
        son.setData("data from son");
        son.setSonName("child");
        son.setDescription("parent description");
        son.setReference1(ref);

        boolean value = admin.save(son);
        Assert.assertTrue(value);

        Son1 s = new Son1();
        Assert.assertTrue(admin.obtain(s, "reference1.value = 'house'"));
        Assert.assertEquals("house", s.getReference1().getValue());
    }
View Full Code Here

        Assert.assertEquals(2, array4.size());
    }

    @Test
    public void testReferenceNull(){
        Son1 son = new Son1();
        son.setData("son yes");
        son.setSonName("son name yes");
        son.setDescription("parent yes");

        boolean value = admin.save(son);
        Assert.assertTrue(value);

        Son1 s = new Son1();
        Assert.assertTrue(admin.obtain(s, "description = 'parent yes'"));
        Assert.assertEquals("parent yes", s.getDescription());
        Assert.assertEquals(null, s.getReference1());
    }
View Full Code Here

        Assert.assertTrue(admin.delete(test));
    }

    @Test
    public void testInheritanceQuery(){
        Son2 son = new Son2();
        son.setDescriptionSon("description - son");
        son.setDescription2("description2");
        son.setDescription1("description1");
        Reference2 test = new Reference2();
        test.setValue("value test reference");
        son.setReferenceTest(test);

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

        Assert.assertTrue(admin.obtain(son, "referenceTest.value = 'value test reference'"));
        Assert.assertEquals("description - son", son.getDescriptionSon());
    }
View Full Code Here

        System.out.println("mi otro nombre".equalsIgnoreCase(t2.getOtro()));
        System.out.println(null == t2.getPruebaIgnore());
    }

    public void testModifyCollection(){
        Collection1 test = new Collection1();
        test.setName("name");

        Collection2 t1 = new Collection2();
        t1.setDescription("description1");
        Collection2 t2 = new Collection2();
        t2.setDescription("description2");
        Collection2 t3 = new Collection2();
        t3.setDescription("description3");
        ArrayList array = new ArrayList();
        array.add(t1);
        array.add(t2);
        array.add(t3);

        test.setCollection2(array);

        System.out.println(admin.save(test));

        System.out.println(admin.obtain(test, "name = 'name'"));

        Collection2 t = new Collection2();
        t.setDescription("description added");
        test.getCollection2().add(t);

        System.out.println(admin.modify(test));

        Collection1 tt = new Collection1();
        System.out.println(admin.obtain(tt, "name = 'name'"));
        System.out.println("description added".equalsIgnoreCase(((Collection2)tt.getCollection2().get(tt.getCollection2().size()-1)).getDescription()));
        System.out.println(admin.delete(test));
    }
View Full Code Here

TOP

Related Classes of cat.quickdb.date200912.model.Collection1

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.