Package er.plugintest.model

Examples of er.plugintest.model.Country


    public void run() {
      for (int i = 0; i < 25; i++) {
        ERXEC ec = (ERXEC) ERXEC.newEditingContext();
        ec.lock();
        try {
          Country country = Country.fetchAllCountries(ec).lastObject();
          City city = City.createCity(ec, RandomStringUtils.randomAlphabetic(15));
          city.setCountryRelationship(country);
         
          ec.saveChanges();
        } finally {
View Full Code Here


      Integer cnt = ERXEOControlUtilities.objectCountWithQualifier(ec, City.ENTITY_NAME, City.DISTICT.eq("DC"));

      assertNotNull(cnt);
      assertEquals(Integer.valueOf(1), cnt);

      Country country = Country.createCountry(ec, "USA", "United States of America");
      country.setCapital(city);
      try {
        // make sure blobs work
        NSData flag = new NSData(ERXFileUtilities.inputStreamForResourceNamed("us.png", null, null), 1024);
        country.setFlag(flag);
      } catch (IOException e) {
        log.error(org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(e), e);
        throw new RuntimeException(e.getMessage(), e);
      }
      ec.saveChanges();
View Full Code Here

  public void testUpdate() {
    ERXEC ec = (ERXEC) ERXEC.newEditingContext();
    ec.lock();
    try {
      Country country = Country.fetchCountry(ec, Country.CODE.eq("NLD"));
      final String headOfState = "Queen " + country.headOfState();
      country.setHeadOfState(headOfState);
      ec.saveChanges();

      Integer cnt = ERXEOControlUtilities.objectCountWithQualifier(ec, Country.ENTITY_NAME, Country.HEAD_OF_STATE.eq(headOfState));

      assertNotNull(cnt);
View Full Code Here

  public void testDelete() {
    ERXEC ec = (ERXEC) ERXEC.newEditingContext();
    ec.lock();
    try {
      Country country = Country.fetchCountry(ec, Country.CODE.eq("NOR"));
      country.delete();
      ec.saveChanges();

      Integer cnt = ERXEOControlUtilities.objectCountWithQualifier(ec, Country.ENTITY_NAME, Country.CODE.eq("NOR"));

      assertNotNull(cnt);
View Full Code Here

TOP

Related Classes of er.plugintest.model.Country

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.