本文整理匯總了Java中org.apache.jorphan.collections.SearchByClass.getSearchResults方法的典型用法代碼示例。如果您正苦於以下問題:Java SearchByClass.getSearchResults方法的具體用法?Java SearchByClass.getSearchResults怎麽用?Java SearchByClass.getSearchResults使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.jorphan.collections.SearchByClass
的用法示例。
在下文中一共展示了SearchByClass.getSearchResults方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: selectThreadGroup
import org.apache.jorphan.collections.SearchByClass; //導入方法依賴的package包/類
private void selectThreadGroup(AbstractThreadGroup tg) {
debugger.selectThreadGroup(tg);
treeModel.clearTestPlan();
HashTree origTree = debugger.getSelectedTree();
TreeCloner cloner = new TreeCloner();
origTree.traverse(cloner);
HashTree selectedTree = cloner.getClonedTree();
// Hack to resolve ModuleControllers from JMeter.java
SearchClass<ReplaceableController> replaceableControllers = new SearchClass<>(ReplaceableController.class);
selectedTree.traverse(replaceableControllers);
Collection<ReplaceableController> replaceableControllersRes = replaceableControllers.getSearchResults();
for (ReplaceableController replaceableController : replaceableControllersRes) {
replaceableController.resolveReplacementSubTree((JMeterTreeNode) treeModel.getRoot());
}
JMeter.convertSubTree(selectedTree);
try {
treeModel.addSubTree(selectedTree, (JMeterTreeNode) treeModel.getRoot());
} catch (IllegalUserActionException e) {
throw new RuntimeException(e);
}
// select TG for visual convenience
SearchByClass<DebuggingThreadGroup> tgs = new SearchByClass<>(DebuggingThreadGroup.class);
selectedTree.traverse(tgs);
for (DebuggingThreadGroup forSel : tgs.getSearchResults()) {
Wrapper<AbstractThreadGroup> wtg = new ThreadGroupWrapper();
wtg.setWrappedElement(forSel);
selectTargetInTree(wtg);
}
}
示例2: notifyTestListenersOfEnd
import org.apache.jorphan.collections.SearchByClass; //導入方法依賴的package包/類
private void notifyTestListenersOfEnd(SearchByClass<TestStateListener> testListeners) {
log.info("Notifying test listeners of end of test");
for (TestStateListener tl : testListeners.getSearchResults()) {
try {
if (host == null) {
tl.testEnded();
} else {
tl.testEnded(host);
}
} catch (Exception e) {
log.warn("Error encountered during shutdown of "+tl.toString(),e);
}
}
if (host != null) {
log.info("Test has ended on host "+host);
long now=System.currentTimeMillis();
System.out.println("Finished the test on host " + host + " @ "+new Date(now)+" ("+now+")"
+(exitAfterTest ? " - exit requested." : ""));
if (exitAfterTest){
exit();
}
}
active=false;
}
示例3: notifyTestListenersOfStart
import org.apache.jorphan.collections.SearchByClass; //導入方法依賴的package包/類
private void notifyTestListenersOfStart(SearchByClass<TestStateListener> testListeners) {
for (TestStateListener tl : testListeners.getSearchResults()) {
if (tl instanceof TestBean) {
TestBeanHelper.prepare((TestElement) tl);
}
if (host == null) {
tl.testStarted();
} else {
tl.testStarted(host);
}
}
}
示例4: JMeterThread
import org.apache.jorphan.collections.SearchByClass; //導入方法依賴的package包/類
public JMeterThread(HashTree test, JMeterThreadMonitor monitor, ListenerNotifier note) {
this.monitor = monitor;
threadVars = new JMeterVariables();
testTree = test;
compiler = new TestCompiler(testTree);
threadGroupLoopController = (Controller) testTree.getArray()[0];
SearchByClass<TestIterationListener> threadListenerSearcher = new SearchByClass<>(TestIterationListener.class); // TL - IS
test.traverse(threadListenerSearcher);
testIterationStartListeners = threadListenerSearcher.getSearchResults();
SearchByClass<SampleMonitor> sampleMonitorSearcher = new SearchByClass<>(SampleMonitor.class);
test.traverse(sampleMonitorSearcher);
sampleMonitors = sampleMonitorSearcher.getSearchResults();
notifier = note;
running = true;
}
示例5: notifyTestListenersOfStart
import org.apache.jorphan.collections.SearchByClass; //導入方法依賴的package包/類
@SuppressWarnings("deprecation") // Deliberate use of deprecated method
private void notifyTestListenersOfStart(SearchByClass<TestStateListener> testListeners) {
for (TestStateListener tl : testListeners.getSearchResults()) {
if (tl instanceof TestBean) {
TestBeanHelper.prepare((TestElement) tl);
}
if (host == null) {
tl.testStarted();
} else {
tl.testStarted(host);
}
}
}
示例6: JMeterThread
import org.apache.jorphan.collections.SearchByClass; //導入方法依賴的package包/類
public JMeterThread(HashTree test, JMeterThreadMonitor monitor, ListenerNotifier note) {
this.monitor = monitor;
threadVars = new JMeterVariables();
testTree = test;
compiler = new TestCompiler(testTree);
controller = (Controller) testTree.getArray()[0];
SearchByClass<TestIterationListener> threadListenerSearcher = new SearchByClass<TestIterationListener>(TestIterationListener.class); // TL - IS
test.traverse(threadListenerSearcher);
testIterationStartListeners = threadListenerSearcher.getSearchResults();
notifier = note;
running = true;
}