You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gora.apache.org by al...@apache.org on 2018/01/18 17:52:21 UTC

[1/2] gora git commit: Setting dirty with value -1 (11111111b) instead of -128(1000000b) when calling setDirty()

Repository: gora
Updated Branches:
  refs/heads/master f028a548b -> e66d8cd80


Setting dirty with value -1 (11111111b) instead of -128(1000000b) when calling setDirty()


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/546a1c7d
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/546a1c7d
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/546a1c7d

Branch: refs/heads/master
Commit: 546a1c7d5d40f45e7ce2331255c1763a5b04579e
Parents: f028a54
Author: Alfonso Nishikawa Muñumer <al...@gmail.com>
Authored: Wed Jan 10 19:06:25 2018 -0100
Committer: Alfonso Nishikawa Muñumer <al...@gmail.com>
Committed: Wed Jan 10 19:06:25 2018 -0100

----------------------------------------------------------------------
 .../main/java/org/apache/gora/persistency/impl/PersistentBase.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/546a1c7d/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java
----------------------------------------------------------------------
diff --git a/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java b/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java
index 15022fc..3ecb725 100644
--- a/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java
+++ b/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java
@@ -159,7 +159,7 @@ public abstract class PersistentBase extends SpecificRecordBase implements
     ByteBuffer dirtyBytes = getDirtyBytes();
     assert (dirtyBytes.position() == 0);
     for (int i = 0; i < dirtyBytes.limit(); i++) {
-      dirtyBytes.put(i, (byte) -128);
+      dirtyBytes.put(i, (byte) -1);
     }
   }
 


[2/2] gora git commit: Tests for GORA-421, fixing setDirty()

Posted by al...@apache.org.
Tests for GORA-421, fixing setDirty()


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/e66d8cd8
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/e66d8cd8
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/e66d8cd8

Branch: refs/heads/master
Commit: e66d8cd80c0fd29925050aec9ff96095617dd076
Parents: 546a1c7
Author: Alfonso Nishikawa Muñumer <al...@gmail.com>
Authored: Thu Jan 11 08:40:20 2018 -0100
Committer: Alfonso Nishikawa Muñumer <al...@gmail.com>
Committed: Thu Jan 11 08:40:20 2018 -0100

----------------------------------------------------------------------
 .../gora/persistency/impl/TestPersistentBase.java   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/e66d8cd8/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
----------------------------------------------------------------------
diff --git a/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java b/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
index cae635b..1a9374e 100644
--- a/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
+++ b/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
@@ -153,4 +153,20 @@ public class TestPersistentBase {
     
     assertEquals(employee, Employee.newBuilder(employee).build());
   }
+  
+  /**
+   * Test that #setDirty() sets all the shallow fields dirty.
+   * GORA-421
+   */
+  @Test
+  public void testSetDirty() {
+    WebPage page = WebPage.newBuilder().build();
+    assertEquals("Expected the new Persistent instance to not be dirty.", false, page.isDirty()) ;
+    page.setDirty();
+    
+    // Assert each field is dirty
+    for (Field field : page.getSchema().getFields()) {
+      assertEquals("The field " + field.name() + " is not dirty.", true, page.isDirty(field.name()));
+    }
+  }
 }