Package org.fcrepo.server.journal.readerwriter.multicast

Examples of org.fcrepo.server.journal.readerwriter.multicast.JournalEntrySizeEstimator


            XMLStreamException, FactoryConfigurationError {
        MockMulticastJournalWriter mjw =
                new MockMulticastJournalWriter(parameters, role, server);
        mjw.setCheckParametersForValidity(false);

        JournalEntrySizeEstimator estimator =
                new JournalEntrySizeEstimator(mjw);

        for (CreatorJournalEntry journalEntry : journalEntries) {
            StringWriter stringWriter = new StringWriter();
            XMLEventWriter xmlEventWriter =
                    new IndentingXMLEventWriter(XMLOutputFactory.newInstance()
                            .createXMLEventWriter(stringWriter));
            mjw.writeJournalEntry(journalEntry, xmlEventWriter);
            long estimatedSize = estimator.estimateSize(journalEntry);
            assertSizesAreReallyClose(stringWriter.getBuffer().length(),
                                      estimatedSize);
        }
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.journal.readerwriter.multicast.JournalEntrySizeEstimator

Copyright © 2018 www.massapicom. 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.