For NullClipARGB we are throwing SkippedException only if instance of caught exception is PrinterException. All other exceptions are considered unrelated to printer configuration.
For CountPrintServices we want to throw SkippedException in the case when lpstat is not installed, where an IOException is caught in that case. For ExceptionTest we want to throw SkippedException for all PrinterExceptions which were not caused by IndexOutOfBoundsException. For rest of the tests if PrintService was not created instead RuntimeException we are throwing now SkippedException. Tested on environment without printer installed. Test are passing with skipped exception as expected. Passed: java/awt/print/PrinterJob/ExceptionTest.java Passed: java/awt/print/PrinterJob/ImagePrinting/NullClipARGB.java Passed: java/awt/print/PrinterJob/PrtException.java Passed: javax/print/attribute/AttributeTest.java Passed: javax/print/attribute/GetCopiesSupported.java Passed: javax/print/attribute/SidesPageRangesTest.java Passed: javax/print/attribute/SupportedPrintableAreas.java Passed: javax/print/PrintServiceLookup/CountPrintServices.java Passed: javax/print/CheckDupFlavor.java Additionally unused imports have been removed. ------------- Commit messages: - Reverted indentation. - Reverting code cleanup changes. - Added PrintService check. - Updated copyright years. - 8316412: javax/print tests fail without printer set up Changes: https://git.openjdk.org/jdk/pull/15821/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15821&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8316412 Stats: 49 lines in 9 files changed: 31 ins; 0 del; 18 mod Patch: https://git.openjdk.org/jdk/pull/15821.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15821/head:pull/15821 PR: https://git.openjdk.org/jdk/pull/15821