Package org.custommonkey.xmlunit

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


    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


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

        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, Charset.defaultCharset() );

        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

    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

        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

    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

        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

            Diff diff = new Diff(inputStreamReader,
                                 new InputStreamReader(new ByteArrayInputStream(baos.toByteArray()), UTF8));

            detaileddiffs = new DetailedDiff(diff);
            detaileddiffs.overrideDifferenceListener(new SchemaAttrDiff());
            boolean result = detaileddiffs.similar();
            if (!result) {
                printFailureDetail(schema, detaileddiffs);
            }
            assertTrue("Serialized out schema not similar to original", result);
        } catch (Exception e) {
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.