YARN-1760. TestRMAdminService assumes CapacityScheduler. (kasha)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1571777 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Karthik Kambatla 2014-02-25 18:06:45 +00:00
parent 6c9c3144dd
commit 5a42e1b7c3
2 changed files with 12 additions and 2 deletions

View File

@ -352,6 +352,8 @@ Release 2.4.0 - UNRELEASED
transits from standby to active mode so as to assimilate any changes that transits from standby to active mode so as to assimilate any changes that
happened while it was in standby mode. (Xuan Gong via vinodkv) happened while it was in standby mode. (Xuan Gong via vinodkv)
YARN-1760. TestRMAdminService assumes CapacityScheduler. (kasha)
Release 2.3.1 - UNRELEASED Release 2.3.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -62,7 +62,7 @@ import org.junit.Test;
public class TestRMAdminService { public class TestRMAdminService {
private final Configuration configuration = new YarnConfiguration(); private Configuration configuration;;
private MockRM rm = null; private MockRM rm = null;
private FileSystem fs; private FileSystem fs;
private Path workingPath; private Path workingPath;
@ -70,7 +70,7 @@ public class TestRMAdminService {
@Before @Before
public void setup() throws IOException { public void setup() throws IOException {
Configuration.addDefaultResource(YarnConfiguration.CS_CONFIGURATION_FILE); configuration = new YarnConfiguration();
fs = FileSystem.get(configuration); fs = FileSystem.get(configuration);
workingPath = workingPath =
new Path(new File("target", this.getClass().getSimpleName() new Path(new File("target", this.getClass().getSimpleName()
@ -94,9 +94,16 @@ public class TestRMAdminService {
fs.delete(tmpDir, true); fs.delete(tmpDir, true);
} }
private void useCapacityScheduler() {
configuration.set(YarnConfiguration.RM_SCHEDULER,
CapacityScheduler.class.getCanonicalName());
configuration.addResource(YarnConfiguration.CS_CONFIGURATION_FILE);
}
@Test @Test
public void testAdminRefreshQueuesWithLocalConfigurationProvider() public void testAdminRefreshQueuesWithLocalConfigurationProvider()
throws IOException, YarnException { throws IOException, YarnException {
useCapacityScheduler();
rm = new MockRM(configuration); rm = new MockRM(configuration);
rm.init(configuration); rm.init(configuration);
rm.start(); rm.start();
@ -119,6 +126,7 @@ public class TestRMAdminService {
throws IOException, YarnException { throws IOException, YarnException {
configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS, configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
"org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider"); "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
useCapacityScheduler();
try { try {
rm = new MockRM(configuration); rm = new MockRM(configuration);
rm.init(configuration); rm.init(configuration);