Open Execution file and parse it [message #100678] |
Sat, 09 June 2007 19:43  |
Eclipse User |
|
|
|
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 15:05  |
Eclipse User |
|
|
|
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!!
|
|
|
Powered by
FUDForum. Page generated in 0.08301 seconds