hwanju commented on a change in pull request #14499: URL: https://github.com/apache/flink/pull/14499#discussion_r555766406
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/security/FlinkSecurityManagerTest.java ########## @@ -0,0 +1,415 @@ +/* + * 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.flink.runtime.security; + +import org.apache.flink.configuration.ClusterOptions; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.configuration.IllegalConfigurationException; +import org.apache.flink.core.testutils.CheckedThread; +import org.apache.flink.runtime.UserSystemExitException; +import org.apache.flink.util.TestLogger; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.security.Permission; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicInteger; + +import static org.apache.flink.core.testutils.CommonTestUtils.assertThrows; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** Tests for {@code FlinkUserSecurityManager}. */ +public class FlinkSecurityManagerTest extends TestLogger { + + private static final int TEST_EXIT_CODE = 123; + SecurityManager originalSecurityManager; + FlinkSecurityManager flinkSecurityManager; Review comment: I've put it to member as it's almost certainly used for every test for convenience. (Actually it's a bit historical reason that I initialized it to THROW as most tests (before 2nd revision) are with THROW but now it's not initialized). Do you prefer local to member in this case? ---------------------------------------------------------------- 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: us...@infra.apache.org