test/com/sun/servicetag/JavaServiceTagTest1.java

Print this page




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * @test
  28  * @bug     6622366
  29  * @summary Basic Test for ServiceTag.getJavaServiceTag(String)
  30  *          to verify that the registration.xml and servicetag files
  31  *          are both created correctly.
  32  * @author  Mandy Chung
  33  *
  34  * @run build JavaServiceTagTest1
  35  * @run main JavaServiceTagTest1
  36  */
  37 
  38 import com.sun.servicetag.*;
  39 import java.io.*;
  40 import java.util.*;
  41 
  42 public class JavaServiceTagTest1 {
  43     private static String registrationDir = System.getProperty("test.classes");
  44     private static String servicetagDir = System.getProperty("test.src");
  45     private static File regFile;
  46     private static File svcTagFile;
  47     private static Registry registry;
  48     public static void main(String[] argv) throws Exception {
  49         // cleanup the registration.xml and servicetag file in the test directory
  50         System.setProperty("servicetag.dir.path", registrationDir);
  51         regFile = new File(registrationDir, "registration.xml");
  52         regFile.delete();
  53 
  54         svcTagFile = new File(registrationDir, "servicetag");
  55         svcTagFile.delete();




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * @test
  28  * @bug     6622366
  29  * @summary Basic Test for ServiceTag.getJavaServiceTag(String)
  30  *          to verify that the registration.xml and servicetag files
  31  *          are both created correctly.
  32  * @author  Mandy Chung
  33  *
  34  * @run build JavaServiceTagTest1
  35  * @run main/othervm JavaServiceTagTest1
  36  */
  37 
  38 import com.sun.servicetag.*;
  39 import java.io.*;
  40 import java.util.*;
  41 
  42 public class JavaServiceTagTest1 {
  43     private static String registrationDir = System.getProperty("test.classes");
  44     private static String servicetagDir = System.getProperty("test.src");
  45     private static File regFile;
  46     private static File svcTagFile;
  47     private static Registry registry;
  48     public static void main(String[] argv) throws Exception {
  49         // cleanup the registration.xml and servicetag file in the test directory
  50         System.setProperty("servicetag.dir.path", registrationDir);
  51         regFile = new File(registrationDir, "registration.xml");
  52         regFile.delete();
  53 
  54         svcTagFile = new File(registrationDir, "servicetag");
  55         svcTagFile.delete();