Examples of District


Examples of org.bitbucket.andyrobr.clever.models.District

        assertNotNull(teachers);
        assertTrue(teachers.size() == 1);

        List<District> districts = clever.getDistricts();
        District district = districts.get(0);

        List<Teacher> teachersInDistrict = clever.getTeachersFromDistrict(district.getId());

        assertNotNull(teachersInDistrict);
        assertTrue(teachersInDistrict.size() == 1);

        assertEquals(teachersInDistrict.get(0), teachers.get(0));
View Full Code Here

Examples of org.bitbucket.andyrobr.clever.models.District

    }

    @Test
    public void testGetStudentsFromDistrict() throws Exception
    {
        District district = clever.getDistricts().get(0);

        List<Student> students = clever.getStudentsFromDistrict(district.getId());

        assertNotNull(students);
        assertTrue(students.size() == 1);

        District studentDistrict = clever.getDistrictFromStudent(students.get(0).getId());

        // If a district includes a student, then the student must be in the district.
        assertEquals(studentDistrict, district);
    }
View Full Code Here

Examples of org.bitbucket.andyrobr.clever.models.District

        List<Student> students = clever.getStudents();

        assertNotNull(students);
        assertTrue(students.size() == 1);

        District district = clever.getDistricts().get(0);

        List<Student> studentsInDistrict = clever.getStudentsFromDistrict(district.getId());

        assertNotNull(studentsInDistrict);
        assertTrue(studentsInDistrict.size() == 1);

        assertEquals(studentsInDistrict.get(0), students.get(0));
View Full Code Here

Examples of org.fenixedu.academic.domain.District

    public static ResidenceInformationForm createFromPerson(final Person person) {
        if (person.hasDefaultPhysicalAddress()) {
            final PhysicalAddress physicalAddress = person.getDefaultPhysicalAddress();
            final Country country = getCountryOfResidenceFromPhysicalAddress(physicalAddress);
            final District districtOfResidence =
                    physicalAddress.getDistrictOfResidence() != null ? District.readByName(physicalAddress
                            .getDistrictOfResidence()) : null;

            final DistrictSubdivision districtSubdivisionOfResidence;
            if (districtOfResidence != null) {
                districtSubdivisionOfResidence =
                        physicalAddress.getDistrictSubdivisionOfResidence() != null ? districtOfResidence
                                .getDistrictSubdivisionByName(physicalAddress.getDistrictSubdivisionOfResidence()) : null;
            } else {
                districtSubdivisionOfResidence = null;
            }
View Full Code Here

Examples of org.fenixedu.academic.domain.District

    @Override
    public Object provide(Object source, Object currentValue) {
        final FiliationForm filiationForm = (FiliationForm) source;
        if (filiationForm.getDistrictOfBirth() != null) {
            final District district = District.readByName(filiationForm.getDistrictOfBirth());

            if (district != null) {
                return transformToStringCollection(district);
            }
        }
View Full Code Here

Examples of org.radargun.stages.tpcc.domain.District

      boolean found = w.load(basicCache);
      if (!found) throw new ElementNotFoundException("W_ID=" + w_id + " not found!");
      w.setW_ytd(h_amount);
      w.store(basicCache);

      District d = new District();
      d.setD_id(d_id);
      d.setD_w_id(w_id);
      found = d.load(basicCache);
      if (!found) throw new ElementNotFoundException("D_ID=" + d_id + " D_W_ID=" + w_id + " not found!");

      d.setD_ytd(h_amount);
      d.store(basicCache);

      Customer c = null;

      if (c_by_name) {
         new_c_last = c_last;
         List cList = null;
         cList = CustomerDAC.loadByCLast(basicCache, c_w_id, c_d_id, new_c_last);

         if (cList == null || cList.isEmpty())
            throw new ElementNotFoundException("C_LAST=" + c_last + " C_D_ID=" + c_d_id + " C_W_ID=" + c_w_id + " not found!");

         Collections.sort(cList);

         namecnt = cList.size();

         if (namecnt % 2 == 1) namecnt++;
         Iterator<Customer> itr = cList.iterator();

         for (int i = 1; i <= namecnt / 2; i++) {
            c = itr.next();
         }
      } else {
         c = new Customer();
         c.setC_id(c_id);
         c.setC_d_id(c_d_id);
         c.setC_w_id(c_w_id);
         found = c.load(basicCache);
         if (!found)
            throw new ElementNotFoundException("C_ID=" + c_id + " C_D_ID=" + c_d_id + " C_W_ID=" + c_w_id + " not found!");
      }

      c.setC_balance(c.getC_balance() + h_amount);
      if (c.getC_credit().equals("BC")) {

         c_data = c.getC_data();

         c_new_data = c.getC_id() + " " + c_d_id + " " + c_w_id + " " + d_id + " " + w_id + " " + h_amount + " |";
         if (c_data.length() > c_new_data.length()) {
            c_new_data += c_data.substring(0, c_data.length() - c_new_data.length());
         } else {
            c_new_data += c_data;
         }

         if (c_new_data.length() > 500) c_new_data = c_new_data.substring(0, 500);

         c.setC_data(c_new_data);
         c.store(basicCache);
      } else {
         c.store(basicCache);
      }

      w_name = w.getW_name();
      d_name = d.getD_name();

      if (w_name.length() > 10) w_name = w_name.substring(0, 10);
      if (d_name.length() > 10) d_name = d_name.substring(0, 10);
      h_data = w_name + "    " + d_name;
View Full Code Here

Examples of org.radargun.stages.tpcc.domain.District

            log.info("Index:" + slaveIndex + "; Init:" + init_id_district + "; Num:" + num_of_districts);
         }
         for (int id_district = init_id_district; id_district <= (init_id_district - 1 + num_of_districts); id_district++) {
            log.info(" DISTRICT " + id_district);

            District newDistrict = new District(id_wharehouse,
                                                id_district,
                                                TpccTools.aleaChainec(6, 10),
                                                TpccTools.aleaChainec(10, 20),
                                                TpccTools.aleaChainec(10, 20),
                                                TpccTools.aleaChainec(10, 20),
                                                TpccTools.aleaChainel(2, 2),
                                                TpccTools.aleaChainen(4, 4) + TpccTools.CHAINE_5_1,
                                                TpccTools.aleaFloat(Float.valueOf("0.0000").floatValue(), Float.valueOf("0.2000").floatValue(), 4),
                                                TpccTools.WAREHOUSE_YTD,
                                                3001);

            boolean successful = false;
            while (!successful) {
               try {
                  newDistrict.store(basicCache);
                  successful = true;
               } catch (Throwable e) {
                  log.warn("Storing new district failed", e);
               }
            }
View Full Code Here

Examples of org.radargun.stages.tpcc.domain.District

      found = w.load(basicCache);
      if (!found) throw new ElementNotFoundException("W_ID=" + w_id + " not found!");


      District d = new District();
      // see clause 2.4.2.2 (dot 4)


      d.setD_id(d_id);
      d.setD_w_id(w_id);
      found = d.load(basicCache);
      if (!found) throw new ElementNotFoundException("D_ID=" + d_id + " D_W_ID=" + w_id + " not found!");


      o_id = d.getD_next_o_id();


      NewOrder no = new NewOrder(o_id, d_id, w_id);

      no.store(basicCache);

      d.setD_next_o_id(d.getD_next_o_id() + 1);

      d.store(basicCache);


      Order o = new Order(o_id, d_id, w_id, c_id, new Date(), -1, o_ol_cnt, o_all_local);

      o.store(basicCache);
View Full Code Here

Examples of quickdb.model.District

        System.out.println( (results2.size() == 0) );
    }

    public void testSaveObjectComposed() {
        Address a = new Address();
        District d = new District("district1");
        a.setStreet("false street 123");
        a.setIdDistrict(d);
        boolean value = admin.save(a);

        System.out.println(value);
View Full Code Here

Examples of quickdb.model.District

    }

    public void testSaveCollectionComposed() {
        ArrayList array = new ArrayList();
        Address a2 = new Address();
        District d2 = new District("district2");
        a2.setStreet("address 2");
        a2.setIdDistrict(d2);
        array.add(a2);

        Address a3 = new Address();
        District d3 = new District("district3");
        a3.setStreet("address 3");
        a3.setIdDistrict(d3);
        array.add(a3);

        admin.setCollection(true);
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.