You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2004/02/13 00:59:02 UTC
cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/gui/action RemoteStart.java
sebb 2004/02/12 15:59:02
Modified: src/core/org/apache/jmeter/engine RemoteJMeterEngine.java
StandardJMeterEngine.java ClientJMeterEngine.java
RemoteJMeterEngineImpl.java JMeterEngine.java
src/core/org/apache/jmeter/gui/util MenuFactory.java
JMeterMenuBar.java
src/core/org/apache/jmeter/gui/action RemoteStart.java
Log:
ASF L V2; added Remote Exit functionality
Revision Changes Path
1.5 +18 -53 jakarta-jmeter/src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java
Index: RemoteJMeterEngine.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RemoteJMeterEngine.java 25 Jun 2003 21:18:04 -0000 1.4
+++ RemoteJMeterEngine.java 12 Feb 2004 23:59:01 -0000 1.5
@@ -1,57 +1,21 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.engine;
import java.rmi.Remote;
@@ -60,7 +24,7 @@
import org.apache.jorphan.collections.HashTree;
/**
- * @version $Revision$
+ * @version $Revision$ Last updated $Date$
*/
public interface RemoteJMeterEngine extends Remote
{
@@ -69,4 +33,5 @@
void stopTest() throws RemoteException;
void reset() throws RemoteException;
void setHost(String host) throws RemoteException;
+ void exit() throws RemoteException;
}
1.41 +36 -52 jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
Index: StandardJMeterEngine.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- StandardJMeterEngine.java 13 Jan 2004 14:49:32 -0000 1.40
+++ StandardJMeterEngine.java 12 Feb 2004 23:59:01 -0000 1.41
@@ -1,57 +1,21 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.engine;
import java.io.PrintWriter;
@@ -463,5 +427,25 @@
verifyThreadsStopped();
}
-
+ // Remote exit
+ public void exit()
+ {
+ // Needs to be run in a separate thread to allow RMI call to return OK
+ Thread t = new Thread(){
+ public void run(){
+ //log.info("Pausing");
+ try
+ {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ log.info("Bye");
+ System.exit(0);
+ };
+ };
+ log.info("Starting Closedown");
+ t.start();
+ }
}
1.14 +32 -53 jakarta-jmeter/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java
Index: ClientJMeterEngine.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ClientJMeterEngine.java 9 Feb 2004 00:48:16 -0000 1.13
+++ ClientJMeterEngine.java 12 Feb 2004 23:59:01 -0000 1.14
@@ -1,57 +1,21 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.engine;
import java.net.MalformedURLException;
import java.rmi.Naming;
@@ -167,6 +131,21 @@
catch(Exception ex)
{
log.error("",ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.jmeter.engine.JMeterEngine#exit()
+ */
+ public void exit()
+ {
+ try
+ {
+ remote.exit();
+ }
+ catch (RemoteException e)
+ {
+ log.warn("Could not perform remote exit: "+e.toString());
}
}
}
1.16 +23 -53 jakarta-jmeter/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java
Index: RemoteJMeterEngineImpl.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- RemoteJMeterEngineImpl.java 26 Nov 2003 02:48:18 -0000 1.15
+++ RemoteJMeterEngineImpl.java 12 Feb 2004 23:59:01 -0000 1.16
@@ -1,57 +1,21 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.engine;
import java.net.InetAddress;
@@ -130,6 +94,12 @@
backingEngine.stopTest();//TODO: askThreadsToStop() instead?
}
+ public void exit() throws RemoteException
+ {
+ log.info("Exitting");
+ backingEngine.exit();
+ }
+
/**
* The main program for the RemoteJMeterEngineImpl class.
*
1.5 +18 -53 jakarta-jmeter/src/core/org/apache/jmeter/engine/JMeterEngine.java
Index: JMeterEngine.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/JMeterEngine.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JMeterEngine.java 25 Jun 2003 21:18:04 -0000 1.4
+++ JMeterEngine.java 12 Feb 2004 23:59:01 -0000 1.5
@@ -1,64 +1,28 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.engine;
import org.apache.jorphan.collections.HashTree;
/**
* @author Michael Stover
- * @version $Revision$
+ * @version $Revision$ Last updated $Date$
*/
public interface JMeterEngine
{
@@ -67,4 +31,5 @@
void stopTest();
void reset();
void setHost(String host);
+ void exit();
}
1.29 +17 -53 jakarta-jmeter/src/core/org/apache/jmeter/gui/util/MenuFactory.java
Index: MenuFactory.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/util/MenuFactory.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- MenuFactory.java 10 Feb 2004 22:05:39 -0000 1.28
+++ MenuFactory.java 12 Feb 2004 23:59:01 -0000 1.29
@@ -1,57 +1,21 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.gui.util;
import java.awt.event.KeyEvent;
1.22 +48 -52 jakarta-jmeter/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
Index: JMeterMenuBar.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- JMeterMenuBar.java 10 Feb 2004 22:05:39 -0000 1.21
+++ JMeterMenuBar.java 12 Feb 2004 23:59:01 -0000 1.22
@@ -1,57 +1,21 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.gui.util;
import java.awt.Component;
import java.awt.event.KeyEvent;
@@ -116,10 +80,15 @@
JMenuItem help_about;
String[] remoteHosts;
+ private JMenu remote_exit;
+ private JMenuItem remote_exit_all;
+ private Collection remote_engine_exit;
+
public JMeterMenuBar()
{
remote_engine_start = new LinkedList();
remote_engine_stop = new LinkedList();
+ remote_engine_exit = new LinkedList();
remoteHosts =
JOrphanUtils.split(
JMeterUtils.getPropDefault("remote_hosts", ""),
@@ -414,6 +383,18 @@
remote_stop_all.addActionListener(ActionRouter.getInstance());
remote_stop_all.setActionCommand("remote_stop_all");
runMenu.add(remote_stop_all);
+
+ if (remote_exit != null)
+ {
+ runMenu.add(remote_exit);
+ }
+ remote_exit_all =
+ new JMenuItem(JMeterUtils.getResString("remote_exit_all"));
+ remote_exit_all.addActionListener(ActionRouter.getInstance());
+ remote_exit_all.setActionCommand("remote_exit_all");
+ runMenu.add(remote_exit_all);
+
+
runMenu.addSeparator();
runMenu.add(run_clear);
runMenu.add(run_clearAll);
@@ -494,10 +475,12 @@
Iterator iter = remote_engine_start.iterator();
Iterator iter2 = remote_engine_stop.iterator();
- while (iter.hasNext() && iter2.hasNext())
+ Iterator iter3 = remote_engine_exit.iterator();
+ while (iter.hasNext() && iter2.hasNext() && iter3.hasNext())
{
JMenuItem start = (JMenuItem) iter.next();
JMenuItem stop = (JMenuItem) iter2.next();
+ JMenuItem exit = (JMenuItem) iter3.next();
if (start.getText().equals(host))
{
log.info("Found start host: " + start.getText());
@@ -508,6 +491,11 @@
log.info("Found stop host: " + stop.getText());
stop.setEnabled(running);
}
+ if (exit.getText().equals(host))
+ {
+ log.info("Found exit host: " + exit.getText());
+ exit.setEnabled(true);
+ }
}
}
@@ -524,6 +512,7 @@
{
remote_start = new JMenu(JMeterUtils.getResString("remote_start"));
remote_stop = new JMenu(JMeterUtils.getResString("remote_stop"));
+ remote_exit = new JMenu(JMeterUtils.getResString("remote_exit"));
for (int i = 0; i < remoteHosts.length; i++)
{
@@ -541,6 +530,13 @@
item.setEnabled(false);
remote_engine_stop.add(item);
remote_stop.add(item);
+ item = new JMenuItem(remoteHosts[i]);
+ item.setActionCommand("remote_exit");
+ item.setName(remoteHosts[i]);
+ item.addActionListener(ActionRouter.getInstance());
+ item.setEnabled(false);
+ remote_engine_exit.add(item);
+ remote_exit.add(item);
}
}
}
1.14 +49 -53 jakarta-jmeter/src/core/org/apache/jmeter/gui/action/RemoteStart.java
Index: RemoteStart.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/action/RemoteStart.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- RemoteStart.java 7 Sep 2003 18:54:53 -0000 1.13
+++ RemoteStart.java 12 Feb 2004 23:59:02 -0000 1.14
@@ -1,57 +1,21 @@
+// $Header$
/*
- * ====================================================================
- * The Apache Software License, Version 1.1
+ * Copyright 2001-2004 The Apache Software Foundation.
*
- * Copyright (c) 2001,2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache JMeter" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache JMeter", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
package org.apache.jmeter.gui.action;
import java.awt.Component;
import java.awt.event.ActionEvent;
@@ -74,7 +38,7 @@
/**
* @author Michael Stover
* @author Drew Gulino
- * @version $Revision$
+ * @version $Revision$ Last updated $Date$
*/
public class RemoteStart extends AbstractAction
{
@@ -87,6 +51,8 @@
commands.add("remote_stop");
commands.add("remote_start_all");
commands.add("remote_stop_all");
+ commands.add("remote_exit");
+ commands.add("remote_exit_all");
}
private Map remoteEngines = new HashMap();
@@ -142,6 +108,22 @@
doRemoteStop(el.trim());
}
}
+ else if (action.equals("remote_exit"))
+ {
+ doRemoteExit(name);
+ }
+ else if (action.equals("remote_exit_all"))
+ {
+ String remote_hosts_string =
+ JMeterUtils.getPropDefault("remote_hosts", "127.0.0.1");
+ java.util.StringTokenizer st =
+ new java.util.StringTokenizer(remote_hosts_string, ",");
+ while (st.hasMoreElements())
+ {
+ String el = (String) st.nextElement();
+ doRemoteExit(el.trim());
+ }
+ }
}
/**
@@ -156,6 +138,20 @@
JMeterEngine engine = (JMeterEngine) remoteEngines.get(name);
engine.stopTest();
}
+
+ /**
+ * Exits a remote testing engine
+ *
+ * @param name the DNS name or IP address of the remote testing engine
+ *
+ */
+ private void doRemoteExit(String name)
+ {
+ JMeterEngine engine = (JMeterEngine) remoteEngines.get(name);
+ if (engine == null) return;
+ //GuiPackage.getInstance().getMainFrame().showStoppingMessage(name);
+ engine.exit();
+ }
/**
* Starts a remote testing engine
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org