--- old/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java 2019-07-03 17:18:06.143640600 +0100 +++ new/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java 2019-07-03 17:18:03.701555000 +0100 @@ -23,10 +23,10 @@ /* * @test - * @bug 8153732 8212202 8221263 8221412 + * @bug 8153732 8212202 8221263 8221412 8222108 * @requires (os.family == "Windows") * @summary Windows remote printer changes do not reflect in lookupPrintServices() - * @run main/manual RemotePrinterStatusRefresh + * @run main/manual/othervm -Dsun.java2d.print.minRefreshTime=120 RemotePrinterStatusRefresh */ import java.awt.BorderLayout; @@ -63,6 +63,9 @@ public class RemotePrinterStatusRefresh extends WindowAdapter { + private static final long DEFAULT_REFRESH_TIME = 240L; + private static final long MINIMAL_REFRESH_TIME = 120L; + private static final long refreshTime = getRefreshTime(); private static final long TIMEOUT = refreshTime * 4 + 60; @@ -181,7 +184,7 @@ + "configured printers.\n" + "Step 1: Add or Remove a network printer using " + "Windows Control Panel.\n" - + "Step 2: Wait for 4 minutes after adding or removing.\n" + + "Step 2: Wait for 2\u20134 minutes after adding or removing.\n" + " \"Next printer refresh in\" gives you a " + "rough estimation on when update will happen.\n" + "Step 3: Click Refresh." @@ -195,7 +198,7 @@ + "Step 5: Click Pass if the list of printers is correctly " + "updated.\n" + "Step 6: If the list is not updated, wait for another " - + "4 minutes, and then click Refresh again.\n" + + "2\u20134 minutes, and then click Refresh again.\n" + "Step 7: If the list does not update, click Fail.\n" + "\n" + "You have to click Refresh to enable Pass and Fail buttons. " @@ -215,12 +218,13 @@ private static long getRefreshTime() { String refreshTime = - System.getProperty("sun.java2d.print.minRefreshTime", "240"); + System.getProperty("sun.java2d.print.minRefreshTime", + Long.toString(DEFAULT_REFRESH_TIME)); try { long value = Long.parseLong(refreshTime); - return value < 240L ? 240L : value; + return value < MINIMAL_REFRESH_TIME ? MINIMAL_REFRESH_TIME : value; } catch (NumberFormatException e) { - return 240L; + return DEFAULT_REFRESH_TIME; } }