|
@@ -27,6 +27,7 @@ import java.io.PrintStream;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.fs.FsShell;
|
|
import org.apache.hadoop.fs.FsShell;
|
|
import org.apache.hadoop.util.ToolRunner;
|
|
import org.apache.hadoop.util.ToolRunner;
|
|
|
|
+import org.junit.After;
|
|
import org.junit.Before;
|
|
import org.junit.Before;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
|
|
|
|
@@ -34,12 +35,21 @@ public class TestXAttrCommands {
|
|
private final ByteArrayOutputStream errContent =
|
|
private final ByteArrayOutputStream errContent =
|
|
new ByteArrayOutputStream();
|
|
new ByteArrayOutputStream();
|
|
private Configuration conf = null;
|
|
private Configuration conf = null;
|
|
|
|
+ private PrintStream initialStdErr;
|
|
|
|
|
|
@Before
|
|
@Before
|
|
public void setup() throws IOException {
|
|
public void setup() throws IOException {
|
|
|
|
+ errContent.reset();
|
|
|
|
+ initialStdErr = System.err;
|
|
System.setErr(new PrintStream(errContent));
|
|
System.setErr(new PrintStream(errContent));
|
|
conf = new Configuration();
|
|
conf = new Configuration();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @After
|
|
|
|
+ public void cleanUp() throws Exception {
|
|
|
|
+ errContent.reset();
|
|
|
|
+ System.setErr(initialStdErr);
|
|
|
|
+ }
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void testGetfattrValidations() throws Exception {
|
|
public void testGetfattrValidations() throws Exception {
|