Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Open Execution file and parse it
Open Execution file and parse it [message #100678] Sat, 09 June 2007 23:43 Go to next message
Eclipse UserFriend
Originally posted by: user.domain.invalid

Hi all,

I'm building a Rational Manual Tester exporter plugin.

But I need to open an execution file, get the content and build a PDF
with it.

Since the execution file is similar to a jar file, I'm using the JarFile
class to get it's content.
Well the problem is when I try to parse the ResourceContents file.
Since I'm opening and getting the information on demand I don't want to
create a file then use:

URI uri = URI.createFileURI(new File("ResourceContents").getAbsolutePath());

then

Resource resource = resourceSet.getResource(uri, true);

Is there either a better way to do it or to create a URI from an
InputStream?

Thanks in Advance!!
Re: Open Execution file and parse it [message #101505 is a reply to message #100678] Fri, 22 June 2007 19:05 Go to previous message
Paul Slauenwhite is currently offline Paul SlauenwhiteFriend
Messages: 975
Registered: July 2009
Senior Member
Hi,
An execution result file is an EMF model serialized to XMI and
compressed. You can iterate the contents by using the following code:

//Resolve the test result file:
File testResultFile = new File(<test result file path>);

//Initialize the test models:
org.eclipse.hyades.models.common.facades.behavioral.impl.Fac adeResourceFactoryImpl.initializeRequisiteModels();


//Create the resource set:
org.eclipse.emf.ecore.resource.ResourceSet resourceSet = new
ResourceSetImpl();


//Resolve the test result resource:
org.eclipse.emf.ecore.resource.Resource testResultResource =
resourceSet.getResource(URI.createFileURI(testResultFile.get AbsolutePath()),true);


//Resolve the test result:
org.eclipse.hyades.models.common.testprofile.TPFExecutionRes ult testResult =
(TPFExecutionResult) testResultResource.getContents().get(0);

I would recommend creating a report generator that generates a PDF
instead of an HTML report
( http://www.eclipse.org/tptp/home/documents/process/developme nt/Guide-to-TPTP-BIRT-Reports.html).
You can also use the XML Test Report generator to generate an XML
representation of a one or more test results.

Paul
<user@domain.invalid> wrote in message
news:f4fe1k$ebp$1@build.eclipse.org...
> Hi all,
>
> I'm building a Rational Manual Tester exporter plugin.
>
> But I need to open an execution file, get the content and build a PDF with
> it.
>
> Since the execution file is similar to a jar file, I'm using the JarFile
> class to get it's content.
> Well the problem is when I try to parse the ResourceContents file.
> Since I'm opening and getting the information on demand I don't want to
> create a file then use:
>
> URI uri = URI.createFileURI(new
> File("ResourceContents").getAbsolutePath());
>
> then
>
> Resource resource = resourceSet.getResource(uri, true);
>
> Is there either a better way to do it or to create a URI from an
> InputStream?
>
> Thanks in Advance!!
Previous Topic:DataPool in concurrency
Next Topic:How to Write to a Datapool?
Goto Forum:
  


Current Time: Fri Dec 27 03:18:14 GMT 2024

Powered by FUDForum. Page generated in 0.03579 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top