コード例 #1
0
  /**
   * Tests the creation of the entity A.<br>
   *
   * <ul>
   *   <li>Step 1 : Create an entity
   *   <li>Step 2 : Search the entity and verify it exists
   * </ul>
   *
   * @throws DaoException if an unexpected DAO exception occurs.
   */
  public final void testCreateA() throws DaoException {
    // fill attributes with example values
    A a = getAExample();

    // Execute the tested code
    assobidimanytomanyDao.createA(a);

    // Verify result
    boolean found = false;
    for (A currentA : assobidimanytomanyDao.findAllAs()) {
      if (currentA.equals(a)) {
        found = true;
      }
    }
    Assert.assertTrue("A not created", found);
  }
コード例 #2
0
  /**
   * Test the modification of an entity A.<br>
   *
   * <ul>
   *   <li>Step 1 : Create an entity
   *   <li>Step 2 : Modify the entity
   *   <li>Step 3 : Search the entity and verify the modified values
   * </ul>
   *
   * @throws DaoException if an unexpected DAO exception occurs.
   */
  public final void testUpdateA() throws DaoException {
    // Initialized the test
    A a = getAExample();
    assobidimanytomanyDao.createA(a);

    // Execute the tested code
    assobidimanytomanyDao.updateA(a);

    // Verify result
    boolean found = false;
    for (A currentA : assobidimanytomanyDao.findAllAs()) {
      if (currentA.equals(a)) {
        found = true;
      }
    }
    Assert.assertTrue("A not found", found);
  }