streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robdouglas <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: simple file reader/writer
Date Tue, 11 Nov 2014 23:25:01 GMT
Github user robdouglas commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/124#discussion_r20190174
  
    --- Diff: streams-contrib/streams-persist-file/src/test/java/org/apache/streams/file/test/FilePersistIT.java
---
    @@ -0,0 +1,112 @@
    +package org.apache.streams.file.test;
    +
    +import com.google.common.collect.Lists;
    +import com.google.common.collect.Maps;
    +import com.google.common.collect.Queues;
    +import org.apache.streams.console.ConsolePersistReader;
    +import org.apache.streams.console.ConsolePersistWriter;
    +import org.apache.streams.core.StreamBuilder;
    +import org.apache.streams.core.StreamsDatum;
    +import org.apache.streams.core.StreamsResultSet;
    +import org.apache.streams.local.builders.LocalStreamBuilder;
    +import org.apache.streams.file.FileConfiguration;
    +import org.apache.streams.file.FilePersistReader;
    +import org.apache.streams.file.FilePersistWriter;
    +import org.junit.After;
    +import org.junit.Assert;
    +import org.junit.Before;
    +import org.junit.Test;
    +
    +import org.mockito.Mock;
    +import org.mockito.Mockito;
    +import org.mockito.internal.util.reflection.Whitebox;
    +import org.powermock.api.mockito.PowerMockito;
    +
    +import static org.mockito.Mockito.mock;
    +import static org.mockito.Mockito.when;
    +
    +import java.io.BufferedInputStream;
    +import java.io.BufferedReader;
    +import java.io.File;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.io.InputStreamReader;
    +import java.io.OutputStream;
    +import java.io.PrintStream;
    +import java.util.Map;
    +import java.util.Properties;
    +import java.util.concurrent.TimeUnit;
    +
    +import static org.mockito.Mockito.mock;
    +
    +/**
    + * Created by sblackmon on 10/20/14.
    + */
    +public class FilePersistIT {
    +
    +    private FileConfiguration testConfiguration;
    +
    +    ConsolePersistReader reader = Mockito.mock(ConsolePersistReader.class);
    +    ConsolePersistWriter writer = Mockito.mock(ConsolePersistWriter.class);
    +
    +    StreamsDatum testDatum1 = new StreamsDatum("{\"datum\":1}");
    +    StreamsDatum testDatum2 = new StreamsDatum("{\"datum\":2}");
    +    StreamsDatum testDatum3 = new StreamsDatum("{\"datum\":3}");
    +
    +    @Before
    +    public void prepareTest() {
    +
    +        testConfiguration = new FileConfiguration();
    +        testConfiguration.setPath("target/FilePersistIT.txt");
    +
    +        File file = new File( testConfiguration.getPath());
    +        if( file.exists() )
    --- End diff --
    
    Small nit: could you surround this statement with braces to fit in line with the rest
of the code base?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message