...
Let's take a look at the real test example available from src/test/system/test/org/apache/hadoop/mapred/TestCluster.java
. As always your best source of information and knowledge about any software system is its source code
Wiki Markup Let's start with {{@BeforeClass}} fixture creating an instance of \*cluster proxy\* (in this case for a MapReduce cluster) which provides access to MapReduce daemons (the Job Tracker \[JT\] and Task Trackers \[TTs\]). The second call creates all needed \*daemon proxies\* and makes them available through \*Herriot library\* APIs. As part of this setup Herriot will guarantee that the test environment is clean and all internal states are reset. Also, a number of exceptions that arise in the daemon logs will be saved. This is particularly useful as it allows us to disregard exceptions raised in the log files before a Herriot test has been started. {{@BeforeClass}} will guarantee that only one instance of \*cluster proxy\* is created (for this is an expensive operation) for use in all test cases defined in the test class. \\
Code Block | ||
---|---|---|
| ||
@BeforeClass public static void before() throws Exception { cluster = MRCluster.createCluster(new Configuration()); cluster.setUp(); } |
...