mrunit-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vineet Mittal <vineetmittal....@gmail.com>
Subject Unable to provide input to MapDriver as file Path (mrunit-1.0.0-hadoop1.jar)
Date Mon, 15 Jul 2013 13:20:58 GMT
Hi,
I am using MR Unit 1.0.0 hadoop1.
I am trying to provide a file as input to MapDriver using the API

*MapDriver.setMapInputPath()  *     //which is implemented in
MapDriverBase.java



My test code looks like -

*@BeforeClass
    public void setUp() throws URISyntaxException, IOException {
        super.setUp();
        mapDriver.setMapInputPath(new
Path(this.getClass().getClassLoader().getResource(rollupInPutDatafile).getPath()));
    }

    @Test
    public void testMapperRollupFileInputDEVICEFOUND() throws IOException,
URISyntaxException {
        mapDriver.runTest();
    }
*

Looks like it just sets the path but doesnt read the input file from this
path.
When I run the test case using mvn it throws exception . A little stack
trace pasted below -
            *  <![CDATA[java.lang.IllegalStateException: No input was
provided
        at
org.apache.hadoop.mrunit.MapDriverBase.preRunChecks(MapDriverBase.java:282)
        at
org.apache.hadoop.mrunit.mapreduce.MapDriver.run(MapDriver.java:134)
        at org.apache.hadoop.mrunit.TestDriver.runTest(TestDriver.java:574)*

Please guide me if I am doing some thing wrong in my test case.

Warm Regards,
Vineet.

Mime
View raw message