Package com.orientechnologies.orient.test.domain.base

Examples of com.orientechnologies.orient.test.domain.base.JavaSimpleTestClass


  }

  @Test(dependsOnMethods = "testCollectionsRemove")
  public void testCascadeDeleteSimpleObject() {
    JavaCascadeDeleteTestClass test = database.newInstance(JavaCascadeDeleteTestClass.class);
    JavaSimpleTestClass simple = database.newInstance(JavaSimpleTestClass.class);
    simple.setText("asdasd");
    test.setSimpleClass(simple);
    database.save(test);
    ORID testRid = database.getRecordByUserObject(test, false).getIdentity();
    ORID simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    database.delete(testRid);
    simple = database.load(simpleRid);
    Assert.assertNull(simple);

    // TEST SET NULL
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    test = database.newInstance(JavaCascadeDeleteTestClass.class);
    simple = database.newInstance(JavaSimpleTestClass.class);
    simple.setText("asdasd");
    test.setSimpleClass(simple);
    database.save(test);
    testRid = database.getRecordByUserObject(test, false).getIdentity();
    simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    test.setSimpleClass(null);
    database.save(test);
    simple = database.load(simpleRid);
    Assert.assertNull(simple);
    database.delete(test);

    // TEST CHANGE NEW RECORD
    test = database.newInstance(JavaCascadeDeleteTestClass.class);
    simple = database.newInstance(JavaSimpleTestClass.class);
    simple.setText("asdasd");
    test.setSimpleClass(simple);
    database.save(test);
    testRid = database.getRecordByUserObject(test, false).getIdentity();
    simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
    database.close();
View Full Code Here


  }

  @Test(dependsOnMethods = "testCollectionsRemove")
  public void testCascadeDeleteSimpleObject() {
    JavaCascadeDeleteTestClass test = database.newInstance(JavaCascadeDeleteTestClass.class);
    JavaSimpleTestClass simple = database.newInstance(JavaSimpleTestClass.class);
    simple.setText("asdasd");
    test.setSimpleClass(simple);
    database.save(test);
    ORID testRid = database.getRecordByUserObject(test, false).getIdentity();
    ORID simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    database.delete(testRid);
    simple = database.load(simpleRid);
    Assert.assertNull(simple);

    // TEST SET NULL
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    test = database.newInstance(JavaCascadeDeleteTestClass.class);
    simple = database.newInstance(JavaSimpleTestClass.class);
    simple.setText("asdasd");
    test.setSimpleClass(simple);
    database.save(test);
    testRid = database.getRecordByUserObject(test, false).getIdentity();
    simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    test.setSimpleClass(null);
    database.save(test);
    simple = database.load(simpleRid);
    Assert.assertNull(simple);
    database.delete(test);

    // TEST CHANGE NEW RECORD
    test = database.newInstance(JavaCascadeDeleteTestClass.class);
    simple = database.newInstance(JavaSimpleTestClass.class);
    simple.setText("asdasd");
    test.setSimpleClass(simple);
    database.save(test);
    testRid = database.getRecordByUserObject(test, false).getIdentity();
    simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
    database.close();
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.test.domain.base.JavaSimpleTestClass

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.