Package org.structr.core.entity

Examples of org.structr.core.entity.TestFour


       

    try {

      final Property<Integer> instance = TestFour.integerProperty;
      final TestFour testEntity        = createTestNode(TestFour.class);
     
      assertNotNull(testEntity);

      // store integer in the test entitiy
      final Integer value = 2345;
View Full Code Here


      final PropertyMap properties  = new PropertyMap();
      final PropertyKey<Integer> key = TestFour.integerProperty;
     
      properties.put(key, 2345);
     
      final TestFour testEntity     = createTestNode(TestFour.class, properties);
     
      assertNotNull(testEntity);

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

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

        Result<TestFour> result = app.nodeQuery(TestFour.class).and(key, 2345).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<Integer> key = OneFourOneToOne.integerProperty;
     
      assertNotNull(testOne);
      assertNotNull(testFour);
     
View Full Code Here

  public void test() {
   
    try {

      final Property<Long> instance = TestFour.longProperty;
      final TestFour testEntity     = createTestNode(TestFour.class);

      assertNotNull(testEntity);

      // store long in the test entitiy
      final Long value = 2857312362L;
View Full Code Here

      final PropertyMap properties  = new PropertyMap();
      final PropertyKey<Long> key = TestFour.longProperty;
     
      properties.put(key, 2857312362L);
     
      final TestFour testEntity     = createTestNode(TestFour.class, properties);
     
      assertNotNull(testEntity);

      try (final Tx tx = app.tx()) {
       
        // check value from database
        assertEquals((Long)2857312362L, (Long)testEntity.getProperty(key));

        Result<TestFour> result = app.nodeQuery(TestFour.class).and(key, 2857312362L).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<Long> key = OneFourOneToOne.longProperty;
     
      assertNotNull(testOne);
      assertNotNull(testFour);
     
View Full Code Here

  public void testStringArrayProperty() {

    try {

      final Property<String[]> instance = TestFour.stringArrayProperty;
      final TestFour testEntity         = createTestNode(TestFour.class);

      assertNotNull(testEntity);

      // store a string array in the test entitiy
      final String[] arr = new String[] { "one", "two", "three", "four", "five" };
View Full Code Here

      final String[] arr1 = new String[] { "one" };
      final String[] arr5 = new String[] { "one", "two", "three", "four", "five" };

      properties.put(key, arr1);

      TestFour testEntity = null;
      try (final Tx tx = app.tx()) {
        testEntity = createTestNode(TestFour.class, properties);
        tx.success();
      }

      assertNotNull(testEntity);


      Result<TestFour> result = null;
      try (final Tx tx = app.tx()) {

        result = app.nodeQuery(TestFour.class).and(key, new String[]{"one"}).getResult();
        assertEquals(1, result.size());
        assertEquals(result.get(0), testEntity);
      }


      try (final Tx tx = app.tx()) {
        testEntity.setProperty(key, arr5);
        tx.success();
      }

      try (final Tx tx = app.tx()) {
View Full Code Here

      final PropertyMap properties    = new PropertyMap();
     
      properties.put(TestFour.enumProperty, TestEnum.Status1);
     
      final TestFour testEntity        = createTestNode(TestFour.class, properties);
     
      assertNotNull(testEntity);

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

        // check value from database
        assertEquals(TestEnum.Status1, testEntity.getProperty(TestFour.enumProperty));
      }
     
    } catch (FrameworkException fex) {
     
      fail("Unable to store array");
View Full Code Here

      final PropertyMap properties  = new PropertyMap();
      final PropertyKey<TestEnum> key = TestFour.enumProperty;
     
      properties.put(key, TestEnum.Status1);
     
      final TestFour testEntity     = createTestNode(TestFour.class, properties);
     
      assertNotNull(testEntity);

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

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

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

        assertEquals(1, result.size());
        assertEquals(testEntity, result.get(0));
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.