Skip to main content
summaryrefslogtreecommitdiffstats
blob: 174335fda8e5f11f90189b8c2c49d005efc3fbf3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<%!
/*  Copyright 2008 IBM Corp.  All rights reserved.  This source code is made available under the terms of the Eclipse Public License, v1.0. */
%>
<html>
<head>
<title>Instructions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<font size="+2"> Automated Testing of Modeling Project Builds</font> 
<p>last updated: November 9, 2005</p>
<p><font size="+1">Description</font></p>
<p>This document describes how to run the your project's JUnit test plugins from the command 
  line. This is the same mechanism used in the builds.</p>
<p>Click <a href="testframework.html">here</a> for a description of the testing 
  framework, and how it can be used outside of the setup described here.</p>
<p>If you simply wish to write and run JUnit tests interactively from an Eclipse 
  workbench, try one of the links below:</p>
<p><a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-ui-home/plugins/org.eclipse.jdt.junit/index.html">JUnit 
  Support in Eclipse</a><br>
<a href="http://dev.eclipse.org:8080/help/content/help:/org.eclipse.jdt.doc.user/tasks/tasks-207.htm?resultof=%6a%75%6e%69%74%20&toc=%2Forg.eclipse.jdt.doc.user%2Ftoc.xml">Using 
  JUnit</a></p>

<p><font size="+1">Requirements</font></p>
<p>1. All test machines must have a java runtime environment (version 1.3.1) installed and added to the path environment variable (see 
  <a href="#vm">-vm</a> parameter below).<br>
  2. <a href="http://www.info-zip.org/pub/infozip/UnZip.html">Info-ZIP UnZip</a> 
  version 5.41 or later installed and added to the path.<br>
  3. The Automated Test feature from a
  <a href="http://www.eclipse.org/modeling/<c:get select="$build/@parentProjectName"/>">downloads</a>. 
  This contains the test framework plugins and the JUnit test plugins to run.<br>
  4. The zip file from the same build as the Automated Test feature.  You can use the <c:get select="$build/@parentProjectName"/>-*-SDK zip file instead of the individual files.<br>
  5. An Eclipse SDK zip file. The URL and build name of the required builds 
  are specified in the build.cfg file included in the Automated Test zip file.</p>
<p><font size="+1">Setup</font></p>
<p>1. Extract the <c:get select="$build/@parentProjectName"/>-*-automated-tests-<c:get select="$build/@incubationTag"/>&lt;buildid&gt;.zip. On Window, extract 
  this file close to the root of the drive to prevent some path names from exceeding 
  the 255 character limit. This will create a top-level directory &quot;<i>testing</i>&quot;.<br>
  2. Place the Eclipse SDK zip file and the project's runtime in the <i>testing</i> directory. 
  Do not unzip these files. (The test scripts will take care of this)<br>
</p>
<p><font size="+1">Running Tests</font></p>
<p>1. cd to the <i>testing</i> directory<br>
  2. Run the following script:</p>
<p><b>runtests.sh [-os &lt;operating system&gt;] [-ws &lt;windowing system&gt;] [-arch 
  &lt;architecture&gt;] [-noclean] [&lt;testTarget&gt;][-properties &lt;path&gt;][-vm 
  &lt;path to java executable&gt;]</b></p>
All parameters and targets are optional on windows systems. Just running &quot;runtests.sh&quot; 
will run <b>ALL</b> tests on Windows, installing a clean Eclipse and your project's SDK between 
each test target. On *nix systems, the os, ws and arch parameters must be specified. 
<br>
<br>
Test results are placed in the <i>testing</i>/<i>results</i> directory in xml and html format.<br>
<p><font size="+1"><a name="vm"></a>Parameters</font></p>
<table width="90%" border="1">
  <tr> 
    <td>Parameter</td>
    <td>Description</td>
  </tr>
  <tr> 
    <td>-os &lt;operating system&gt;</td>
    <td>The OS the tests are being run on. One of: aix, hpux, linux, qnx, solaris, 
      win32. <b>Default win32</b></td>
  </tr>
  <tr> 
    <td>-ws &lt;windowing system&gt;</td>
    <td>The windowing system the tests are being run on. One of: motif, gtk, photon, 
      win32. <b>Default win32</b></td>
  </tr>
  <tr> 
    <td>-arch &lt;architecture&gt;</td>
    <td>The architecture the tests are being run on. One of: ppc, PA_RISC, x86, 
      sparc. <b>Default x86</b></td>
  </tr>
  <tr> 
    <td>-noclean</td>
    <td>Run tests without installing an Eclipse and GEF SDK and tests between 
      test targets. Default is to re-install these between test targets.</td>
  </tr>
  <tr> 
    <td>-properties</td>
    <td>Used to reference a properties file containing additional Ant properties 
      used in running tests.Can be used to pass additional vm arguments to the 
      Java virtual machine running the tests by adding the entry &quot;extraVMargs=&lt;the 
      args to pass to the vm&gt;&quot; to the specified properties file.</td>
  </tr>
  <tr>
    <td>-vm</td>
    <td>The full path to the java executable with which to run the tests. Use 
      this to specify a specific virtual machine with which to run the tests. 
      For example, &quot;-vm c:\sun131\jre\bin\java&quot;. Default set to &quot;java&quot; 
      (i.e. java executable on system path). </td>
  </tr>
</table>
  
<p><font size="+1">Test Targets</font></p>
<p>Specifies which ant target to run in the main test.xml. Typically this corresponds 
  to a test project's tests. If you do not specify a test target then the <b>all</b> 
  test target is run.</p>

<table width="90%" border="1">
  <tr> 
    <td>all</td>
    <td>Runs all the targets below.</td>
  </tr>
  <tr> 
    <td><c:get select="$build/@parentProjectName"/></td>
    <td>Runs the JUnit tests located in the test plug-ins</td>
  </tr>
  <tr> 
    <td>genHtml</td>
    <td>Converts xml test results in the &quot;<i>testing</i>/<i>results</i>&quot; directory 
      to html.</td>
  </tr>
</table>
<p>&nbsp;</p>
<p><font size="+1"><a name="appendixb"></a>Appendix A- Supported os, ws, and arch 
  value combinations</font></p>
<p>The following table contains the values that can be used with the -os, -ws, 
  and -arch switches.</p>
<table width="75%" border="1">
  <tr> 
    <td>Operating System (os)</td>
    <td>Windowing System (ws)</td>
    <td>Architecture (arch)</td>
  </tr>
  <tr> 
    <td>aix</td>
    <td>motif</td>
    <td>ppc</td>
  </tr>
  <tr> 
    <td>hpux</td>
    <td>motif</td>
    <td>PA_RISC</td>
  </tr>
  <tr> 
    <td>linux</td>
    <td>gtk</td>
    <td>x86</td>
  </tr>
  <tr> 
    <td>linux</td>
    <td>motif</td>
    <td>x86</td>
  </tr>
  <tr> 
    <td height="24">qnx</td>
    <td height="24">photon</td>
    <td height="24">x86</td>
  </tr>
  <tr> 
    <td>solaris</td>
    <td>motif</td>
    <td>sparc</td>
  </tr>
  <tr> 
    <td>win32</td>
    <td>win32</td>
    <td>x86</td>
  </tr>
</table>
</body>
</html>

Back to the top