Package ca.wowapi.entities

Examples of ca.wowapi.entities.Realm


    try {
      JSONObject jsonobject = getJSONFromRequest(finalURL);
      JSONArray jarray = jsonobject.getJSONArray("realms");
      jsonobject = jarray.getJSONObject(0);

      Realm realm = new Realm();
      realm.setName(jsonobject.getString("name"));
      realm.setPopulation(jsonobject.getString("population"));
      realm.setType(jsonobject.getString("type"));
      realm.setSlug(jsonobject.getString("slug"));
      realm.setStatus(jsonobject.getBoolean("status"));
      realm.setQueue(jsonobject.getBoolean("queue"));

      return realm;
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


      JSONArray jarray = jsonobject.getJSONArray("realms");
      for (int i = 0; i < jarray.length(); i++) {

        jsonobject = jarray.getJSONObject(i);

        Realm realm = new Realm();
        realm.setName(jsonobject.getString("name"));
        realm.setPopulation(jsonobject.getString("population"));
        realm.setType(jsonobject.getString("type"));
        realm.setSlug(jsonobject.getString("slug"));
        realm.setStatus(jsonobject.getBoolean("status"));
        realm.setQueue(jsonobject.getBoolean("queue"));

        list.add(realm);
      }
      return list;
View Full Code Here

    realmAPI = new RealmAPI()
  }

  @Test
  public void getRealmByNameTest() {
    Realm r = realmAPI.getRealm("Ravencrest", RealmAPI.REGION_US);
    Assert.assertNotNull(r);
    Assert.assertEquals("Ravencrest", r.getName());
  }
View Full Code Here

TOP

Related Classes of ca.wowapi.entities.Realm

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.