本文整理汇总了Java中org.apache.hadoop.yarn.webapp.Controller类的典型用法代码示例。如果您正苦于以下问题:Java Controller类的具体用法?Java Controller怎么用?Java Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Controller类属于org.apache.hadoop.yarn.webapp包,在下文中一共展示了Controller类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testController
import org.apache.hadoop.yarn.webapp.Controller; //导入依赖的package包/类
public static <T> Injector testController(Class<? extends Controller> ctrlr,
String methodName, Class<T> api, T impl, Module... modules) {
try {
Injector injector = createMockInjector(api, impl, modules);
Method method = ctrlr.getMethod(methodName, (Class<?>[])null);
method.invoke(injector.getInstance(ctrlr), (Object[])null);
return injector;
} catch (Exception e) {
throw new WebAppException(e);
}
}
示例2: setup
import org.apache.hadoop.yarn.webapp.Controller; //导入依赖的package包/类
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mockAppContext = mock(AppContext.class);
Configuration conf = new Configuration(false);
conf.set(TezConfiguration.TEZ_HISTORY_URL_BASE, "http://uihost:9001/foo");
when(mockAppContext.getAMConf()).thenReturn(conf);
mockRequestContext = mock(Controller.RequestContext.class);
mockResponse = mock(HttpServletResponse.class);
mockRequest = mock(HttpServletRequest.class);
}