File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
src/test/kotlin/kotlinx/coroutines/experimental Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 37
37
<sourceDirectory >src/main/kotlin</sourceDirectory >
38
38
<testSourceDirectory >src/test/kotlin</testSourceDirectory >
39
39
40
+
40
41
<plugins >
41
42
<plugin >
42
43
<artifactId >maven-surefire-plugin</artifactId >
49
50
<configuration >
50
51
<forkMode >once</forkMode >
51
52
<jvm >${env.JDK_16} /bin/java</jvm >
52
- <argLine >-ea -Xmx1g -Xms1g</argLine >
53
+ <argLine >-ea -Xmx1g -Xms1g -Djava.security.manager=kotlinx.coroutines.experimental.TestSecurityManager </argLine >
53
54
</configuration >
54
55
</execution >
55
56
</executions >
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2016-2017 JetBrains s.r.o.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package kotlinx.coroutines.experimental
18
+
19
+ import java.security.Permission
20
+
21
+ class TestSecurityManager : SecurityManager () {
22
+ override fun checkPropertyAccess (key : String? ) {
23
+ if (key?.startsWith(" kotlinx." ) == true )
24
+ throw SecurityException (" '$key ' property is not allowed" )
25
+ }
26
+
27
+ override fun checkPermission (perm : Permission ? ) {
28
+ /* allow everything else */
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments