diff --git a/stratosphere-addons/avro/src/test/java/eu/stratosphere/api/java/record/io/avro/AvroRecordInputFormatTest.java b/stratosphere-addons/avro/src/test/java/eu/stratosphere/api/java/record/io/avro/AvroRecordInputFormatTest.java index 0ce5952bebc3a..f2a0c578981ae 100644 --- a/stratosphere-addons/avro/src/test/java/eu/stratosphere/api/java/record/io/avro/AvroRecordInputFormatTest.java +++ b/stratosphere-addons/avro/src/test/java/eu/stratosphere/api/java/record/io/avro/AvroRecordInputFormatTest.java @@ -23,6 +23,7 @@ import eu.stratosphere.core.fs.FileInputSplit; import eu.stratosphere.types.Record; import eu.stratosphere.types.StringValue; +import eu.stratosphere.util.OperatingSystem; /** @@ -105,7 +106,7 @@ public void createFiles() throws IOException { @Test public void testDeserialisation() throws IOException { Configuration parameters = new Configuration(); - format.setFilePath("file://"+testFile.getAbsolutePath()); + format.setFilePath(testFile.toURI().toString()); format.configure(parameters); FileInputSplit[] splits = format.createInputSplits(1); Assert.assertEquals(splits.length, 1); diff --git a/stratosphere-core/src/test/java/eu/stratosphere/api/common/io/FileOutputFormatTest.java b/stratosphere-core/src/test/java/eu/stratosphere/api/common/io/FileOutputFormatTest.java index 80f20e80d1c30..71fa1f3f9fd20 100644 --- a/stratosphere-core/src/test/java/eu/stratosphere/api/common/io/FileOutputFormatTest.java +++ b/stratosphere-core/src/test/java/eu/stratosphere/api/common/io/FileOutputFormatTest.java @@ -12,6 +12,7 @@ import eu.stratosphere.configuration.Configuration; import eu.stratosphere.types.IntValue; import eu.stratosphere.util.LogUtils; +import eu.stratosphere.util.OperatingSystem; public class FileOutputFormatTest { @@ -32,7 +33,7 @@ public void testCreateNoneParallelLocalFS() { throw new RuntimeException("Test in error", e); } - String tmpFilePath = "file://"+tmpOutPath.getAbsolutePath(); + String tmpFilePath = tmpOutPath.toURI().toString(); Configuration config = new Configuration(); config.setString(FileOutputFormat.FILE_PARAMETER_KEY, tmpFilePath); @@ -169,7 +170,7 @@ public void testCreateParallelLocalFS() { throw new RuntimeException("Test in error", e); } - String tmpFilePath = "file://"+tmpOutPath.getAbsolutePath(); + String tmpFilePath = tmpOutPath.toURI().toString(); Configuration config = new Configuration(); config.setString(FileOutputFormat.FILE_PARAMETER_KEY, tmpFilePath); @@ -255,7 +256,7 @@ public void testOverwriteNoneParallelLocalFS() { throw new RuntimeException("Test in error", e); } - String tmpFilePath = "file://"+tmpOutPath.getAbsolutePath(); + String tmpFilePath = tmpOutPath.toURI().toString(); Configuration config = new Configuration(); config.setString(FileOutputFormat.FILE_PARAMETER_KEY, tmpFilePath); @@ -399,7 +400,7 @@ public void testOverwriteParallelLocalFS() { throw new RuntimeException("Test in error", e); } - String tmpFilePath = "file://"+tmpOutPath.getAbsolutePath(); + String tmpFilePath = tmpOutPath.toURI().toString(); Configuration config = new Configuration(); config.setString(FileOutputFormat.FILE_PARAMETER_KEY, tmpFilePath); diff --git a/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessFixedLengthInputFormatTest.java b/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessFixedLengthInputFormatTest.java index 98bc94dd9bc3a..4529d87d610ed 100644 --- a/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessFixedLengthInputFormatTest.java +++ b/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessFixedLengthInputFormatTest.java @@ -82,6 +82,9 @@ public void testOpen() { @Test public void testCheckExitCode() { + if(OperatingSystem.isWindows()) + return; + Configuration config = new Configuration(); config.setInteger(ExternalProcessFixedLengthInputFormat.RECORDLENGTH_PARAMETER_KEY, 8); ExternalProcessInputSplit split = new ExternalProcessInputSplit(1, failingCommand); @@ -127,6 +130,9 @@ public void testCheckExitCode() { @Test public void testUserCodeTermination() { + if(OperatingSystem.isWindows()) + return; + Configuration config = new Configuration(); config.setInteger(ExternalProcessFixedLengthInputFormat.RECORDLENGTH_PARAMETER_KEY, 8); config.setInteger(MyExternalProcessTestInputFormat.FAILCOUNT_PARAMETER_KEY, 100); @@ -161,6 +167,9 @@ public void testUserCodeTermination() { @Test public void testReadStream() { + if(OperatingSystem.isWindows()) + return; + Configuration config = new Configuration(); config.setInteger(ExternalProcessFixedLengthInputFormat.RECORDLENGTH_PARAMETER_KEY, 8); ExternalProcessInputSplit split = new ExternalProcessInputSplit(1, this.thousandRecordsCommand); @@ -187,6 +196,9 @@ public void testReadStream() { @Test public void testReadInvalidStream() { + if(OperatingSystem.isWindows()) + return; + Configuration config = new Configuration(); config.setInteger(ExternalProcessFixedLengthInputFormat.RECORDLENGTH_PARAMETER_KEY, 8); ExternalProcessInputSplit split = new ExternalProcessInputSplit(1, this.incompleteRecordsCommand); diff --git a/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessInputFormatTest.java b/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessInputFormatTest.java index b53013b04b4ac..1ab5ebc23e710 100644 --- a/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessInputFormatTest.java +++ b/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/ExternalProcessInputFormatTest.java @@ -79,6 +79,9 @@ public void testOpen() { @Test public void testCheckExitCode() { + if(OperatingSystem.isWindows()) + return; + Configuration config = new Configuration(); ExternalProcessInputSplit split = new ExternalProcessInputSplit(1, failingCommand); @@ -122,6 +125,9 @@ public void testCheckExitCode() { @Test public void testUserCodeTermination() { + if(OperatingSystem.isWindows()) + return; + Configuration config = new Configuration(); config.setInteger(MyExternalProcessTestInputFormat.FAILCOUNT_PARAMETER_KEY, 100); ExternalProcessInputSplit split = new ExternalProcessInputSplit(1, this.neverEndingCommand); @@ -155,6 +161,9 @@ public void testUserCodeTermination() { @Test public void testReadStream() { + if(OperatingSystem.isWindows()) + return; + Configuration config = new Configuration(); ExternalProcessInputSplit split = new ExternalProcessInputSplit(1, this.thousandRecordsCommand); Record record = new Record(); diff --git a/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/TextInputFormatTest.java b/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/TextInputFormatTest.java index 9454cd957167a..9328d481eaec6 100644 --- a/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/TextInputFormatTest.java +++ b/stratosphere-java/src/test/java/eu/stratosphere/api/java/record/io/TextInputFormatTest.java @@ -73,10 +73,12 @@ public void testPositionBug() { Record r = new Record(); assertTrue("Expecting first record here", inputFormat.nextRecord(r)); - assertEquals(FIRST, r.getField(0, StringValue.class).getValue()); + String field = r.getField(0, StringValue.class).getValue().replace("\r", ""); // Windows bug? + assertEquals(FIRST, field); assertTrue("Expecting second record here",inputFormat.nextRecord(r )); - assertEquals(SECOND, r.getField(0, StringValue.class).getValue()); + field = r.getField(0, StringValue.class).getValue().replace("\r", ""); // Windows bug? + assertEquals(SECOND, field); assertFalse("The input file is over", inputFormat.nextRecord(r)); } diff --git a/stratosphere-tests/src/test/java/eu/stratosphere/test/localDistributed/LocalDistributedExecutorTest.java b/stratosphere-tests/src/test/java/eu/stratosphere/test/localDistributed/LocalDistributedExecutorTest.java index c265d5b2f3c33..74bb5881ad520 100644 --- a/stratosphere-tests/src/test/java/eu/stratosphere/test/localDistributed/LocalDistributedExecutorTest.java +++ b/stratosphere-tests/src/test/java/eu/stratosphere/test/localDistributed/LocalDistributedExecutorTest.java @@ -15,6 +15,7 @@ import eu.stratosphere.client.localDistributed.LocalDistributedExecutor; import eu.stratosphere.example.java.record.wordcount.WordCount; import eu.stratosphere.test.testdata.WordCountData; +import eu.stratosphere.util.OperatingSystem; import org.junit.Assert; import org.junit.Test; @@ -44,7 +45,7 @@ public void testLocalDistributedExecutorWithWordCount() { WordCount wc = new WordCount(); lde.start(2); - lde.run(wc.getPlan("4", "file://" + inFile.getAbsolutePath(), "file://" + outFile.getAbsolutePath())); + lde.run(wc.getPlan("4", inFile.toURI().toString(), outFile.toURI().toString())); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage());