use of com.sun.enterprise.tools.verifier.gui.MainFrame in project Payara by payara.
the class VerifierMain method main.
public static void main(String[] args) throws GlassFishException, IOException {
VerifierFrameworkContext verifierFrameworkContext = new Initializer(args).getVerificationContext();
// Since in gui mode, we don't get a chance to clean up, we need to install a shutdown hook
addShutdownHook();
gfr = GlassFishRuntime.bootstrap();
GlassFishProperties gfp = new GlassFishProperties();
gfp.setProperty(StartupContext.TIME_ZERO_NAME, (new Long(System.currentTimeMillis())).toString());
final String VERIFIER_MODULE = "org.glassfish.verifier";
gfp.setProperty(StartupContext.STARTUP_MODULE_NAME, VERIFIER_MODULE);
// gfp.setConfigFileURI("file:/tmp/domain.xml");
GlassFish gf = gfr.newGlassFish(gfp);
gf.start();
int failedCount = -1;
Verifier verifier = gf.getService(Verifier.class);
if (verifierFrameworkContext.isUsingGui()) {
MainFrame mf = new MainFrame(verifierFrameworkContext.getJarFileName(), true, verifier);
mf.setSize(800, 600);
mf.setVisible(true);
} else {
LocalStringManagerImpl smh = StringManagerHelper.getLocalStringsManager();
try {
verifier.init(verifierFrameworkContext);
verifier.verify();
} catch (Exception e) {
LogRecord logRecord = new LogRecord(Level.SEVERE, smh.getLocalString(verifier.getClass().getName() + // NOI18N
".verifyFailed", // NOI18N
"Could not verify successfully."));
logRecord.setThrown(e);
verifierFrameworkContext.getResultManager().log(logRecord);
}
verifier.generateReports();
failedCount = verifierFrameworkContext.getResultManager().getFailedCount() + verifierFrameworkContext.getResultManager().getErrorCount();
System.exit(failedCount);
}
}
Aggregations