Examples of MemoryStorageProvider


Examples of org.apache.james.mime4j.storage.MemoryStorageProvider

        }
    }

    private static final class MessageTest implements Test {
        public void run(byte[] content, int repetitions) throws Exception {
            DefaultStorageProvider.setInstance(new MemoryStorageProvider());
            MessageBuilder builder = new DefaultMessageBuilder();

            for (int i = 0; i < repetitions; i++) {
                builder.parseMessage(new ByteArrayInputStream(content));
            }
View Full Code Here

Examples of org.apache.james.mime4j.storage.MemoryStorageProvider

        }
    }

    private static final class MessageTest implements Test {
        public void run(byte[] content, int repetitions) throws Exception {
            DefaultStorageProvider.setInstance(new MemoryStorageProvider());

            for (int i = 0; i < repetitions; i++) {
                new Message(new ByteArrayInputStream(content));
            }
        }
View Full Code Here

Examples of org.apache.james.mime4j.storage.MemoryStorageProvider

import org.apache.james.mime4j.util.CharsetUtil;

public class SingleBodyCopyTest extends TestCase {

    public void testCopyStorageBinaryBody() throws Exception {
        Storage storage = new MemoryStorageProvider()
                .store(new ByteArrayInputStream("test".getBytes()));
        MultiReferenceStorage multiReferenceStorage = new MultiReferenceStorage(
                storage);
        SingleBody body = new StorageBinaryBody(multiReferenceStorage);
        copyTest(body);
View Full Code Here

Examples of org.apache.james.mime4j.storage.MemoryStorageProvider

        SingleBody body = new StorageBinaryBody(multiReferenceStorage);
        copyTest(body);
    }

    public void testCopyStorageTextBody() throws Exception {
        Storage storage = new MemoryStorageProvider()
                .store(new ByteArrayInputStream("test".getBytes()));
        MultiReferenceStorage multiReferenceStorage = new MultiReferenceStorage(
                storage);
        SingleBody body = new StorageTextBody(multiReferenceStorage,
                CharsetUtil.US_ASCII);
View Full Code Here

Examples of org.apache.james.mime4j.storage.MemoryStorageProvider

        SingleBody body = new StringTextBody("test", CharsetUtil.US_ASCII);
        copyTest(body);
    }

    public void testDisposeStorageBinaryBody() throws Exception {
        Storage storage = new MemoryStorageProvider()
                .store(new ByteArrayInputStream("test".getBytes()));
        MultiReferenceStorage multiReferenceStorage = new MultiReferenceStorage(
                storage);
        SingleBody body = new StorageBinaryBody(multiReferenceStorage);
        disposeTest(body, storage);
View Full Code Here

Examples of org.apache.james.mime4j.storage.MemoryStorageProvider

        SingleBody body = new StorageBinaryBody(multiReferenceStorage);
        disposeTest(body, storage);
    }

    public void testDisposeStorageTextBody() throws Exception {
        Storage storage = new MemoryStorageProvider()
                .store(new ByteArrayInputStream("test".getBytes()));
        MultiReferenceStorage multiReferenceStorage = new MultiReferenceStorage(
                storage);
        SingleBody body = new StorageTextBody(multiReferenceStorage,
                CharsetUtil.US_ASCII);
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.