This is an automated email from the ASF dual-hosted git repository.

zyxxoo pushed a commit to branch refactor/rust-rewrite-design
in repository https://gitbox.apache.org/repos/asf/hugegraph.git


The following commit(s) were added to refs/heads/refactor/rust-rewrite-design 
by this push:
     new 868ea9f03 test(snapshot): cover deprecated handler checksum
868ea9f03 is described below

commit 868ea9f0399701223d42c4122a1ae132e121993f
Author: vaughn <[email protected]>
AuthorDate: Sun Sep 13 16:28:38 2026 +0800

    test(snapshot): cover deprecated handler checksum
---
 .../hugegraph/store/core/snapshot/SnapshotHandlerTest.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git 
a/hugegraph-store/hg-store-test/src/main/java/org/apache/hugegraph/store/core/snapshot/SnapshotHandlerTest.java
 
b/hugegraph-store/hg-store-test/src/main/java/org/apache/hugegraph/store/core/snapshot/SnapshotHandlerTest.java
index 9b44612b6..a06fba969 100644
--- 
a/hugegraph-store/hg-store-test/src/main/java/org/apache/hugegraph/store/core/snapshot/SnapshotHandlerTest.java
+++ 
b/hugegraph-store/hg-store-test/src/main/java/org/apache/hugegraph/store/core/snapshot/SnapshotHandlerTest.java
@@ -31,6 +31,7 @@ import org.apache.commons.io.FileUtils;
 import org.apache.hugegraph.store.core.StoreEngineTestBase;
 import org.apache.hugegraph.store.meta.Partition;
 import org.apache.hugegraph.store.snapshot.SnapshotHandler;
+import org.apache.hugegraph.store.snapshot.HgSnapshotHandler;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -222,4 +223,17 @@ public class SnapshotHandlerTest extends 
StoreEngineTestBase {
         String after = (String) method.invoke(hgSnapshotHandlerUnderTest, 
file.getPath());
         assertNotEquals(before, after);
     }
+
+    @Test
+    public void testDeprecatedHandlerChecksumChangesWhenModified() throws 
Exception {
+        File file = new File("/tmp/snapshot/deprecated-checksum.sst");
+        FileUtils.writeByteArrayToFile(file, "before".getBytes("UTF-8"));
+        Method method = 
HgSnapshotHandler.class.getDeclaredMethod("calculateChecksum", String.class);
+        method.setAccessible(true);
+        HgSnapshotHandler handler = new 
HgSnapshotHandler(createPartitionEngine(1));
+        String before = (String) method.invoke(handler, file.getPath());
+        FileUtils.writeByteArrayToFile(file, "after".getBytes("UTF-8"));
+        String after = (String) method.invoke(handler, file.getPath());
+        assertNotEquals(before, after);
+    }
 }

Reply via email to