public Object[] resolve(Method method) { Object[] values = new Object[method.getParameterTypes().length]; Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { ContainerResource resource = getResourceAnnotation(method.getParameterAnnotations()[i]); if (resource != null) { Annotation[] qualifiers = filterAnnotations(method.getParameterAnnotations()[i]); values[i] = lookup(method.getParameterTypes()[i], resource, qualifiers); } } return values; }
public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }
containerContext.get().activate(container.getName()); if (Context.class.isAssignableFrom(type)) { return lookupContext(type, resource, qualifiers); } else if (ManagementClient.class.isAssignableFrom(type)) { return managementClient.get();
public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }
containerContext.get().activate(container.getName()); if (Context.class.isAssignableFrom(type)) { return lookupContext(type, resource, qualifiers); } else if (ManagementClient.class.isAssignableFrom(type)) { return managementClient.get();
public Object[] resolve(Method method) { Object[] values = new Object[method.getParameterTypes().length]; Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { ContainerResource resource = getResourceAnnotation(method.getParameterAnnotations()[i]); if (resource != null) { Annotation[] qualifiers = filterAnnotations(method.getParameterAnnotations()[i]); values[i] = lookup(method.getParameterTypes()[i], resource, qualifiers); } } return values; }
public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }
containerContext.get().activate(container.getName()); if (Context.class.isAssignableFrom(type)) { return lookupContext(type, resource, qualifiers); } else if (ManagementClient.class.isAssignableFrom(type)) { return managementClient.get();
public Object[] resolve(Method method) { Object[] values = new Object[method.getParameterTypes().length]; Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { ContainerResource resource = getResourceAnnotation(method.getParameterAnnotations()[i]); if (resource != null) { Annotation[] qualifiers = filterAnnotations(method.getParameterAnnotations()[i]); values[i] = lookup(method.getParameterTypes()[i], resource, qualifiers); } } return values; }
public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }
containerContext.get().activate(container.getName()); if (Context.class.isAssignableFrom(type)) { return lookupContext(type, resource, qualifiers); } else if (ManagementClient.class.isAssignableFrom(type)) { return managementClient.get();
public Object[] resolve(Method method) { Object[] values = new Object[method.getParameterTypes().length]; Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { ContainerResource resource = getResourceAnnotation(method.getParameterAnnotations()[i]); if (resource != null) { Annotation[] qualifiers = filterAnnotations(method.getParameterAnnotations()[i]); values[i] = lookup(method.getParameterTypes()[i], resource, qualifiers); } } return values; }