/*
@test
@bug 7023011
@library ../../../regtesthelpers
@build Sysout
@summary Toolkit.getPrintJob() throws wrong exceptions
@author andrei dmitriev: area=awt.headless
@run main GetPrintJob
*/
/*
* In headfull mode we should always getting NPE on the getPrintJob() call if frame == null.
*/
public class GetPrintJob {
boolean stage1Passed = false;
boolean stage2Passed = false;
try {
} catch (NullPointerException e) {
stage1Passed = true;
}
if (!stage1Passed) {
throw new RuntimeException("getPrintJob() should have thrown NPE but didn't.");
}
try {
} catch (NullPointerException e) {
stage2Passed = true;
}
if (!stage2Passed) {
throw new RuntimeException("getPrintJob() should have thrown NPE but didn't.");
}
}
}