You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mrunit.apache.org by "JenWang (JIRA)" <ji...@apache.org> on 2011/05/22 14:12:48 UTC

[jira] [Updated] (MRUNIT-12) Support MultipleOutputs test, load dataset from text,and some usefull annotation

     [ https://issues.apache.org/jira/browse/MRUNIT-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

JenWang updated MRUNIT-12:
--------------------------

    Attachment: mrunit_enhance.zip

the code resolve this issues

> Support MultipleOutputs test, load dataset from text,and some usefull annotation
> --------------------------------------------------------------------------------
>
>                 Key: MRUNIT-12
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-12
>             Project: MRUnit
>          Issue Type: New Feature
>            Reporter: JenWang
>         Attachments: mrunit_enhance.zip
>
>
> example:
> public void testReduce () {
>   List<TimeInfo> values = new ArrayList<TimeInfo>();
>   values.add(new TimeInfo(1, 3));
>   values.add(new TimeInfo(2, 5));
>   values.add(new TimeInfo(3, 7));
>   reduceDriver.withReducer(reducer)
>           .withInput(new Text("444"), values)
>           . withMutiOutput ("somePrefix"+444%8,new Text("444"),new LongWritable(2))
>           .runTest();
> }
>  
> load test data from text and use annotation:
>  
> @RunWith(MRUnitJunit4TestClassRunner.class)
> public class XXXMRUseAnnotationTest {
>   @MapInputSet
>   @MapReduce(mapper = Map.class, reducer = Reduce.class)
>   private MapReduceDriver<LongWritable, Text, Text, TimeInfo, Text, LongWritable> mrDriver;
>   @Test
>   @MapInputSet("ConsignTimeMRUseAnnotationTest.txt")
>   public void testMapReduce_3record_1user() {
>        mrDriver. withMutiOutput ("somePrefix"+444%8,new Text("444"),new LongWritable(2))
>                     .runTest();
>    }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira