Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 201844
Collapse All | Expand All

(-)tasks/treporttest.xhtml (-27 / +22 lines)
Lines 26-38 Link Here
26
<h1>Generating BIRT test reports</h1>
26
<h1>Generating BIRT test reports</h1>
27
27
28
<p>
28
<p>
29
Test execution histories can be exported to HTML reports that use the 
29
Once execution histories have been generated from executing test suites, you can
30
Business Intelligence and Reporting Tools reporting system. These reports present the 
30
generate a BIRT test report to summarize the test execution results.  The 
31
data in tables and charts so that end users can easily find trends and analyze the data effectively.
31
Business Intelligence and Reporting Tools (BIRT) test reports aggregate and summarize 
32
numerous test executions over a period of time.  The BIRT test reports present test 
33
executions in tables and charts so users can easily locate trends and effectually analyze.
32
</p>
34
</p>
33
35
34
<p>
36
<p>
35
The following is a list of existing BIRT reports:
37
The following BIRT test report types are provided:
36
</p>
38
</p>
37
39
38
<table border="1" width="596" cellspacing="2" cellpadding="2" style="border-collapse:collapse">
40
<table border="1" width="596" cellspacing="2" cellpadding="2" style="border-collapse:collapse">
Lines 40-78 Link Here
40
    <tr>
42
    <tr>
41
      <th>Report</th>
43
      <th>Report</th>
42
      <th>Description</th>
44
      <th>Description</th>
45
    </tr>     
46
    <tr>
47
		<td>HTML Tabular Test Report (BIRT)</td>
48
		<td>Tabular report with only the most recent execution results for each selected test within a specified period of time.</td>
43
    </tr>
49
    </tr>
44
      
45
    <tr>
50
    <tr>
46
		<td>
51
		<td>HTML Test Pass Report (BIRT)<sup>1</sup></td>
47
			HTML Tabular Test Report (BIRT)
52
		<td>Report with only the most recent execution results for each selected test within a specified period of time.</td>
48
		</td>
49
		<td>
50
			A tabular report with the most recent execution results for each selected 
51
			tests within a specified period of time. 
52
		</td>
53
    </tr>
53
    </tr>
54
    <tr>
54
    <tr>
55
      <td>HTML Test Pass Report (BIRT)</td>
55
		<td>XML Test Report</td>
56
      <td valign="top">A test pass report with the most recent execution results for each selected tests within a specified period of time. A pie chart shows the number of failed, inconclusive, passed and error tests. </td>
56
		<td>Report with all of the execution results for each selected test within a specified period of time in an XML format.</td>
57
    </tr>
57
    </tr>
58
  </tbody>
58
  </tbody>
59
</table>
59
</table>
60
60
61
<p>
61
[1] Adobe's <a href="http://www.adobe.com/svg/viewer/install/main.html">Scalable Vector Graphics (SVG)</a> browser plug-in is required. 
62
<b>Note:</b> to view the charts in some of the reports you need to install 
63
Adobe's Scalable Vector Graphics (SVG) browser plug-in. You can get this free 
64
viewer from the Adobe web site at 
65
<a href="http://www.adobe.com/svg/viewer/install/main.html">http://www.adobe.com/svg/viewer/install/main.html </a>. 
66
</p>
67
62
68
<h3><a id="link5"></a>Reporting on the data in the view</h3>
63
<p>Generate the BIRT test report:</p>
69
<p>Generate the report: </p>
70
<ol>
64
<ol>
71
  <li>Right-click on a test in the Test Navigator and select <strong>Report... </strong> from the pop-up menu.</li>
65
  <li>Right-click on a test suite in the Test Navigator and select <strong>Report... </strong> from the context menu.</li>
72
  <li>The <strong>New Report</strong> dialog launches.</li>
66
  <li>The <strong>New Report</strong> dialog opens.</li>
73
  <li>Select the <strong>Time Frame Historic </strong> option then click on <strong>Next </strong>.</li>
67
  <li>Select one of the BIRT test report types and click on <strong>Next </strong>.</li>
74
  <li>Provide the parent folder and a name for the report, then click on <strong>Next </strong> and provide the report time frame Start and End dates and times.</li>
68
  <li>Provide the parent folder and a name for the BIRT test report, then click on <strong>Next</strong>.</li>
75
  <li>Click on <strong>Finish </strong> to generate the report.</li>
69
  <li>Optionally, provide the report window (start and end data and time) for the BIRT test report.</li>
70
  <li>Click <strong>Finish </strong> to generate the BIRT test report.</li>
76
</ol>
71
</ol>
77
</body>
72
</body>
78
</html>
73
</html>
(-)tasks/tcreatetestreports.htm (-93 / +47 lines)
Lines 2-8 Link Here
2
<html lang="en-us" xml:lang="en-us">
2
<html lang="en-us" xml:lang="en-us">
3
<!-- 
3
<!-- 
4
/**********************************************************************
4
/**********************************************************************
5
 * Copyright (c) 2007 IBM Corporation.
5
 * Copyright (c) 2007, 2008 IBM Corporation.
6
 * All rights reserved.   This content
6
 * All rights reserved.   This content
7
 * is made available under the terms of the Eclipse Public License v1.0
7
 * is made available under the terms of the Eclipse Public License v1.0
8
 * which accompanies this distribution, and is available at
8
 * which accompanies this distribution, and is available at
Lines 21-125 Link Here
21
</head>
21
</head>
22
<body>
22
<body>
23
23
24
<h2>Generating test reports</h2>
24
<h1>Generating test reports</h1>
25
25
<p>
26
<p>
26
After you have run your tests and generated execution histories, you can generate a report
27
Once execution histories have been generated from executing test suites, you can
27
on those test results to summarize the data.
28
generate a test report to summarize the test execution results.  The test reports 
29
aggregate and summarize numerous test executions over a period of time.  The test 
30
reports present test executions in tables and charts so users can easily locate 
31
trends and effectually analyze.
28
</p>
32
</p>
29
33
30
Generate the report:
34
<p>
31
<ol>
35
The following test report types are provided:
32
	<li>
33
	Right-click on a test in the Test Navigator and
34
	select <b>Report...</b> from the pop-up menu.
35
	</li>
36
	<li>
37
	The <b>New Report</b> dialog launches.
38
	</li>
39
	<li>
40
	Select the <b>Time Frame Historic</b> option then click on
41
	<b>Next</b>.
42
	</li>
43
	<li>
44
	Provide the parent folder and a name for the report, then
45
	click on <b>Next</b> and provide the report time frame Start and End dates and times.
46
	</li>
47
	<li>
48
	Click on <b>Finish</b> to generate the report. 
49
	</li>
50
</ol>
51
52
<h2>Time Frame Historic report</h2>
53
<p>There are 4 tabs in the report: Overview, By Test, By Log, and Details.</p>
54
55
<h3>Overview Tab</h3>
56
57
<p>The Overview report is a 3D pie chart showing the overall
58
breakdown across all test runs during the specified period. In this example
59
two-thirds (66.67%) of the tests failed and one-third (33.33%) were in error.</p>
60
61
<p><img src="../images/junitanalysis009.png" alt="Pie chart showing 66.67% of the tests failed and 33.33% of the tests were in error."/></p>
62
63
64
<h3>By Test Tab</h3>
65
66
<p>The By Test report shows the overall relative proportions
67
of the categories Pass, Inconclusive, Fail, and Error.  </p>
68
69
<p><img src="../images/junitanalysis011.png" alt="Part of a bar chart showing that a portion of the test failed and a portion of the test was in error."/></p>
70
71
<h3>By Test Log Tab</h3>
72
73
<p>The By Test Log report shows, for each test log,  the overall relative proportions of the
74
categories Pass, Inconclusive, Fail, and Error.  </p>
75
76
<p><img src="../images/junitanalysis013.png" alt="Part of a bar chart summarizing two tests. Both tests have part fail and part error."/></p>
77
78
<h3>Details Tab</h3>
79
80
<p>The <b>Details</b> report is in 2 sections: <b>Summary</b>
81
and <b>Results by Test</b>.
82
</p>
36
</p>
83
37
84
<p><img src="../images/junitanalysis015.png" alt=""/></p>
38
<table border="1" width="596" cellspacing="2" cellpadding="2" style="border-collapse:collapse">
85
39
  <tbody>
86
40
    <tr>
87
<h3>Summary</h3>
41
      <th>Report</th>
88
42
      <th>Description</th>
89
<p>The Summary lists the following:
43
    </tr>     
90
	<ul>
44
    <tr>
91
		<li>name of the tests that ran</li>
45
		<td>Test Pass Report<sup>1</sup></td>
92
		<li>verdict across all of those tests</li>
46
		<td>Report with only the most recent execution results for each selected test within a specified period of time.</td>
93
		<li>creation date of the report</li>
47
    </tr>
94
		<li>start time of the execution histories</li>
48
    <tr>
95
		<li>end time of the execution histories</li>
49
		<td>Time Frame Historic<sup>1</sup></td>
96
		<li>number of pass results</li>
50
		<td>Report with all of the execution results for each selected test within a specified period of time.</td>
97
		<li>number of fail results</li>
51
    </tr>
98
		<li>number of inconclusive results</li>
52
    <tr>
99
		<li>number of error results</li>
53
		<td>Test Pass Report<sup>1</sup></td>
100
	</ul>
54
		<td>Report with only the most recent execution results for each selected test within a specified period of time.</td>
101
This section summarizes the outcomes for test runs taking place
55
    </tr>
102
during the specified period. In this example, out of a total of 6 tests,  there were 4 failed tests and 2 tests in
56
  </tbody>
103
error. </p>
57
</table>
104
105
<h3>Results by Test</h3>
106
107
<p>The Results by Test section is a table with eight columns: 
108
	<ul>
109
		<li>Test Log (the name of the test)</li>
110
		<li>Date (the day and time of the execution history)</li>
111
		<li>Pass (the number of tests that passed)</li>
112
		<li>Inconclusive (the number of tests that were inconclusive)</li>
113
		<li>Fail (the number of tests that failed)</li>
114
		<li>Error (the number of tests that had an error)</li>
115
		<li>Attempted (the number of tests attempted)</li>
116
		<li>Failure Rate (the percentage of tests that failed)</li>
117
	</ul>
118
	This section tabulates the the test outcomes for each test log.</p>
119
120
58
59
[1] Adobe's <a href="http://www.adobe.com/svg/viewer/install/main.html">Scalable Vector Graphics (SVG)</a> browser plug-in is required. 
121
60
61
<p>Configure the fonts used when generating the test report:</p>
62
<ol>
63
 	<li>Open the <b>Window &gt; Preferences</b> dialog.</li>
64
	<li>Select the report <b>Test &gt; Test Report &gt; Font</b> preference page.</li>
65
	<li>Configure the fonts used when generating the test report.</li>
66
	<li>Select <b>OK</b>.</li>
67
</ol>
122
68
69
<p>Generate the test report:</p>
70
<ol>
71
  <li>Right-click on a test suite in the Test Navigator and select <strong>Report... </strong> from the context menu.</li>
72
  <li>The <strong>New Report</strong> dialog opens.</li>
73
  <li>Select one of the test report types and click on <strong>Next </strong>.</li>
74
  <li>Provide the parent folder and a name for the test report, then click on <strong>Next</strong>.</li>
75
  <li>Optionally, provide the report window (start and end data and time) for the test report.</li>
76
  <li>Click <strong>Finish </strong> to generate the test report.</li>
77
</ol>
123
</body>
78
</body>
124
125
</html>
79
</html>
(-)tasks/tcreateperformancetestreports.htm (-29 / +41 lines)
Lines 35-77 Link Here
35
<title>Generating performance test reports</title>
35
<title>Generating performance test reports</title>
36
</head>
36
</head>
37
<body>
37
<body>
38
<a name="analzingtestresults"><!-- --></a>
39
38
40
<h1 class="topictitle1">Generating performance test reports</h1>
39
<h1>Generating performance test reports</h1>
41
40
42
<p>At the conclusion of a performance test run you see an execution history, which you can create two types of graphical performance test reports; Page Response Time and Page Hit Rate.  The Page Response Time report is a bar graph showing the seconds required to process each page in the test and
41
<p>
43
the average response time for all pages.</p>
42
Once execution histories have been generated from executing performance test suites, you can
44
43
generate a performance test report to summarize the test execution results.  The performance test reports 
45
<img src="../images/prt_no_values.gif" alt="Sample Page Response Time report that shows a bar for each of five pages. The bar shows the number of seconds for each page."/>
44
aggregate and summarize numerous test executions over a period of time.  The performance test 
45
reports present test executions in charts so users can easily locate trends and effectually analyze.
46
</p>
46
47
47
<p>The Page Hit Rate report is a bar graph showing the hits per second to each page and the total hit rate for all pages. The exact numbers displayed
48
<p>
48
at the top of the bars (available on the Page Response Time as well) do not appear unless you click one of the bars.</p>
49
The following performance test report types are provided:
50
</p>
49
51
50
<img src="../images/phr_values.gif" alt="sample Page Hit Rate report showing the hits per second for five pages and the total hit rate for all pages."/>
52
<table border="1" width="596" cellspacing="2" cellpadding="2" style="border-collapse:collapse">
53
  <tbody>
54
    <tr>
55
      <th>Report</th>
56
      <th>Description</th>
57
    </tr>     
58
    <tr>
59
		<td>HTTP Page Response Time<sup>1</sup></td>
60
		<td>Report with the response time for each HTTP page in the the most recent execution results for each selected test.</td>
61
    </tr>
62
    <tr>
63
		<td>HTTP Page Hit Rate<sup>1</sup></td>
64
		<td>Create a report with the hits per second for each HTTP page in the the most recent execution results for each selected test.</td>
65
    </tr>
66
  </tbody>
67
</table>
51
68
52
<p>In order to view the Page Response Time and the Page Hit Rate reports, you need to install Adobe's Scalable Vector Graphics (SVG) browser plug-in.
69
[1] Adobe's <a href="http://www.adobe.com/svg/viewer/install/main.html">Scalable Vector Graphics (SVG)</a> browser plug-in is required. 
53
You can get this free viewer from the Adobe web site at <a href="http://www.adobe.com/svg/viewer/install/main.html">http://www.adobe.com/svg/viewer/install/main.html</a>.</p>
54
70
55
<p>To generate reports from a performance test's results:
71
<p>Configure the fonts used when generating the performance test report:</p>
56
<ol>
72
<ol>
57
	<li>In the <b>Test Navigator</b>, right-click the performance test and select <b>Report</b>. Page one of the <b>New Report</b> wizard opens.</li>
73
 	<li>Open the <b>Window &gt; Preferences</b> dialog.</li>
58
	<li>Click the type of report you want to create. If you want to see the report immediately, without having to browse to it, leave the <b>Open Report
74
	<li>Select the report <b>Test &gt; Test Report &gt; Font</b> preference page.</li>
59
	Automatically</b> box checked. When you click <b>Next</b>, the second page of the New Report wizard opens.</li>
75
	<li>Configure the fonts used when generating the performance test report.</li>
60
	<li>From the list of projects in the middle pane, click the one that you want to put the report file in: the project's name appears in the <b>Enter
76
	<li>Select <b>OK</b>.</li>
61
	or select the parent folder</b> box.</li>
62
	<li>In the <b>File name</b> box, enter the name of the report file.</li>
63
	<li>Click <b>Finish</b>.</li>
64
</ol>
77
</ol>
65
</p>
66
<p>If you left the <b>Open Report Automatically</b> box checked in step 1 (assuming you have the SVG viewer installed), the report opens in your
67
browser.</p>
68
78
69
79
<p>Generate the performance test report:</p>
70
<div>
80
<ol>
71
<p><b class="parentlink">Parent topic:</b> <a href="../concepts/ctestwithhyades.htm"
81
  <li>Right-click on a performance test suite in the Test Navigator and select <strong>Report... </strong> from the context menu.</li>
72
	title="The Eclipse test and performance tools platform (TPTP) supports automated performance testing of HTTP applications.">Performance Testing with
82
  <li>The <strong>New Report</strong> dialog opens.</li>
73
TPTP</a><br />
83
  <li>Select one of the performance test report types and click on <strong>Next </strong>.</li>
74
</p>
84
  <li>Provide the parent folder and a name for the performance test report, then click on <strong>Next</strong>.</li>
75
</div>
85
  <li>Optionally, provide the report window (start and end data and time) for the performance test report.</li>
86
  <li>Click <strong>Finish </strong> to generate the performance test report.</li>
87
</ol>
76
</body>
88
</body>
77
</html>
89
</html>
(-)src/org/eclipse/hyades/test/tools/ui/common/internal/report/ReportStylesPreferencePage.java (-53 / +49 lines)
Lines 12-17 Link Here
12
package org.eclipse.hyades.test.tools.ui.common.internal.report;
12
package org.eclipse.hyades.test.tools.ui.common.internal.report;
13
13
14
import org.eclipse.hyades.test.tools.ui.common.internal.report.jscrib.StylesInitializer;
14
import org.eclipse.hyades.test.tools.ui.common.internal.report.jscrib.StylesInitializer;
15
import org.eclipse.hyades.ui.internal.util.GridDataUtil;
15
import org.eclipse.jface.dialogs.Dialog;
16
import org.eclipse.jface.dialogs.Dialog;
16
import org.eclipse.jface.preference.PreferencePage;
17
import org.eclipse.jface.preference.PreferencePage;
17
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.SWT;
Lines 19-36 Link Here
19
import org.eclipse.swt.layout.GridLayout;
20
import org.eclipse.swt.layout.GridLayout;
20
import org.eclipse.swt.widgets.Composite;
21
import org.eclipse.swt.widgets.Composite;
21
import org.eclipse.swt.widgets.Control;
22
import org.eclipse.swt.widgets.Control;
23
import org.eclipse.swt.widgets.Group;
22
import org.eclipse.tptp.platform.report.core.internal.DStyleRegistry;
24
import org.eclipse.tptp.platform.report.core.internal.DStyleRegistry;
23
import org.eclipse.tptp.platform.report.signals.internal.Signal;
25
import org.eclipse.tptp.platform.report.signals.internal.Signal;
24
import org.eclipse.tptp.platform.report.ui.swt.widgets.internal.StylesFieldEditor;
26
import org.eclipse.tptp.platform.report.ui.swt.widgets.internal.StylesFieldEditor;
25
import org.eclipse.tptp.test.samples.SamplesPlugin;
27
import org.eclipse.tptp.test.samples.SamplesPlugin;
28
import org.eclipse.tptp.test.samples.internal.resources.SamplesPluginResourceBundle;
26
import org.eclipse.ui.IWorkbench;
29
import org.eclipse.ui.IWorkbench;
27
import org.eclipse.ui.IWorkbenchPreferencePage;
30
import org.eclipse.ui.IWorkbenchPreferencePage;
28
import org.eclipse.ui.PlatformUI;
29
30
31
31
32
/**
32
/**
33
 * @see PreferencePage
33
 * 
34
 */
35
/**
36
 * ReportStylesPreferencePage.java
37
 * <p/>
38
 * 
39
 * 
40
 * @author  Paul E. Slauenwhite
41
 * @version April 11, 2008
42
 * @since   June 6, 2005
43
 * @see     PreferencePage
34
 */
44
 */
35
public class ReportStylesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
45
public class ReportStylesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
36
46
Lines 38-74 Link Here
38
    
48
    
39
    public static final String ID = "ReportView.Preferences";
49
    public static final String ID = "ReportView.Preferences";
40
    
50
    
41
	private class LocalStylesFieldEditor extends StylesFieldEditor
51
    public static Signal sig_asv_graphic_style_chgd = new Signal("valueChanged()"); //$NON-NLS-1$
42
	{
52
43
		public LocalStylesFieldEditor(String name, String labelText,
53
	private DStyleRegistry registry = null;
44
				Composite parent) {
54
45
			super(name, labelText, parent);
46
		}
47
		public  void loadDefault() {
48
			super.loadDefault();
49
			this.setPresentsDefaultValue(false);
50
		}
51
	}
52
	/**
53
	 *
54
	 */
55
	public ReportStylesPreferencePage() {
55
	public ReportStylesPreferencePage() {
56
	}
56
	}
57
57
58
	/**
59
	 * @see PreferencePage#init
60
	 */
61
	DStyleRegistry registry = null;
62
	public void init(IWorkbench workbench)  {
58
	public void init(IWorkbench workbench)  {
63
		this.registry = StylesInitializer.getCurrentReportStyles();
59
		this.registry = StylesInitializer.getCurrentReportStyles();
64
	}
60
	}
65
61
        
66
	protected void performDefaults() {
67
		this.recentStylesEditor.loadDefault();	
68
	}
69
    
70
    public static Signal sig_asv_graphic_style_chgd = new Signal("valueChanged()"); //$NON-NLS-1$
71
    
72
	public boolean performOk() {
62
	public boolean performOk() {
73
63
74
		sig_asv_graphic_style_chgd.setBlocked(true);
64
		sig_asv_graphic_style_chgd.setBlocked(true);
Lines 77-119 Link Here
77
		sig_asv_graphic_style_chgd.emit();
67
		sig_asv_graphic_style_chgd.emit();
78
		return true;
68
		return true;
79
	}
69
	}
70
	
80
	public void createControl(Composite parent) {
71
	public void createControl(Composite parent) {
81
		super.createControl(parent);
72
		super.createControl(parent);
82
        //TODO: add call help online
83
//		SamplesPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(parent, LLCContextIds.PREF_GRP_STYLE_PAGE);
84
		
85
	}
73
	}
74
	
75
	protected void performDefaults() {
76
		this.recentStylesEditor.loadDefault();	
77
	}
78
	
86
	/**
79
	/**
87
	 * @see PreferencePage#createContents
80
	 * @see PreferencePage#createContents
88
	 */
81
	 */
89
	protected Control createContents(Composite parent)  {
82
	protected Control createContents(Composite parent)  {
90
		Composite composite = new Composite(parent, SWT.NULL);
83
				
91
		GridLayout layout = new GridLayout();
84
		SamplesPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(parent, SamplesPlugin.getID() + ".ptrf001");
92
		layout.marginWidth = 0;
85
93
		layout.marginHeight = 0;
86
		Composite composite = new Composite(parent, SWT.NONE);
94
		composite.setLayout(layout);
87
		composite.setLayoutData(GridDataUtil.createFill());
95
		composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
88
		composite.setLayout(new GridLayout());
96
		composite.setFont(parent.getFont());
89
90
		final Group sampleReportFontGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
91
		sampleReportFontGroup.setLayout(new GridLayout());
92
		sampleReportFontGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
93
		sampleReportFontGroup.setText(SamplesPluginResourceBundle.TEST_REPORT_FONT_PREFERENCES_GROUP_NAME);
97
		
94
		
98
		this.recentStylesEditor = new LocalStylesFieldEditor(ReportStylesPreferencePage.ID, "message", composite); //$NON-NLS-1$
95
		this.recentStylesEditor = new LocalStylesFieldEditor(ReportStylesPreferencePage.ID, "message", sampleReportFontGroup); //$NON-NLS-1$
99
		this.recentStylesEditor.setStylesRegistry(this.registry);
96
		this.recentStylesEditor.setStylesRegistry(this.registry);
100
		this.recentStylesEditor.setPreferenceStore(SamplesPlugin.getDefault().getPreferenceStore());
97
		this.recentStylesEditor.setPreferenceStore(SamplesPlugin.getDefault().getPreferenceStore());
101
		this.recentStylesEditor.setPage(this);
98
		this.recentStylesEditor.setPage(this);
102
99
103
        sig_asv_graphic_style_chgd.connect(this,"refreshView()"); //$NON-NLS-1$
104
        Dialog.applyDialogFont( composite );
100
        Dialog.applyDialogFont( composite );
105
		return composite;
101
		return composite;
106
	}
102
	}
107
    
103
	
108
    /**
104
	private class LocalStylesFieldEditor extends StylesFieldEditor
109
     * this method is connected to the signal sig_asv_graphic_style_chgd and
105
	{
110
     * it is called when the colors are modified in the preferences and 
106
		public LocalStylesFieldEditor(String name, String labelText,
111
     * refreshes the view if it is visible
107
				Composite parent) {
112
     */
108
			super(name, labelText, parent);
113
    public void refreshView()
109
		}
114
    {
110
		public  void loadDefault() {
115
        ReportView view = (ReportView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ReportView.ID); //$NON-NLS-1$
111
			super.loadDefault();
116
        if(view!=null)
112
			this.setPresentsDefaultValue(false);
117
            view.redrawContent();
113
		}
118
    }
114
	}
119
}
115
}
(-)src/org/eclipse/hyades/test/tools/ui/common/internal/report/ReportView.java (-208 lines)
Removed Link Here
1
/* ***********************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * $Id: ReportView.java,v 1.8 2008/04/10 14:53:22 paules Exp $
8
 *
9
 * Contributors:
10
 * IBM - Initial API and implementation
11
 ************************************************************/
12
13
14
package org.eclipse.hyades.test.tools.ui.common.internal.report;
15
16
17
import java.io.File;
18
19
import org.eclipse.hyades.test.ui.util.RCPFileEditorInput;
20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.graphics.Point;
22
import org.eclipse.swt.widgets.Composite;
23
import org.eclipse.swt.widgets.Display;
24
import org.eclipse.tptp.platform.report.core.internal.DLinkUtil;
25
import org.eclipse.tptp.platform.report.core.internal.IDDocument;
26
import org.eclipse.tptp.platform.report.core.internal.IDLink;
27
import org.eclipse.tptp.platform.report.drivers.ui.internal.SWTViewer;
28
import org.eclipse.tptp.platform.report.ui.dialogs.internal.StyleEditorDialog;
29
import org.eclipse.tptp.platform.report.ui.dialogs.internal.ZoomEditorDialog;
30
import org.eclipse.tptp.test.samples.SamplesPlugin;
31
import org.eclipse.tptp.test.samples.internal.resources.SamplesPluginResourceBundle;
32
import org.eclipse.ui.IEditorDescriptor;
33
import org.eclipse.ui.PlatformUI;
34
import org.eclipse.ui.WorkbenchException;
35
import org.eclipse.ui.part.ViewPart;
36
37
/**
38
 * This sample class demonstrates how to plug-in a new
39
 * workbench view. The view shows data obtained from the
40
 * model. The sample creates a dummy model on the fly,
41
 * but a real implementation would connect to the model
42
 * available either in this or another plug-in (e.g. the workspace).
43
 * The view is connected to the model using a content provider.
44
 * <p>
45
 * The view uses a label provider to define how model
46
 * objects should be presented in the view. Each
47
 * view can present the same model objects using
48
 * different labels and icons, if needed. Alternatively,
49
 * a single label provider can be shared between views
50
 * in order to ensure that objects of the same type are
51
 * presented in the same way everywhere.
52
 * <p>
53
 */
54
55
public class ReportView extends ViewPart {
56
57
    
58
    public static final String ID = "org.eclipse.hyades.test.tools.ui.common.internal.report.ReportView"; //$NON-NLS-$1
59
    
60
	private SWTViewer viewer;
61
	//private Action actionZoom;
62
	
63
	//private Action actionStyles;
64
65
 
66
	private static ZoomEditorDialog zd;
67
	private static StyleEditorDialog styleEditor;
68
69
    private class ReportViewer extends SWTViewer {
70
        
71
        public ReportViewer(Composite parent, int style) 
72
        {
73
            super(parent, style);
74
            
75
        }
76
        
77
        public void activateLink(IDLink link, Point p)
78
        {
79
            if (DLinkUtil.isInternalLink(link))
80
            {
81
                super.activateLink(link, p);
82
            }
83
            else
84
            {
85
               //check if the image exists on the disk
86
               File f = new File(link.getTarget());
87
               if (f.exists())
88
               {
89
                   IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(link.getTarget());
90
                   
91
                   //FileSystemElement fse = new FileSystemElement(link.getTarget(), null , false);
92
                   //ExtFile fse = new ExtFile(link.getTarget());
93
                   RCPFileEditorInput rcpfile = new RCPFileEditorInput(f);
94
                   
95
                   try {
96
                       PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(rcpfile, editor.getId());
97
                   }
98
                   catch (WorkbenchException e)
99
                   {
100
                	   SamplesPlugin.logError("Unable to open file = " + link.getTarget());
101
                   }
102
                  //return copyImageFile(link.getTarget());
103
               }
104
            }
105
        }
106
    }
107
    
108
    
109
	/**
110
	 * The constructor.
111
	 */
112
	public ReportView() {
113
	}
114
    
115
    /**
116
     * Shows a document in the view
117
     */
118
    public void setDocument(IDDocument doc)
119
    {
120
        viewer.setContent(doc);
121
    }
122
    
123
    /**
124
     * Applies zoom factor to the view
125
     */
126
	public void applyZoom()
127
	{
128
		viewer.setZoom(zd.getZoomFactor(), zd.isMaintainRatio());
129
	}
130
    
131
132
    /**
133
     * Applies styles factor to the view
134
     */
135
    public void applyStyles()
136
    {
137
       
138
    }
139
	 
140
	/**
141
	 * This is a callback that will allow us
142
	 * to create the viewer and initialize it.
143
	 */
144
	public void createPartControl(Composite parent) {
145
		viewer = new ReportViewer(parent, SWT.DIALOG_TRIM|SWT.RESIZE );
146
        viewer.setBackground( Display.getDefault().getSystemColor( SWT.COLOR_WHITE ));
147
		setPartName(SamplesPluginResourceBundle.ReportWindow_Title ); 
148
		// Add icon in local toolbar
149
		/*IToolBarManager bars =*/ getViewSite().getActionBars().getToolBarManager();
150
		makeActions();
151
		//bars.add(actionZoom);
152
		//bars.add(actionStyles);
153
		// Zoom Dialog Creation
154
		zd = new ZoomEditorDialog(parent.getShell());
155
	    zd.applied.connect(this, "applyZoom()"); //$NON-NLS-$1
156
	    // Style Dialog Creation
157
	    styleEditor = new StyleEditorDialog(parent.getShell());
158
	    styleEditor.applied.connect(this, "applyStyles()"); //$NON-NLS-$1
159
	}
160
	
161
	private void makeActions() {
162
		/*actionZoom = new Action() {
163
			public void run() {
164
				zd.setData(frame.getViewer().getContentsWidth(), frame.getViewer().getContentsHeight(),
165
						frame.getViewer().getBounds().width, frame.getViewer().getBounds().height,
166
						frame.getViewer().getZoom());
167
		   	 	zd.open();
168
			}
169
		};
170
		actionZoom.setText("Zoom");
171
		actionZoom.setToolTipText("Zoom...");
172
		actionZoom.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
173
			getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD));
174
		
175
		actionStyles = new Action() {
176
			public void run() {
177
				IDItem doc = viewer.getContentItem();
178
				if (doc!=null)
179
				{
180
					DStyleRegistry r = new DStyleRegistry();
181
					r.merge(doc);
182
					styleEditor.setStyles(r);
183
					styleEditor.open();
184
				}
185
			}
186
		};
187
		actionStyles.setText("Styles");
188
		actionStyles.setToolTipText("Modify Styles...");
189
		actionStyles.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
190
			getImageDescriptor(ISharedImages.IMG_OBJ_ELEMENT));*/
191
		
192
	}
193
	
194
	/**
195
	 * Passing the focus request to the viewer's control.
196
	 */
197
	public void setFocus() {
198
		viewer.setFocus();
199
	}
200
    
201
    /**
202
     * Redraw the content
203
     */
204
    public void redrawContent()
205
    {
206
        viewer.redraw();
207
    }
208
}
(-)src/org/eclipse/tptp/test/samples/internal/resources/SamplesPluginResourceBundle.java (+1 lines)
Lines 36-41 Link Here
36
	public static String Time_Frame_Historic_ReportWindow_Title;
36
	public static String Time_Frame_Historic_ReportWindow_Title;
37
	public static String HTTP_Page_Response_Time_ReportWindow_Title;
37
	public static String HTTP_Page_Response_Time_ReportWindow_Title;
38
	public static String HTTP_Page_Hit_Rate_ReportWindow_Title;
38
	public static String HTTP_Page_Hit_Rate_ReportWindow_Title;
39
	public static String TEST_REPORT_FONT_PREFERENCES_GROUP_NAME;
39
	public static String ReportWindow_Title;
40
	public static String ReportWindow_Title;
40
	public static String ReportWindowWizardPage_Title;
41
	public static String ReportWindowWizardPage_Title;
41
	public static String ReportWindowWizardPage_Description;
42
	public static String ReportWindowWizardPage_Description;
(-)src/org/eclipse/tptp/test/samples/internal/resources/messages.properties (+2 lines)
Lines 23-28 Link Here
23
HTTP_Page_Response_Time_ReportWindow_Title = HTTP Page Response Time
23
HTTP_Page_Response_Time_ReportWindow_Title = HTTP Page Response Time
24
HTTP_Page_Hit_Rate_ReportWindow_Title 	   = HTTP Page Hit Rate
24
HTTP_Page_Hit_Rate_ReportWindow_Title 	   = HTTP Page Hit Rate
25
25
26
TEST_REPORT_FONT_PREFERENCES_GROUP_NAME = Test Report Fonts
27
26
ReportWindowWizardPage_Title	  						= Select a time frame
28
ReportWindowWizardPage_Title	  						= Select a time frame
27
ReportWindowWizardPage_Description						= Enter the start and end date and time ({0}) for the report window.
29
ReportWindowWizardPage_Description						= Enter the start and end date and time ({0}) for the report window.
28
ReportWindowWizardPage_LABEL_STARTTIME					= Start date and time:
30
ReportWindowWizardPage_LABEL_STARTTIME					= Start date and time:
(-)plugin.properties (-4 / +2 lines)
Lines 22-30 Link Here
22
pluginName   						= TPTP Test Framework and Tools Samples
22
pluginName   						= TPTP Test Framework and Tools Samples
23
providerName 						= Eclipse.org
23
providerName 						= Eclipse.org
24
24
25
#Report
25
#Sample test reports:
26
REPORT_WINDOW_WTITLE				= Test Report
27
28
REPORT_WINDOW_WIZ_NAME				= Time Frame Historic
26
REPORT_WINDOW_WIZ_NAME				= Time Frame Historic
29
REPORT_WINDOW_WIZ_DESC				= Create a report with all of the execution results for each selected test within a specified period of time.
27
REPORT_WINDOW_WIZ_DESC				= Create a report with all of the execution results for each selected test within a specified period of time.
30
28
Lines 37-41 Link Here
37
HIT_RATE_TITLE 						= HTTP Page Hit Rate
35
HIT_RATE_TITLE 						= HTTP Page Hit Rate
38
HIT_RATE_DESC		             	= Create a report with the hits per second for each HTTP page in the the most recent execution results for each selected test.
36
HIT_RATE_DESC		             	= Create a report with the hits per second for each HTTP page in the the most recent execution results for each selected test.
39
37
40
#Test Report font preferences
38
#Font preferences for the sample test reports: 
41
TEST_REPORT_FONT_PREFERENCES_PAGE_NAME   = Fonts
39
TEST_REPORT_FONT_PREFERENCES_PAGE_NAME   = Fonts
(-)plugin.xml (-13 / +5 lines)
Lines 51-69 Link Here
51
            id="org.eclipse.hyades.test.tools.ui.http.internal.reports.hitrate.HTTPPageHitRateReportGeneratorWizard.java"/>
51
            id="org.eclipse.hyades.test.tools.ui.http.internal.reports.hitrate.HTTPPageHitRateReportGeneratorWizard.java"/>
52
   	</extension>
52
   	</extension>
53
   
53
   
54
   	<extension
55
      	point="org.eclipse.ui.views">
56
      	<category
57
           	name="%REPORT_WINDOW_WTITLE"
58
            id="org.eclipse.tptp.test.samples.views"/>
59
	   	<view
60
            name="%REPORT_WINDOW_WTITLE"
61
            icon="icons/full/etool16/report_window_wiz.gif"
62
            category="org.eclipse.hyades.test.ui.views"
63
            class="org.eclipse.hyades.test.tools.ui.common.internal.report.ReportView"
64
            id="org.eclipse.hyades.test.tools.ui.common.internal.report.ReportView"/>
65
   	</extension>
66
   
67
   	<extension 
54
   	<extension 
68
   		point="org.eclipse.ui.preferencePages">
55
   		point="org.eclipse.ui.preferencePages">
69
      	<page name="%TEST_REPORT_FONT_PREFERENCES_PAGE_NAME" 
56
      	<page name="%TEST_REPORT_FONT_PREFERENCES_PAGE_NAME" 
Lines 71-74 Link Here
71
          	class="org.eclipse.hyades.test.tools.ui.common.internal.report.ReportStylesPreferencePage" 
58
          	class="org.eclipse.hyades.test.tools.ui.common.internal.report.ReportStylesPreferencePage" 
72
          	id="org.eclipse.hyades.test.tools.ui.common.internal.report.ReportStylesPreferencePage"/>
59
          	id="org.eclipse.hyades.test.tools.ui.common.internal.report.ReportStylesPreferencePage"/>
73
   	</extension>
60
   	</extension>
61
   	
62
   	<extension point="org.eclipse.help.contexts">
63
	    <contexts file="infopop\samplesUI.xml"/>	   
64
    </extension>
65
   	
74
</plugin>
66
</plugin>
(-)infopop/samplesUI.xml (+22 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
Copyright (c) 2008 IBM Corporation and others. 
4
All rights reserved.   This program and the accompanying materials 
5
are made available under the terms of the Eclipse Public License v1.0 
6
which accompanies this distribution, and is available at 
7
http://www.eclipse.org/legal/epl-v10.html
8
$Id$
9
         
10
Contributors: 
11
IBM - Initial contribution
12
-->
13
<?NLS TYPE="org.eclipse.help.contexts"?>
14
<contexts>
15
16
	<!-- Preferences: Test Report Fonts: -->
17
	<context id="ptrf001"> 
18
    	<description>Configure the fonts used when generating test reports.</description> 
19
        <topic href="../org.eclipse.hyades.test.doc.user/tasks/tcreatetestreports.htm" label="Generating test reports"/> 
20
        <topic href="../org.eclipse.hyades.test.doc.user/tasks/tcreateperformancetestreports.htm" label="Generating performance test reports"/> 
21
   	</context> 
22
</contexts> 

Return to bug 201844