1402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll/*******************************************************************************
2402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Copyright (c) 2000, 2009 IBM Corporation and others.
3402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * All rights reserved. This program and the accompanying materials
4402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * are made available under the terms of the Eclipse Public License v1.0
5402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * which accompanies this distribution, and is available at
6402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * http://www.eclipse.org/legal/epl-v10.html
7402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll *
8402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Contributors:
9402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll *     IBM Corporation - initial API and implementation
10402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll *******************************************************************************/
11402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpackage org.eclipse.test.performance.ui;
12402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
13402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollimport org.eclipse.equinox.app.IApplication;
14402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollimport org.eclipse.equinox.app.IApplicationContext;
15402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollimport org.eclipse.test.internal.performance.results.db.DB_Results;
16402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
17402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll/**
18402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Main class to generate performance results of all scenarios matching a given pattern
19402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * in one HTML page per component.
20402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll *
21402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @see GenerateResults for the complete implementation
22402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll */
23402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpublic class Main implements IApplication {
24402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
25402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll/**
26402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Generate the performance results for a specified build regarding to a specific reference.
27402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * This action generates following HTML files:
28402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * <ul>
29402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * <li>A summary table to see the variations for all the concerned scenarios</li>
30402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * <li>A global php file including global scenario fingerprints and links for all concerned components results php files</li>
31402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * <li>A php file for each component including scenario fingerprints and status table with links to a scenario data file</li>
32402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * <li>A data HTML file for each config of each scenario included in status table</li>
33402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * </ul>
34402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
35402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll */
36402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpublic Object start(IApplicationContext context) throws Exception {
37402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	DB_Results.DB_CONNECTION = true; // force DB connection while running the application
38402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	GenerateResults generation = new GenerateResults();
39402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	String[] args = (String[]) context.getArguments().get("application.args");
40402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	generation.run(args);
41402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	return null;
42402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll}
43402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
44402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll/* (non-Javadoc)
45402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @see org.eclipse.equinox.app.IApplication#stop()
46402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll */
47402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpublic void stop() {
48402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	// Do nothing
49402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll}
50402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll}