Parsing TPTP test execution results [message #54289] |
Wed, 22 February 2006 07:24  |
Eclipse User |
|
|
|
Originally posted by: tom.andersson.accenture.com
Hi.
I'm trying to convert TPTP AGR test results to a custom format from a
standalone application. So far I've managed to parse the
TPFExecutionResult instance and have access to all data in it.
Now the question remains how to find out names and possibly other
attributes for the testcases in the testsuite. Is there a nice way around
as the XMI file does only seem to have the ID's of the tests? Do i need to
couple the actual testsuite somehow to get access to testcase attributes?
Thanks in advance,
Tom
|
|
|
|
Re: Parsing TPTP test execution results [message #54396 is a reply to message #54316] |
Wed, 22 February 2006 11:25   |
Eclipse User |
|
|
|
Originally posted by: tom.andersson.accenture.com
Hi and thanks for the tips!
Unfortunately I still had no success in resolving test case properties..
It would probably be sufficient to be able to resolve the invocation
names. The problems i'm facing are:
1) When I load in the execution file and loop through the
TPFExecutionEvents, they seem to be missing a lot of information. For
example the text-property is null and the verdicts 'unknown' reasons. In
the XMI file these are shown ok. The verdict status (pass/fail..) are ok
though. Here's how i read the stuff in, does this look ok:
---------------
Common_TestprofilePackage profilePackage =
Common_TestprofilePackage.eINSTANCE;
URI xmiFileUri = URI.createFileURI(xmiFile.getAbsolutePath());
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "xmi",
new XMIResourceFactoryImpl());
resourceSet.getPackageRegistry().put(profilePackage.getNsURI (),
profilePackage);
return resourceSet.getResource(xmiFileUri, true);
---------------
2) I've now also loaded the actual TPFTestSuite so that i could compare
the ID's of the results and the actual testcases or invocations of the
testsuite. For some reason, though, the ID's of the TPFExecutionEvents
don't compare to the test suite id's very well (the id's of the loaded
events don't match the id's in the execution xmi-file).
Here's a sample what my events look like after they've been parsed:
---------------
org.eclipse.hyades.models.common.testprofile.impl.TPFVerdict EventImpl @1e845c2
(id: C9C6C362701E6C666DEFCEFFA3BD11DA, description: null, name: null)
(ownerId: E36787C12DEE9F254965F7C08F3C11DA(1), timestamp: 1140620582127,
text: null, eventType: null, scriptFileURI: null, scriptLineNumber: 0)
(verdict: fail, reason: unknown)
---------------
Phew.. so, I guess I'm going wrong here somewhere. Any help is appreciated.
Thanks,
Tom
|
|
|
Re: Parsing TPTP test execution results [message #55157 is a reply to message #54396] |
Mon, 27 February 2006 10:35   |
Eclipse User |
|
|
|
Hi Tom,
Please could you attach one of your test cases with an associated
execution results file (that works as you explain bellow).
--Marius
Tom Andersson wrote:
> Hi and thanks for the tips!
>
> Unfortunately I still had no success in resolving test case properties..
> It would probably be sufficient to be able to resolve the invocation
> names. The problems i'm facing are:
>
> 1) When I load in the execution file and loop through the
> TPFExecutionEvents, they seem to be missing a lot of information. For
> example the text-property is null and the verdicts 'unknown' reasons. In
> the XMI file these are shown ok. The verdict status (pass/fail..) are ok
> though. Here's how i read the stuff in, does this look ok:
>
> ---------------
> Common_TestprofilePackage profilePackage =
> Common_TestprofilePackage.eINSTANCE;
> URI xmiFileUri = URI.createFileURI(xmiFile.getAbsolutePath());
> ResourceSet resourceSet = new ResourceSetImpl();
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "xmi",
> new XMIResourceFactoryImpl());
> resourceSet.getPackageRegistry().put(profilePackage.getNsURI (),
> profilePackage);
>
> return resourceSet.getResource(xmiFileUri, true);
> ---------------
>
> 2) I've now also loaded the actual TPFTestSuite so that i could compare
> the ID's of the results and the actual testcases or invocations of the
> testsuite. For some reason, though, the ID's of the TPFExecutionEvents
> don't compare to the test suite id's very well (the id's of the loaded
> events don't match the id's in the execution xmi-file).
>
> Here's a sample what my events look like after they've been parsed:
> ---------------
> org.eclipse.hyades.models.common.testprofile.impl.TPFVerdict EventImpl @1e845c2
> (id: C9C6C362701E6C666DEFCEFFA3BD11DA, description: null, name: null)
> (ownerId: E36787C12DEE9F254965F7C08F3C11DA(1), timestamp: 1140620582127,
> text: null, eventType: null, scriptFileURI: null, scriptLineNumber: 0)
> (verdict: fail, reason: unknown)
> ---------------
>
> Phew.. so, I guess I'm going wrong here somewhere. Any help is appreciated.
>
> Thanks,
> Tom
>
|
|
|
|
|
|
Re: Parsing TPTP test execution results [message #55565 is a reply to message #55510] |
Tue, 28 February 2006 14:30  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------060100060501030100010501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Hi Tom,
Please try the attached files, unzip the test-resource.zip into a folder
and then run LoadExecutionResults by passing the path to the
EclipseTests.execution as an argument.
You should see all the values that you see in the snippets that you
provided in the previous message. For example search for "Test debug
perspective_behavior" in both testsuite snippet and the console output.
--Marius
--------------060100060501030100010501
Content-Type: text/java;
name="LoadExecutionResults.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="LoadExecutionResults.java"
package org.eclipse.hyades.use.cases.junit.models.test.utils;
import java.io.File;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.hyades.models.common.facades.behavioral.impl.Exe cutionFacadeResourceFactoryImpl;
import org.eclipse.hyades.models.common.facades.behavioral.impl.Fac adeResourceFactoryImpl;
import org.eclipse.hyades.models.common.testprofile.Common_Testprof ilePackage;
import org.eclipse.hyades.models.common.testprofile.TPFExecutionRes ult;
import org.eclipse.hyades.models.common.util.ICommonConstants;
public class LoadExecutionResults {
public static void main(String[] args) {
if(args.length==0)
{
System.out.println("Usage: java LoadExecutionResults <path_to_execution_file>");
return;
}
File executionFile = new File(args[0]);
Common_TestprofilePackage profilePackage = Common_TestprofilePackage.eINSTANCE;
URI executionResourceURI = URI.createFileURI(executionFile.getAbsolutePath());
ResourceSet resourceSet = new ResourceSetImpl();
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(ICommonConstants.TEST_SUITE_FILE_EXTENSION,
new FacadeResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(ICommonConstants.DEPLOYMENT_FILE_EXTENSION,
new FacadeResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(ICommonConstants.EXECUTION_FILE_EXTENSION,
new ExecutionFacadeResourceFactoryImpl());
Resource resource = resourceSet.getResource(executionResourceURI, true);
TreeIterator treeIterator = resource.getAllContents();
URI testsuiteResourceURI =null;
while (treeIterator.hasNext()) {
EObject element = (EObject) treeIterator.next();
if(element instanceof TPFExecutionResult)
{
testsuiteResourceURI = EcoreUtil.getURI(((TPFExecutionResult)element).getTest()).tr imFragment();
}
System.out.println("executionResource: "+element);
}
resource = resourceSet.getResource(testsuiteResourceURI, true);
treeIterator = resource.getAllContents();
while (treeIterator.hasNext()) {
EObject element = (EObject) treeIterator.next();
System.out.println("testsuiteResource: "+element);
}
}
}
--------------060100060501030100010501
Content-Type: application/x-zip-compressed;
name="test-resources.zip "
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="test-resources.zip "
UEsDBAoAAAAAABtZXDTUzDMeYwYAAGMGAAAlAAAAdGVzdC1yZXNvdXJjZXMv RWNsaXBzZVRl
c3RzLnRlc3RzdWl0ZVBLAwQUAAAACAATWVw0YB+4geEFAACmIAAAEAAAAFJl c291cmNlQ29u
dGVudHPtWutP20gQ/37S/Q8+I/Glil8hDwi0Co7T5q6lHAQ4qarQ4mySpbY3 510n9Hr87zdr
bxzHsZNAH6p0ESKx17Pz/M3MjuH41YPvKVMcMkKDE9XUDFXBgUsHJBidqFf9 bqWpvnr56y/H
NvV9Gtz2MeOTkA6Jh4/6511xexkRjpUHnxylbCzBBhgH7AjWT9Qx55MjXZ/N Zhr1RxoNR/pf
73opCVsmmVVjCsswTCB7e+mOsY8qJGAcBS6e75IKneIxmhIa3vYCjkPkclCA LbHDrkcmDMc8
x5/RADPdpwPsMd2NWeh3koVOMiw0UDwnKmP70wTwxcaELR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AABtZXDTUzDMeYwYAAGMGAAAlAAAAAAAAAAAAIAC2gQAAAAB0 ZXN0LXJlc291
cmNlcy9FY2xpcHNlVGVzdHMudGVzdHN1aXRlUEsBAhQACgAAAAAAl11cNAAA AAAAAAAAAAAA
AA8AAAAAAAAAAAAQAP9BpgYAAHRlc3QtcmVzb3VyY2VzL1BLAQIUABQAAgAI AC9ZXDQb4FaQ
rQYAAKgGAAAWAAAAAAAAAAAAIAAAANMGAABFY2xpcHNlVGVzdHMuZXhlY3V0 aW9uUEsFBgAA
AAADAAMA1AAAALQNAAAAAA==
--------------060100060501030100010501--
|
|
|
Powered by
FUDForum. Page generated in 0.03597 seconds