From c16598db53414d8146c5072c5e98376d12b92f4f Mon Sep 17 00:00:00 2001 From: malenkov Date: Fri, 30 Jul 2010 19:40:29 +0400 Subject: [PATCH] 6972468: Security manager should be used for tests in java/beans/XMLEncoder Reviewed-by: peterz --- test/java/beans/XMLEncoder/Test4631471.java | 10 ++++++++-- test/java/beans/XMLEncoder/Test4903007.java | 6 +++--- .../beans/XMLEncoder/javax_swing_JLayeredPane.java | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/test/java/beans/XMLEncoder/Test4631471.java b/test/java/beans/XMLEncoder/Test4631471.java index 9c67e60e3..0b3b107f7 100644 --- a/test/java/beans/XMLEncoder/Test4631471.java +++ b/test/java/beans/XMLEncoder/Test4631471.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4631471 + * @bug 4631471 6972468 * @summary Tests DefaultTreeModel encoding * @author Sergey Malenkov, Mark Davidson */ @@ -37,6 +37,12 @@ import javax.swing.tree.TreeNode; public abstract class Test4631471 extends AbstractTest { public static void main(String[] args) throws Exception { + main(); + System.setSecurityManager(new SecurityManager()); + main(); + } + + private static void main() throws Exception { // the DefaultMutableTreeNode will archive correctly new Test4631471() { protected Object getObject() { diff --git a/test/java/beans/XMLEncoder/Test4903007.java b/test/java/beans/XMLEncoder/Test4903007.java index 825837209..02ba9a6a9 100644 --- a/test/java/beans/XMLEncoder/Test4903007.java +++ b/test/java/beans/XMLEncoder/Test4903007.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4903007 + * @bug 4903007 6972468 * @summary Tests encoding of container with boxes and BoxLayout * @author Sergey Malenkov, Mark Davidson */ @@ -36,7 +36,7 @@ import javax.swing.JPanel; public class Test4903007 extends AbstractTest { public static void main(String[] args) throws Exception { - new Test4903007().test(false); // TODO: could not encode with security manager + new Test4903007().test(true); } protected JPanel getObject() { diff --git a/test/java/beans/XMLEncoder/javax_swing_JLayeredPane.java b/test/java/beans/XMLEncoder/javax_swing_JLayeredPane.java index 05c90ba15..1e41bc41e 100644 --- a/test/java/beans/XMLEncoder/javax_swing_JLayeredPane.java +++ b/test/java/beans/XMLEncoder/javax_swing_JLayeredPane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 5023552 + * @bug 5023552 6972468 * @summary Tests JLayeredPane encoding * @author Sergey Malenkov */ @@ -35,7 +35,7 @@ import javax.swing.JPanel; public final class javax_swing_JLayeredPane extends AbstractTest { public static void main(String[] args) { - new javax_swing_JLayeredPane().test(false); // TODO: could not encode with security manager + new javax_swing_JLayeredPane().test(true); } private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) { -- GitLab