public abstract class HadoopTestCase extends TestCase
| Modifier and Type | Field and Description |
|---|---|
static int |
CLUSTER_MR |
static int |
DFS_FS |
static int |
LOCAL_FS |
static int |
LOCAL_MR |
| Constructor and Description |
|---|
HadoopTestCase(int mrMode,
int fsMode,
int taskTrackers,
int dataNodes)
Creates a testcase for local or cluster MR using DFS.
|
| Modifier and Type | Method and Description |
|---|---|
protected JobConf |
createJobConf()
Returns a job configuration preconfigured to run against the Hadoop
managed by the testcase.
|
protected FileSystem |
getFileSystem()
Returns the Filesystem in use.
|
boolean |
isLocalFS()
Indicates if the filesystem is local or DFS.
|
boolean |
isLocalMR()
Indicates if the MR is running in local or cluster mode.
|
protected void |
setUp()
Creates Hadoop instance based on constructor configuration before
a test case is run.
|
protected void |
tearDown()
Destroys Hadoop instance based on constructor configuration after
a test case is run.
|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toStringassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, formatpublic static final int LOCAL_MR
public static final int CLUSTER_MR
public static final int LOCAL_FS
public static final int DFS_FS
public HadoopTestCase(int mrMode, int fsMode, int taskTrackers, int dataNodes) throws IOException
mrMode - indicates if the MR should be local (LOCAL_MR) or cluster
(CLUSTER_MR)fsMode - indicates if the FS should be local (LOCAL_FS) or DFS (DFS_FS)
local FS when using relative PATHs)taskTrackers - number of task trackers to start when using clusterdataNodes - number of data nodes to start when using DFSIOException - thrown if the base directory cannot be set.public boolean isLocalMR()
public boolean isLocalFS()
protected void setUp() throws Exception
protected void tearDown() throws Exception
protected FileSystem getFileSystem()
protected JobConf createJobConf()