[RFC][icedtea-web] Plugin doesn't halt when required elements from JNLP files are missing.

Omair Majid omajid at redhat.com
Mon Mar 19 09:56:47 PDT 2012

On 03/19/2012 02:38 AM, Jiri Vanek wrote:
> On 03/17/2012 12:35 AM, Omair Majid wrote:
>> On 03/14/2012 04:08 PM, Danesh Dadachanji wrote:
>>> +    * netx/net/sourceforge/jnlp/Parser.java:
>>> +    (getInformationDesc): If title or vendor are not found in info,
>>> +    a new ParseException is thrown.
>> There is something wrong here. Many unit tests contain snippets of jnlp
>> files that do not contain title or vendor tags. Those unit tests are
>> (mostly) still passing (by this, I mean a simple parse operation on them
>> succeeds). I see about 1 new failure where I was expecting tons.
> As far as I know Danesh have fixed all the information elements across
> testcases.

I was referring to junit tests (located at tests/netx/unit). Danesh and
I talked about it on irc today. It looks like the Parser class is lazy
and only parses parts of the xml when specific methods are called. So if
you dont call the getInfo() method of the Parser, it will not check that
the information element is valid. Most of the unit tests are not calling
these methods explicitly so they are not checking for the validity.

This is not a problem for jnlp parsing (using JNLPFile) because JNLPFile
invokes all these lazy methods of the Parser (essentially) in its

>> Did I mention I prefer unit tests rather than integration tests for
>> checking corner cases? :)
> Yap. This give sense. The fault of directing this to reproducers run to
> my head :(

No worries. It's nice to have test cases one way or another :)


More information about the distro-pkg-dev mailing list