Skip to content

Commit 70e5aa0

Browse files
committed
Fix SecurityManager test for Java 17,
1 parent 43aa6d9 commit 70e5aa0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

xstream/src/test/com/thoughtworks/acceptance/SecurityManagerTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006, 2007, 2009, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2024 XStream Committers.
2+
* Copyright (C) 2006, 2007, 2009, 2010, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2024, 2025 XStream Committers.
33
* All rights reserved.
44
*
55
* The software in this package is published under the terms of the BSD
@@ -28,8 +28,8 @@
2828
import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
2929
import com.thoughtworks.xstream.core.JVM;
3030
import com.thoughtworks.xstream.io.xml.DomDriver;
31+
import com.thoughtworks.xstream.io.xml.MXParserDriver;
3132
import com.thoughtworks.xstream.io.xml.SimpleStaxDriver;
32-
import com.thoughtworks.xstream.io.xml.Xpp3Driver;
3333
import com.thoughtworks.xstream.testutil.DynamicSecurityManager;
3434

3535
import junit.framework.TestCase;
@@ -202,7 +202,7 @@ public void testSerializeWithXppDriverAndSunUnsafeReflectionProviderAndActiveSec
202202
sm.setReadOnly();
203203
System.setSecurityManager(sm);
204204

205-
xstream = new XStream(new Xpp3Driver());
205+
xstream = new XStream(new MXParserDriver());
206206

207207
assertBothWays();
208208
}
@@ -246,7 +246,7 @@ public void testSerializeWithXppDriverAndPureJavaReflectionProviderAndActiveSecu
246246
sm.setReadOnly();
247247
System.setSecurityManager(sm);
248248

249-
xstream = new XStream(new PureJavaReflectionProvider(), new Xpp3Driver());
249+
xstream = new XStream(new PureJavaReflectionProvider(), new MXParserDriver());
250250

251251
assertBothWays();
252252
}
@@ -300,6 +300,8 @@ public void testSerializeWithDomDriverAndPureJavaReflectionProviderAndActiveSecu
300300
sm.addPermission(source, new PropertyPermission("jdk.xml.overrideDefaultParser", "read"));
301301
sm.addPermission(source, new PropertyPermission("jdk.xml.resetSymbolTable", "read"));
302302
sm.addPermission(source, new PropertyPermission("jdk.xml.totalEntitySizeLimit", "read"));
303+
sm.addPermission(source, new PropertyPermission("jdk.xml.xpathExprGrpLimit", "read"));
304+
sm.addPermission(source, new PropertyPermission("jdk.xml.xpathExprOpLimit", "read"));
303305
sm.addPermission(source, new PropertyPermission("maxOccurLimit", "read"));
304306
sm.addPermission(source, new PropertyPermission("sun.boot.class.path", "read"));
305307
sm.addPermission(source, new PropertyPermission("sun.io.serialization.extendedDebugInfo", "read"));

0 commit comments

Comments
 (0)