/** * Creates a second example of Class_Many_01 with other values. * * @return Returns a new instance of class Class_Many_01 with fields filled with other test * values. * @throws DaoException if an unexpected DAO exception occurs. */ protected ClassMany01 getClassMany01Example2() throws DaoException { // fill attributes with example values ClassMany01 classMany01 = new ClassMany01(); classMany01.setFakeAttr(new Float(725185254.0)); return classMany01; }
/** * Test the modification of an entity Class_Many_01.<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 testUpdateClassMany01() throws DaoException { // Initialized the test ClassMany01 classMany01 = getClassMany01Example(); classMany01Dao.createClassMany01(classMany01); // Execute the tested code classMany01.setFakeAttr(new Float(725185254.0)); classMany01Dao.updateClassMany01(classMany01); // Verify result boolean found = false; for (ClassMany01 currentClassMany01 : classMany01Dao.findAllClassMany01s()) { if (currentClassMany01.equals(classMany01)) { found = true; Assert.assertEquals( "Value fakeAttr not modified", new Float(725185254.0), classMany01.getFakeAttr()); } } Assert.assertTrue("ClassMany01 not found", found); }