jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java
changeset 28522 c1aedcf211da
parent 22959 2d9d076cee41
child 30820 0d4717a011d3
equal deleted inserted replaced
28521:b86e910f3310 28522:c1aedcf211da
    76  *
    76  *
    77  * The test then tries to locate services/resources within the jars using
    77  * The test then tries to locate services/resources within the jars using
    78  * URLClassLoader. Each request to the HTTP server is recorded to ensure
    78  * URLClassLoader. Each request to the HTTP server is recorded to ensure
    79  * only the correct amount of requests are being made.
    79  * only the correct amount of requests are being made.
    80  *
    80  *
    81  * Note: Needs jdk/lib/tools.jar in the classpath to compile and run.
       
    82  */
    81  */
    83 
    82 
    84 public class Basic {
    83 public class Basic {
    85     static final String slash = File.separator;
    84     static final String slash = File.separator;
    86     static final String[] testSources =  {
    85     static final String[] testSources =  {
   158         }
   157         }
   159     }
   158     }
   160 
   159 
   161     static String jar;
   160     static String jar;
   162     static {
   161     static {
   163         String javaHome = System.getProperty("java.home");
   162         jar = System.getProperty("java.home") + slash+  "bin" + slash + "jar";
   164         if (javaHome.endsWith("jre")) {
       
   165             int index = javaHome.lastIndexOf(slash);
       
   166             if (index != -1)
       
   167                 javaHome = javaHome.substring(0, index);
       
   168         }
       
   169 
       
   170         jar = javaHome + slash+  "bin" + slash + "jar";
       
   171     }
   163     }
   172 
   164 
   173     /* create the index */
   165     /* create the index */
   174     static void createIndex(String workingDir) {
   166     static void createIndex(String workingDir) {
   175         // ProcessBuilder is used so that the current directory can be set
   167         // ProcessBuilder is used so that the current directory can be set