You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mrunit.apache.org by jd...@apache.org on 2012/04/20 07:08:43 UTC
svn commit: r1328200 - in /incubator/mrunit/trunk/src:
main/java/org/apache/hadoop/mrunit/
main/java/org/apache/hadoop/mrunit/counters/
main/java/org/apache/hadoop/mrunit/internal/counters/
main/java/org/apache/hadoop/mrunit/internal/io/ main/java/org/...
Author: jdonofrio
Date: Fri Apr 20 05:08:41 2012
New Revision: 1328200
URL: http://svn.apache.org/viewvc?rev=1328200&view=rev
Log:
MRUNIT-104: move non user classes into internal package
Added:
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/counters/
- copied from r1328193, incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/counters/
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/io/
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/io/Serialization.java
- copied, changed from r1328193, incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/Serialization.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockInputSplit.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockOutputCollector.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockReporter.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockContextWrapper.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockInputSplit.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockMapContextWrapper.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockOutputCommitter.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockRawKeyValueIterator.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReduceContextWrapper.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReporter.java
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/io/
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/io/TestSerialization.java (contents, props changed)
- copied, changed from r1328193, incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestSerialization.java
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/
- copied from r1328193, incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/mock/
Removed:
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/Serialization.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/counters/
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/mock/
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mock/
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestSerialization.java
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/mock/
Modified:
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapDriver.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/PipelineMapReduceDriver.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriver.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriverBase.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/TestDriver.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/counters/CounterWrapper.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapDriver.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java
incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/ReduceDriver.java
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockOutputCollector.java
incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockReporter.java
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapDriver.java Fri Apr 20 05:08:41 2012
@@ -29,9 +29,9 @@ import org.apache.hadoop.conf.Configurat
import org.apache.hadoop.mapred.Counters;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Mapper;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
-import org.apache.hadoop.mrunit.mock.MockOutputCollector;
-import org.apache.hadoop.mrunit.mock.MockReporter;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.mapred.MockOutputCollector;
+import org.apache.hadoop.mrunit.internal.mapred.MockReporter;
import org.apache.hadoop.mrunit.types.Pair;
/**
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/MapReduceDriver.java Fri Apr 20 05:08:41 2012
@@ -30,7 +30,7 @@ import org.apache.hadoop.io.RawComparato
import org.apache.hadoop.mapred.Counters;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.Reducer;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
import org.apache.hadoop.mrunit.types.Pair;
/**
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/PipelineMapReduceDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/PipelineMapReduceDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/PipelineMapReduceDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/PipelineMapReduceDriver.java Fri Apr 20 05:08:41 2012
@@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configurat
import org.apache.hadoop.mapred.Counters;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.Reducer;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
import org.apache.hadoop.mrunit.types.Pair;
/**
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriver.java Fri Apr 20 05:08:41 2012
@@ -28,9 +28,9 @@ import org.apache.hadoop.conf.Configurat
import org.apache.hadoop.mapred.Counters;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Reducer;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
-import org.apache.hadoop.mrunit.mock.MockOutputCollector;
-import org.apache.hadoop.mrunit.mock.MockReporter;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.mapred.MockOutputCollector;
+import org.apache.hadoop.mrunit.internal.mapred.MockReporter;
import org.apache.hadoop.mrunit.types.Pair;
/**
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriverBase.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriverBase.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriverBase.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/ReduceDriverBase.java Fri Apr 20 05:08:41 2012
@@ -24,6 +24,7 @@ import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mrunit.internal.io.Serialization;
import org.apache.hadoop.mrunit.types.Pair;
/**
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/TestDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/TestDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/TestDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/TestDriver.java Fri Apr 20 05:08:41 2012
@@ -30,7 +30,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.io.Serialization;
import org.apache.hadoop.mrunit.types.Pair;
public abstract class TestDriver<K1, V1, K2, V2> {
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/counters/CounterWrapper.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/counters/CounterWrapper.java?rev=1328200&r1=1328193&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/counters/CounterWrapper.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/counters/CounterWrapper.java Fri Apr 20 05:08:41 2012
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hadoop.mrunit.counters;
+package org.apache.hadoop.mrunit.internal.counters;
import static org.apache.hadoop.mrunit.internal.util.ArgumentChecker.returnNonNull;
Copied: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/io/Serialization.java (from r1328193, incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/Serialization.java)
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/io/Serialization.java?p2=incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/io/Serialization.java&p1=incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/Serialization.java&r1=1328193&r2=1328200&rev=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/Serialization.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/io/Serialization.java Fri Apr 20 05:08:41 2012
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hadoop.mrunit;
+package org.apache.hadoop.mrunit.internal.io;
import java.io.IOException;
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockInputSplit.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockInputSplit.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockInputSplit.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockInputSplit.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,70 @@
+/**
+ * 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.hadoop.mrunit.internal.mapred;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.FileSplit;
+import org.apache.hadoop.mapred.InputSplit;
+
+/**
+ * A fake InputSplit object to be returned by our MockReporter to the user
+ * class.
+ */
+@SuppressWarnings("deprecation")
+public class MockInputSplit extends FileSplit implements InputSplit {
+
+ private static final Path MOCK_PATH = new Path("somefile");
+
+ public MockInputSplit() {
+ super(MOCK_PATH, 0, 0, (String[]) null);
+ }
+
+ @Override
+ public long getLength() {
+ return 0;
+ }
+
+ @Override
+ public String[] getLocations() throws IOException {
+ return null;
+ }
+
+ @Override
+ public void readFields(final DataInput in) throws IOException {
+ }
+
+ @Override
+ public void write(final DataOutput out) throws IOException {
+ }
+
+ @Override
+ public String toString() {
+ return "MockInputSplit";
+ }
+
+ /**
+ * Return the path object represented by this as a FileSplit.
+ */
+ public static Path getMockPath() {
+ return MOCK_PATH;
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockOutputCollector.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockOutputCollector.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockOutputCollector.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockOutputCollector.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,60 @@
+/**
+ * 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.hadoop.mrunit.internal.mapred;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapred.OutputCollector;
+import org.apache.hadoop.mrunit.internal.io.Serialization;
+import org.apache.hadoop.mrunit.types.Pair;
+
+/**
+ * OutputCollector to use in the test framework for Mapper and Reducer classes.
+ * Accepts a set of output (k, v) pairs and returns them to the framework for
+ * validation.
+ */
+public class MockOutputCollector<K, V> implements OutputCollector<K, V> {
+
+ private final ArrayList<Pair<K, V>> collectedOutputs;
+ private final Serialization serialization;
+
+ public MockOutputCollector(final Configuration conf) {
+ collectedOutputs = new ArrayList<Pair<K, V>>();
+ serialization = new Serialization(conf);
+ }
+
+ /**
+ * Accepts another (key, value) pair as an output of this mapper/reducer.
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void collect(final K key, final V value) throws IOException {
+ collectedOutputs.add(new Pair<K, V>(serialization.copy(key), serialization
+ .copy(value)));
+ }
+
+ /**
+ * @return The outputs generated by the mapper/reducer being tested
+ */
+ public List<Pair<K, V>> getOutputs() {
+ return collectedOutputs;
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockReporter.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockReporter.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockReporter.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapred/MockReporter.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,86 @@
+/**
+ * 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.hadoop.mrunit.internal.mapred;
+
+import org.apache.hadoop.mapred.Counters;
+import org.apache.hadoop.mapred.Counters.Counter;
+import org.apache.hadoop.mapred.InputSplit;
+import org.apache.hadoop.mapred.Reporter;
+
+@SuppressWarnings("deprecation")
+public class MockReporter implements Reporter {
+
+ private final MockInputSplit inputSplit = new MockInputSplit();
+ private final Counters counters;
+
+ public enum ReporterType {
+ Mapper, Reducer
+ }
+
+ private final ReporterType typ;
+
+ public MockReporter(final ReporterType kind, final Counters ctrs) {
+ typ = kind;
+ counters = ctrs;
+ }
+
+ @Override
+ public InputSplit getInputSplit() {
+ if (typ == ReporterType.Reducer) {
+ throw new UnsupportedOperationException(
+ "Reducer cannot call getInputSplit()");
+ } else {
+ return inputSplit;
+ }
+ }
+
+ @Override
+ public void incrCounter(final Enum<?> key, final long amount) {
+ counters.incrCounter(key, amount);
+ }
+
+ @Override
+ public void incrCounter(final String group, final String counter,
+ final long amount) {
+ counters.incrCounter(group, counter, amount);
+ }
+
+ @Override
+ public void setStatus(final String status) {
+ // do nothing.
+ }
+
+ @Override
+ public void progress() {
+ // do nothing.
+ }
+
+ @Override
+ public Counter getCounter(final String group, final String name) {
+ return counters.findCounter(group, name);
+ }
+
+ @Override
+ public Counter getCounter(final Enum<?> key) {
+ return counters.findCounter(key);
+ }
+
+ public float getProgress() {
+ return 0;
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockContextWrapper.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockContextWrapper.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockContextWrapper.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockContextWrapper.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,87 @@
+/**
+ * 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.hadoop.mrunit.internal.mapreduce;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapreduce.Counter;
+import org.apache.hadoop.mapreduce.Counters;
+import org.apache.hadoop.mapreduce.TaskInputOutputContext;
+import org.apache.hadoop.mrunit.internal.io.Serialization;
+import org.apache.hadoop.mrunit.types.Pair;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+public abstract class MockContextWrapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> {
+ protected final Counters counters;
+ protected final Configuration conf;
+ protected final Serialization serialization;
+ protected final List<Pair<KEYOUT, VALUEOUT>> outputs = new ArrayList<Pair<KEYOUT, VALUEOUT>>();
+
+ public MockContextWrapper(final Counters counters, final Configuration conf) {
+ this.conf = conf;
+ serialization = new Serialization(conf);
+ this.counters = counters;
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ protected void createCommon(
+ final TaskInputOutputContext<KEYIN, VALUEIN, KEYOUT, VALUEOUT> context)
+ throws IOException, InterruptedException {
+ when(context.getCounter((Enum) any())).thenAnswer(new Answer<Counter>() {
+ @Override
+ public Counter answer(final InvocationOnMock invocation) {
+ final Object[] args = invocation.getArguments();
+ return counters.findCounter((Enum) args[0]);
+ }
+ });
+ when(context.getCounter(anyString(), anyString())).thenAnswer(
+ new Answer<Counter>() {
+ @Override
+ public Counter answer(final InvocationOnMock invocation) {
+ final Object[] args = invocation.getArguments();
+ return counters.findCounter((String) args[0], (String) args[1]);
+ }
+ });
+ when(context.getConfiguration()).thenAnswer(new Answer<Configuration>() {
+ @Override
+ public Configuration answer(final InvocationOnMock invocation) {
+ return conf;
+ }
+ });
+ doAnswer(new Answer<Object>() {
+ @Override
+ public Object answer(final InvocationOnMock invocation) {
+ final Object[] args = invocation.getArguments();
+ outputs.add(new Pair(serialization.copy(args[0]), serialization
+ .copy(args[1])));
+ return null;
+ }
+ }).when(context).write((KEYOUT) any(), (VALUEOUT) any());
+
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockInputSplit.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockInputSplit.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockInputSplit.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockInputSplit.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,46 @@
+/**
+ * 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.hadoop.mrunit.internal.mapreduce;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapreduce.lib.input.FileSplit;
+
+/**
+ * Mock implementation of InputSplit that does nothing.
+ */
+public class MockInputSplit extends FileSplit {
+
+ private static final Path MOCK_PATH = new Path("somefile");
+
+ public MockInputSplit() {
+ super(MOCK_PATH, 0, 0, (String[]) null);
+ }
+
+ @Override
+ public String toString() {
+ return "MockInputSplit";
+ }
+
+ /**
+ * Return the path object represented by this as a FileSplit.
+ */
+ public static Path getMockPath() {
+ return MOCK_PATH;
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockMapContextWrapper.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockMapContextWrapper.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockMapContextWrapper.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockMapContextWrapper.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,119 @@
+/**
+ * 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.hadoop.mrunit.internal.mapreduce;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapreduce.Counters;
+import org.apache.hadoop.mapreduce.InputSplit;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mrunit.types.Pair;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+/**
+ * o.a.h.mapreduce.Mapper.map() expects to use a Mapper.Context object as a
+ * parameter. We want to override the functionality of a lot of Context to have
+ * it send the results back to us, etc. But since Mapper.Context is an inner
+ * class of Mapper, we need to put any subclasses of Mapper.Context in a
+ * subclass of Mapper.
+ *
+ * This wrapper class exists for that purpose.
+ */
+public class MockMapContextWrapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> extends
+ MockContextWrapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> {
+
+ protected static final Log LOG = LogFactory
+ .getLog(MockMapContextWrapper.class);
+ protected final List<Pair<KEYIN, VALUEIN>> inputs;
+ protected Pair<KEYIN, VALUEIN> currentKeyValue;
+ protected final Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context context;
+ protected InputSplit inputSplit;
+
+ public MockMapContextWrapper(final List<Pair<KEYIN, VALUEIN>> inputs,
+ final Counters counters, final Configuration conf, final InputSplit inputSplit)
+ throws IOException, InterruptedException {
+ super(counters, conf);
+ this.inputs = inputs;
+ this.inputSplit = inputSplit;
+ context = create();
+ }
+
+ @SuppressWarnings({ "unchecked" })
+ private Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context create()
+ throws IOException, InterruptedException {
+ final Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context context = mock(org.apache.hadoop.mapreduce.Mapper.Context.class);
+
+ createCommon(context);
+
+ /*
+ * In actual context code nextKeyValue() modifies the current state so we
+ * can here as well.
+ */
+ when(context.nextKeyValue()).thenAnswer(new Answer<Boolean>() {
+ @Override
+ public Boolean answer(final InvocationOnMock invocation) {
+ if (inputs.size() > 0) {
+ currentKeyValue = inputs.remove(0);
+ return true;
+ } else {
+ currentKeyValue = null;
+ return false;
+ }
+ }
+ });
+ when(context.getCurrentKey()).thenAnswer(new Answer<KEYIN>() {
+ @Override
+ public KEYIN answer(final InvocationOnMock invocation) {
+ return currentKeyValue.getFirst();
+ }
+ });
+ when(context.getCurrentValue()).thenAnswer(new Answer<VALUEIN>() {
+ @Override
+ public VALUEIN answer(final InvocationOnMock invocation) {
+ return currentKeyValue.getSecond();
+ }
+ });
+ when(context.getInputSplit()).thenAnswer(new Answer<InputSplit>() {
+ @Override
+ public InputSplit answer(InvocationOnMock invocation) throws Throwable {
+ return inputSplit;
+ }
+ });
+ return context;
+ }
+
+ /**
+ * @return the outputs from the MockOutputCollector back to the test harness.
+ */
+ public List<Pair<KEYOUT, VALUEOUT>> getOutputs() {
+ return outputs;
+ }
+
+ public Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context getMockContext() {
+ return context;
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockOutputCommitter.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockOutputCommitter.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockOutputCommitter.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockOutputCommitter.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,54 @@
+/**
+ * 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.hadoop.mrunit.internal.mapreduce;
+
+import org.apache.hadoop.mapreduce.JobContext;
+import org.apache.hadoop.mapreduce.OutputCommitter;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+
+/**
+ * Mock implementation of OutputCommitter that does nothing.
+ */
+public class MockOutputCommitter extends OutputCommitter {
+
+ @Override
+ public void setupJob(final JobContext jobContext) {
+ }
+
+ @Override
+ public void cleanupJob(final JobContext jobContext) {
+ }
+
+ @Override
+ public void setupTask(final TaskAttemptContext taskContext) {
+ }
+
+ @Override
+ public boolean needsTaskCommit(final TaskAttemptContext taskContext) {
+ return false;
+ }
+
+ @Override
+ public void commitTask(final TaskAttemptContext taskContext) {
+ }
+
+ @Override
+ public void abortTask(final TaskAttemptContext taskContext) {
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockRawKeyValueIterator.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockRawKeyValueIterator.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockRawKeyValueIterator.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockRawKeyValueIterator.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,52 @@
+/**
+ * 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.hadoop.mrunit.internal.mapreduce;
+
+import org.apache.hadoop.io.DataInputBuffer;
+import org.apache.hadoop.mapred.RawKeyValueIterator;
+import org.apache.hadoop.util.Progress;
+
+/**
+ * Mock implementation of RawKeyValueIterator that does nothing.
+ */
+public class MockRawKeyValueIterator implements RawKeyValueIterator {
+ @Override
+ public DataInputBuffer getKey() {
+ return null;
+ }
+
+ @Override
+ public DataInputBuffer getValue() {
+ return null;
+ }
+
+ @Override
+ public boolean next() {
+ return false;
+ }
+
+ @Override
+ public void close() {
+ }
+
+ @Override
+ public Progress getProgress() {
+ return null;
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReduceContextWrapper.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReduceContextWrapper.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReduceContextWrapper.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReduceContextWrapper.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,144 @@
+/**
+ * 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.hadoop.mrunit.internal.mapreduce;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapreduce.Counters;
+import org.apache.hadoop.mapreduce.Reducer;
+import org.apache.hadoop.mrunit.types.Pair;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+/**
+ * o.a.h.mapreduce.Reducer.reduce() expects to use a Reducer.Context object as a
+ * parameter. We want to override the functionality of a lot of Context to have
+ * it send the results back to us, etc. But since Reducer.Context is an inner
+ * class of Reducer, we need to put any subclasses of Reducer.Context in a
+ * subclass of Reducer.
+ *
+ * This wrapper class exists for that purpose.
+ */
+public class MockReduceContextWrapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> extends
+ MockContextWrapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> {
+
+ protected static final Log LOG = LogFactory
+ .getLog(MockReduceContextWrapper.class);
+ protected final List<Pair<KEYIN, List<VALUEIN>>> inputs;
+ protected Pair<KEYIN, List<VALUEIN>> currentKeyValue;
+ protected final Reducer<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context context;
+
+ public MockReduceContextWrapper(
+ final List<Pair<KEYIN, List<VALUEIN>>> inputs, final Counters counters,
+ final Configuration conf) throws IOException, InterruptedException {
+ super(counters, conf);
+ this.inputs = inputs;
+ context = create();
+ }
+
+ @SuppressWarnings({ "unchecked" })
+ private Reducer<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context create()
+ throws IOException, InterruptedException {
+
+ final Reducer<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context context = mock(org.apache.hadoop.mapreduce.Reducer.Context.class);
+ createCommon(context);
+ /*
+ * In actual context code nextKeyValue() modifies the current state so we
+ * can here as well.
+ */
+ when(context.nextKey()).thenAnswer(new Answer<Boolean>() {
+ @Override
+ public Boolean answer(final InvocationOnMock invocation) {
+ if (inputs.size() > 0) {
+ currentKeyValue = inputs.remove(0);
+ return true;
+ } else {
+ currentKeyValue = null;
+ return false;
+ }
+ }
+ });
+ when(context.getCurrentKey()).thenAnswer(new Answer<KEYIN>() {
+ @Override
+ public KEYIN answer(final InvocationOnMock invocation) {
+ return currentKeyValue.getFirst();
+ }
+ });
+ when(context.getValues()).thenAnswer(new Answer<Iterable<VALUEIN>>() {
+ @Override
+ public Iterable<VALUEIN> answer(final InvocationOnMock invocation) {
+ return makeOneUseIterator(currentKeyValue.getSecond().iterator());
+ }
+ });
+ return context;
+ }
+
+ /**
+ * @return the outputs from the MockOutputCollector back to the test harness.
+ */
+ public List<Pair<KEYOUT, VALUEOUT>> getOutputs() {
+ return outputs;
+ }
+
+ protected static <V> Iterable<V> makeOneUseIterator(final Iterator<V> parent) {
+ return new Iterable<V>() {
+ private final Iterator<V> iter = new Iterator<V>() {
+ private boolean used;
+
+ @Override
+ public boolean hasNext() {
+ if (used) {
+ return false;
+ }
+ return parent.hasNext();
+ }
+
+ @Override
+ public V next() {
+ if (used) {
+ throw new IllegalStateException();
+ }
+ return parent.next();
+ }
+
+ @Override
+ public void remove() {
+ throw new IllegalStateException();
+ }
+ };
+
+ @Override
+ public Iterator<V> iterator() {
+ return iter;
+ }
+ };
+ }
+
+ public Reducer<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context getMockContext() {
+ return context;
+ }
+}
Added: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReporter.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReporter.java?rev=1328200&view=auto
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReporter.java (added)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/internal/mapreduce/MockReporter.java Fri Apr 20 05:08:41 2012
@@ -0,0 +1,55 @@
+/**
+ * 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.hadoop.mrunit.internal.mapreduce;
+
+import org.apache.hadoop.mapreduce.Counter;
+import org.apache.hadoop.mapreduce.Counters;
+import org.apache.hadoop.mapreduce.StatusReporter;
+
+public class MockReporter extends StatusReporter {
+
+ private final Counters counters;
+
+ public MockReporter(final Counters ctrs) {
+ counters = ctrs;
+ }
+
+ @Override
+ public void setStatus(final String status) {
+ // do nothing.
+ }
+
+ @Override
+ public void progress() {
+ // do nothing.
+ }
+
+ @Override
+ public Counter getCounter(final String group, final String name) {
+ return counters.findCounter(group, name);
+ }
+
+ @Override
+ public Counter getCounter(final Enum<?> key) {
+ return counters.findCounter(key);
+ }
+
+ public float getProgress() {
+ return 0;
+ }
+}
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapDriver.java Fri Apr 20 05:08:41 2012
@@ -31,9 +31,9 @@ import org.apache.hadoop.mapreduce.Count
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mrunit.MapDriverBase;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
-import org.apache.hadoop.mrunit.mapreduce.mock.MockInputSplit;
-import org.apache.hadoop.mrunit.mapreduce.mock.MockMapContextWrapper;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.mapreduce.MockInputSplit;
+import org.apache.hadoop.mrunit.internal.mapreduce.MockMapContextWrapper;
import org.apache.hadoop.mrunit.types.Pair;
/**
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/MapReduceDriver.java Fri Apr 20 05:08:41 2012
@@ -31,7 +31,7 @@ import org.apache.hadoop.mapreduce.Count
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mrunit.MapReduceDriverBase;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
import org.apache.hadoop.mrunit.types.Pair;
/**
Modified: incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/ReduceDriver.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/ReduceDriver.java?rev=1328200&r1=1328199&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/ReduceDriver.java (original)
+++ incubator/mrunit/trunk/src/main/java/org/apache/hadoop/mrunit/mapreduce/ReduceDriver.java Fri Apr 20 05:08:41 2012
@@ -30,8 +30,8 @@ import org.apache.hadoop.conf.Configurat
import org.apache.hadoop.mapreduce.Counters;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mrunit.ReduceDriverBase;
-import org.apache.hadoop.mrunit.counters.CounterWrapper;
-import org.apache.hadoop.mrunit.mapreduce.mock.MockReduceContextWrapper;
+import org.apache.hadoop.mrunit.internal.counters.CounterWrapper;
+import org.apache.hadoop.mrunit.internal.mapreduce.MockReduceContextWrapper;
import org.apache.hadoop.mrunit.types.Pair;
/**
Copied: incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/io/TestSerialization.java (from r1328193, incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestSerialization.java)
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/io/TestSerialization.java?p2=incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/io/TestSerialization.java&p1=incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestSerialization.java&r1=1328193&r2=1328200&rev=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestSerialization.java (original)
+++ incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/io/TestSerialization.java Fri Apr 20 05:08:41 2012
@@ -15,12 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hadoop.mrunit;
+package org.apache.hadoop.mrunit.internal.io;
import static org.junit.Assert.assertEquals;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.mrunit.internal.io.Serialization;
import org.junit.Test;
public class TestSerialization {
Propchange: incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/io/TestSerialization.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockOutputCollector.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockOutputCollector.java?rev=1328200&r1=1328193&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockOutputCollector.java (original)
+++ incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockOutputCollector.java Fri Apr 20 05:08:41 2012
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hadoop.mrunit.mock;
+package org.apache.hadoop.mrunit.internal.mapred;
import java.io.IOException;
Modified: incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockReporter.java
URL: http://svn.apache.org/viewvc/incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockReporter.java?rev=1328200&r1=1328193&r2=1328200&view=diff
==============================================================================
--- incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockReporter.java (original)
+++ incubator/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/internal/mapred/TestMockReporter.java Fri Apr 20 05:08:41 2012
@@ -15,12 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hadoop.mrunit.mock;
+package org.apache.hadoop.mrunit.internal.mapred;
import static org.junit.Assert.assertTrue;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mrunit.ExpectedSuppliedException;
+import org.apache.hadoop.mrunit.internal.mapred.MockReporter;
import org.junit.Rule;
import org.junit.Test;