You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/06/05 08:03:49 UTC

[GitHub] [ignite] dgarus commented on a change in pull request #7897: IGNITE-13112 CacheEvent#subjectId is always null for cache events with types EVT_CACHE_STARTED and EVT_CACHE_STOPPED

dgarus commented on a change in pull request #7897:
URL: https://github.com/apache/ignite/pull/7897#discussion_r435755821



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/security/events/AbstractSecurityCacheEventTest.java
##########
@@ -0,0 +1,203 @@
+/*
+ * 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.internal.processors.security.events;
+
+import com.google.common.collect.Iterators;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.events.CacheEvent;
+import org.apache.ignite.events.Event;
+import org.apache.ignite.events.EventType;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.processors.security.AbstractSecurityTest;
+import org.apache.ignite.lang.IgniteBiPredicate;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.plugin.security.SecuritySubject;
+
+import static org.apache.ignite.events.EventType.EVT_CACHE_STOPPED;
+
+/**
+ * Abstract class to test correctness of {@link CacheEvent#subjectId}.
+ */
+@SuppressWarnings("rawtypes")
+public abstract class AbstractSecurityCacheEventTest extends AbstractSecurityTest {
+    /** Counter. */
+    protected static final AtomicInteger COUNTER = new AtomicInteger();
+
+    /** Node that registers event listeners. */
+    private static final String LISTENER_NODE = "listener_node";
+
+    /** Events latch. */
+    private static volatile CountDownLatch evtsLatch;
+
+    /** Logins in remote filters. */
+    private static final Collection<String> rmtLogins = new ConcurrentLinkedQueue<>();

Review comment:
       To get as much information as possible about the failure. A failure message will contain info about all logins inside predicates.




----------------------------------------------------------------
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:
users@infra.apache.org