jdk/test/com/sun/servicetag/SystemRegistryTest.java
changeset 5815 8c68030e27b1
parent 5813 8e455cd3e807
child 7668 d4a77089c587
equal deleted inserted replaced
5814:abee09402885 5815:8c68030e27b1
    29  * @summary Basic Test for registry class
    29  * @summary Basic Test for registry class
    30  *          by replacing stclient with SvcTagClient utility
    30  *          by replacing stclient with SvcTagClient utility
    31  * @author  Mandy Chung
    31  * @author  Mandy Chung
    32  *
    32  *
    33  * @run build SvcTagClient SystemRegistryTest Util
    33  * @run build SvcTagClient SystemRegistryTest Util
    34  * @run main/othervm SystemRegistryTest
    34  * @run main SystemRegistryTest
    35  */
    35  */
    36 
    36 
    37 import com.sun.servicetag.*;
    37 import com.sun.servicetag.*;
    38 import java.io.*;
    38 import java.io.*;
    39 import java.util.*;
    39 import java.util.*;
    48                                         "servicetag3.properties"
    48                                         "servicetag3.properties"
    49                                     };
    49                                     };
    50 
    50 
    51     private static Registry registry;
    51     private static Registry registry;
    52     public static void main(String[] argv) throws Exception {
    52     public static void main(String[] argv) throws Exception {
    53         registry = Util.getSvcTagClientRegistry();
    53         try {
       
    54             registry = Util.getSvcTagClientRegistry();
       
    55             runTest();
       
    56         } finally {
       
    57             // restore empty registry file
       
    58             Util.emptyRegistryFile();
       
    59         }
       
    60     }
    54 
    61 
       
    62     private static void runTest() throws Exception {
    55         for (String filename : files) {
    63         for (String filename : files) {
    56             File f = new File(servicetagDir, filename);
    64             File f = new File(servicetagDir, filename);
    57             ServiceTag svcTag = Util.newServiceTag(f);
    65             ServiceTag svcTag = Util.newServiceTag(f);
    58             ServiceTag st = registry.addServiceTag(svcTag);
    66             ServiceTag st = registry.addServiceTag(svcTag);
    59             list.add(st);
    67             list.add(st);