Search in sources :

Example 1 with WebAppException

use of org.apache.hadoop.yarn.webapp.WebAppException in project hadoop by apache.

the class WebAppTests method testController.

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);
    }
}
Also used : WebAppException(org.apache.hadoop.yarn.webapp.WebAppException) Injector(com.google.inject.Injector) Method(java.lang.reflect.Method) IOException(java.io.IOException) WebAppException(org.apache.hadoop.yarn.webapp.WebAppException)

Aggregations

Injector (com.google.inject.Injector)1 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 WebAppException (org.apache.hadoop.yarn.webapp.WebAppException)1