コード例 #1
0
  /**
   * Test method for {@link
   * in.solpro.nucleus.apps.core.dbhelper.CompanyHelper#addCompany(in.solpro.nucleus.apps.common.Company)}.
   */
  public void testAddPartyAddress() {
    PartyAddress partyaddress = new PartyAddress();
    partyaddress.setContactperson("TEST PERSON");
    partyaddress.setCity(city);
    partyaddress.setParty(party);
    // partyaddress.addParty( party );
    partyaddress.setType(addresstype);
    try {
      new PartyAddressHelper().addPartyAddress(partyaddress);
    } catch (Exception e) {
      fail();
    }

    List<PartyAddress> list = (List<PartyAddress>) party.getAddressList();
    for (int i = 0; i < list.size(); i++) System.out.println("" + list.get(i).getCity().getName());
  }
コード例 #2
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    ledgergroup = new LedgerGroup();
    ledgergroup.setName("Test LedgerGroup");
    ledgergroup.setType(LedgerGroupType.EXPENSES);
    new LedgerGroupHelper().addLedgerGroup(ledgergroup);
    negledgergroup = new LedgerGroup();
    negledgergroup.setName("Test NegLedgerGroup");
    negledgergroup.setType(LedgerGroupType.EXPENSES);
    SessionUtil.setCompany(companyNegTest);
    new LedgerGroupHelper().addLedgerGroup(negledgergroup);
    SessionUtil.setCompany(company);

    party = new Party();
    party.setName("Test Party");
    party.setLedgergroup(ledgergroup);
    new PartyHelper().addParty(party);
    negparty = new Party();
    negparty.setName("Test negParty");
    negparty.setLedgergroup(negledgergroup);
    SessionUtil.setCompany(companyNegTest);
    new PartyHelper().addParty(negparty);
    SessionUtil.setCompany(company);

    addresstype = new AddressType();
    addresstype.setName("Test AddressType");
    new AddressTypeHelper().addAddressType(addresstype);
    negaddresstype = new AddressType();
    negaddresstype.setName("Test negAddressType");
    SessionUtil.setCompany(companyNegTest);
    new AddressTypeHelper().addAddressType(negaddresstype);
    SessionUtil.setCompany(company);

    country = new Country();
    country.setName("TEST COUNTRY");
    new CountryHelper().addCountry(country);
    negcountry = new Country();
    negcountry.setName("NEG TEST COUNTRY");
    SessionUtil.setCompany(companyNegTest);
    new CountryHelper().addCountry(negcountry);
    SessionUtil.setCompany(company);

    state = new State();
    state.setName("Test State");
    state.setCountry(country);
    new StateHelper().addState(state);
    negstate = new State();
    negstate.setName("NEG Test State");
    negstate.setCountry(negcountry);
    SessionUtil.setCompany(companyNegTest);
    new StateHelper().addState(negstate);
    SessionUtil.setCompany(company);

    district = new District();
    district.setName("Test District");
    district.setState(state);
    new DistrictHelper().addDistrict(district);
    negdistrict = new District();
    negdistrict.setName("NEG Test District");
    negdistrict.setState(negstate);
    SessionUtil.setCompany(companyNegTest);
    new DistrictHelper().addDistrict(negdistrict);
    SessionUtil.setCompany(company);

    city = new City();
    city.setName("TEST CITY");
    city.setDistrict(district);
    new CityHelper().addCity(city);
    negcity = new City();
    negcity.setName("TEST negCITY");
    negcity.setDistrict(negdistrict);
    new CityHelper().addCity(negcity);
  }