Examples of Country


Examples of com.orientechnologies.orient.test.domain.business.Country

  }

  @Test(dependsOnMethods = "testInsertRollback")
  public void testUpdateCommit() {
    String initialCountryName = "updateCommit";
    Country country = new Country(initialCountryName);

    database.save(country);
    Assert.assertNotNull(country.getId());
    Assert.assertNotNull(country.getVersion());

    Integer initVersion = (Integer) country.getVersion();

    database.begin();
    Country loaded = (Country) database.load((ORecordId) country.getId());
    Assert.assertEquals(loaded, country);
    String newName = "ShouldBeChanged";
    loaded.setName(newName);
    database.save(loaded);
    database.commit();

    loaded = (Country) database.load((ORecordId) country.getId());
    Assert.assertTrue(loaded.equals(country));
    Assert.assertEquals(loaded.getId(), country.getId());
    Assert.assertEquals(loaded.getVersion(), new Integer(initVersion + 1));
    Assert.assertEquals(loaded.getName(), newName);
  }
View Full Code Here

Examples of com.orientechnologies.orient.test.domain.business.Country

  }

  @Test(dependsOnMethods = "testUpdateCommit")
  public void testUpdateRollback() {
    String initialCountryName = "updateRollback";
    Country country = new Country(initialCountryName);

    database.save(country);
    Assert.assertNotNull(country.getId());
    Assert.assertNotNull(country.getVersion());

    Integer initVersion = (Integer) country.getVersion();

    database.begin();
    Country loaded = (Country) database.load((ORecordId) country.getId());
    Assert.assertEquals(loaded, country);
    String newName = "ShouldNotBeChanged";
    loaded.setName(newName);
    database.save(loaded);
    database.rollback();

    loaded = (Country) database.load((ORecordId) country.getId());
    Assert.assertNotSame(loaded, country);
    Assert.assertEquals(loaded.getVersion(), initVersion);
    Assert.assertEquals(loaded.getName(), initialCountryName);
  }
View Full Code Here

Examples of com.orientechnologies.orient.test.domain.business.Country

  }

  @Test(dependsOnMethods = "testUpdateRollback")
  public void testDeleteCommit() {
    String initialCountryName = "deleteCommit";
    Country Country = new Country(initialCountryName);

    long initCount = database.countClass(Country.class);

    database.save(Country);

    Assert.assertEquals(database.countClass(Country.class), initCount + 1);

    database.begin();
    database.delete(Country);
    database.commit();

    Assert.assertEquals(database.countClass(Country.class), initCount);
    Country found = (Country) database.load((ORecordId) Country.getId());
    Assert.assertNull(found);
  }
View Full Code Here

Examples of com.orientechnologies.orient.test.domain.business.Country

  }

  @Test(dependsOnMethods = "testDeleteCommit")
  public void testDeleteRollback() {
    String initialCountryName = "deleteRollback";
    Country country = new Country(initialCountryName);

    long initCount = database.countClass(Country.class);

    database.save(country);

    Assert.assertEquals(database.countClass(Country.class), initCount + 1);

    database.begin();
    database.delete(country);
    database.rollback();

    Assert.assertEquals(database.countClass(Country.class), initCount + 1);
    Country found = (Country) database.load((ORecordId) country.getId());
    Assert.assertNotNull(found);
    Assert.assertEquals(found.getName(), country.getName());
  }
View Full Code Here

Examples of com.orientechnologies.orient.test.domain.business.Country

  @Test
  public void createAnnotatedObjects() {
    database = new ODatabaseObjectTx(url).open("admin", "admin");

    Country austria = new Country("Austria");
    City graz = new City(austria, "Graz");
    database.save(graz);

    account = new Account();
    database.save(account);
View Full Code Here

Examples of com.orientechnologies.orient.test.domain.business.Country

  }

  @Test(dependsOnMethods = "testOrientObjectIdPlusVersionAnnotationsInTx")
  public void testInsertCommit() {
    String initialCountryName = "insertCommit";
    Country country = new Country(initialCountryName);

    long initCount = database.countClass(Country.class);

    database.begin();
    database.save(country);
    database.commit();

    Assert.assertEquals(database.countClass(Country.class), initCount + 1);
    Assert.assertNotNull(country.getId());
    Assert.assertNotNull(country.getVersion());

    Country found = (Country) database.load((ORecordId) country.getId());
    Assert.assertNotNull(found);
    Assert.assertEquals(country.getName(), found.getName());
  }
View Full Code Here

Examples of com.uphea.domain.Country

    if (countryId == null) {
      return null;
    }
    // forcing iterating loop over java5
    for (int i = 0; i < totalCountries; i++) {
      Country country = countries.get(i);
      if (country.getId().equals(countryId)) {
        return country;
      }
    }
    return null;
  }
View Full Code Here

Examples of com.vaadin.tests.data.bean.Country

            p.setBirthDate(new Date(2011 - 1900 - p.getAge(), 11 - 1, 24));
            if (i % 42 == 0) {
                p.setSex(Sex.UNKNOWN);
            }
            String city = "City " + (i / 10);
            Country country = Country.FINLAND;
            Address address = new Address("Street " + i, 12345 + i * 2, city,
                    country);
            p.setAddress(address);
            bic.addBean(p);
        }
View Full Code Here

Examples of com.zesped.model.Country

    Collection<State> oStates = null;
    if (client!=null) {
      if (!client.isNull("country")) {
        try {
          connect();
            Country oCntr = Countries.top(getSession()).getCountry(getSession(), client.getString("country"));
            if (oCntr!=null)
              oStates = oCntr.states(getSession()).list(getSession());
            else
              oStates = new ArrayList<State>();
            disconnect();
            } catch (Exception xcpt) {
            Log.out.error(xcpt.getMessage(), xcpt);
View Full Code Here

Examples of controller.enums.Country

    //pass configuration
    String road = "Gartenstra�e";
    String houseNumber = "12A";
    String location = "Leverkusen";
    String postalNumber = "79348";
    Country ccountry = Country.GERMANY;
    String scountry = null;
    if (new AddressChecker(road, houseNumber, location, postalNumber, ccountry).check() != true ||
        new AddressChecker(road, houseNumber, location, postalNumber, scountry).check() != true){
      throw new Exception("valid Address configuration declared invalid");
    }
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.