Parsing TestSuites from a stream

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Parsing TestSuites from a stream

JaPe-2

org.testng.xml.Parser no longer (it's been a long time now)  supports
parsing XML test suite files from a custom input stream (not a physical
file).
There is still a Parser constructor taking in a Stream instance, but
this is never used in the Parser.parse() method.
Several months ago we have developed a simple web test runner on top of
TestNG. This uses custom InputStreams to initialize (parse) test
suites. Now when trying to upgrade to the last TestNG release, we have
discovered,it is no longer possible to do it our way.

Is it a bug of the 5.4. release or was it done by purpose?


Thnx JaPe


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Parsing TestSuites from a stream

Alexandru Popescu ☀

I am wondering if you can send us a patch for this problem?

TIA,

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator


On 12/11/06, JaPe <[hidden email]> wrote:

>
> org.testng.xml.Parser no longer (it's been a long time now)  supports
> parsing XML test suite files from a custom input stream (not a physical
> file).
> There is still a Parser constructor taking in a Stream instance, but
> this is never used in the Parser.parse() method.
> Several months ago we have developed a simple web test runner on top of
> TestNG. This uses custom InputStreams to initialize (parse) test
> suites. Now when trying to upgrade to the last TestNG release, we have
> discovered,it is no longer possible to do it our way.
>
> Is it a bug of the 5.4. release or was it done by purpose?
>
>
> Thnx JaPe
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Parsing TestSuites from a stream

JaPe-2

As soon as somebody (a testng developer) states that this is a bug I
hope I can patch it. But I'm still not sure whether it's a bug or not.
Because I plan to keep our code with the latest testng version,
patching just this testng release would be useless - it would be better
for me to change the way we use the Parser class.

JaPe

Alexandru Popescu wrote:

> I am wondering if you can send us a patch for this problem?
>
> TIA,
>
> ./alex
> --
> .w( the_mindstorm )p.
>   TestNG co-founder
> EclipseTestNG Creator
>
>
> On 12/11/06, JaPe <[hidden email]> wrote:
> >
> > org.testng.xml.Parser no longer (it's been a long time now)  supports
> > parsing XML test suite files from a custom input stream (not a physical
> > file).
> > There is still a Parser constructor taking in a Stream instance, but
> > this is never used in the Parser.parse() method.
> > Several months ago we have developed a simple web test runner on top of
> > TestNG. This uses custom InputStreams to initialize (parse) test
> > suites. Now when trying to upgrade to the last TestNG release, we have
> > discovered,it is no longer possible to do it our way.
> >
> > Is it a bug of the 5.4. release or was it done by purpose?
> >
> >
> > Thnx JaPe
> >
> >
> > >
> >


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Parsing TestSuites from a stream

Alexandru Popescu ☀

On 12/13/06, JaPe <[hidden email]> wrote:
>
> As soon as somebody (a testng developer) states that this is a bug I
> hope I can patch it. But I'm still not sure whether it's a bug or not.
> Because I plan to keep our code with the latest testng version,
> patching just this testng release would be useless - it would be better
> for me to change the way we use the Parser class.
>
> JaPe
>

I wouldn't say it is a bug... but an API design bug :-). Yes, we
should use the stream and not recreate it in the parseOneFile method.
The fix should be trivial. If you don't have a patch, then I guess I
can fix it a bit later today.

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

> Alexandru Popescu wrote:
> > I am wondering if you can send us a patch for this problem?
> >
> > TIA,
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >   TestNG co-founder
> > EclipseTestNG Creator
> >
> >
> > On 12/11/06, JaPe <[hidden email]> wrote:
> > >
> > > org.testng.xml.Parser no longer (it's been a long time now)  supports
> > > parsing XML test suite files from a custom input stream (not a physical
> > > file).
> > > There is still a Parser constructor taking in a Stream instance, but
> > > this is never used in the Parser.parse() method.
> > > Several months ago we have developed a simple web test runner on top of
> > > TestNG. This uses custom InputStreams to initialize (parse) test
> > > suites. Now when trying to upgrade to the last TestNG release, we have
> > > discovered,it is no longer possible to do it our way.
> > >
> > > Is it a bug of the 5.4. release or was it done by purpose?
> > >
> > >
> > > Thnx JaPe
> > >
> > >
> > > >
> > >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Parsing TestSuites from a stream

Bill Michell-3
In reply to this post by JaPe-2
Unfortunately, it looks to me like allowing a bare InputStream to the constructor was a design mistake.
 
If anything, I think that it needs to be a org.xml.sax.InputSource that gets passed. An InputStream has no working directory information associated with it, and thus the behaviour of an XML parser is not very well defined, since it depends on the "current directory", whatever that might be!
 
If I was working on my own code here, I'd refactor the class to use an InputSource internally and re-write the other constructors to construct a suitable InputSource. I'd also delete the InputStream-only constructor, and rewrite any code that used it, so that the working directory was explicitly provided.

 
On 13/12/06, JaPe <[hidden email]> wrote:

As soon as somebody (a testng developer) states that this is a bug I
hope I can patch it. But I'm still not sure whether it's a bug or not.
Because I plan to keep our code with the latest testng version,
patching just this testng release would be useless - it would be better
for me to change the way we use the Parser class.

JaPe

Alexandru Popescu wrote:

> I am wondering if you can send us a patch for this problem?
>
> TIA,
>
> ./alex
> --
> .w( the_mindstorm )p.
>   TestNG co-founder
> EclipseTestNG Creator
>
>

> On 12/11/06, JaPe <[hidden email]> wrote:
> >
> > org.testng.xml.Parser no longer (it's been a long time now)  supports
> > parsing XML test suite files from a custom input stream (not a physical
> > file).
> > There is still a Parser constructor taking in a Stream instance, but
> > this is never used in the Parser.parse() method.
> > Several months ago we have developed a simple web test runner on top of
> > TestNG. This uses custom InputStreams to initialize (parse) test
> > suites. Now when trying to upgrade to the last TestNG release, we have
> > discovered,it is no longer possible to do it our way.
> >
> > Is it a bug of the 5.4. release or was it done by purpose?
> >
> >
> > Thnx JaPe
> >
> >
> > >
> >



--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---