use of com.orientechnologies.orient.core.db.object.OLazyObjectSetInterface in project orientdb by orientechnologies.
the class CRUDObjectPhysicalTest method checkLazyLoadingOff.
@Test(dependsOnMethods = "createLinked")
public void checkLazyLoadingOff() {
database.setLazyLoading(false);
for (Profile obj : database.browseClass(Profile.class).setFetchPlan("*:1")) {
Assert.assertTrue(!(obj.getFollowings() instanceof OLazyObjectSetInterface) || ((OLazyObjectSetInterface<Profile>) obj.getFollowings()).isConverted());
Assert.assertTrue(!(obj.getFollowers() instanceof OLazyObjectSetInterface) || ((OLazyObjectSetInterface<Profile>) obj.getFollowers()).isConverted());
if (obj.getNick().equals("Neo")) {
Assert.assertEquals(obj.getFollowers().size(), 0);
Assert.assertEquals(obj.getFollowings().size(), 2);
} else if (obj.getNick().equals("Morpheus") || obj.getNick().equals("Trinity")) {
Assert.assertEquals(obj.getFollowings().size(), 0);
Assert.assertEquals(obj.getFollowers().size(), 1);
Assert.assertTrue(obj.getFollowers().iterator().next() instanceof Profile);
}
}
}
use of com.orientechnologies.orient.core.db.object.OLazyObjectSetInterface in project orientdb by orientechnologies.
the class CRUDObjectPhysicalTestSchemaFull method checkLazyLoadingOff.
@Test(dependsOnMethods = "createLinked")
public void checkLazyLoadingOff() {
database.setLazyLoading(false);
for (Profile obj : database.browseClass(Profile.class).setFetchPlan("*:1")) {
Assert.assertTrue(!(obj.getFollowings() instanceof OLazyObjectSetInterface) || ((OLazyObjectSetInterface<Profile>) obj.getFollowings()).isConverted());
Assert.assertTrue(!(obj.getFollowers() instanceof OLazyObjectSetInterface) || ((OLazyObjectSetInterface<Profile>) obj.getFollowers()).isConverted());
if (obj.getNick().equals("Neo")) {
Assert.assertEquals(obj.getFollowers().size(), 0);
Assert.assertEquals(obj.getFollowings().size(), 2);
} else if (obj.getNick().equals("Morpheus") || obj.getNick().equals("Trinity")) {
Assert.assertEquals(obj.getFollowings().size(), 0);
Assert.assertEquals(obj.getFollowers().size(), 1);
Assert.assertTrue(obj.getFollowers().iterator().next() instanceof Profile);
}
}
}
Aggregations