< prev index next >

test/jdk/java/net/httpclient/security/Driver.java

Print this page
rev 51731 : imported patch 8210732


   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 8087112
  27  * @library /lib/testlibrary/

  28  * @modules java.net.http
  29  *          java.logging
  30  *          jdk.httpserver
  31  * @build jdk.testlibrary.SimpleSSLContext jdk.testlibrary.Utils
  32  * @compile ../../../../com/sun/net/httpserver/LogFilter.java
  33  * @compile ../../../../com/sun/net/httpserver/FileServerHandler.java
  34  * @compile ../ProxyServer.java
  35  * @build Security
  36  *
  37  * @run main/othervm Driver
  38  */
  39 
  40 /**
  41  * driver required for allocating free portnumbers and putting this number
  42  * into security policy file used in some tests.
  43  *
  44  * The tests are in Security.java and port number supplied in -Dport.number
  45  * and -Dport.number1 for tests that require a second free port
  46  */
  47 import java.io.File;
  48 import java.io.FileOutputStream;
  49 import java.io.IOException;
  50 import java.io.InputStream;
  51 import java.io.OutputStream;
  52 import java.nio.file.Files;
  53 import java.nio.file.Path;
  54 import java.nio.file.Paths;
  55 import java.util.ArrayList;
  56 import java.util.List;
  57 import java.util.stream.Collectors;
  58 import jdk.testlibrary.Utils;
  59 
  60 /**
  61  * Driver for tests
  62  */
  63 public class Driver {
  64     // change the default value to "true" to get the subprocess traces.
  65     final static boolean DEBUG = Boolean.parseBoolean(System.getProperty("test.debug", "true"));
  66 
  67     public static void main(String[] args) throws Throwable {
  68         System.out.println("Starting Driver");
  69         runtest("1.policy", "1");
  70         runtest("10.policy", "10");
  71         runtest("11.policy", "11");
  72         runtest("12.policy", "12");
  73         System.out.println("DONE");
  74     }
  75 
  76     static final Path CWD = Paths.get(".");
  77 
  78     static class Logger extends Thread {




   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 8087112
  27  * @library /lib/testlibrary/
  28  * @library /test/lib
  29  * @modules java.net.http
  30  *          java.logging
  31  *          jdk.httpserver
  32  * @build jdk.testlibrary.SimpleSSLContext jdk.test.lib.Utils
  33  * @compile ../../../../com/sun/net/httpserver/LogFilter.java
  34  * @compile ../../../../com/sun/net/httpserver/FileServerHandler.java
  35  * @compile ../ProxyServer.java
  36  * @build Security
  37  *
  38  * @run main/othervm Driver
  39  */
  40 
  41 /**
  42  * driver required for allocating free portnumbers and putting this number
  43  * into security policy file used in some tests.
  44  *
  45  * The tests are in Security.java and port number supplied in -Dport.number
  46  * and -Dport.number1 for tests that require a second free port
  47  */
  48 import java.io.File;
  49 import java.io.FileOutputStream;
  50 import java.io.IOException;
  51 import java.io.InputStream;
  52 import java.io.OutputStream;
  53 import java.nio.file.Files;
  54 import java.nio.file.Path;
  55 import java.nio.file.Paths;
  56 import java.util.ArrayList;
  57 import java.util.List;
  58 import java.util.stream.Collectors;
  59 import jdk.test.lib.Utils;
  60 
  61 /**
  62  * Driver for tests
  63  */
  64 public class Driver {
  65     // change the default value to "true" to get the subprocess traces.
  66     final static boolean DEBUG = Boolean.parseBoolean(System.getProperty("test.debug", "true"));
  67 
  68     public static void main(String[] args) throws Throwable {
  69         System.out.println("Starting Driver");
  70         runtest("1.policy", "1");
  71         runtest("10.policy", "10");
  72         runtest("11.policy", "11");
  73         runtest("12.policy", "12");
  74         System.out.println("DONE");
  75     }
  76 
  77     static final Path CWD = Paths.get(".");
  78 
  79     static class Logger extends Thread {


< prev index next >