maksaska commented on code in PR #12128:
URL: https://github.com/apache/ignite/pull/12128#discussion_r2157330773


##########
modules/core/src/test/java/org/apache/ignite/client/ClientOrderedCollectionWarnTest.java:
##########
@@ -0,0 +1,218 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import javax.cache.processor.EntryProcessor;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.LogListener;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.TransactionConcurrency;
+import org.apache.ignite.transactions.TransactionIsolation;
+import org.junit.Test;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
+import static 
org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
+import static 
org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
+import static org.apache.ignite.transactions.TransactionIsolation.SERIALIZABLE;
+
+/** */
+public class ClientOrderedCollectionWarnTest extends GridCommonAbstractTest {
+    /** */
+    private static final String WARN_LSNR_MSG = "Unordered %s java.util."; //
+
+    /** */
+    private static final LogListener MAP_WARN_LSNR =
+        LogListener.matches(String.format(WARN_LSNR_MSG, 
"map")).times(1).build();
+
+    /** */
+    private static final LogListener SET_WARN_LSNR =
+        LogListener.matches(String.format(WARN_LSNR_MSG, 
"collection")).times(1).build();
+
+    /** */
+    private final ListeningTestLogger testLog = new ListeningTestLogger(log);
+
+    /** */
+    private static IgniteEx ign;
+
+    /** */
+    private static IgniteClient cli;
+
+    /** */
+    private static ClientCache<Long, Long> cache;
+
+    /** */
+    @Override protected IgniteConfiguration getConfiguration(String 
instanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(instanceName);
+
+        testLog.registerListener(MAP_WARN_LSNR);
+        testLog.registerListener(SET_WARN_LSNR);
+
+        cfg.setGridLogger(testLog);
+
+        return cfg;
+    }
+
+    /** */
+    private ClientConfiguration getClientConfiguration() {
+        return new 
ClientConfiguration().setAddresses(Config.SERVER).setLogger(testLog);
+    }
+
+    /** */
+    private ClientCacheConfiguration getClientClientConfiguration() {
+        return new ClientCacheConfiguration()
+            .setName(DEFAULT_CACHE_NAME)
+            .setAtomicityMode(TRANSACTIONAL);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        ign = startGrid();
+        cli = Ignition.startClient(getClientConfiguration());
+
+        cache = cli.getOrCreateCache(getClientClientConfiguration());
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        ign.close();
+        cli.close();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        MAP_WARN_LSNR.reset();
+        SET_WARN_LSNR.reset();
+    }
+
+    /** */
+    @Test
+    public void putAll() throws Exception {
+        Runnable cacheOpTreeMap = () -> cache.putAll(fillMap(new TreeMap<>()));
+        Runnable cacheOpHashMap = () -> cache.putAll(fillMap(new HashMap<>()));
+
+        testOp(cacheOpTreeMap, cacheOpHashMap, MAP_WARN_LSNR);
+    }
+
+    /** */
+    @Test
+    public void invokeAll() throws Exception {
+        Runnable cacheOpTreeSet = () -> cache.invokeAll(fillSet(new 
TreeSet<>()), new TestEntryProcessor());
+        Runnable cacheOpHashSet = () -> cache.invokeAll(fillSet(new 
HashSet<>()), new TestEntryProcessor());
+
+        testOp(cacheOpTreeSet, cacheOpHashSet, SET_WARN_LSNR);
+    }
+
+    /** */
+    @Test
+    public void testRemoveAll() throws Exception {
+        Runnable cacheOpTreeSet = () -> cache.removeAll(fillSet(new 
TreeSet<>()));
+        Runnable cacheOpHashSet = () -> cache.removeAll(fillSet(new 
HashSet<>()));
+
+        testOp(cacheOpTreeSet, cacheOpHashSet, SET_WARN_LSNR);
+    }
+
+    /** */
+    @Test
+    public void testGetAll() throws Exception {
+        Runnable cacheOpTreeSet = () -> cache.removeAll(fillSet(new 
TreeSet<>()));

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.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to