8265019: Update tests for additional TestNG test permissions
Reviewed-by: naoto, bpb, alanb
This commit is contained in:
parent
7e4cd48020
commit
ffb3771816
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
import java.io.FilePermission;
|
import java.io.FilePermission;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.ReflectPermission;
|
||||||
import java.security.CodeSource;
|
import java.security.CodeSource;
|
||||||
import java.security.Permission;
|
import java.security.Permission;
|
||||||
import java.security.PermissionCollection;
|
import java.security.PermissionCollection;
|
||||||
@ -205,14 +206,19 @@ class TestPolicy extends Policy {
|
|||||||
permissions.add(new RuntimePermission("getClassLoader"));
|
permissions.add(new RuntimePermission("getClassLoader"));
|
||||||
permissions.add(new RuntimePermission("setSecurityManager"));
|
permissions.add(new RuntimePermission("setSecurityManager"));
|
||||||
permissions.add(new RuntimePermission("createSecurityManager"));
|
permissions.add(new RuntimePermission("createSecurityManager"));
|
||||||
permissions.add(new PropertyPermission("testng.show.stack.frames",
|
|
||||||
"read"));
|
|
||||||
permissions.add(new PropertyPermission("user.dir", "read"));
|
permissions.add(new PropertyPermission("user.dir", "read"));
|
||||||
permissions.add(new PropertyPermission("test.src", "read"));
|
permissions.add(new PropertyPermission("test.src", "read"));
|
||||||
permissions.add(new PropertyPermission("file.separator", "read"));
|
permissions.add(new PropertyPermission("file.separator", "read"));
|
||||||
permissions.add(new PropertyPermission("line.separator", "read"));
|
permissions.add(new PropertyPermission("line.separator", "read"));
|
||||||
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
|
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
|
||||||
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
|
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.show.stack.frames",
|
||||||
|
"read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.thread.affinity", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.mode.dryrun", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.report.xml.name", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.timezone", "read"));
|
||||||
|
permissions.add(new ReflectPermission("suppressAccessChecks"));
|
||||||
permissions.add(new FilePermission("<<ALL FILES>>", "execute"));
|
permissions.add(new FilePermission("<<ALL FILES>>", "execute"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -23,6 +23,7 @@
|
|||||||
package util;
|
package util;
|
||||||
|
|
||||||
import java.io.FilePermission;
|
import java.io.FilePermission;
|
||||||
|
import java.lang.reflect.ReflectPermission;
|
||||||
import java.security.AllPermission;
|
import java.security.AllPermission;
|
||||||
import java.security.CodeSource;
|
import java.security.CodeSource;
|
||||||
import java.security.Permission;
|
import java.security.Permission;
|
||||||
@ -102,12 +103,17 @@ public class TestPolicy extends Policy {
|
|||||||
permissions.add(new RuntimePermission("getClassLoader"));
|
permissions.add(new RuntimePermission("getClassLoader"));
|
||||||
permissions.add(new RuntimePermission("setSecurityManager"));
|
permissions.add(new RuntimePermission("setSecurityManager"));
|
||||||
permissions.add(new RuntimePermission("createSecurityManager"));
|
permissions.add(new RuntimePermission("createSecurityManager"));
|
||||||
permissions.add(new PropertyPermission("testng.show.stack.frames",
|
|
||||||
"read"));
|
|
||||||
permissions.add(new PropertyPermission("line.separator", "read"));
|
permissions.add(new PropertyPermission("line.separator", "read"));
|
||||||
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
|
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
|
||||||
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
|
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
|
||||||
permissions.add(new PropertyPermission("java.io.tmpdir", "read"));
|
permissions.add(new PropertyPermission("java.io.tmpdir", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.show.stack.frames",
|
||||||
|
"read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.thread.affinity", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.mode.dryrun", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.report.xml.name", "read"));
|
||||||
|
permissions.add(new PropertyPermission("testng.timezone", "read"));
|
||||||
|
permissions.add(new ReflectPermission("suppressAccessChecks"));
|
||||||
permissions.add(new FilePermission("<<ALL FILES>>",
|
permissions.add(new FilePermission("<<ALL FILES>>",
|
||||||
"read, write, delete"));
|
"read, write, delete"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user