Package com.orientechnologies.orient.test.domain.whiz

Examples of com.orientechnologies.orient.test.domain.whiz.Collector


    super.afterMethod();
  }

  public void testIndexCollection() {
    Collector collector = new Collector();
    collector.setStringCollection(Arrays.asList("spam", "eggs"));
    collector = database.save(collector);

    List<ODocument> result = database.command(new OCommandSQL("select key, rid from index:Collector.stringCollection")).execute();

    Assert.assertNotNull(result);
View Full Code Here


  }

  public void testIndexCollectionInTx() throws Exception {
    try {
      database.begin();
      Collector collector = new Collector();
      collector.setStringCollection(Arrays.asList("spam", "eggs"));
      collector = database.save(collector);
      database.commit();
    } catch (Exception e) {
      database.rollback();
      throw e;
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdate() {
    Collector collector = new Collector();
    collector.setStringCollection(Arrays.asList("spam", "eggs"));
    collector = database.save(collector);
    collector.setStringCollection(Arrays.asList("spam", "bacon"));
    collector = database.save(collector);

    List<ODocument> result = database.command(new OCommandSQL("select key, rid from index:Collector.stringCollection")).execute();

    Assert.assertNotNull(result);
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdateInTx() throws Exception {
    Collector collector = new Collector();
    collector.setStringCollection(Arrays.asList("spam", "eggs"));
    collector = database.save(collector);
    try {
      database.begin();
      collector.setStringCollection(Arrays.asList("spam", "bacon"));
      collector = database.save(collector);
      database.commit();
    } catch (Exception e) {
      database.rollback();
      throw e;
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdateInTxRollback() throws Exception {
    Collector collector = new Collector();
    collector.setStringCollection(Arrays.asList("spam", "eggs"));
    collector = database.save(collector);
    database.begin();
    collector.setStringCollection(Arrays.asList("spam", "bacon"));
    collector = database.save(collector);
    database.rollback();

    List<ODocument> result = database.command(new OCommandSQL("select key, rid from index:Collector.stringCollection")).execute();
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdateAddItem() {
    Collector collector = new Collector();
    collector.setStringCollection(Arrays.asList("spam", "eggs"));
    collector = database.save(collector);

    database.command(new OCommandSQL("UPDATE " + collector.getId() + " add stringCollection = 'cookies'")).execute();

    List<ODocument> result = database.command(new OCommandSQL("select key, rid from index:Collector.stringCollection")).execute();

    Assert.assertNotNull(result);
    Assert.assertEquals(result.size(), 3);
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdateAddItemInTx() throws Exception {
    Collector collector = new Collector();
    collector.setStringCollection(new ArrayList<String>(Arrays.asList("spam", "eggs")));
    collector = database.save(collector);

    try {
      database.begin();
      Collector loadedCollector = (Collector) database.load(new ORecordId(collector.getId()));
      loadedCollector.getStringCollection().add("cookies");
      database.save(loadedCollector);
      database.commit();
    } catch (Exception e) {
      database.rollback();
      throw e;
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdateAddItemInTxRollback() throws Exception {
    Collector collector = new Collector();
    collector.setStringCollection(new ArrayList<String>(Arrays.asList("spam", "eggs")));
    collector = database.save(collector);

    database.begin();
    Collector loadedCollector = (Collector) database.load(new ORecordId(collector.getId()));
    loadedCollector.getStringCollection().add("cookies");
    loadedCollector = database.save(loadedCollector);
    database.rollback();

    List<ODocument> result = database.command(new OCommandSQL("select key, rid from index:Collector.stringCollection")).execute();
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdateRemoveItemInTx() throws Exception {
    Collector collector = new Collector();
    collector.setStringCollection(new ArrayList<String>(Arrays.asList("spam", "eggs")));
    collector = database.save(collector);

    try {
      database.begin();
      Collector loadedCollector = (Collector) database.load(new ORecordId(collector.getId()));
      loadedCollector.getStringCollection().remove("spam");
      loadedCollector = database.save(loadedCollector);
      database.commit();
    } catch (Exception e) {
      database.rollback();
      throw e;
View Full Code Here

      }
    }
  }

  public void testIndexCollectionUpdateRemoveItemInTxRollback() throws Exception {
    Collector collector = new Collector();
    collector.setStringCollection(new ArrayList<String>(Arrays.asList("spam", "eggs")));
    collector = database.save(collector);

    database.begin();
    Collector loadedCollector = (Collector) database.load(new ORecordId(collector.getId()));
    loadedCollector.getStringCollection().remove("spam");
    loadedCollector = database.save(loadedCollector);
    database.rollback();

    List<ODocument> result = database.command(new OCommandSQL("select key, rid from index:Collector.stringCollection")).execute();
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.test.domain.whiz.Collector

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.