Ejemplo n.º 1
0
  /**
   * Test the modification of an entity TABLE.<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 testUpdateTABLE() throws DaoException {
    // Initialized the test
    TABLE tABLE = getTABLEExample();
    tABLEDao.createTABLE(tABLE);

    // Execute the tested code
    tABLE.setCOLUMN(new Integer(1993459542));
    tABLE.setPRIMARYKEY(new Integer(1284802305));
    tABLEDao.updateTABLE(tABLE);

    // Verify result
    boolean found = false;
    for (TABLE currentTABLE : tABLEDao.findAllTABLEs()) {
      if (currentTABLE.equals(tABLE)) {
        found = true;
        Assert.assertEquals(
            "Value cOLUMN not modified", new Integer(1993459542), tABLE.getCOLUMN());
        Assert.assertEquals(
            "Value pRIMARYKEY not modified", new Integer(1284802305), tABLE.getPRIMARYKEY());
      }
    }
    Assert.assertTrue("TABLE not found", found);
  }