[
https://issues.apache.org/jira/browse/FLINK-2445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15208181#comment-15208181
]
ASF GitHub Bot commented on FLINK-2445:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/1625#discussion_r57136296
--- Diff:
flink-java/src/test/java/org/apache/flink/api/java/hadoop/mapred/HadoopOutputFormatTest.java
---
@@ -0,0 +1,216 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.api.java.hadoop.mapred;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.hadoop.conf.Configurable;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.mapred.*;
+import org.apache.hadoop.util.Progressable;
+import org.junit.Test;
+import org.mockito.Matchers;
+
+import java.io.IOException;
+
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.*;
+
+public class HadoopOutputFormatTest {
+
+ @Test
+ public void testOpen() throws Exception {
+
+ OutputFormat<String, Long> dummyOutputFormat =
mock(DummyOutputFormat.class);
+ DummyOutputCommitter outputCommitter =
mock(DummyOutputCommitter.class);
+ JobConf jobConf = mock(JobConf.class);
--- End diff --
This line needs to be replaced by `JobConf jobConf = spy(new JobConf());`.
The Hadoop code copies the `JobConf` and access additional fields that
cannot be mocked.
> Add tests for HadoopOutputFormats
> ---------------------------------
>
> Key: FLINK-2445
> URL: https://issues.apache.org/jira/browse/FLINK-2445
> Project: Flink
> Issue Type: Test
> Components: Hadoop Compatibility, Tests
> Affects Versions: 0.9.1, 0.10.0
> Reporter: Fabian Hueske
> Assignee: Martin Liesenberg
> Labels: starter
>
> The HadoopOutputFormats and HadoopOutputFormatBase classes are not
> sufficiently covered by unit tests.
> We need tests that ensure that the methods of the wrapped Hadoop
> OutputFormats are correctly called.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)