oaa2
directory of the distribution.HTML reporting in OaaTest requires you have
ANT installed. GUI reporting
does not require ANT.direct_connect
connections. We suggest you disable direct_connect
in your agents when using OaaTest. runtime/oaatest/samples/test2.runtime/scripts/oaatest_gui.bat (Windows) or
runtime/scripts/oaatest_gui.sh
(UNIX) and set TEST_IN to point to your test files,oaatest_gui.bat or oaatest_gui.sh.junit.jar or junit-3.8.1.jar
in its lib directory ($ANT_HOME/lib).
If its not there, copy lib/jar/junit-3.8.1.jar from your
OAA distribution.runtime/scripts/oaatest_html.xml: oaatest.in to point to your test
files,oaatest.out to the desired HTML output
location,runtime/scripts, run "ant -f
oaatest_html.xml".oaatest.out}/html/results.html.lib/jar to the tool's
classpath:
oaa2.jarantlr-oaa.jarconcurrent-1.3.1.jarlog4j-1.2.7.jarruntime/oaatest/jar/oaa2oaatest.jar to the
tool's classpath.oaatest.in Java system
property to point to your test files, perhaps through the Java VM
command line, "-Doaatest.in=c:\my\test\files".com.sri.oaa2.tools.oaatest.OaaTest<testcase>
element per
file. It
contains <send>, <toFac>, <fromFac>,
<parallel>,
and <prompt> elements. Use <send>
to initiate some
behavior
in an OAA agent or the system as a whole. Then use <toFac>
and
<fromFac> to check for the expected response,
indicated by events
to and from the facilitator. Use <parallel>
when you expect several events, but the relative order is
undefined. Use
<prompt> for user input.
<testcase>
<send>
oaa_Solve(weather([in(houston)],_),[blocking(false)])
</send>
<toFac>
ev_solved(_,_,_,
weather([in(houston)],_),
_,
[weather([in(houston)],HoustonWeather)])
<regex
var="HoustonWeather"
value="'The
weather in houston is currently .* temperature .*'"
/>
</toFac>
</testcase>
'The
weather in houston is currently partly cloudy with a temperature of 102
degrees.'.
<testcase><send>, <toFac>, <fromFac>,
<parallel>,
and <prompt> elements.timeout (integer, optional): Set the default timeout
value
(seconds)
for <toFac>, <fromFac>, and <parallel>
tags. 5
seconds if not specified.<send> oaa_Solve(Goal,Params) oaa_AddData(Data,Params) oaa_RemoveData(Data,Params) oaa_ReplaceData(Data,Params) oaa_LoadData(Data,Params) oaa_SaveData(Data,Params) oaa_AddTrigger(Type,Condition,Action,Params) oaa_RemoveTrigger(Type,Condition,Action,Params)<toFac>/<fromFac>timeout (integer, optional):
Specify in seconds how
long to wait for the event. Default is 5 seconds or value from
<testcase> tag if set.<toFac>/<fromFac><name
var="Var"
value="Val"
/>
where name is one of the tags given below, Var
is a variable from the
preceding ICL term, and Val is interpreted as below.| Name |
Type for "value"
Parameter |
Meaning |
|---|---|---|
gt |
number |
Var will only match
int or float
numbers greater than Val, e.g. <gt var="X"
value="3">
means X
> 3. |
lt, le,
ge |
number |
similar to gt
for <,
<=, and >=. |
regex |
regular expression |
Var will only match
ICL terms
that match the regular expression given in Val. The
regular
expression syntax is that of the java.util.Regex.Pattern
class. When using '|' for OR, add an extra set of parenthesis around
the entire OR expression, e.g. <regex var="FirstName"
value="(('Joe')|('Mary')|('Elmo')|('Alexa'))" /> |
contains |
ICL term |
Var will only match
ICL lists
that contain the ICL term Val as an element.Match list L iff some element of L unifies with Val. |
member |
ICL list |
Var will only match
ICL terms
that are a member of the ICL list Val.Match term T iff T unifies with some member of Val. |
subset |
ICL list |
Var will only match
ICL lists
that are a subset of the ICL list Val. Duplicates
are ignored in
both Val and potential matching lists.Match list L iff all elements of L unify with some element of Val. |
superset |
ICL list |
Var will only match
ICL lists
that are a superset of the ICL list Val. Duplicates
ignored.Match list L iff all elements of Val unify with some
element of L. |
equalset |
ICL list |
Var will only match
ICL lists
that contain the same terms as the ICL list Val.
Order and
duplicates are ignored.Match list L iff all elements of L unify with some element of Val
ANDall elements of Val unify with some element of L. |
[dog(rover),cat(X)] is a subset of [iguana(earl),cat(whiskers),dog(Y)].<parallel><send>
event
causes multiple agents to act. You might require certain events
from multiple agents, but don't know which will complete first.<toFac> or
<fromFac> tags giving the list
of events to match. The <parallel> tag will
succeed when it
has seen a matching event for each of its <toFac>/<fromFac>
children. Order of the children does
not matter.timeout (integer, optional):
Minimum time in seconds to wait for
all events to complete. Actual timeout will be maximum of this
value and all children's timeouts.<prompt><prompt message="Enter 'list all addresses'
in the
window and press OK"/>. May not be used inside
<parallel>.message
attribute, but not both.message (string, optional):
Text to display in dialog. Can
only be used if text contents are empty.< and & A
single quote ' inside an ICL
string is escaped with two quotes '' as usual in ICL.<testcase>
<send>
oaa_Solve(foo('It''s true that 3 <
4, but not
3 > 4'),[])
</send>
<send>
oaa_Solve(foo('This is an
ampersand &'),[])
</send>
</testcase>
<send>
oaa_Solve(foo(a,b,c,d
e,f,g,h,
'I am a quoted string with a newline right here.
I am the same quoted string after the newline.'),
[]
)
</send><send>
item
to run one of the agent's solvables. Then add <toFac>
items
to look for the agent's response to the facilitator or <fromFac>
items to look for the facilitator forwarding the response back to
OaaTest.<send>
items to mimic user-interface agents or whatever starts the system
running. Add <toFac> and <fromFac>
items to look for
critical events in the system interaction. When there is
ambiguity about the ordering of events, use a <parallel>
item
with nested <toFac> and <fromFac>
items. You might
start by using the Monitor Agent to observe the system and save the
Monitor log as an OTML file, see next section."Save Log as OTML"
under the "Event log" menu. First, record a log of
interactions among OAA agents, then "Save Log as OTML".
You will have the choice of generating an "active" or "passive" OTML
script. An active OTML script uses <send>
events to initiate behavior in an OAA system, then uses <toFac>
and <fromFac> to match events and confirm the
expected behavior. A passive OTML script has no <send>
events. Some application other than OaaTest (perhaps a GUI)
initiates behavior, then the OTML script uses <toFac>
and <fromFac> to confirm the expected
behavior. To generate an active script, you must select an
"Initiating Agent" from the list of agents involved in the logged
events. The generated script will actively <send>
whenever the Initiating Agent sent an event. For example, if you
used the Debug Agent to initiate behavior while recording events, then
the Debug Agent is your Initiating Agent.<toFac>/<fromFac>
event patterns more abstract, replacing overly-specific ICL terms with
"_".English Request"
box, type "Who is adam cheyer's boss" and click the send button
(unlabeled button to the right of the text box).Show Log". You
should see the events involved in the previous action, about eight of
them.Event Log|Save
Log as
OTML".oaa_debug_agent as the Initiating Agent.manager.otml.manager.otml using GUI
test-reporting, see Methods
of Running OaaTest. TEST_IN in runtime/scripts/oaatest_gui.bat
will point to your manager.otml file.*.otml files or follows the instructions in any Index
Files.index.idx and follow instructions in
that index file. Otherwise, add all .otml files and
traverse all subdirectories..otml" .idx"quick.idx
run a quick subset of tests and complete.idx run the
entire
time-consuming set.
<index>
<testcase file="setup.otml"/>
<repeat count="2000">
<testcase
file="set.otml"/>
<testcase
file="get.otml"/>
</repeat>
<testcase file="teardown.otml"/>
</index>
setup.otml test file, then
runs set.otml followed by get.otml 2000
times, and completes by running teardown.otml. setup.otml
prepares the OAA system for testing, set/get.otml are the
body of the test, and teardown.otml cleans up.
If the test fails during set/get, the repeat stops but teardown
still cleans up properly.<index><testcase>, <dir>, and
<repeat> elements.<testcase>file (required): relative filename of the OTML file.<dir>index.idx, follow the instructions there.
Otherwise, add all *.otml files and traverse all
sub-subdirectories.dir (required): relative pathname of the subdirectory.<repeat><repeat>
elements may be nested, but there is rarely a reason to do so.<testcase>, <repeat>,
and <dir> elements.count (integer, required): number of times to repeat.junitreport are not
especially well-suited to OaaTest output. We plan to make HTML
reports simpler and more legible. Reports will
include links to the OTML files,
line numbers where tests failed, and a division into top-level summary
page
and individual detail pages.