/*
 * Copyright (C) 2010 TranceCode Software
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 * 
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
 */
package org.trancecode;

import com.google.common.collect.ImmutableList;
import org.testng.Assert;

/**
 * {@link Assert} extensions.
 * 
 * @author Herve Quiroz
 */
public final class TcAssert
{
    public static <T> void assertIterableEquals(final Iterable<T> actual, final Iterable<T> expected)
    {
        Assert.assertEquals(ImmutableList.copyOf(actual), ImmutableList.copyOf(expected));
    }
}

@@ -865,322 +865,1670 @@
 ort 
-org.testng.Assert;%0A%0A/**%0A * %7B@link Assert%7D extensions.%0A * %0A * @author Herve Quiroz%0A */%0Apublic final class TcAssert%0A%7B%0A    public static %3CT%3E void assertIterableEquals(final Iterable%3CT%3E actual, final Iterable%3CT%3E expected)%0A    %7B%0A        Assert.assertEquals(ImmutableList.copyOf(actual), ImmutableList.copyOf(expected));
+junit.framework.AssertionFailedError;%0Aimport net.sf.saxon.dom.NodeOverNodeInfo;%0Aimport net.sf.saxon.s9api.Processor;%0Aimport net.sf.saxon.s9api.XdmNode;%0Aimport org.custommonkey.xmlunit.XMLAssert;%0Aimport org.custommonkey.xmlunit.XMLUnit;%0Aimport org.testng.Assert;%0Aimport org.trancecode.xml.saxon.Saxon;%0Aimport org.w3c.dom.Document;%0A%0A/**%0A * %7B@link Assert%7D extensions.%0A * %0A * @author Herve Quiroz%0A */%0Apublic final class TcAssert%0A%7B%0A    public static %3CT%3E void assertIterableEquals(final Iterable%3CT%3E actual, final Iterable%3CT%3E expected)%0A    %7B%0A        Assert.assertEquals(ImmutableList.copyOf(actual), ImmutableList.copyOf(expected));%0A    %7D%0A%0A    public static void assertEquals(final XdmNode expected, final XdmNode actual)%0A    %7B%0A        assertEquals(expected, actual, true);%0A    %7D%0A%0A    public static void assertEquals(final XdmNode expected, final XdmNode actual, final boolean ignoreWhitespace)%0A    %7B%0A        assert expected != null;%0A        assert actual != null;%0A        final Processor processor = (Processor) expected.getUnderlyingNode().getConfiguration().getProcessor();%0A        final XdmNode docExpected = Saxon.asDocumentNode(expected, processor);%0A        final XdmNode docActual = Saxon.asDocumentNode(actual, processor);%0A        XMLUnit.setIgnoreWhitespace(ignoreWhitespace);%0A        try%0A        %7B%0A            XMLAssert.assertXMLEqual((Document) NodeOverNodeInfo.wrap(docExpected.getUnderlyingNode()),%0A                    (Document) NodeOverNodeInfo.wrap(docActual.getUnderlyingNode()));%0A        %7D%0A        catch (final AssertionFailedError e)%0A        %7B%0A            Assert.fail(String.format(%22expected:%5Cn%25s%5Cnactual:%5Cn%25s%22, docExpected, docActual), e);%0A        %7D
 %0A   

Add TcAssert.assertEquasl() for XdmNode instances