< prev index next >

test/jdk/java/lang/ProcessBuilder/ProcessStartLoggingTest.java

Print this page

 23 
 24 import java.io.BufferedReader;
 25 import java.io.File;
 26 import java.io.IOException;
 27 import java.nio.file.Path;
 28 import java.util.List;
 29 import java.util.logging.LogRecord;
 30 import java.util.logging.Logger;
 31 import java.util.logging.StreamHandler;
 32 import java.util.stream.Stream;
 33 
 34 import org.junit.jupiter.params.provider.Arguments;
 35 import org.junit.jupiter.params.provider.MethodSource;
 36 import org.junit.jupiter.params.ParameterizedTest;
 37 import static org.junit.jupiter.api.Assertions.assertEquals;
 38 import static org.junit.jupiter.api.Assertions.fail;
 39 
 40 /*
 41  * @test
 42  * @summary verify logging of ProcessBuilder.start()

 43  * @run junit/othervm ProcessStartLoggingTest
 44  */
 45 public class ProcessStartLoggingTest {
 46 
 47     private final static int NORMAL_STATUS = 0;
 48     private final static int ERROR_STATUS = 1;
 49 
 50     private static final String TEST_JDK = System.getProperty("test.jdk");
 51     private static final String TEST_SRC = System.getProperty("test.src");
 52 
 53     private static Object HOLD_LOGGER;
 54 
 55     /**
 56      * Launch a process with the arguments.
 57      * @param args 1 or strings passed directly to ProcessBuilder as command and arguments.
 58      */
 59     public static void main(String[] args) throws InterruptedException {
 60         if (System.getProperty("ThrowingHandler") != null) {
 61             HOLD_LOGGER = ProcessStartLoggingTest.ThrowingHandler.installHandler();
 62         }

 23 
 24 import java.io.BufferedReader;
 25 import java.io.File;
 26 import java.io.IOException;
 27 import java.nio.file.Path;
 28 import java.util.List;
 29 import java.util.logging.LogRecord;
 30 import java.util.logging.Logger;
 31 import java.util.logging.StreamHandler;
 32 import java.util.stream.Stream;
 33 
 34 import org.junit.jupiter.params.provider.Arguments;
 35 import org.junit.jupiter.params.provider.MethodSource;
 36 import org.junit.jupiter.params.ParameterizedTest;
 37 import static org.junit.jupiter.api.Assertions.assertEquals;
 38 import static org.junit.jupiter.api.Assertions.fail;
 39 
 40 /*
 41  * @test
 42  * @summary verify logging of ProcessBuilder.start()
 43  * @requires vm.flagless
 44  * @run junit/othervm ProcessStartLoggingTest
 45  */
 46 public class ProcessStartLoggingTest {
 47 
 48     private final static int NORMAL_STATUS = 0;
 49     private final static int ERROR_STATUS = 1;
 50 
 51     private static final String TEST_JDK = System.getProperty("test.jdk");
 52     private static final String TEST_SRC = System.getProperty("test.src");
 53 
 54     private static Object HOLD_LOGGER;
 55 
 56     /**
 57      * Launch a process with the arguments.
 58      * @param args 1 or strings passed directly to ProcessBuilder as command and arguments.
 59      */
 60     public static void main(String[] args) throws InterruptedException {
 61         if (System.getProperty("ThrowingHandler") != null) {
 62             HOLD_LOGGER = ProcessStartLoggingTest.ThrowingHandler.installHandler();
 63         }
< prev index next >