Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » [asf] query test result and generate report from ant
[asf] query test result and generate report from ant [message #115455] Mon, 15 October 2007 05:57 Go to next message
Eclipse User
Originally posted by: matthias.goettler.mathema.de

Hi all,

I have been trying to use the Automated Services Framework (ASF), but have
run into troubles using ant:
- running my unittest works fine
- querying the test result using the interrogator from does not work using
the example provided in the eclipse help ("Using the TPTP automatable
services"); with slight changes, this feature does work, though
- creating test reports from tests does not work at all; using the script
below, I get the message "[tptp:publication] ERROR: cannot find report
element null" after all the files to be added are listed correctly.
- sometimes the whole script will cause something like an illegal access
in memory ("cannot execute "read" on 0x0...").

I tried the scritp again while writing this message, and the first run
executed tests correctly, but failed generating the reports. For the
second run, I applied ant's "-debug"-option and the follwing happened:
[tptp:test] Test started!
[tptp:test] #
[tptp:test] # An unexpected error has been detected by HotSpot Virtual
Machine:
[tptp:test] #
[tptp:test] # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9122ba,
pid=2056, tid=212
[tptp:test] #
[tptp:test] # Java VM: Java HotSpot(TM) Client VM (1.5.0_12-b04 mixed mode)
[tptp:test] # Problematic frame:
[tptp:test] # C [ntdll.dll+0x122ba]
[tptp:test] #
[tptp:test] # An error report file with more information is saved as
hs_err_pid2056.log
[tptp:test] #
[tptp:test] # If you would like to submit a bug report, please visit:
[tptp:test] # http://java.sun.com/webapps/bugreport/crash.jsp
[tptp:test] #
[tptp:test] java.io.FileNotFoundException: C:\temp\memento2517-out.dat
(The system cannot find the file specified)
[tptp:test] at java.io.FileInputStream.open(Native Method)
[tptp:test] at java.io.FileInputStream.<init>(Unknown Source)
[tptp:test] at java.io.FileInputStream.<init>(Unknown Source)
[tptp:test] at
org.eclipse.hyades.automation.client.strategies.OutOfProcess Strategy.restoreMemento(OutOfProcessStrategy.java:363)
[tptp:test] at
org.eclipse.hyades.automation.client.strategies.OutOfProcess Strategy.execute(OutOfProcessStrategy.java:302)
[tptp:test] at
org.eclipse.hyades.automation.client.ServiceProxy.execute(Se rviceProxy.java:77)
[tptp:test] at
org.eclipse.hyades.automation.client.AutomationClient$Defaul t.execute(AutomationClient.java:160)
[tptp:test] at
org.eclipse.hyades.automation.client.adapters.java.Automatio nClientAdapter.execute(AutomationClientAdapter.java:168)
[tptp:test] at
org.eclipse.hyades.automation.client.adapters.ant.Automation ClientAdapter$Automation.execute(AutomationClientAdapter.jav a
:305)
[tptp:test] at
org.eclipse.hyades.automation.client.adapters.ant.Automation ClientAdapter$Execution.execute(AutomationClientAdapter.java :
611)
[tptp:test] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
[tptp:test] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[tptp:test] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
[tptp:test] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
[tptp:test] at java.lang.reflect.Method.invoke(Unknown Source)
[tptp:test] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:105)
[tptp:test] at org.apache.tools.ant.Task.perform(Task.java:348)
[tptp:test] at org.apache.tools.ant.Target.execute(Target.java:357)
[tptp:test] at
org.apache.tools.ant.Target.performTasks(Target.java:385)
[tptp:test] at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1329)
[tptp:test] at
org.apache.tools.ant.Project.executeTarget(Project.java:1298 )
[tptp:test] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
[tptp:test] at
org.apache.tools.ant.Project.executeTargets(Project.java:118 1)
[tptp:test] at org.apache.tools.ant.Main.runBuild(Main.java:698)
[tptp:test] at org.apache.tools.ant.Main.startAnt(Main.java:199)
[tptp:test] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[tptp:test] at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

BUILD FAILED
F:\docs\Campus\Ab_ins_Tipi\ant\asf_test.xml:40:
java.lang.NullPointerException
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:115)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298 )
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:118 1)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at
org.apache.tools.ant.PropertyHelper.setProperty(PropertyHelp er.java:308)
at org.apache.tools.ant.Project.setProperty(Project.java:507)
at
org.eclipse.hyades.automation.client.adapters.ant.Automation ClientAdapter$Execution.execute(AutomationClientAdapter.java :631)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:105)
... 11 more
--- Nested Exception ---
java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at
org.apache.tools.ant.PropertyHelper.setProperty(PropertyHelp er.java:308)
at org.apache.tools.ant.Project.setProperty(Project.java:507)
at
org.eclipse.hyades.automation.client.adapters.ant.Automation ClientAdapter$Execution.execute(AutomationClientAdapter.java :631)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298 )
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:118 1)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


I am using eclipse 3.3, TPTP 4.4.0.3 and Java 1.5 on Windows XP. My
ant-script used for launching is the following:
<project name="TPTP Ant Tasks Test Script"
default="test-results-publication"
xmlns:tptp="antlib:org.eclipse.hyades.automation.client.adapters.ant ">

<property name="eclipse.home" value="F:\docs\Campus\Ab_ins_tipi\eclipse"/>
<property name="report.dir" value="F:\docs\Campus\Ab_ins_tipi"/>


<!-- Define common properties for all automatable services -->
<property name="tptp.test.workspace"
value="F:\docs\Campus\Ab_ins_tipi\workspace"/>
<property name="tptp.test.project" value="MosaicCreator" />
<property name="tptp.test.connection"
value="tptp:rac://localhost:10002/default"/>
<property name="tptp.automation.eclipse" value="${eclipse.home}" />

<!-- Define script-local properties, that vary by installation -->
<property name="project.dir"
value="${tptp.test.workspace}\${tptp.test.project}"/>
<property name="report.publication.location" location="${report.dir}" />
<property name="tptp.publication.service"
value=" org.eclipse.tptp.test.report.birt.publish-tabular-testsuites "/>


<description>
This ant script tests the TPTP automation ant task client adapters
and also can be used to test the underlying execution of TPTP automatable
services via the TPTP automation server
</description>

<!-- Execute TPTP test suites -->
<target
name="test" description="Executes TPTP Test Suites using default TPTP Ant
Tasks">

<!--
Execute a TPTP test suite using the test task and providing the workspace
-->
<tptp:test
workspace="F:\docs\Campus\Ab_ins_tipi\workspace"
project="MosaicCreator"
suite="src/de/mathema/swmtgoet/MyJUnitTest.testsuite"
synchronicity="synchronous"
resultsrefid="tptp.test.results"/>

</target>

<!-- Interrogate test suite results for verdict -->
<target name="test-results-interrogation" depends="test">
<echo message="Interrogating test suite results..." />
<echo> ***** filelist is : ${tptp.test.results} ***** </echo>
<condition property="tptp.test.success">
<tptp:interrogation verdictproperty="tptp.test.verdict">
<filelist refid="tptp.test.results"/>
</tptp:interrogation>
</condition>
<echo message="The overall test result verdict is: '${tptp.test.verdict}'"
/>
<echo> ***** filelist is : ${tptp.test.results} ***** </echo>
</target>

<target name="test-results-publication" depends="test">
<echo message="Publishing test suite results report..." />
<tptp:publication report="${report.publication.location}/report.html">
<fileset dir="F:\docs\Campus\Ab_ins_tipi\workspace\MosaicCreator">
<include name="*.execution"/>
</fileset>
</tptp:publication>
</target>


<target name="set-date-range">
<!-- Use standard ant tstamp mechanisms to specify the desired date
range -->
<!-- This example uses a range between today and 60 days days prior -->
<tstamp>
<format property="startDateTime" pattern="MM/dd/yyyy hh:mm aa"
offset="-60" unit="day"/>
</tstamp>
<tstamp>
<format property="endDateTime" pattern="MM/dd/yyyy hh:mm aa"/>
</tstamp>
</target>

<!-- Publish test suite results report -->
<target name="test-results-publication-custom"
depends="set-date-range,test">
<echo message="Publishing test suite results report..." />
<tptp:publication report="${report.dir}/report.html"

reportTemplateLocation=" org.eclipse.tptp.test.report.birt.internal.TabularTPFTestSui teReportElement "
startDateTime="${startDateTime}" endDateTime="${endDateTime}" >
<fileset dir="F:\docs\Campus\Ab_ins_tipi\workspace\MosaicCreator">
<include name="**/*.testsuite" />
</fileset>
</tptp:publication>
</target>

</project>

I know, this is all quite strange, but I feel I have no more ideas to
track down what I may have gotten wrong.

Tanks in advance.
Matthias
Re: [asf] query test result and generate report from ant [message #120287 is a reply to message #115455] Tue, 08 January 2008 14:34 Go to previous message
DuWayne Morris is currently offline DuWayne Morris
Messages: 36
Registered: July 2009
Member
Hi,

My apologies for the late reply.

For the missing file exception [tptp:test] java.io.FileNotFoundException:
C:\temp\memento2517-out.dat (The system cannot find the file specified),
this is a symptom of an uncaught exception somewhere that caused the
headless eclipse process to exit without writing the output results file.
See the following defect for further details:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=194503

Typically, this particular error has been relatively infrequent and
random. If this error happens more than once, it is a good idea to make
sure the test in question still runs without a problem from the IDE.

As for the main issue with reporting, there have been several defects
fixed since 4.4.0.3 that may be responsible for the difficulties. While I
realize you are using the latest release, would you be able to switch to a
later development version, such as 4.4.1 or one of the recent stable
builds in 4.5?

If you are unable to switch to a later build or you are still having a
problem with getting the reporting to work under ASF, let me know and I
will give this some added more expedient response.

Thanks,
DuWayne
Previous Topic:How to user TPTP to find Perm Gen leak?
Next Topic:BIRT classpath issue when publishing report
Goto Forum:
  


Current Time: Tue Sep 02 02:56:34 EDT 2014

Powered by FUDForum. Page generated in 0.02054 seconds