Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8267184: Add -Djava.security.manager=allow to tests calling System.setSecurityManager #4071

Closed
wants to merge 20 commits into from
Closed
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author Tom Rodriguez
*
* @modules java.rmi
* @run main compiler.exceptions.ExceptionInInit
* @run main/othervm -Djava.security.manager=allow compiler.exceptions.ExceptionInInit
*/

package compiler.exceptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@
* NO_SEC_MAN
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -XX:+EnableJVMCI
* -Djava.security.manager=allow
* compiler.jvmci.SecurityRestrictionsTest
* NO_PERM
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -XX:+EnableJVMCI
* -Djava.security.manager=allow
* compiler.jvmci.SecurityRestrictionsTest
* ALL_PERM
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -XX:+EnableJVMCI -XX:-UseJVMCICompiler
* -Djava.security.manager=allow
* compiler.jvmci.SecurityRestrictionsTest
* NO_JVMCI_ACCESS_PERM
* @run main/othervm -XX:+UnlockExperimentalVMOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static void main(String args[]) throws Exception {
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI",
"-Xbootclasspath/a:.",
"-Djava.security.manager=allow",
Test.class.getName());
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("protection domain added");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static void main(String... args) throws Exception {
// -Xlog:protectiondomain=trace
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=trace",
"-Xmx128m",
"-Djava.security.manager=allow",
Hello.class.getName(), "security_manager");
new OutputAnalyzer(pb.start())
.shouldHaveExitValue(0)
Expand All @@ -49,6 +50,7 @@ public static void main(String... args) throws Exception {
// -Xlog:protectiondomain=debug
pb = ProcessTools.createJavaProcessBuilder("-Xlog:protectiondomain=debug",
"-Xmx128m",
"-Djava.security.manager=allow",
Hello.class.getName(), "security_manager");
new OutputAnalyzer(pb.start())
.shouldHaveExitValue(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
*
* @library /vmTestbase
* /test/lib
* @run main/othervm -Xlog:gc=debug:gc.log gc.ArrayJuggle.Juggle01.Juggle01 -gp charArr -ms medium
* @run main/othervm -Xlog:gc=debug:gc.log -Djava.security.manager=allow gc.ArrayJuggle.Juggle01.Juggle01 -gp charArr -ms medium
*/

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.CatalogReferCircularityTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.CatalogReferCircularityTest
* @run testng/othervm catalog.CatalogReferCircularityTest
* @summary Via nextCatalog entry, the catalog reference chain may be
* a (partial) closed circuit. For instance, a catalog may use itself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DefaultFeaturesTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.DefaultFeaturesTest
* @run testng/othervm catalog.DefaultFeaturesTest
* @summary This case tests if the default feature values are expected.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* @bug 8077931 8176405
* @library /javax/xml/jaxp/libs
* @modules java.xml/javax.xml.catalog:open
* @run testng/othervm -DrunSecMngr=true catalog.DeferFeatureTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.DeferFeatureTest
* @run testng/othervm catalog.DeferFeatureTest
* @summary This case tests whether the catalogs specified in delegateSystem,
* delegatePublic, delegateURI and nextCatalog entries are used lazily
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DelegatePublicTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.DelegatePublicTest
* @run testng/othervm catalog.DelegatePublicTest
* @summary Get matched URIs from DelegatePublic entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DelegateSystemTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.DelegateSystemTest
* @run testng/othervm catalog.DelegateSystemTest
* @summary Get matched URIs from delegateSystem entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DelegateUriTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.DelegateUriTest
* @run testng/othervm catalog.DelegateUriTest
* @summary Get matched URIs from delegateURI entries.
*/
Expand Down
2 changes: 1 addition & 1 deletion test/jaxp/javax/xml/jaxp/functional/catalog/GroupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.GroupTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.GroupTest
* @run testng/othervm catalog.GroupTest
* @summary Get matched URIs from system, public and uri entries respectively,
* and some of the entries are enclosed by group entries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.LoadCatalogTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.LoadCatalogTest
* @run testng/othervm catalog.LoadCatalogTest
* @summary When catalog resolver loads catalog files, the current catalog file
* and the catalog files specified by the nextCatalog entries may not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.NextCatalogTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.NextCatalogTest
* @run testng/othervm catalog.NextCatalogTest
* @summary Get matched URIs from system, public and uri entries respectively,
* but some of the entries are defined in none-current catalog files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.NormalizationTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.NormalizationTest
* @run testng/othervm catalog.NormalizationTest
* @summary Before matching identifiers and URI references, it has to normalize
* the passed identifiers and URI references. And then the catalog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PreferFeatureTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.PreferFeatureTest
* @run testng/othervm catalog.PreferFeatureTest
* @summary This case tests how does the feature affect the catalog resolution,
* and tests the priority between this feature and attribute prefer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PreferTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.PreferTest
* @run testng/othervm catalog.PreferTest
* @summary Get matched URIs from system and public family entries, which
* specify the prefer attribute. It tests how does the prefer attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PublicFamilyTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.PublicFamilyTest
* @run testng/othervm catalog.PublicFamilyTest
* @summary Get matched URIs from public and delegatePublic entries.
* It tests the resolution priorities among the public family entries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PublicTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.PublicTest
* @run testng/othervm catalog.PublicTest
* @summary Get matched URIs from public entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.ResolveFeatureTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.ResolveFeatureTest
* @run testng/othervm catalog.ResolveFeatureTest
* @summary This case tests how does resolve feature affect the catalog
* resolution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.RewriteSystemTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.RewriteSystemTest
* @run testng/othervm catalog.RewriteSystemTest
* @summary Get matched URIs from rewriteSystem entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.RewriteUriTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.RewriteUriTest
* @run testng/othervm catalog.RewriteUriTest
* @summary Get matched URIs from rewriteURI entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SpecifyCatalogTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.SpecifyCatalogTest
* @run testng/othervm catalog.SpecifyCatalogTest
* @summary This case tests how to specify the catalog files.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SystemFamilyTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.SystemFamilyTest
* @run testng/othervm catalog.SystemFamilyTest
* @summary Get matched URIs from system, rewriteSystem, systemSuffix and
* delegateSystem entries. It tests the resolution priorities among
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SystemSuffixTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.SystemSuffixTest
* @run testng/othervm catalog.SystemSuffixTest
* @summary Get matched URIs from systemSuffix entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SystemTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.SystemTest
* @run testng/othervm catalog.SystemTest
* @summary Get matched URIs from system entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UriFamilyTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.UriFamilyTest
* @run testng/othervm catalog.UriFamilyTest
* @summary Get matched URIs from uri, rewriteURI, uriSuffix and delegateURI
* entries. It tests the resolution priorities among the uri family
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UriSuffixTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.UriSuffixTest
* @run testng/othervm catalog.UriSuffixTest
* @summary Get matched URIs from rewriteURI entries.
*/
Expand Down
2 changes: 1 addition & 1 deletion test/jaxp/javax/xml/jaxp/functional/catalog/UriTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UriTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.UriTest
* @run testng/othervm catalog.UriTest
* @summary Get matched URIs from uri entries.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UrnUnwrappingTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.UrnUnwrappingTest
* @run testng/othervm catalog.UrnUnwrappingTest
* @summary If the passed public identifier is started with "urn:publicid:",
* it has to be regarded as URN and normalized. And then the catalog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @test
* @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.ValidateCatalogTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow catalog.ValidateCatalogTest
* @run testng/othervm catalog.ValidateCatalogTest
* @summary A legal catalog file must be well-formed XML, the root element
* must be catalog, and the naming space of the root element must be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.DurationTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.datatype.ptests.DurationTest
* @run testng/othervm javax.xml.datatype.ptests.DurationTest
* @summary Class containing the test cases for Duration.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @test
* @bug 8169778
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.FactoryNewInstanceTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.datatype.ptests.FactoryNewInstanceTest
* @run testng/othervm javax.xml.datatype.ptests.FactoryNewInstanceTest
* @summary Tests for DatatypeFactory.newInstance(factoryClassName , classLoader)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* @test
* @bug 5049592 5041845 5048932 5064587 5040542 5049531 5049528
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.XMLGregorianCalendarTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.datatype.ptests.XMLGregorianCalendarTest
* @run testng/othervm javax.xml.datatype.ptests.XMLGregorianCalendarTest
* @summary Class containing the test cases for XMLGregorianCalendar
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DBFNamespaceTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.DBFNamespaceTest
* @run testng/othervm javax.xml.parsers.ptests.DBFNamespaceTest
*/
@Listeners({jaxp.library.FilePolicy.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DocumentBuilderFactoryTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.DocumentBuilderFactoryTest
* @run testng/othervm javax.xml.parsers.ptests.DocumentBuilderFactoryTest
*/
@Listeners({jaxp.library.FilePolicy.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DocumentBuilderImpl01
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.DocumentBuilderImpl01
* @run testng/othervm javax.xml.parsers.ptests.DocumentBuilderImpl01
*/
@Listeners({jaxp.library.FilePolicy.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.FactoryConfErrorTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.FactoryConfErrorTest
* @run testng/othervm javax.xml.parsers.ptests.FactoryConfErrorTest
*/
@Listeners({jaxp.library.BasePolicy.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXFactoryNewInstanceTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.SAXFactoryNewInstanceTest
* @run testng/othervm javax.xml.parsers.ptests.SAXFactoryNewInstanceTest
* @summary Tests for SAXParserFactory.newInstance(factoryClassName , classLoader)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @test
* @bug 8169778
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserFactTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.SAXParserFactTest
* @run testng/othervm javax.xml.parsers.ptests.SAXParserFactTest
*/
@Listeners({jaxp.library.BasePolicy.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.SAXParserTest
* @run testng/othervm javax.xml.parsers.ptests.SAXParserTest
*/
@Listeners({jaxp.library.FilePolicy.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
/*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest02
* @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow javax.xml.parsers.ptests.SAXParserTest02
* @run testng/othervm javax.xml.parsers.ptests.SAXParserTest02
*/
@Listeners({jaxp.library.BasePolicy.class})
Expand Down
Loading