Package org.structr.core.entity

Examples of org.structr.core.entity.TestFour


  public void testSimpleSearchOnRelationship() {
   
    try {

      final TestOne testOne        = createTestNode(TestOne.class);
      final TestFour testFour      = createTestNode(TestFour.class);
      final Property<TestEnum> key = OneFourOneToOne.enumProperty;
     
      assertNotNull(testOne);
      assertNotNull(testFour);
     
View Full Code Here


    // create a new node, check labels, modify type, check labels again

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

      // create entity of type TestFour
      final TestFour testEntity = createTestNode(TestFour.class);

      // check if node exists
      assertNotNull(testEntity);

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

      // save ID for later use
      id = testEntity.getUuid();

      // change type to TestFive
      testEntity.setProperty(GraphObject.type, TestFive.class.getSimpleName());

      // commit transaction
      tx.success();

    } catch (FrameworkException fex) {

      fail("Unexpected exception");
    }


    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

  public void test() {

    try {

      final Property<Double> instance = TestFour.doubleProperty;
      final TestFour testEntity        = createTestNode(TestFour.class);

      assertNotNull(testEntity);

      // store double in the test entitiy
      final Double value = 3.141592653589793238;
View Full Code Here

  public void testNaN() {

    try {

      final Property<Double> instance = TestFour.doubleProperty;
      final TestFour testEntity        = createTestNode(TestFour.class);

      assertNotNull(testEntity);

      // store NaN double in the test entitiy
      final Double value = Double.NaN;
View Full Code Here

      final PropertyMap properties  = new PropertyMap();
      final PropertyKey<Double> key = TestFour.doubleProperty;

      properties.put(key, 3.141592653589793238);

      final TestFour testEntity     = createTestNode(TestFour.class, properties);

      assertNotNull(testEntity);

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

        // check value from database
        assertEquals(3.141592653589793238, testEntity.getProperty(key));

        Result<TestFour> result = app.nodeQuery(TestFour.class).and(key, 3.141592653589793238).getResult();

        assertEquals(1, result.size());
        assertEquals(testEntity, result.get(0));
View Full Code Here

      final PropertyMap properties  = new PropertyMap();
      final PropertyKey<Double> key = TestFour.doubleProperty;

      properties.put(key, Double.NaN);

      final TestFour testEntity     = createTestNode(TestFour.class, properties);

      assertNotNull(testEntity);

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

        // check value from database
        assertEquals(Double.NaN, testEntity.getProperty(key));

        Result<TestFour> result = app.nodeQuery(TestFour.class).and(key, Double.NaN).getResult();

        assertEquals(1, result.size());
        assertEquals(testEntity, result.get(0));
View Full Code Here

      final PropertyMap properties  = new PropertyMap();
      final PropertyKey<Double> key = TestFour.doubleProperty;

      properties.put(key, Double.NEGATIVE_INFINITY);

      final TestFour testEntity     = createTestNode(TestFour.class, properties);

      assertNotNull(testEntity);

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

        // check value from database
        assertEquals(Double.NEGATIVE_INFINITY, testEntity.getProperty(key));

        Result<TestFour> result = app.nodeQuery(TestFour.class).and(key, Double.NEGATIVE_INFINITY).getResult();

        assertEquals(1, result.size());
        assertEquals(testEntity, result.get(0));
View Full Code Here

      final PropertyMap properties  = new PropertyMap();
      final PropertyKey<Double> key = TestFour.doubleProperty;

      properties.put(key, Double.POSITIVE_INFINITY);

      final TestFour testEntity     = createTestNode(TestFour.class, properties);

      assertNotNull(testEntity);

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

        // check value from database
        assertEquals(Double.POSITIVE_INFINITY, testEntity.getProperty(key));

        Result<TestFour> result = app.nodeQuery(TestFour.class).and(key, Double.POSITIVE_INFINITY).getResult();

        assertEquals(1, result.size());
        assertEquals(testEntity, result.get(0));
View Full Code Here

  public void testSimpleSearchOnRelationship() {

    try {

      final TestOne testOne      = createTestNode(TestOne.class);
      final TestFour testFour    = createTestNode(TestFour.class);
      final Property<Double> key = OneFourOneToOne.doubleProperty;

      assertNotNull(testOne);
      assertNotNull(testFour);
View Full Code Here

  public void test() {
   
    try {

      final Property<String> instance = TestFour.stringProperty;
      final TestFour testEntity        = createTestNode(TestFour.class);
     
      assertNotNull(testEntity);

      // store string in the test entitiy
      final String value = "This is a test!";
View Full Code Here

TOP

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

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.