I get it now :p<br><br><div class="gmail_quote">On Wed, Jun 13, 2012 at 1:16 AM, Lincoln Baxter, III <span dir="ltr"><<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah! Whoops, yes, that is actually a very good idea :) Thanks Dan, it's late and I'm tired :p<div class="HOEnZb">
<div class="h5"><br><br><div class="gmail_quote">On Wed, Jun 13, 2012 at 1:12 AM, Dan Allen <span dir="ltr"><<a href="mailto:dan.j.allen@gmail.com" target="_blank">dan.j.allen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Let's not miss the original point that George makes, which is that comparing the structure may make less fragile tests than comparing the raw HTML. I tend to agree, unless there is something very important about maintaining the whitespace. Even then, a structure comparison tool should be able to accommodate that rule.<br>
<br>-Dan<div><div><br><br><div class="gmail_quote">On Wed, Jun 13, 2012 at 1:00 AM, Lincoln Baxter, III <span dir="ltr"><<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yeah, I'm not sure there's a great way around this aside from a more black-box functional approach, but even that might not be getting as fine-grained as some of these tests need to be. With greater test coverage, I think it could be replaced, however.<br>
<br>~Lincoln<div><div><br><br><div class="gmail_quote">On Mon, Jun 11, 2012 at 10:25 PM, Richard Kennard <span dir="ltr"><<a href="mailto:richard@kennardconsulting.com" target="_blank">richard@kennardconsulting.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+1 for this.<br>
<br>
However note there are different levels of tests. Classes like FacesScaffoldScenarioTest are only meant to test very small, very specific things. Basically<br>
regression testing. Classes like FacesScaffoldWeatherTest are also small and specific.<br>
<br>
The real testing is done using Arquillian (like FacesScaffoldPetClinicClient and FacesScaffoldShoppingClient). Because whilst your point about 'if you<br>
place a line break in a generated XHTML... it breaks the whole test' is very valid, even with XmlUnit you are vulnerable to 'if you place an extra XML<br>
element in a generated XHTML... it breaks the whole test'.<br>
<br>
Testing through Arquillian is the only way to be really sure the generated app actually works, IMHO. Because you are testing it the way the user would.<br>
<br>
However, definitely +1 for using XmlUnit, as far as that goes.<br>
<br>
Regards,<br>
<br>
Richard.<br>
<div><div><br>
On 12/06/2012 12:09 PM, George Gastaldi wrote:<br>
> Hello all,<br>
><br>
> I noticed that most of our scaffold unit tests are kinda hard to<br>
> maintain. specially because they compare XHTML as strings, instead of<br>
> the structure as a whole.<br>
> This implies that if you place a line break in a generated XHTML for<br>
> example, it breaks the whole test as well.<br>
> What about if we refactor these tests to use XmlUnit instead ?<br>
> (<a href="http://xmlunit.sourceforge.net/" target="_blank">http://xmlunit.sourceforge.net/</a>)<br>
> This way we could compare the structure without the ugly plain string<br>
> comparison, WDYT ?<br>
><br>
><br>
> Regards,,<br>
> George Gastaldi<br>
> _______________________________________________<br>
> forge-dev mailing list<br>
> <a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
><br>
><br>
<br>
_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>"Simpler is better."<br>
</font></span><br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br></div></div><div>Dan Allen</div>Principal Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><div><a href="http://google.com/profiles/dan.j.allen" target="_blank">http://google.com/profiles/dan.j.allen</a><br>
<a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br></div><br>
<br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>"Simpler is better."<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>"Simpler is better."<br>