You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2014/03/08 19:48:36 UTC
svn commit: r1575589 - in
/ofbiz/trunk/framework/entity/src/org/ofbiz/entity: GenericEntity.java
test/EntityTestSuite.java
Author: adrianc
Date: Sat Mar 8 18:48:35 2014
New Revision: 1575589
URL: http://svn.apache.org/r1575589
Log:
GenericEntity.java bug fix, updated the unit tests.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java?rev=1575589&r1=1575588&r2=1575589&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java Sat Mar 8 18:48:35 2014
@@ -301,7 +301,7 @@ public class GenericEntity implements Ma
*/
public void removedFromDatasource() {
assertIsMutable();
- this.hasChanged();
+ this.clearChanged();
this.setImmutable();
}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=1575589&r1=1575588&r2=1575589&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Sat Mar 8 18:48:35 2014
@@ -95,7 +95,9 @@ public class EntityTestSuite extends Ent
*/
public void testMakeValue() throws Exception {
// This method call directly stores a new value into the entity engine
- delegator.create("TestingType", "testingTypeId", "TEST-1", "description", "Testing Type #1");
+ GenericValue createdValue = delegator.create("TestingType", "testingTypeId", "TEST-1", "description", "Testing Type #1");
+ assertTrue("Created value is mutable", createdValue.isMutable());
+ assertFalse("Observable has not changed", createdValue.hasChanged());
// This sequence creates the GenericValue entities first, puts them in a List, then calls the delegator to store them all
List<GenericValue> newValues = new LinkedList<GenericValue>();
@@ -142,6 +144,7 @@ public class EntityTestSuite extends Ent
GenericValue testValue = delegator.findOne("TestingType", false, "testingTypeId", "TEST-4");
assertEquals("Retrieved value has the correct description", "Testing Type #4", testValue.getString("description"));
testValue.remove();
+ assertFalse("Observable has not changed", testValue.hasChanged());
// Test immutable
try {
testValue.put("description", "New Testing Type #4");