Package models

Examples of models.Account


        params.flash();
        validation.keep();
            adminForm();
        }
        
      new Account(username, password, email, true, null);
     
      Bootstrap.index();
    }
View Full Code Here


        Account.deleteAll();
    }

    @Test
    public void testDeleteAll() {
        Account before = new Account("loginxyz", "a@a.a");
        before.save();
        Account.deleteAll();
        Assert.assertEquals(0, Account.count());
    }
View Full Code Here

        Assert.assertEquals(0, Account.count());
    }

    @Test
    public void testDelete() {
        Account before = new Account("loginxyz", "a@a.a");
        before.save();
        Assert.assertEquals(1, Account.count());
        before.delete();
        Assert.assertEquals(0, Account.count());
    }
View Full Code Here

        Account.findAll();
    }

    @Test
    public void testIdAfterSaved() {
        Account acc = new Account("loginxyz", "a@a.a");
        acc.save();
        assertNotNull(acc.getId());
    }
View Full Code Here

        assertNotNull(acc.getId());
    }

    @Test
    public void testFindByNullId() {
        Account acc = new Account("loginxyz", "a@a.a");
        acc.save();
        Object id = acc.getId();
        assertNotNull(id);
        acc = Account.findById(acc.getId());
        assertEquals(acc.login, "loginxyz");
        assertNull(Account.findById(null));
        //assertNotNull(Account.findById(acc.getId()).get());
        //assertNull(Account.findById(null));
    }
View Full Code Here

        //assertNull(Account.findById(null));
    }

    @Test
    public void testUnique() {
        Account before = new Account("loginxyz", "a@a.a");
        before.save();
        before = new Account("loginxyz1", "a@a.a");
        try {
            before.save();
            Logger.info("count: %1$s", Account.count());
        } catch (Exception e) {
          Logger.info("count1: %1$s", Account.count());
            assertTrue(true);
            return;
View Full Code Here

        Logger.info("count2: %1$s", Account.count());
    }
   
    @Test
    public void testDistinct() {
        Account a1 = new Account("loginxyz", "a@a.a");
        a1.save();
        Account a2 = new Account("loginabc", "a@a.x");
        a2.save();
        Set<?> set = Account._distinct("email");
        assertSame(2, set.size());
        Account a3 = new Account("login123", "a@a.b", "SG");
        a3.save();
        Account a4 = new Account("login456", "a@a.c", "AU");
        a4.save();
        set = Account.q("region", "AU").distinct("email");
        assertSame(3, set.size());
        assertTrue(set.contains("a@a.a"));
        assertTrue(set.contains("a@a.x"));
        assertTrue(set.contains("a@a.c"));
View Full Code Here

    }

    protected void setUpAggregation() {
        assertTrue(Account.count() == 0);
       
        Account a1 = new Account("loginxyz", "a@a.a", "AU", "IT");
        a1.score = 10;
        a1.save();
       
        a1 = new Account("loginabc", "a@a.x", "AU", "SA");
        a1.score = 20;
        a1.save();
       
        a1 = new Account("login123", "a@a.x", "CN", "IT");
        a1.score = 12;
        a1.save();

        a1 = new Account("login456", "a@a.x", "CN", "SA");
        a1.score = 18;
        a1.save();
    }
View Full Code Here

       
        Account.deleteAll();
        User.deleteAll();
        ModelA.deleteAll();
       
        acc = new Account("green", "green@pixolut.com", "AU", "IT").save();
        usr = new User("green", "testing").save();
        ma = new ModelA().save();
       
        GlobalLifecycleEventListener.resetCounter();
        AccountUserLifecycleEventListener.resetCounter();
View Full Code Here

public class UpdateOperationsTest extends UnitTest {

    @Before
    public void setup() {
        Account.deleteAll();
        new Account("abc", "abc@1.com", "au", "it", 29, 77).save();
        new Account("xyz", "xyz@1.com", "au", "it", 32, 89).save();
    }
View Full Code Here

TOP

Related Classes of models.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.