Search in sources :

Example 1 with ApplicationBlock

use of org.apache.hadoop.yarn.server.nodemanager.webapp.ApplicationPage.ApplicationBlock in project hadoop by apache.

the class TestNMAppsPage method testNMAppsPage.

@Test
public void testNMAppsPage() {
    Configuration conf = new Configuration();
    final NMContext nmcontext = new NMContext(new NMContainerTokenSecretManager(conf), new NMTokenSecretManagerInNM(), null, new ApplicationACLsManager(conf), new NMNullStateStoreService(), false, conf);
    Injector injector = WebAppTests.createMockInjector(NMContext.class, nmcontext, new Module() {

        @Override
        public void configure(Binder binder) {
            NodeManager nm = TestNMAppsPage.mocknm(nmcontext);
            binder.bind(NodeManager.class).toInstance(nm);
            binder.bind(Context.class).toInstance(nmcontext);
        }
    });
    ApplicationBlock instance = injector.getInstance(ApplicationBlock.class);
    instance.set(YarnWebParams.APPLICATION_ID, applicationid);
    instance.render();
}
Also used : Binder(com.google.inject.Binder) NodeManager(org.apache.hadoop.yarn.server.nodemanager.NodeManager) ApplicationACLsManager(org.apache.hadoop.yarn.server.security.ApplicationACLsManager) Configuration(org.apache.hadoop.conf.Configuration) NMContext(org.apache.hadoop.yarn.server.nodemanager.NodeManager.NMContext) Injector(com.google.inject.Injector) NMContainerTokenSecretManager(org.apache.hadoop.yarn.server.nodemanager.security.NMContainerTokenSecretManager) NMTokenSecretManagerInNM(org.apache.hadoop.yarn.server.nodemanager.security.NMTokenSecretManagerInNM) Module(com.google.inject.Module) NMNullStateStoreService(org.apache.hadoop.yarn.server.nodemanager.recovery.NMNullStateStoreService) ApplicationBlock(org.apache.hadoop.yarn.server.nodemanager.webapp.ApplicationPage.ApplicationBlock) Test(org.junit.Test)

Aggregations

Binder (com.google.inject.Binder)1 Injector (com.google.inject.Injector)1 Module (com.google.inject.Module)1 Configuration (org.apache.hadoop.conf.Configuration)1 NodeManager (org.apache.hadoop.yarn.server.nodemanager.NodeManager)1 NMContext (org.apache.hadoop.yarn.server.nodemanager.NodeManager.NMContext)1 NMNullStateStoreService (org.apache.hadoop.yarn.server.nodemanager.recovery.NMNullStateStoreService)1 NMContainerTokenSecretManager (org.apache.hadoop.yarn.server.nodemanager.security.NMContainerTokenSecretManager)1 NMTokenSecretManagerInNM (org.apache.hadoop.yarn.server.nodemanager.security.NMTokenSecretManagerInNM)1 ApplicationBlock (org.apache.hadoop.yarn.server.nodemanager.webapp.ApplicationPage.ApplicationBlock)1 ApplicationACLsManager (org.apache.hadoop.yarn.server.security.ApplicationACLsManager)1 Test (org.junit.Test)1