/** * Makes sure that the given {@link StepContext} has all the context parameters this descriptor wants to see, * and if not, throw {@link MissingContextVariableException} indicating which variable is missing. */ public final void checkContextAvailability(StepContext c) throws MissingContextVariableException, IOException, InterruptedException { // TODO the order here is nondeterministic; should we pick the lexicographic first? Or extend MissingContextVariableException to take a Set<Class<?>> types? for (Class<?> type : getRequiredContext()) { Object v = c.get(type); if (v==null) throw new MissingContextVariableException(type); } }
/** * Makes sure that the given {@link StepContext} has all the context parameters this descriptor wants to see, * and if not, throw {@link MissingContextVariableException} indicating which variable is missing. */ public final void checkContextAvailability(StepContext c) throws MissingContextVariableException, IOException, InterruptedException { // TODO the order here is nondeterministic; should we pick the lexicographic first? Or extend MissingContextVariableException to take a Set<Class<?>> types? for (Class<?> type : getRequiredContext()) { Object v = c.get(type); if (v==null) throw new MissingContextVariableException(type); } }
/** * Returns {@link StepDescriptor}s with body that can provide a context of this type, * so that the error message can diagnose what steps were likely missing. * * <p> * In such error diagnosing context, we don't care about {@link StepDescriptor}s that just * decorates/modifies the existing context, so we check required context as well to * exclude them */ public @Nonnull List<StepDescriptor> getProviders() { List<StepDescriptor> r = new ArrayList<StepDescriptor>(); for (StepDescriptor sd : StepDescriptor.all()) { if (isIn(sd.getProvidedContext()) && !isIn(sd.getRequiredContext())) r.add(sd); } return r; }
/** * Returns {@link StepDescriptor}s with body that can provide a context of this type, * so that the error message can diagnose what steps were likely missing. * * <p> * In such error diagnosing context, we don't care about {@link StepDescriptor}s that just * decorates/modifies the existing context, so we check required context as well to * exclude them */ public @Nonnull List<StepDescriptor> getProviders() { List<StepDescriptor> r = new ArrayList<StepDescriptor>(); for (StepDescriptor sd : StepDescriptor.all()) { if (isIn(sd.getProvidedContext()) && !isIn(sd.getRequiredContext())) r.add(sd); } return r; }
if (sd.takesImplicitBlockArgument() && !(BlockedStepsAndMethodCalls.blockedInMethodCalls().containsKey(sd.getFunctionName())) && !(sd.getRequiredContext().contains(Launcher.class)) && !(sd.getRequiredContext().contains(FilePath.class)) && !(ADDITIONAL_BLOCKED_STEPS.contains(sd.getFunctionName()))) { descriptors.add(sd);