Examples of IInputStreamConsumer


Examples of com.documents4j.api.IInputStreamConsumer

    }

    @Test(timeout = DEFAULT_CONVERSION_TIMEOUT, expected = ConverterAccessException.class)
    public void testInputStreamToInputStreamConsumerExecute() throws Exception {
        InputStream inputStream = spy(new FileInputStream(validFile(true)));
        IInputStreamConsumer inputStreamConsumer = mock(IInputStreamConsumer.class);
        try {
            getConverter()
                    .convert(inputStream).as(validInputType())
                    .to(inputStreamConsumer).as(validTargetType())
                    .execute();
View Full Code Here

Examples of com.documents4j.api.IInputStreamConsumer

    }

    @Test(timeout = DEFAULT_CONVERSION_TIMEOUT, expected = ConverterAccessException.class)
    public void testInputStreamToInputStreamConsumerFuture() throws Exception {
        InputStream inputStream = spy(new FileInputStream(validFile(true)));
        IInputStreamConsumer inputStreamConsumer = mock(IInputStreamConsumer.class);
        try {
            getConverter()
                    .convert(inputStream).as(validInputType())
                    .to(inputStreamConsumer).as(validTargetType())
                    .schedule().get();
View Full Code Here

Examples of com.documents4j.api.IInputStreamConsumer

        InputStream inputStream = spy(new FileInputStream(source));
        IInputStreamSource inputStreamSource = mock(IInputStreamSource.class);
        when(inputStreamSource.getInputStream()).thenReturn(inputStream);

        OutputStream outputStream = mock(OutputStream.class);
        IInputStreamConsumer inputStreamConsumer = mock(IInputStreamConsumer.class);
        doAnswer(new CloseStreamAnswer()).when(inputStreamConsumer).onComplete(any(InputStream.class));

        assertTrue(getConverter().convert(inputStreamSource).as(validInputType()).to(inputStreamConsumer).as(validTargetType()).execute());
        assertTrue(source.exists());
View Full Code Here

Examples of com.documents4j.api.IInputStreamConsumer

        InputStream inputStream = spy(new FileInputStream(source));
        IInputStreamSource inputStreamSource = mock(IInputStreamSource.class);
        when(inputStreamSource.getInputStream()).thenReturn(inputStream);

        OutputStream outputStream = mock(OutputStream.class);
        IInputStreamConsumer inputStreamConsumer = mock(IInputStreamConsumer.class);
        doAnswer(new CloseStreamAnswer()).when(inputStreamConsumer).onComplete(any(InputStream.class));

        assertTrue(getConverter().convert(inputStreamSource).as(validInputType()).to(inputStreamConsumer).as(validTargetType()).schedule().get());
        assertTrue(source.exists());
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.