@Override public void testEnded(String host) { if (testListener != null) { testListener.testEnded(host); } }
@Override public void testStarted(String host) { if (testListener != null) { testListener.testStarted(host); } }
@Override public void testStarted() { if (testListener != null) { testListener.testStarted(); } }
@Override public void testEnded() { if (testListener != null) { testListener.testEnded(); } }
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); } } }
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+")" // NOSONAR Intentional +(EXIT_AFTER_TEST ? " - exit requested." : "")); if (EXIT_AFTER_TEST){ exit(); } } active=false; }
/** * This will notify test listeners directly within the Proxy that the 'test' * (here meaning the proxy recording) has started. */ private void notifyTestListenersOfStart() { JMeterTreeModel treeModel = getJmeterTreeModel(); JMeterTreeNode myNode = treeModel.getNodeOf(this); if(myNode != null) { Enumeration<?> kids = myNode.children(); while (kids.hasMoreElements()) { JMeterTreeNode subNode = (JMeterTreeNode)kids.nextElement(); if (subNode.isEnabled()) { TestElement testElement = subNode.getTestElement(); if (testElement instanceof TestStateListener) { ((TestStateListener) testElement).testStarted(); } } } } }
/** * This will notify test listeners directly within the Proxy that the 'test' * (here meaning the proxy recording) has ended. */ private void notifyTestListenersOfEnd() { JMeterTreeModel treeModel = getJmeterTreeModel(); JMeterTreeNode myNode = treeModel.getNodeOf(this); if(myNode != null) { Enumeration<?> kids = myNode.children(); while (kids.hasMoreElements()) { JMeterTreeNode subNode = (JMeterTreeNode)kids.nextElement(); if (subNode.isEnabled()) { TestElement testElement = subNode.getTestElement(); if (testElement instanceof TestStateListener) { // TL - TE ((TestStateListener) testElement).testEnded(); } } } } }