Package org.structr.core.entity

Examples of org.structr.core.entity.TestFive


    }


    try (final Tx tx = app.tx()) {

      final TestFive testEntity = app.get(TestFive.class, id);

      assertNotNull(testEntity);

      // check labels after type change
      assertTrue(labelsAfter.containsAll(Iterables.toSet(testEntity.getNode().getLabels())));

    } catch (FrameworkException fex) {

      fail("Unexpected exception");
    }
View Full Code Here


    }
  }
 
  private void testCallbacks(final SecurityContext securityContext) throws FrameworkException {
   
    TestFive entity = null;
    Integer zero = 0;
    Integer one  = 1;
   
    try (final Tx tx = app.tx()) {

      entity = app.create(TestFive.class);
      tx.success();
     
    } catch (Throwable t) {
     
      t.printStackTrace();
    }

    assertNotNull("Entity should have been created", entity);
   
    // creation assertions
    try (final Tx tx = app.tx()) {
     
      assertEquals("modifiedInBeforeCreation should have a value of 1: ", one, entity.getProperty(TestFive.modifiedInBeforeCreation));
      assertEquals("modifiedInAfterCreation should have a value of 1:  ", one, entity.getProperty(TestFive.modifiedInAfterCreation));

      // modification assertions
      assertEquals("modifiedInBeforeModification should have a value of 0: ", zero, entity.getProperty(TestFive.modifiedInBeforeModification));
      assertEquals("modifiedInAfterModification should have a value of 0:  ", zero, entity.getProperty(TestFive.modifiedInAfterModification));
    }
   
   
    // 2nd part of the test: modify node
    try (final Tx tx = app.tx()) {

      final TestFive finalEntity = entity;

      finalEntity.setProperty(TestFive.intProperty, 123);
      tx.success();
     
    } catch (Throwable t) {
      t.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of org.structr.core.entity.TestFive

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.