use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class AddThinkTimeBetweenEachStep method doAction.
@Override
public void doAction(ActionEvent e) {
GuiPackage guiPackage = GuiPackage.getInstance();
JMeterTreeNode currentNode = guiPackage.getTreeListener().getCurrentNode();
if (!(currentNode.getUserObject() instanceof Controller || currentNode.getUserObject() instanceof ThreadGroup)) {
Toolkit.getDefaultToolkit().beep();
return;
}
try {
addThinkTimeToChildren(guiPackage, currentNode);
} catch (Exception err) {
Toolkit.getDefaultToolkit().beep();
log.error("Failed to add think times", err);
JMeterUtils.reportErrorToUser("Failed to add think times", err);
}
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class ApplyNamingConvention method doAction.
@Override
public void doAction(ActionEvent e) {
GuiPackage guiPackage = GuiPackage.getInstance();
JMeterTreeNode currentNode = guiPackage.getTreeListener().getCurrentNode();
if (!(currentNode.getUserObject() instanceof Controller)) {
Toolkit.getDefaultToolkit().beep();
return;
}
try {
applyNamingPolicyToCurrentNode(guiPackage, currentNode);
} catch (Exception err) {
Toolkit.getDefaultToolkit().beep();
log.error("Failed to apply naming policy", err);
JMeterUtils.reportErrorToUser("Failed to apply naming policy", err);
}
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class ChangeParent method doAction.
@Override
public void doAction(ActionEvent e) {
String name = ((Component) e.getSource()).getName();
GuiPackage guiPackage = GuiPackage.getInstance();
JMeterTreeNode currentNode = guiPackage.getTreeListener().getCurrentNode();
if (!(currentNode.getUserObject() instanceof Controller)) {
Toolkit.getDefaultToolkit().beep();
return;
}
try {
guiPackage.updateCurrentNode();
TestElement controller = guiPackage.createTestElement(name);
changeParent(controller, guiPackage, currentNode);
} catch (Exception err) {
Toolkit.getDefaultToolkit().beep();
log.error("Failed to change parent", err);
}
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class RemoteThreadsListenerImpl method threadStarted.
/**
*
* @see RemoteThreadsListener#threadStarted()
*/
@Override
public void threadStarted() {
JMeterContextService.incrNumberOfThreads();
GuiPackage gp = GuiPackage.getInstance();
if (gp != null) {
// check there is a GUI
gp.getMainFrame().updateCounts();
}
for (RemoteThreadsLifeCycleListener listener : listeners) {
listener.threadNumberIncreased(JMeterContextService.getNumberOfThreads());
}
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class HttpMirrorControl method stopHttpMirror.
public void stopHttpMirror() {
if (server != null) {
server.stopServer();
GuiPackage instance = GuiPackage.getInstance();
if (instance != null) {
instance.unregister(server);
}
try {
// wait for server to stop
server.join(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
server = null;
}
}
Aggregations