alievmirza commented on a change in pull request #160:
URL: https://github.com/apache/ignite-3/pull/160#discussion_r649261668



##########
File path: 
modules/vault/src/test/java/org/apache/ignite/internal/vault/impl/VaultBaseContractsTest.java
##########
@@ -147,52 +142,44 @@ public void range() throws ExecutionException, 
InterruptedException {
     }
 
     /**
-     * watch contract.
+     * putAll with applied revision contract.
      */
     @Test
-    public void watch() throws ExecutionException, InterruptedException {
-        ByteArray key;
-
-        Map<ByteArray, byte[]> values = new HashMap<>();
-
-        for (int i = 0; i < 10; i++) {
-            key = getKey(i);
+    public void putAllAndRevision() throws ExecutionException, 
InterruptedException, IgniteInternalCheckedException {
+        Map<ByteArray, byte[]> entries = new HashMap<>();
 
-            values.put(key, getValue(key, i));
-        }
+        int entriesNum = 100;
 
-        values.forEach((k, v) -> vaultManager.put(k, v));
+        ByteArray appRevKey = ByteArray.fromString("test_applied_revision");
 
-        for (Map.Entry<ByteArray, byte[]> entry : values.entrySet())
-            assertEquals(entry.getValue(), 
vaultManager.get(entry.getKey()).get().value());
+        for (int i = 0; i < entriesNum; i++) {
+            ByteArray key = getKey(i);
 
-        CountDownLatch counter = new CountDownLatch(4);
+            entries.put(key, getValue(key, i));
+        }
 
-        VaultWatch vaultWatch = new VaultWatch(getKey(3), getKey(7), new 
VaultListener() {
-            @Override public boolean onUpdate(@NotNull Iterable<Entry> 
entries) {
-                counter.countDown();
+        for (int i = 0; i < entriesNum; i++) {
+            ByteArray key = getKey(i);
 
-                return true;
-            }
+            assertNull(vaultManager.get(key).get().value());
+        }
 
-            @Override public void onError(@NotNull Throwable e) {
-                // no-op
-            }
-        });
+        vaultManager.putAll(entries, appRevKey, 1L);
 
-        vaultManager.watch(vaultWatch);
+        for (int i = 0; i < entriesNum; i++) {
+            ByteArray key = getKey(i);
 
-        for (int i = 3; i < 7; i++)
-            vaultManager.put(getKey(i), ("new" + i).getBytes());
+            assertEquals(entries.get(key), 
vaultManager.get(key).get().value());

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to