Ah! Whoops, yes, that is actually a very good idea :) Thanks Dan, it&#39;s late and I&#39;m tired :p<br><br><div class="gmail_quote">On Wed, Jun 13, 2012 at 1:12 AM, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.j.allen@gmail.com" target="_blank">dan.j.allen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Let&#39;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 class="h5"><br><br><div class="gmail_quote">On Wed, Jun 13, 2012 at 1:00 AM, Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yeah, I&#39;m not sure there&#39;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">&lt;<a href="mailto:richard@kennardconsulting.com" target="_blank">richard@kennardconsulting.com</a>&gt;</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 &#39;if you<br>
place a line break in a generated XHTML... it breaks the whole test&#39; is very valid, even with XmlUnit you are vulnerable to &#39;if you place an extra XML<br>
element in a generated XHTML... it breaks the whole test&#39;.<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>
&gt; Hello all,<br>
&gt;<br>
&gt; I noticed that most of our scaffold unit tests are kinda hard to<br>
&gt; maintain. specially because they compare XHTML as strings, instead of<br>
&gt; the structure as a whole.<br>
&gt; This implies that if you place a line break in a generated XHTML for<br>
&gt; example, it breaks the whole test as well.<br>
&gt; What about if we refactor these tests to use XmlUnit instead ?<br>
&gt; (<a href="http://xmlunit.sourceforge.net/" target="_blank">http://xmlunit.sourceforge.net/</a>)<br>
&gt; This way we could compare the structure without the ugly plain string<br>
&gt; comparison, WDYT ?<br>
&gt;<br>
&gt;<br>
&gt; Regards,,<br>
&gt; George Gastaldi<br>
&gt; _______________________________________________<br>
&gt; forge-dev mailing list<br>
&gt; <a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
&gt;<br>
&gt;<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>&quot;Simpler is better.&quot;<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">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>&quot;Simpler is better.&quot;<br>