Home:ALL Converter>Hadoop JUnit testing writing/reading to/from the hdfs

Hadoop JUnit testing writing/reading to/from the hdfs

Ask Time:2011-06-09T23:26:15         Author:Needs Help

Json Formatter

I have written a class(es) that writes and reads from hdfs. Given certain conditions that are occurring when these classes are instantiated they create a specific path and file, and write to it (or they go to a previously created path and file and read from it). I have tested it by running a few hadoop jobs, and it appears to be functioning correctly.

However, I would like to be able to test this in the JUnit framework, but I have not found a good solution for being able to test reading and writing to hdfs in JUnit. I would appreciate an helpful advice on the matter. Thanks.

Author:Needs Help,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/6295311/hadoop-junit-testing-writing-reading-to-from-the-hdfs
yy