Skip to content

Commit

Permalink
FileBasedSinkTest: fix tests in Windows OS by using IOChannelUtils.re…
Browse files Browse the repository at this point in the history
…solve().
  • Loading branch information
peihe committed Dec 13, 2016
1 parent d9657ff commit c914250
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -51,6 +51,7 @@
import org.apache.beam.sdk.io.FileBasedSink.WritableByteChannelFactory;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.util.IOChannelUtils;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -88,8 +89,7 @@ private String getBaseTempDirectory() {
@Test
public void testWriter() throws Exception {
String testUid = "testId";
String expectedFilename =
getBaseTempDirectory() + "/" + testUid;
String expectedFilename = IOChannelUtils.resolve(getBaseTempDirectory(), testUid);
SimpleSink.SimpleWriter writer = buildWriter();

List<String> values = Arrays.asList("sympathetic vulture", "boresome hummingbird");
Expand Down Expand Up @@ -488,8 +488,7 @@ public void testFileBasedWriterWithWritableByteChannelFactory() throws Exception
.createWriteOperation(null);
final FileBasedWriter<String> writer =
writeOp.createWriter(null);
final String expectedFilename =
writeOp.tempDirectory.get() + "/" + testUid;
final String expectedFilename = IOChannelUtils.resolve(writeOp.tempDirectory.get(), testUid);

final List<String> expected = new ArrayList<>();
expected.add("header");
Expand Down

0 comments on commit c914250

Please sign in to comment.