Search in sources :

Example 21 with Account

use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.

the class CRUDObjectPhysicalTest method testUpdate.

@Test(dependsOnMethods = "update")
public void testUpdate() {
    int i = 0;
    Account a;
    for (OObjectIteratorClass<Account> iterator = database.browseClass("Account"); iterator.hasNext(); ) {
        iterator.setFetchPlan("*:1");
        a = iterator.next();
        if (i % 2 == 0)
            Assert.assertEquals(a.getAddresses().get(0).getCity().getCountry().getName(), "Spain");
        else
            Assert.assertEquals(a.getAddresses().get(0).getCity().getCountry().getName(), "Italy");
        Assert.assertEquals(a.getSalary(), i + 500.1f);
        i++;
    }
}
Also used : Account(com.orientechnologies.orient.test.domain.business.Account) Test(org.testng.annotations.Test)

Example 22 with Account

use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.

the class CRUDObjectPhysicalTestSchemaFull method queryPerFloat.

@Test(dependsOnMethods = "checkLazyLoadingOff")
public void queryPerFloat() {
    final List<Account> result = database.query(new OSQLSynchQuery<ODocument>("select * from Account where salary = 500.10"));
    Assert.assertTrue(result.size() > 0);
    Account account;
    for (int i = 0; i < result.size(); ++i) {
        account = result.get(i);
        Assert.assertEquals(account.getSalary(), 500.10f);
    }
}
Also used : Account(com.orientechnologies.orient.test.domain.business.Account) ODocument(com.orientechnologies.orient.core.record.impl.ODocument) Test(org.testng.annotations.Test)

Example 23 with Account

use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.

the class CRUDObjectPhysicalTestSchemaFull method testUpdate.

@Test(dependsOnMethods = "update")
public void testUpdate() {
    int i = 0;
    Account a;
    for (OObjectIteratorCluster<Account> iterator = database.browseCluster("Account"); iterator.hasNext(); ) {
        iterator.setFetchPlan("*:1");
        a = iterator.next();
        if (i % 2 == 0)
            Assert.assertEquals(a.getAddresses().get(0).getCity().getCountry().getName(), "Spain");
        else
            Assert.assertEquals(a.getAddresses().get(0).getCity().getCountry().getName(), "Italy");
        Assert.assertEquals(a.getSalary(), i + 500.1f);
        i++;
    }
}
Also used : Account(com.orientechnologies.orient.test.domain.business.Account) Test(org.testng.annotations.Test)

Aggregations

Account (com.orientechnologies.orient.test.domain.business.Account)23 Test (org.testng.annotations.Test)21 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)5 Address (com.orientechnologies.orient.test.domain.business.Address)5 City (com.orientechnologies.orient.test.domain.business.City)4 Country (com.orientechnologies.orient.test.domain.business.Country)4 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)3 ORID (com.orientechnologies.orient.core.id.ORID)2 EnumTest (com.orientechnologies.orient.test.domain.base.EnumTest)2 Company (com.orientechnologies.orient.test.domain.business.Company)2 Profile (com.orientechnologies.orient.test.domain.whiz.Profile)2 DatabaseAbstractTest (com.orientechnologies.DatabaseAbstractTest)1 OObjectDatabaseTx (com.orientechnologies.orient.object.db.OObjectDatabaseTx)1 ArrayList (java.util.ArrayList)1