/** * Is the assertion to be applied to the all samples? * * @return <code>true</code> if the assertion is to be applied to the all samples. */ protected boolean isScopeVariable() { return isScopeVariable(fetchScope()); }
/** * Get the scope setting * @return the scope, default parent */ public String fetchScope() { return getPropertyAsString(getScopeName(), SCOPE_PARENT); }
public void setScopeParent() { removeProperty(getScopeName()); }
public void setScopeVariable(String variableName) { setProperty(getScopeName(), SCOPE_VARIABLE); setProperty(SCOPE_VARIABLE_NAME, variableName); }
/** * Show the scope settings from the test element with variable scope * * @param testElement * the test element from which the settings should be shown * @param enableVariableButton * set true to enable the variable panel */ protected void showScopeSettings(AbstractScopedTestElement testElement, boolean enableVariableButton) { String scope = testElement.fetchScope(); if (testElement.isScopeParent(scope)) { scopePanel.setScopeParent(enableVariableButton); } else if (testElement.isScopeChildren(scope)){ scopePanel.setScopeChildren(enableVariableButton); } else if (testElement.isScopeAll(scope)){ scopePanel.setScopeAll(enableVariableButton); } else if (testElement.isScopeVariable(scope)){ scopePanel.setScopeVariable(testElement.getVariableName()); } else { throw new IllegalArgumentException("Invalid scope: "+scope); } }
/** * Generate a list of qualifying sample results, * depending on the scope. * * @param result current sample * @return list containing the current sample and/or its child samples */ protected List<SampleResult> getSampleList(SampleResult result) { List<SampleResult> sampleList = new ArrayList<>(); String scope = fetchScope(); if (isScopeParent(scope) || isScopeAll(scope)) { sampleList.add(result); } if (isScopeChildren(scope) || isScopeAll(scope)) { Collections.addAll(sampleList, result.getSubResults()); } return sampleList; } }
public String getVariableName(){ return getPropertyAsString(SCOPE_VARIABLE_NAME, ""); }
public void setScopeAll() { setProperty(getScopeName(), SCOPE_ALL); }
public void setScopeChildren() { setProperty(getScopeName(), SCOPE_CHILDREN); }