Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.DetailedDiff.similar()


            @Override
            public void skippedComparison(final Node node, final Node node1) {
                // no-op
            }
        });
        assertTrue("Files are not similar", myDiff.similar());
    }

    private <T> void unmarshalAndMarshal(final Class<T> type, final java.lang.String xmlFileName, final java.lang.String expectedFile) throws Exception {

        final Object object = JaxbOpenejbJar2.unmarshal(type, getInputStream(xmlFileName));
View Full Code Here


        final String actual = JaxbWls.marshal(WeblogicEjbJar.class, element);

        XMLUnit.setIgnoreWhitespace(true);
        try {
            final Diff myDiff = new DetailedDiff(new Diff(expected, actual));
            assertTrue("Files are not similar " + myDiff, myDiff.similar());
        } catch (final AssertionFailedError e) {
            assertEquals(expected, actual);
            throw e;
        }
    }
View Full Code Here

        final String actual = new String(baos.toByteArray());

        XMLUnit.setIgnoreWhitespace(true);
        try {
            final Diff myDiff = new DetailedDiff(new Diff(expected, actual));
            assertTrue("Files are not similar " + myDiff, myDiff.similar());
        } catch (final AssertionFailedError e) {
            e.printStackTrace();
            assertEquals(expected, actual);
            throw e;
        }
View Full Code Here

            final String actual = toString(cmpMappings);

            XMLUnit.setIgnoreWhitespace(true);
            try {
                final Diff myDiff = new DetailedDiff(new Diff(expected, actual));
                assertTrue("Files are not similar " + myDiff, myDiff.similar());
            } catch (final AssertionFailedError e) {
                assertEquals(expected, actual);
            }
        }
View Full Code Here

    protected void assertExpectedMetadata( String expectedMetadata, String actualMetadata )
        throws Exception
    {
        DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
        if ( !detailedDiff.similar() )
        {
            // If it isn't similar, dump the difference.
            assertEquals( expectedMetadata, actualMetadata );
        }
        // XMLAssert.assertXMLEqual( "Expected Metadata:", expectedMetadata, actualMetadata );
View Full Code Here

    private void assertModelSimilar( String expectedModel, String actualModel )
        throws Exception
    {
        Diff diff = new Diff( expectedModel, actualModel );
        DetailedDiff detailedDiff = new DetailedDiff( diff );
        if ( !detailedDiff.similar() )
        {
            // If it isn't similar, dump the difference.
            System.out.println( detailedDiff.toString() );
            System.out.println( "-- Actual Model --\n" + actualModel + "\n---------------\n\n" );
            System.out.println( "-- Expected Model --\n" + expectedModel + "\n---------------\n\n" );
View Full Code Here

        StringWriter actualContents = new StringWriter();
        ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( actualFile );
        RepositoryMetadataWriter.write( metadata, actualContents );

        DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadataXml, actualContents.toString() ) );
        if ( !detailedDiff.similar() )
        {
            assertEquals( expectedMetadataXml, actualContents );
        }

        // assertEquals( "Check file contents.", expectedMetadataXml, actualContents );
View Full Code Here

    {
        File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) );
        String actualMetadata = FileUtils.readFileToString( metadataFile, null );

        DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
        if ( !detailedDiff.similar() )
        {
            // If it isn't similar, dump the difference.
            assertEquals( expectedMetadata, actualMetadata );
        }
    }
View Full Code Here

    {
        File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) );
        String actualMetadata = FileUtils.readFileToString( metadataFile, null );

        DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
        if ( !detailedDiff.similar() )
        {
            // If it isn't similar, dump the difference.
            assertEquals( expectedMetadata, actualMetadata );
        }
    }
View Full Code Here

            String actual = toString(cmpMappings);

            XMLUnit.setIgnoreWhitespace(true);
            try {
                Diff myDiff = new DetailedDiff(new Diff(expected, actual));
                assertTrue("Files are not similar " + myDiff, myDiff.similar());
            } catch (AssertionFailedError e) {
                assertEquals(expected, actual);
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.