Skip to main content
summaryrefslogtreecommitdiffstats
blob: 4a11cdfa0a294a1025f5f33ee52840283975aba5 (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (c) 2018 BREDEX GmbH.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html
 -->

<section xml:id="embeddedAgent" xmlns="http://docbook.org/ns/docbook"
 xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xl="http://www.w3.org/1999/xlink">
 <title>Using the Embedded Agent for tests with API</title>
 <section>
  <title>General Information and setup for the Embedded Agent for tests
   with API
  </title>
  <para>It is possible that a AUT agent could be started within a Test.
   Therefore a test can be written and executed completely without an
   other Jubula application.
  </para>
  <para>General setup information</para>
  <para>
   The following section describes where to find the relevant JARs /
   artifacts to use the EmbeddedAgent for API.
   The provided EmbeddedAgent
   has a minimum required runtime environment of
   <emphasis role="strong">Java 8</emphasis>
   .
  </para>
  <para>Following JARs / maven artifacts
   / OSGi bundles must be used in
   addition to the client API jars(see <xref linkend="clientAPI" />.). These Jars must be on the classpath:
  </para>
  <orderedlist>
   <listitem>
    <para>
     Each project requires dependencies to
     <emphasis role="strong">all</emphasis>
     of the
     <emphasis role="strong">toolkit neutral parts</emphasis>
     of the API:
    </para>
    <itemizedlist>
     <listitem>
      <para>org.eclipse.jubula.autagent.api</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.autagent.common</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.client.api</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.toolkit.api</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.rc.common.agent</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.tools</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.tools.exec</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.communication</para>
     </listitem>
    </itemizedlist>
   </listitem>
   <listitem>
   <para>The following are 3rd party libaries which are needed on the classpath.
   <itemizedlist>
     <listitem>
      <para>org.apache.commons.lang</para>
     </listitem>
     <listitem>
      <para>org.apache.commons.io</para>
     </listitem>
     <listitem>
      <para>org.apache.commons.exec</para>
     </listitem>
     <listitem>
      <para>org.apache.commons.codec</para>
     </listitem>
     <listitem>
      <para>org.apache.commons.beanutils</para>
     </listitem>
     <listitem>
      <para>org.apache.oro</para>
     </listitem>
     <listitem>
      <para>org.eclipse.osgi</para>
     </listitem>
     <listitem>
      <para>javax.xml</para>
     </listitem>
     <listitem>
      <para>javax.xml.stream</para>
     </listitem>
     <listitem>
      <para>org.slf4j.api</para>
     </listitem>
     <listitem>
      <para>ch.logback.classic</para>
     </listitem>
     <listitem>
      <para>ch.logback.core</para>
     </listitem>
     <listitem>
      <para>org.xmlpull</para>
     </listitem>
     <listitem>
      <para>com.thoughtworks.xstream</para>
     </listitem>
     </itemizedlist></para>
     </listitem>
   <listitem>
    <para>
 The following jars can be on the classpath but are not mandatory. But it is
 important that they are located in the same directory as the
 org.eclipse.jubula.autagent.api.
 
 The following is needed independent on the toolkit:
    <itemizedlist>
     <listitem>
      <para>org.eclipse.jubula.rc.common</para>
     </listitem>
    </itemizedlist>
 Each project requires dependencies to
     <emphasis role="strong">individual</emphasis>
     parts of the
     <emphasis role="strong">toolkit specific elements</emphasis>
     dependent from the used toolkit of the API:
    </para>
    <itemizedlist>
     <listitem>
      <para>org.eclipse.jubula.rc.javafx</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.rc.javafx.j8u40</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.rc.swing</para>
     </listitem>
     <listitem>
      <para>org.eclipse.jubula.rc.swt</para>
     </listitem>
    </itemizedlist>
    <para>RCP is not listed because the rc.rcp plugin is deployed into
     the AUT
    </para>
   </listitem>
  </orderedlist>
  <para>
   You can find the artifacts in different shapes (plain JAR and maven
   artifact) within
   the
   <emphasis>&lt;ITEInstallationFolder&gt;/development/api</emphasis>
   folder. To define OSGi dependencies to the API artifacts
   you can
   simply include the
   <emphasis>&lt;ITEInstallationFolder&gt;/development/org.eclipse.jubula.repo.zip
   </emphasis>
   in
   your target platform (definition) and define a dependency to the
   "Jubula
   Functional Testing - API Embedded"-feature.
  </para>
  <para>
   A list of changes which happened over time in the API is located
   <link xl:href="../../api-comparison/index.html">here</link>
   .
  </para>
 </section>
 <section>
  <title>Sample execution</title>
  <para>
 The following Code shows a simple example how the embedded Agent can be
 used. The class
 <emphasis>org.eclipse.jubula.autagent.Embedded</emphasis>
 is responsible for the AutAgents lifecycle. The agent can be started
 with
 <emphasis>Embedded.INSTANCE.agent()</emphasis>
 or with an integer parameter for the port number. Only one Agent could
 be started and must be stopped with
 <emphasis>shutdown()</emphasis>
 before any other agent could be run.

 If a Embedded Agent is already started, you can get the AUTAgent
 instance again with
   <emphasis>Embedded.INSTANCE.agent()</emphasis>
   .
   <mediaobject>
    <imageobject>
     <imagedata fileref="images/embeddedAgent.png" />
    </imageobject>
   </mediaobject>
  </para>
 </section>
 <section>
 <title>Mapping with the embedded or external Agent for the API</title>
 
 <para>
 There are multiple ways to get an object mapped. Either you can use the
 mapping vie ITE and export the mapping for API (see
 <xref linkend="export-om" />
 ), or you can use the object Mapping from the Agent. To do this the
 embedded agent must be started and an AUT should be connected to it.
 Also there must be no connection to the Agent, otherwise the Object
 Mapping mode will be disabled. To start the Object Mapping follow the
 instructions. 
 <itemizedlist>
  <listitem>
   <para>Open the context menu of the Agent from the task bar
   </para>
  </listitem>
  <listitem>
   <para>Select Object Mapping
   </para>
  </listitem>
  <listitem>
   <para>Select Start and the AUT the object Mapping should be started for
   </para>
  </listitem>
 </itemizedlist>
 After the connection is successfully established the Object Mapping
 window will be opened. In this Window you get the Component Name, the
 type of the Component and the Encoded ComponentIdentifier. 
 
 The default shortcut for Mapping an component is <emphasis>Control + Schift + Q</emphasis>.
 It can be changed in the menu <emphasis role="menupath">File -> Settings</emphasis> .
    <mediaobject>
    <imageobject>
     <imagedata fileref="images/agentomm.png" />
    </imageobject>
   </mediaobject>
 </para>
 <para role="warning">When using this kind of Mapping you can not have any
  other client (API or ITE) connected to the agent.
 </para>
 <para role="warning">Extensions are not working for an external AUTAgent.
  This can only be achieved with an embedded agent for API. Before you
  start the embedded Agent, register the Testerclasses. 
  
  For mapping purpose it is recommended to have small java application which only starts the
  embedded agent, so it can be used as "external" agent.
 </para>
 </section>
 <section>
 <title>Extensions with the embedded Agent</title>
 <para>
  The embedded Agent can also be customized. The extensions are written
  in the same way as described in 
  <xref linkend="remoteControlExtension" />
  and
  <xref linkend="apiExtension" />.
  </para>
  <para>
  To deploy the extension for the embedded AutAgent for the API you must
  create a
  <emphasis>"ext"</emphasis>
  directory into the directory where the used
  <emphasis>org.eclipse.jubula.autagent.api.jar</emphasis> is located. After
  that you can put your rc extension into the
  <emphasis>"ext"</emphasis>
  directory and the extension will be used.
 </para>
 </section>
</section>

Back to the top