Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13371 > unrolled thread

Validate or unit test for TLD files?

Started byDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
First post2012-04-04 10:13 -0700
Last post2012-04-04 21:11 -0400
Articles 9 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Validate or unit test for TLD files? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-04 10:13 -0700
    Re: Validate or unit test for TLD files? Roedy Green <see_website@mindprod.com.invalid> - 2012-04-04 10:23 -0700
      Re: Validate or unit test for TLD files? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-04 10:45 -0700
    Re: Validate or unit test for TLD files? markspace <-@.> - 2012-04-04 10:27 -0700
      Re: Validate or unit test for TLD files? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-04 10:47 -0700
        Re: Validate or unit test for TLD files? Roedy Green <see_website@mindprod.com.invalid> - 2012-04-04 14:21 -0700
          Re: Validate or unit test for TLD files? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-04 15:06 -0700
          Re: Validate or unit test for TLD files? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-04 19:14 -0300
    Re: Validate or unit test for TLD files? Arne Vajhøj <arne@vajhoej.dk> - 2012-04-04 21:11 -0400

#13371 — Validate or unit test for TLD files?

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-04-04 10:13 -0700
SubjectValidate or unit test for TLD files?
Message-ID<Si%er.27207$GV1.16300@newsfe12.iad>
We have a tag lib descriptor file, and when we tried to integrate it we 
found a problem.  Is there an easy way to validate and/or unit test a 
TLD file?

Thanks,
Daniel.

[toc] | [next] | [standalone]


#13372

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-04-04 10:23 -0700
Message-ID<tp0pn7hasqi96he6e9ivbf80jh70oie1ho@4ax.com>
In reply to#13371
On Wed, 04 Apr 2012 10:13:22 -0700, Daniel Pitts
<newsgroup.nospam@virtualinfinity.net> wrote, quoted or indirectly
quoted someone who said :

>We have a tag lib descriptor file, and when we tried to integrate it we 
>found a problem.  Is there an easy way to validate and/or unit test a 
>TLD file?

I presume you mean a file like this?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag
Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
 <tlibversion>1.0</tlibversion>
 <jspversion>1.1</jspversion>
 <shortname>j2eeforum</shortname>
 <info>Sample Tag library  Created for j2eeforum </info>
  <!-Tag Starts -->
  <tag>
    <name>ipaddress</name>
    <tagclass>j2eeforum.IpAddress </tagclass>
    <bodycontent>empty</bodycontent>
    <info>
 This is a example tag for displaying ipaddress.
    </info>
    <attribute>
    <name>target</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
     </attribute>
</tag>
</taglib>

You could feed an example into Stylus Studio and it will generate you
an XSD for it. Polish the XSD manually, and you have a syntax checker.

See http://mindprod.com/jgloss/xsd.html
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..

[toc] | [prev] | [next] | [standalone]


#13374

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-04-04 10:45 -0700
Message-ID<NM%er.49363$M%7.16784@newsfe10.iad>
In reply to#13372
On 4/4/12 10:23 AM, Roedy Green wrote:
> On Wed, 04 Apr 2012 10:13:22 -0700, Daniel Pitts
> <newsgroup.nospam@virtualinfinity.net>  wrote, quoted or indirectly
> quoted someone who said :
>
>> We have a tag lib descriptor file, and when we tried to integrate it we
>> found a problem.  Is there an easy way to validate and/or unit test a
>> TLD file?
>
> I presume you mean a file like this?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag
> Library 1.1//EN"
> "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
> <taglib>
>   <tlibversion>1.0</tlibversion>
>   <jspversion>1.1</jspversion>
>   <shortname>j2eeforum</shortname>
>   <info>Sample Tag library  Created for j2eeforum</info>
>    <!-Tag Starts -->
>    <tag>
>      <name>ipaddress</name>
>      <tagclass>j2eeforum.IpAddress</tagclass>
>      <bodycontent>empty</bodycontent>
>      <info>
>   This is a example tag for displaying ipaddress.
>      </info>
>      <attribute>
>      <name>target</name>
>      <required>false</required>
>      <rtexprvalue>true</rtexprvalue>
>       </attribute>
> </tag>
> </taglib>
>
> You could feed an example into Stylus Studio and it will generate you
> an XSD for it. Polish the XSD manually, and you have a syntax checker.
>
> See http://mindprod.com/jgloss/xsd.html
Syntax is one thing, but not the only thing that contributes to 
validity.  Classes need to be spelled correctly, functions need to have 
the correct signatures, etc...

[toc] | [prev] | [next] | [standalone]


#13373

Frommarkspace <-@.>
Date2012-04-04 10:27 -0700
Message-ID<jli0a8$egc$1@dont-email.me>
In reply to#13371
On 4/4/2012 10:13 AM, Daniel Pitts wrote:
> We have a tag lib descriptor file, and when we tried to integrate it we
> found a problem. Is there an easy way to validate and/or unit test a TLD
> file?


One Google web search later....

<https://blogs.oracle.com/jluehe/entry/validate_your_tag_library_descriptor>

[toc] | [prev] | [next] | [standalone]


#13375

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-04-04 10:47 -0700
Message-ID<%O%er.49364$M%7.37532@newsfe10.iad>
In reply to#13373
On 4/4/12 10:27 AM, markspace wrote:
> On 4/4/2012 10:13 AM, Daniel Pitts wrote:
>> We have a tag lib descriptor file, and when we tried to integrate it we
>> found a problem. Is there an easy way to validate and/or unit test a TLD
>> file?
>
>
> One Google web search later....
>
> <https://blogs.oracle.com/jluehe/entry/validate_your_tag_library_descriptor>
And... that doesn't provide any build-time validation.  Thanks, but I 
use google myself. The answer wasn't forthcoming so that's why I asked here.

If possible, I'd like to validate these outside of having a J2EE 
container running.

[toc] | [prev] | [next] | [standalone]


#13390

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-04-04 14:21 -0700
Message-ID<7oepn7loiq540l56caa1suu6a27uhill0f@4ax.com>
In reply to#13375
On Wed, 04 Apr 2012 10:47:39 -0700, Daniel Pitts
<newsgroup.nospam@virtualinfinity.net> wrote, quoted or indirectly
quoted someone who said :

>If possible, I'd like to validate these outside of having a J2EE 
>container running.

What kind of errors won't show up by just using the TLD? 
Surely you are not the first person to encounter this problem.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..

[toc] | [prev] | [next] | [standalone]


#13395

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-04-04 15:06 -0700
Message-ID<BB3fr.20024$Ce4.14343@newsfe21.iad>
In reply to#13390
On 4/4/12 2:21 PM, Roedy Green wrote:
> On Wed, 04 Apr 2012 10:47:39 -0700, Daniel Pitts
> <newsgroup.nospam@virtualinfinity.net>  wrote, quoted or indirectly
> quoted someone who said :
>
>> If possible, I'd like to validate these outside of having a J2EE
>> container running.
>
> What kind of errors won't show up by just using the TLD?
> Surely you are not the first person to encounter this problem.
That's the problem, I want to find the errors before use. This is in a 
library package separated from its uses.

[toc] | [prev] | [next] | [standalone]


#13396

FromArved Sandstrom <asandstrom3minus1@eastlink.ca>
Date2012-04-04 19:14 -0300
Message-ID<CJ3fr.2786$5m.2627@newsfe20.iad>
In reply to#13390
On 12-04-04 06:21 PM, Roedy Green wrote:
> On Wed, 04 Apr 2012 10:47:39 -0700, Daniel Pitts
> <newsgroup.nospam@virtualinfinity.net> wrote, quoted or indirectly
> quoted someone who said :
> 
>> If possible, I'd like to validate these outside of having a J2EE 
>> container running.
> 
> What kind of errors won't show up by just using the TLD? 
> Surely you are not the first person to encounter this problem.

I think (repeated) app deployments in a container _will_ winkle out all
the problems. That's been my experience. But it is quite time-consuming,
which is what I think Daniel is getting at.

What I do for Facelets taglib descriptor files *and* the XHTML pages
that use them - which are the only variant I am interested in - is run a
few scripts I've written myself. It's not particularly complicated bash
or Windows Powershell logic.

On a related note I've found myself doing similar things for validating
persistence.xml config files.

AHS
-- 
A fly was very close to being called a "land," cause that's what they do
half the time.
-- Mitch Hedberg

[toc] | [prev] | [next] | [standalone]


#13402

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-04-04 21:11 -0400
Message-ID<4f7cf15d$0$291$14726298@news.sunsite.dk>
In reply to#13371
On 4/4/2012 1:13 PM, Daniel Pitts wrote:
> We have a tag lib descriptor file, and when we tried to integrate it we
> found a problem. Is there an easy way to validate and/or unit test a TLD
> file?

I can not see any other way than writing a unit test JSP
page, deploy it and TLD+JAR and then unit test the output
from the JSP page.

It is very debatable whether that is really *unit* testing,
but ...

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web