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 135983 | Differences between
and this patch

Collapse All | Expand All

(-)build.properties (-1 lines)
Lines 5-9 Link Here
5
               plugin.properties,\
5
               plugin.properties,\
6
               css/,\
6
               css/,\
7
               toc/,\
7
               toc/,\
8
               images/,\
9
               notices.html
8
               notices.html
(-)build.properties (-1 lines)
Lines 6-10 Link Here
6
               plugin.properties,\
6
               plugin.properties,\
7
               css/,\
7
               css/,\
8
               toc/,\
8
               toc/,\
9
               images/,\
10
               notices.html
9
               notices.html
(-)tasks/tptpJUnitTest_testMethods.htm (-7 / +1 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) 2006, 2008 Scapa Technologies and others.
5
 * Copyright (c) 2006, 2009 Scapa Technologies and others.
6
 * All rights reserved. This content is made available under 
6
 * All rights reserved. This content is made available under 
7
 * the terms of the Eclipse Public License v1.0
7
 * 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 25-31 Link Here
25
<p>From the Java class, TPTP JUnit Test automatically
25
<p>From the Java class, TPTP JUnit Test automatically
26
identifies methods whose names begin with 'test' and maps these onto Test
26
identifies methods whose names begin with 'test' and maps these onto Test
27
Methods. For example, the source of the class SimpleTest is as follows:</p>
27
Methods. For example, the source of the class SimpleTest is as follows:</p>
28
<p>&nbsp;</p>
29
28
30
<pre>
29
<pre>
31
package junit.samples;
30
package junit.samples;
Lines 102-115 Link Here
102
}
101
}
103
</pre>
102
</pre>
104
103
105
<p>&nbsp;</p>
106
<p>&nbsp;</p>
107
<p>There are 3 methods whose names begin with 'test': <b>testAdd</b>,
104
<p>There are 3 methods whose names begin with 'test': <b>testAdd</b>,
108
<b>testDivideByZero</b>, and <b>testEquals</b>. These methods are listed in the <b>Test
105
<b>testDivideByZero</b>, and <b>testEquals</b>. These methods are listed in the <b>Test
109
Methods</b> pane of the Overview tab.</p>
106
Methods</b> pane of the Overview tab.</p>
110
<p>&nbsp;</p>
111
<p align=center><img src="../images/junittest001.png" alt=""/></p>
112
<p>&nbsp;</p>
113
107
114
<p>Note that, if the user adds a test method using the test editor, a new method will be added to the code.</p> 
108
<p>Note that, if the user adds a test method using the test editor, a new method will be added to the code.</p> 
115
109
(-)tasks/trunningjunittestsuite.htm (-16 / +2 lines)
Lines 29-46 Link Here
29
29
30
<p>If you want to run a TPTP JUnit Test remotely, you must create and configure a test deployment. 
30
<p>If you want to run a TPTP JUnit Test remotely, you must create and configure a test deployment. 
31
At a basic level, test deployments are 
31
At a basic level, test deployments are 
32
entities which relate other TPTP entities, artifacts and locations in pairs.<br/>
32
entities which relate other TPTP entities, artifacts and locations in pairs.</p>
33
<img width=486 height=216 src="../images/trunningjunittestsuite_image001.gif" alt="tree rooted at 1 with children 2 and 3. 4 is a leaf of 2 and 5 is a leaf of 3."/>
34
<br/><b>Figure 1:
35
<ol>
36
	<li>Deployment</li>
37
	<li>Artifact</li>
38
	<li>Location</li>
39
	<li>Test suites, datapools, and so on</li>
40
	<li>Host name, and so on</li>
41
</ol>
42
</b>
43
</p>
44
33
45
<p>Test <i>artifacts</i> provide associations for test assets like test suites (TPTP JUnit Tests for example) and datapools; test <i>locations</i> identify
34
<p>Test <i>artifacts</i> provide associations for test assets like test suites (TPTP JUnit Tests for example) and datapools; test <i>locations</i> identify
46
the computer where the test suite is to be run; and a test deployment definition typically consists of a pairing comprising a test artifact and a
35
the computer where the test suite is to be run; and a test deployment definition typically consists of a pairing comprising a test artifact and a
Lines 57-67 Link Here
57
	<li>OS Considerations</li>
46
	<li>OS Considerations</li>
58
</ul>
47
</ul>
59
48
60
<p>
61
These issues are discussed in the <i>Deployment ground rules</i> topic.
62
</p>
63
64
<p><b>Related tasks</b><br/>
49
<p><b>Related tasks</b><br/>
50
   <a href="tdeploymentintro.htm">Creating a test deployment</a><br/>
65
   <a href="trun.htm">Running a test</a><br/>
51
   <a href="trun.htm">Running a test</a><br/>
66
</p>
52
</p>
67
53
(-)tasks/tcreatetestreports.htm (-2 / +3 lines)
Lines 15-22 Link Here
15
 -->
15
 -->
16
16
17
<head>
17
<head>
18
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
18
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
19
<link rel="StyleSheet" href="../css/book.css" type="text/css" />
19
<link rel="stylesheet" type="text/css" href="../css/book.css"/>
20
<link rel="stylesheet" type="text/css" href="../css/swg_info_common.css"/>
20
<title>Generating test reports</title>
21
<title>Generating test reports</title>
21
</head>
22
</head>
22
<body>
23
<body>
(-)tasks/tptpJUnitTest_addingTestMethods.htm (-10 / +1 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) 2006, 2007 Scapa Technologies and others.
5
 * Copyright (c) 2006, 2009 Scapa Technologies and others.
6
 * All rights reserved. This content is made available under 
6
 * All rights reserved. This content is made available under 
7
 * the terms of the Eclipse Public License v1.0
7
 * 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 36-47 Link Here
36
1</i> method with <i>testAccount</i> by editing the value in the <b>Name</b> text box. Read about the other widgets on this page in the <i>JUnit Test Editor</i>
topic.
36
1</i> method with <i>testAccount</i> by editing the value in the <b>Name</b> text box. Read about the other widgets on this page in the <i>JUnit Test Editor</i>
topic.
37
</p>
37
</p>
38
38
39
<p>&nbsp;</p>
40
41
<p align=center><img src="../images/junitadd001.png" alt=""/></p>
42
43
<p>&nbsp;</p>
44
45
<p>Repeat to add <i>testOrder</i> and <i>testInvoice</i>.</p>
39
<p>Repeat to add <i>testOrder</i> and <i>testInvoice</i>.</p>
46
40
47
<h3>Associate test methods with the loop</h3>
41
<h3>Associate test methods with the loop</h3>
Lines 56-64 Link Here
56
50
57
<p>To include the testInvoice test method, stop selecting <i>Loop
51
<p>To include the testInvoice test method, stop selecting <i>Loop
58
1</i>, click<b> Add...</b>, select <i>testInvoice</i>, and click on <b>OK</b>. The Behavior should look like the screen capture below: a loop containing an invocation to testAccount and to testOrder, and following the loop an invocation to testInvoice.</p>
52
1</i>, click<b> Add...</b>, select <i>testInvoice</i>, and click on <b>OK</b>. The Behavior should look like the screen capture below: a loop containing an invocation to testAccount and to testOrder, and following the loop an invocation to testInvoice.</p>
59
<img border="0" src="../images/addmethod.gif" width="557" height="380" alt=""/>
60
61
<p>&nbsp;</p>
62
53
63
<h3>The Associated Java</h3>
54
<h3>The Associated Java</h3>
64
55
(-)concepts/cJUnitTestEditor.htm (-8 / +1 lines)
Lines 30-37 Link Here
30
how those methods are invoked.
30
how those methods are invoked.
31
Double-clicking on a JUnit test suite file opens the TPTP
31
Double-clicking on a JUnit test suite file opens the TPTP
32
JUnit Test Suite editor. Three tabs are visible: <b>Overview</b>, <b>Test Methods</b>, and <b>Behavior</b>.</p>
32
JUnit Test Suite editor. Three tabs are visible: <b>Overview</b>, <b>Test Methods</b>, and <b>Behavior</b>.</p>
33
<p align="center"><img border="0" src="../images/juniteditor.gif" width="590"
34
	height="461" alt=""/></p>
35
33
36
<h2>Overview Tab</h2>
34
<h2>Overview Tab</h2>
37
35
Lines 48-55 Link Here
48
46
49
<h2>Test Methods Tab</h2>
47
<h2>Test Methods Tab</h2>
50
<p>If the Test Methods tab is selected then the view switches
48
<p>If the Test Methods tab is selected then the view switches
51
to the Test Methods section of the editor:</p>
49
to the Test Methods section of the editor</p>
52
<p align=center><img src="../images/junittest003.png" alt=""/></p>
53
<p>Selecting a test method reveals its <i>Name</i> and <i>Description</i>
50
<p>Selecting a test method reveals its <i>Name</i> and <i>Description</i>
54
(if present) in the right-hand pane.</p>
51
(if present) in the right-hand pane.</p>
55
<p>To alter a test method <b>name</b>, select the test method
52
<p>To alter a test method <b>name</b>, select the test method
Lines 91-100 Link Here
91
can be changed via the <b>Number of Iterations</b>
88
can be changed via the <b>Number of Iterations</b>
92
check box which specifies the number of loop iterations. </p>
89
check box which specifies the number of loop iterations. </p>
93
90
94
<p><img src="../images/junitbehavior.png" alt=""/></p>
95
96
<p>&nbsp;</p>
97
98
<p>When <span class="uicontrol">Synchronous</span> 
91
<p>When <span class="uicontrol">Synchronous</span> 
99
is checked for a loop, each iteration of the loop is executed sequentially.  That is, the invocations and nested loops contained 
92
is checked for a loop, each iteration of the loop is executed sequentially.  That is, the invocations and nested loops contained 
100
in the loop are executed, based to their  <span class="uicontrol">Synchronous</span> property, for an 
93
in the loop are executed, based to their  <span class="uicontrol">Synchronous</span> property, for an 
(-)concepts/cedittest.htm (-8 / +7 lines)
Lines 40-47 Link Here
40
by right-clicking it in the <a href='javascript:executeCommand("org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.hyades.test.ui.TestNavigator)")'>Test Navigator</a> of the <a href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.hyades.ui.perspective.TestPerspective)")'>Test Perspective</a> and selecting <span class="uicontrol">Generate</span>.
40
by right-clicking it in the <a href='javascript:executeCommand("org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.hyades.test.ui.TestNavigator)")'>Test Navigator</a> of the <a href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.hyades.ui.perspective.TestPerspective)")'>Test Perspective</a> and selecting <span class="uicontrol">Generate</span>.
41
Or you can first edit the test by right-clicking it and selecting <span class="uicontrol">Open</span>. </p>
41
Or you can first edit the test by right-clicking it and selecting <span class="uicontrol">Open</span>. </p>
42
<p> </p>
42
<p> </p>
43
<p>Open the performance test in the TPTP URL Test editor:</p>
43
<p>Open the performance test in the TPTP URL Test editor.</p>
44
<img src="../images/editOverview.jpg" alt=""/><p>The test opens in the <span class="uicontrol">Overview</span> tab (see the bottom
44
<p>The test opens in the <span class="uicontrol">Overview</span> tab (see the bottom
45
border) with the four edit areas (<span class="uicontrol">TPTP URL Test</span> and <span class="uicontrol">Source
45
border) with the four edit areas (<span class="uicontrol">TPTP URL Test</span> and <span class="uicontrol">Source
46
Information</span> on the left and <span class="uicontrol">Deployment</span> and <span class="uicontrol">HTTP Requests</span> on
46
Information</span> on the left and <span class="uicontrol">Deployment</span> and <span class="uicontrol">HTTP Requests</span> on
47
the right) expanded. You switch to the other edit panes by clicking the appropriate
47
the right) expanded. You switch to the other edit panes by clicking the appropriate
Lines 65-72 Link Here
65
 and select <b>Open Source</b> or <b>Alt+Shift+T, O</b>.</p>
65
 and select <b>Open Source</b> or <b>Alt+Shift+T, O</b>.</p>
66
<p>The <span class="uicontrol">HTTP Requests</span> area on the right lists all HTTP
66
<p>The <span class="uicontrol">HTTP Requests</span> area on the right lists all HTTP
67
requests in the test. Clicking one of these requests takes you to the HTTP
67
requests in the test. Clicking one of these requests takes you to the HTTP
68
Requests view, shown below.</p>
68
Requests view.</p>
69
<img src="../images/editRequests.jpg" alt="" /><p>You can also get to this edit pane by clicking the <span class="uicontrol">HTTP Requests</span> tab
69
<p>You can also get to this edit pane by clicking the <span class="uicontrol">HTTP Requests</span> tab
70
along the bottom. When you click a request on the left, you see that request's
70
along the bottom. When you click a request on the left, you see that request's
71
properties on the right. You can:</p>
71
properties on the right. You can:</p>
72
<ul><li>Change the properties of an existing request</li>
72
<ul><li>Change the properties of an existing request</li>
Lines 83-90 Link Here
83
that you want to simulate during test execution.
83
that you want to simulate during test execution.
84
</p>
84
</p>
85
<p>Clicking the <span class="uicontrol">Behavior</span> tab opens the behavior edit
85
<p>Clicking the <span class="uicontrol">Behavior</span> tab opens the behavior edit
86
pane, shown below.</p>
86
pane.</p>
87
<img src="../images/editBehavior.jpg"  alt=""/><p>The HTTP requests are listed by page, as
87
<p>The HTTP requests are listed by page, as
88
invocations, inside a loop construct initially named <span class="uicontrol">Loop 1</span>.
88
invocations, inside a loop construct initially named <span class="uicontrol">Loop 1</span>.
89
With this loop selected, you can rename the loop, describe what it does, or
89
With this loop selected, you can rename the loop, describe what it does, or
90
change the <span class="uicontrol">Number of Iterations</span>. When <span class="uicontrol">Synchronous</span> 
90
change the <span class="uicontrol">Number of Iterations</span>. When <span class="uicontrol">Synchronous</span> 
Lines 101-108 Link Here
101
Thus, if you click an invocation, an Edit button appears under Detailed Properties.
101
Thus, if you click an invocation, an Edit button appears under Detailed Properties.
102
Clicking this button opens the Test Invocation dialog box, allowing you to
102
Clicking this button opens the Test Invocation dialog box, allowing you to
103
invoke another existing test suite in your workspace with the selected GET
103
invoke another existing test suite in your workspace with the selected GET
104
invocation. <br />
104
invocation.</li>
105
<img src="../images/editBehaviorInvocation.jpg"  alt=""/></li>
106
</ul>
105
</ul>
107
<p>With the <span class="uicontrol">Add</span> button, you can create a new loop.
106
<p>With the <span class="uicontrol">Add</span> button, you can create a new loop.
108
Then, by right-clicking that new loop and selecting <span class="uicontrol">Invocation</span>,
107
Then, by right-clicking that new loop and selecting <span class="uicontrol">Invocation</span>,
(-)samples/saccessdatapool.htm (-9 / +4 lines)
Lines 172-179 Link Here
172
		Invocation dialog appears. Select <b>testItemCost</b> and click OK.</li>
172
		Invocation dialog appears. Select <b>testItemCost</b> and click OK.</li>
173
		<li>Save the test suite. From the File menu, choose <b>File &gt; Save</b>.
173
		<li>Save the test suite. From the File menu, choose <b>File &gt; Save</b>.
174
		<br />
174
		<br />
175
		<img border="0" src="../images/testTutorial_Behavior.gif" width="534"
176
			height="407" alt=""/> <br />
177
		Note: the Save command causes the TPTP JUnit Test editor to create
175
		Note: the Save command causes the TPTP JUnit Test editor to create
178
		test method stubs in <i>MyShoppingCartTest.java</i>.<br />
176
		test method stubs in <i>MyShoppingCartTest.java</i>.<br />
179
		</li>
177
		</li>
Lines 217-225 Link Here
217
		select the datapoolExample project folder for the location.</li>
215
		select the datapoolExample project folder for the location.</li>
218
		<li>Click <b>Run</b> to launch the test.</li>
216
		<li>Click <b>Run</b> to launch the test.</li>
219
	</ul></li>
217
	</ul></li>
220
		<li>Double-click the MyShoppingCartTest test log, which appears in the <a href='javascript:executeCommand("org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.hyades.test.ui.TestNavigator)")'>Test Navigator</a> of the <a href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.hyades.ui.perspective.TestPerspective)")'>Test Perspective</a>. The MyShoppingCartTest test log appears. Select the Events tab to view the test details. You should see the following events: start of test suite, start of Loop_MyShoppingCart, test start, test verdict, test stop, second test start, second test verdict, second test stop, loop stop,  test suite verdict, and  test suite stop.<br />
218
		<li>Double-click the MyShoppingCartTest test log, which appears in the <a href='javascript:executeCommand("org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.hyades.test.ui.TestNavigator)")'>Test Navigator</a> of the <a href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.hyades.ui.perspective.TestPerspective)")'>Test Perspective</a>. The MyShoppingCartTest test log appears. Select the Events tab to view the test details. You should see the following events: start of test suite, start of Loop_MyShoppingCart, test start, test verdict, test stop, second test start, second test verdict, second test stop, loop stop,  test suite verdict, and  test suite stop.</li>
221
		<img border="0" src="../images/testTutorial_JUnitSuccess.gif"
219
		</ol>
222
			width="666" height="420" alt=""/></li></ol><br />
220
		<br />
223
<h2><a name="CreateDatapool">Creating a datapool and initializing test
221
<h2><a name="CreateDatapool">Creating a datapool and initializing test
224
data</a></h2>
222
data</a></h2>
225
<br />In this procedure, you create a simple datapool to store test data.  Using the datapool editor, you define a datapool's structural
223
<br />In this procedure, you create a simple datapool to store test data.  Using the datapool editor, you define a datapool's structural
Lines 270-279 Link Here
270
	</li>
268
	</li>
271
	<li class="skipspace"><span>Click <span class="uicontrol">Finish</span>.</span> If you specified initial datapool dimensions, which may conflict with the CSV file dimensions, a dialog appears. Click <b>Yes</b> to use the dimensions of the CSV file. Click <b>No</b> to use the specified initial dimensions (and possibly truncate the CSV file data).<span>
269
	<li class="skipspace"><span>Click <span class="uicontrol">Finish</span>.</span> If you specified initial datapool dimensions, which may conflict with the CSV file dimensions, a dialog appears. Click <b>Yes</b> to use the dimensions of the CSV file. Click <b>No</b> to use the specified initial dimensions (and possibly truncate the CSV file data).<span>
272
	</span>The Datapool editor appears, showing the data contained in the flowers equivalence class. <br />
270
	</span>The Datapool editor appears, showing the data contained in the flowers equivalence class. <br />
273
	<img
271
	For detailed information about creating a datapool, see <a
274
		border="0" src="../images/testTutorial_datapoolAppears.gif"
275
		width="354" height="416" alt=""/> 
276
		<br />For detailed information about creating a datapool, see <a
277
		href="../tasks/tcreatedatapool.htm">Creating a datapool</a>.</li>
272
		href="../tasks/tcreatedatapool.htm">Creating a datapool</a>.</li>
278
</ol>
273
</ol>
279
<h2><a name="ModifyTestCasesDP"><br />
274
<h2><a name="ModifyTestCasesDP"><br />

Return to bug 135983