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