test/java/util/Properties/LoadAndStoreXML.java

Print this page




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8000354 8000685
  27  * @summary Basic test of storeToXML and loadToXML


  28  */
  29 
  30 import java.io.*;
  31 import java.util.*;
  32 import java.security.*;
  33 
  34 public class LoadAndStoreXML {
  35 
  36     /**
  37      * Simple policy implementation that grants a set of permissions to
  38      * all code sources and protection domains.
  39      */
  40     static class SimplePolicy extends Policy {
  41         private final Permissions perms;
  42 
  43         public SimplePolicy(Permission...permissions) {
  44             perms = new Permissions();
  45             for (Permission permission : permissions)
  46                 perms.add(permission);
  47         }




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8000354 8000685 8004371
  27  * @summary Basic test of storeToXML and loadToXML
  28  * @run main LoadAndStoreXML
  29  * @run main/othervm -Dsun.util.spi.XmlPropertiesProvider=jdk.internal.util.xml.BasicXmlPropertiesProvider LoadAndStoreXML
  30  */
  31 
  32 import java.io.*;
  33 import java.util.*;
  34 import java.security.*;
  35 
  36 public class LoadAndStoreXML {
  37 
  38     /**
  39      * Simple policy implementation that grants a set of permissions to
  40      * all code sources and protection domains.
  41      */
  42     static class SimplePolicy extends Policy {
  43         private final Permissions perms;
  44 
  45         public SimplePolicy(Permission...permissions) {
  46             perms = new Permissions();
  47             for (Permission permission : permissions)
  48                 perms.add(permission);
  49         }