Examples of Profile


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

  public void createLinked() {
    database = ODatabaseObjectPool.global().acquire(url, "admin", "admin");

    long profiles = database.countClass("Profile");

    Profile neo = new Profile("Neo").setValue("test").setLocation(
        new Address("residence", new City(new Country("Spain"), "Madrid"), "Rio de Castilla"));
    neo.addFollowing(new Profile("Morpheus"));
    neo.addFollowing(new Profile("Trinity"));

    database.save(neo);

    Assert.assertEquals(database.countClass("Profile"), profiles + 3);
View Full Code Here

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

    final List<Profile> result = database.query(new OSQLSynchQuery<Profile>(
        "select from Profile where location.city.country.name = 'Spain'"));

    Assert.assertTrue(result.size() > 0);

    Profile profile;
    for (int i = 0; i < result.size(); ++i) {
      profile = result.get(i);

      Assert.assertEquals(profile.getLocation().getCity().getCountry().getName(), "Spain");
    }

    database.close();
  }
View Full Code Here

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

  @Test
  public void queryWithRidAsParameters() {
    database = ODatabaseObjectPool.global().acquire(url, "admin", "admin");
    database.getMetadata().getSchema().reload();

    Profile profile = (Profile) database.browseClass("Profile").next();

    final OSQLSynchQuery<Profile> query = new OSQLSynchQuery<Profile>("select from Profile where @rid = ?");
    List<Profile> result = database.query(query, new ORecordId(profile.getId()));

    Assert.assertEquals(result.size(), 1);

    database.close();
  }
View Full Code Here

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

  @Test
  public void queryWithRidStringAsParameters() {
    database = ODatabaseObjectPool.global().acquire(url, "admin", "admin");
    database.getMetadata().getSchema().reload();

    Profile profile = (Profile) database.browseClass("Profile").next();

    OSQLSynchQuery<Profile> query = new OSQLSynchQuery<Profile>("select from Profile where @rid = ?");
    List<Profile> result = database.query(query, profile.getId());

    Assert.assertEquals(result.size(), 1);

    // TEST WITHOUT # AS PREFIX
    query = new OSQLSynchQuery<Profile>("select from Profile where @rid = ?");
    result = database.query(query, profile.getId().substring(1));

    Assert.assertEquals(result.size(), 1);

    database.close();
  }
View Full Code Here

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

    params.put("surname", "Obama");

    List<Profile> result = database.query(query, params);
    Assert.assertTrue(result.size() != 0);

    Profile obama = result.get(0);

    result = database.query(new OSQLSynchQuery<Profile>("select from Profile where followings contains ( @Rid = :who )"), obama);
    Assert.assertTrue(result.size() != 0);

    database.close();
View Full Code Here

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

    Assert.assertTrue(false);
  }

  @Test(dependsOnMethods = "testHooksIsRegistered")
  public void testHookCreate() throws IOException {
    p = new Profile("HookTest");

    // TEST HOOKS ON CREATE
    Assert.assertEquals(callbackCount, 0);
    database.save(p);
    Assert.assertEquals(callbackCount, 11);
View Full Code Here

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

  }

  @Test(dependsOnMethods = "testRegisterHook")
  public void testHookCalls() throws IOException {

    p = new Profile("HookTxTest");

    // TEST HOOKS ON CREATE
    Assert.assertEquals(callbackCount, 0);
    database.begin();
    database.save(p);
View Full Code Here

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

    database.save(graz);

    account = new Account();
    database.save(account);

    profile = new Profile();
    database.save(profile);
  }
View Full Code Here

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

    database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain");
  }

  @Test
  public void testDuplicatedIndexOnUnique() {
    Profile jayMiner = new Profile("Jay", "Jay", "Miner", null);
    database.save(jayMiner);

    Profile jacobMiner = new Profile("Jay", "Jacob", "Miner", null);

    try {
      database.save(jacobMiner);

      // IT SHOULD GIVE ERROR ON DUPLICATED KEY
View Full Code Here

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

    final List<Profile> result = database.command(new OSQLSynchQuery<Profile>("select * from Profile where nick = 'Jay'"))
        .execute();

    Assert.assertFalse(result.isEmpty());

    Profile record;
    for (int i = 0; i < result.size(); ++i) {
      record = result.get(i);

      OrientTest.printRecord(i, record);

      Assert.assertTrue(record.getName().toString().equalsIgnoreCase("Jay"));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.