コード例 #1
0
  protected void setUp() throws Exception {
    Log.log("TEST", "[" + getClassName() + ".setUp] Enter ");
    // do all your test environment initialisation here ....

    /** @todo initialise test data from test input file */
    PartnerTestHelper helper = (PartnerTestHelper) getEntityTestHelper();

    // prepare dependent embedded entity
    PartnerType partnerType = new PartnerType();
    partnerType.setName(PARTNER_TYPE);
    partnerType.setDescription(PARTNER_TYPE_DESCR);
    partnerType = helper.createPartnerType(partnerType);

    PartnerGroup partnerGroup = new PartnerGroup();
    partnerGroup.setName(PARTNER_GROUP);
    partnerGroup.setDescription(PARTNER_GROUP_DESCR);
    partnerGroup.setPartnerType(partnerType);
    partnerGroup = helper.createPartnerGroup(partnerGroup);

    // initialise default test data in test data set
    Partner entity = null;
    entity = new Partner();
    entity.setPartnerID(PARTNER_ID);
    entity.setName(NAME);
    entity.setDescription(DESCRIPTION);
    entity.setPartnerType(partnerType);
    entity.setPartnerGroup(partnerGroup);
    entity.setState(STATE);
    putTestData(DEFAULT_TESTDATA, entity);
    Log.log("TEST", "[" + getClassName() + ".setUp] Exit");
  }
コード例 #2
0
  protected void assertOnNormalCreate() throws Exception {
    PartnerTestHelper helper = (PartnerTestHelper) getEntityTestHelper();
    _entity = (Partner) helper.getByPartnerID(PARTNER_ID);
    assertNotNull("Null Record", _entity);
    assertEquals("Mismatch Partner ID", PARTNER_ID, _entity.getPartnerID());
    assertEquals("Mismatch Name", NAME, _entity.getName());
    assertEquals("Mismatch Description", DESCRIPTION, _entity.getDescription());
    assertEquals("Mismatch State", STATE, _entity.getState());

    // assert Partner Type info
    PartnerType partnerType = _entity.getPartnerType();
    assertEquals("Mismatch Partner Type", PARTNER_TYPE, partnerType.getName());

    // assert Partner Group info
    PartnerGroup partnerGroup = _entity.getPartnerGroup();
    assertEquals("Mismatch Partner Group", PARTNER_GROUP, partnerGroup.getName());
  }