當前位置: 首頁>>代碼示例>>Java>>正文


Java SearchByClass類代碼示例

本文整理匯總了Java中org.apache.jorphan.collections.SearchByClass的典型用法代碼示例。如果您正苦於以下問題:Java SearchByClass類的具體用法?Java SearchByClass怎麽用?Java SearchByClass使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SearchByClass類屬於org.apache.jorphan.collections包,在下文中一共展示了SearchByClass類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
    }
}
 
開發者ID:Blazemeter,項目名稱:jmeter-debugger,代碼行數:33,代碼來源:DebuggerDialog.java

示例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;
}
 
開發者ID:johrstrom,項目名稱:cloud-meter,代碼行數:25,代碼來源:StandardJMeterEngine.java

示例3: configure

import org.apache.jorphan.collections.SearchByClass; //導入依賴的package包/類
@Override
public void configure(HashTree testTree) {
    // Is testplan serialised?
    SearchByClass<TestPlan> testPlan = new SearchByClass<>(TestPlan.class);
    testTree.traverse(testPlan);
    Object[] plan = testPlan.getSearchResults().toArray();
    if (plan.length == 0) {
        throw new RuntimeException("Could not find the TestPlan class!");
    }
    TestPlan tp = (TestPlan) plan[0];
    serialized = tp.isSerialized();
    tearDownOnShutdown = tp.isTearDownOnShutdown();
    active = true;
    test = testTree;
}
 
開發者ID:johrstrom,項目名稱:cloud-meter,代碼行數:16,代碼來源:StandardJMeterEngine.java

示例4: 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);
        }
    }
}
 
開發者ID:johrstrom,項目名稱:cloud-meter,代碼行數:13,代碼來源:StandardJMeterEngine.java

示例5: startThreadGroup

import org.apache.jorphan.collections.SearchByClass; //導入依賴的package包/類
private void startThreadGroup(AbstractThreadGroup group, int groupCount, SearchByClass<?> searcher, List<?> testLevelElements, ListenerNotifier notifier)
{
    int numThreads = group.getNumThreads();
    JMeterContextService.addTotalThreads(numThreads);
    boolean onErrorStopTest = group.getOnErrorStopTest();
    boolean onErrorStopTestNow = group.getOnErrorStopTestNow();
    boolean onErrorStopThread = group.getOnErrorStopThread();
    boolean onErrorStartNextLoop = group.getOnErrorStartNextLoop();
    String groupName = group.getName();
    log.info("Starting " + numThreads + " threads for group " + groupName + ".");

    if (onErrorStopTest) {
        log.info("Test will stop on error");
    } else if (onErrorStopTestNow) {
        log.info("Test will stop abruptly on error");
    } else if (onErrorStopThread) {
        log.info("Thread will stop on error");
    } else if (onErrorStartNextLoop) {
        log.info("Thread will start next loop on error");
    } else {
        log.info("Thread will continue on error");
    }
    ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
    threadGroupTree.add(group, testLevelElements);

    groups.add(group);
    group.start(groupCount, notifier, threadGroupTree, this);
}
 
開發者ID:johrstrom,項目名稱:cloud-meter,代碼行數:29,代碼來源:StandardJMeterEngine.java

示例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);
    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;
}
 
開發者ID:johrstrom,項目名稱:cloud-meter,代碼行數:16,代碼來源:JMeterThread.java

示例7: configure

import org.apache.jorphan.collections.SearchByClass; //導入依賴的package包/類
@Override
public void configure(HashTree testTree) {
    // Is testplan serialised?
    SearchByClass<TestPlan> testPlan = new SearchByClass<TestPlan>(TestPlan.class);
    testTree.traverse(testPlan);
    Object[] plan = testPlan.getSearchResults().toArray();
    if (plan.length == 0) {
        throw new RuntimeException("Could not find the TestPlan class!");
    }
    TestPlan tp = (TestPlan) plan[0];
    serialized = tp.isSerialized();
    tearDownOnShutdown = tp.isTearDownOnShutdown();
    active = true;
    test = testTree;
}
 
開發者ID:botelhojp,項目名稱:apache-jmeter-2.10,代碼行數:16,代碼來源:StandardJMeterEngine.java

示例8: 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);
        }
    }
}
 
開發者ID:botelhojp,項目名稱:apache-jmeter-2.10,代碼行數:14,代碼來源:StandardJMeterEngine.java

示例9: 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;
}
 
開發者ID:botelhojp,項目名稱:apache-jmeter-2.10,代碼行數:13,代碼來源:JMeterThread.java


注:本文中的org.apache.jorphan.collections.SearchByClass類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。