activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r379619 [27/30] - in /incubator/activemq/trunk: ./ activecluster/ activecluster/src/java/org/apache/activecluster/ activecluster/src/java/org/apache/activecluster/election/ activecluster/src/java/org/apache/activecluster/election/impl/ acti...
Date Tue, 21 Feb 2006 23:14:17 GMT
Modified: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ProducerSysTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ProducerSysTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ProducerSysTest.java (original)
+++ incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ProducerSysTest.java Tue Feb 21 15:12:56 2006
@@ -1,328 +1,328 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * 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.activemq.sampler;
-
-import org.apache.jmeter.testelement.TestListener;
-import org.apache.jmeter.engine.event.LoopIterationEvent;
-import org.apache.jmeter.samplers.SampleResult;
-import org.apache.jmeter.samplers.Entry;
-import org.apache.jmeter.util.JMeterUtils;
-import org.apache.log.Logger;
-import org.apache.jorphan.logging.LoggingManager;
-
-import org.activemq.util.connection.ServerConnectionFactory;
-import org.apache.activemq.util.IdGenerator;
-
-import javax.jms.*;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Properties;
-
-public class ProducerSysTest extends Sampler implements MessageListener {
-
-    private static final Logger log = LoggingManager.getLoggerForClass();
-
-    // Otherwise, the response is scanned for these strings
-    private static final String STATUS_PREFIX = JMeterUtils.getPropDefault("tcp.status.prefix", "");
-    private static final String STATUS_SUFFIX = JMeterUtils.getPropDefault("tcp.status.suffix", "");
-    private static final String STATUS_PROPERTIES = JMeterUtils.getPropDefault("tcp.status.properties", "");
-
-    private static final Properties statusProps = new Properties();
-
-    static {
-        log.info("Protocol Handler name=" + getClassname());
-        log.info("Status prefix=" + STATUS_PREFIX);
-        log.info("Status suffix=" + STATUS_SUFFIX);
-        log.info("Status properties=" + STATUS_PROPERTIES);
-
-        if (STATUS_PROPERTIES.length() > 0) {
-            File f = new File(STATUS_PROPERTIES);
-
-            try {
-                statusProps.load(new FileInputStream(f));
-                log.info("Successfully loaded properties");
-                //haveStatusProps = true;
-            } catch (FileNotFoundException e) {
-                log.info("Property file not found");
-            } catch (IOException e) {
-                log.info("Property file error " + e.toString());
-            }
-        }
-    }
-
-    /**
-     * Constructor for ProducerSysTest Sampler object.
-     */
-    public ProducerSysTest() {
-        log.debug("Created " + this);
-        protocolHandler = this.getProtocol(); //from superclass sampler.
-        log.debug("Using Protocol Handler: " + protocolHandler.getClass().getName());
-    }
-
-    /**
-     * Sends the config message for validating the test messages.
-     *
-     * @throws Exception
-     */
-    protected void publishConfigMessage()  throws Exception  {
-        String text = getConfigMessage();
-        boolean topic = false;
-
-        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
-                                                                                ACTIVEMQ_SERVER,
-                                                                                topic,
-                                                                                this.getEmbeddedBroker());
-
-        Session session = ServerConnectionFactory.createSession(connection,
-                                                                TRANSACTED_FALSE,
-                                                                ACTIVEMQ_SERVER,
-                                                                topic);
-
-        Destination destination = ServerConnectionFactory.createDestination(session,
-                                                                            CONFIG_SUBJECT,
-                                                                            this.getURL(),
-                                                                            ACTIVEMQ_SERVER,
-                                                                            topic);
-
-        MessageProducer publisher = session.createProducer(destination);
-
-        publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-        publishConfigMessage(connection, session, publisher, text);
-    }
-
-    /**
-     * Sends the config information.
-     *
-     * @param connection
-     * @param session
-     * @param publisher
-     * @param text
-     * @throws JMSException
-     */
-    protected void publishConfigMessage(Connection connection, Session session, MessageProducer publisher, String text)
-        throws JMSException {
-
-        Message message = session.createTextMessage(text);
-        publisher.send(message);
-
-        // Close the connection and session after sending the config message
-        ServerConnectionFactory.close(connection, session);
-    }
-
-    /**
-     * Creates the publishers then publish the test messages.
-     *
-     * @throws JMSException
-     */
-    protected void publish() throws JMSException {
-        String subjects[] = getSubjects();
-
-        for( int i=0;i<getNoProducer();i++) {
-            final int  x = i;
-            final String subject = subjects[i % subjects.length];
-
-            Thread thread = new Thread() {
-
-            public void run() {
-              try {
-                   publish(x, subject);
-
-              } catch (Exception e) {
-                 e.printStackTrace();
-              }
-            }
-            };
-
-            thread.start();
-        }
-    }
-
-    /**
-     *  Sends the the information from the client via tcp.
-     *
-     * @param x
-     * @param subject
-     * @throws Exception
-     */
-    protected void publish(int x, String subject) throws Exception {
-        MessageProducer publisher = null;
-
-        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
-                                                                                ACTIVEMQ_SERVER,
-                                                                                this.getTopic(),
-                                                                                this.getEmbeddedBroker());
-
-        if (this.getDurable()) {
-            IdGenerator idGenerator = new IdGenerator();
-            connection.setClientID(idGenerator.generateId());
-        }
-
-        Session session = ServerConnectionFactory.createSession(connection,
-                                                                TRANSACTED_FALSE,
-                                                                ACTIVEMQ_SERVER,
-                                                                this.getTopic());
-
-        Destination destination = ServerConnectionFactory.createDestination(session,
-                                                                            subject,
-                                                                            this.getURL(),
-                                                                            ACTIVEMQ_SERVER,
-                                                                            this.getTopic());
-
-        publisher = session.createProducer(destination);
-
-
-        if (getDurable()) {
-            publisher.setDeliveryMode(DeliveryMode.PERSISTENT);
-        } else {
-            publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-        }
-
-        StringBuffer sb = new StringBuffer();
-
-        for (int i=0; i < this.getNoMessages()-1; ++i){
-             sb.append("PROD");
-             sb.append(x);
-             sb.append("#BODY");
-             sb.append("#");
-             sb.append(i + 1);
-
-             TextMessage message = session.createTextMessage(sb.toString());
-             publisher.send(message);
-
-             sb.delete(0, sb.length());
-         }
-
-         sb.append("PROD");
-         sb.append(x);
-         sb.append("#");
-         sb.append(LAST_MESSAGE);
-         sb.append("#");
-         sb.append(this.getNoMessages());
-
-         TextMessage message = session.createTextMessage(sb.toString());
-
-         publisher.send(message);
-    }
-
-    /**
-     *  Subscribe to the confirmation message that the consumer received the config message.
-     *
-     * @throws JMSException
-     */
-    protected void subscribe() throws JMSException {
-        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
-                                                                                ACTIVEMQ_SERVER,
-                                                                                this.getTopic(),
-                                                                                this.getEmbeddedBroker());
-
-        if (this.getDurable()) {
-            IdGenerator idGenerator = new IdGenerator();
-            connection.setClientID(idGenerator.generateId());
-
-        }
-
-        // Start connection before receiving messages.
-        connection.start();
-
-        Session session = ServerConnectionFactory.createSession(connection,
-                                                                TRANSACTED_FALSE,
-                                                                this.getMQServer(),
-                                                                this.getTopic());
-
-        Destination destination = ServerConnectionFactory.createDestination(session,
-                                                                            CONFIRM_SUBJECT,
-                                                                            this.getURL(),
-                                                                            ACTIVEMQ_SERVER,
-                                                                            this.getTopic());
-
-        MessageConsumer consumer = null;
-
-
-        if (this.getDurable() && this.getTopic()) {
-            consumer = session.createDurableSubscriber((Topic) destination, getClass().getName());
-        } else {
-            consumer = session.createConsumer(destination);
-        }
-
-        consumer.setMessageListener(this);
-        addResource(consumer);
-    }
-
-    /**
-     * Runs and publish the message.
-     *
-     * @throws Exception
-     */
-    public void run() throws Exception {
-
-        // Publish the config message.
-        publishConfigMessage();
-
-        // Wait for the confirmation message
-        subscribe();
-    }
-
-    /**
-     * Retrieves the sample as SampleResult object. There are times that this
-     * is ignored.
-     *
-     * @param e - Entry object.
-     * @return Returns the sample result.
-     */
-    public SampleResult sample(Entry e) { // Entry tends to be ignored ...
-        SampleResult res = new SampleResult();
-        res.setSampleLabel(getName());
-        res.setSamplerData(getURL());
-        res.sampleStart();
-
-        try {
-            // Run the benchmark tool code
-            this.run();
-        } catch (Exception ex) {
-            log.debug("Error running producer ", ex);
-            res.setResponseCode("500");
-            res.setResponseMessage(ex.toString());
-        }
-
-        // Calculate response time
-        res.sampleEnd();
-
-        // Set if we were successful or not
-        res.setSuccessful(true);
-
-        return res;
-    }
-
-    public void onMessage(Message message) {
-        try {
-
-            TextMessage textMessage = (TextMessage) message;
-
-            String confirmMsg = textMessage.getText();
-
-            if (confirmMsg.equals(PUBLISH_MSG)) {
-                publish();
-            }
-
-        } catch (JMSException e) {
-            log.error("Unable to force deserialize the content", e);
-        }
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * 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.activemq.sampler;
+
+import org.apache.jmeter.testelement.TestListener;
+import org.apache.jmeter.engine.event.LoopIterationEvent;
+import org.apache.jmeter.samplers.SampleResult;
+import org.apache.jmeter.samplers.Entry;
+import org.apache.jmeter.util.JMeterUtils;
+import org.apache.log.Logger;
+import org.apache.jorphan.logging.LoggingManager;
+
+import org.activemq.util.connection.ServerConnectionFactory;
+import org.apache.activemq.util.IdGenerator;
+
+import javax.jms.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+public class ProducerSysTest extends Sampler implements MessageListener {
+
+    private static final Logger log = LoggingManager.getLoggerForClass();
+
+    // Otherwise, the response is scanned for these strings
+    private static final String STATUS_PREFIX = JMeterUtils.getPropDefault("tcp.status.prefix", "");
+    private static final String STATUS_SUFFIX = JMeterUtils.getPropDefault("tcp.status.suffix", "");
+    private static final String STATUS_PROPERTIES = JMeterUtils.getPropDefault("tcp.status.properties", "");
+
+    private static final Properties statusProps = new Properties();
+
+    static {
+        log.info("Protocol Handler name=" + getClassname());
+        log.info("Status prefix=" + STATUS_PREFIX);
+        log.info("Status suffix=" + STATUS_SUFFIX);
+        log.info("Status properties=" + STATUS_PROPERTIES);
+
+        if (STATUS_PROPERTIES.length() > 0) {
+            File f = new File(STATUS_PROPERTIES);
+
+            try {
+                statusProps.load(new FileInputStream(f));
+                log.info("Successfully loaded properties");
+                //haveStatusProps = true;
+            } catch (FileNotFoundException e) {
+                log.info("Property file not found");
+            } catch (IOException e) {
+                log.info("Property file error " + e.toString());
+            }
+        }
+    }
+
+    /**
+     * Constructor for ProducerSysTest Sampler object.
+     */
+    public ProducerSysTest() {
+        log.debug("Created " + this);
+        protocolHandler = this.getProtocol(); //from superclass sampler.
+        log.debug("Using Protocol Handler: " + protocolHandler.getClass().getName());
+    }
+
+    /**
+     * Sends the config message for validating the test messages.
+     *
+     * @throws Exception
+     */
+    protected void publishConfigMessage()  throws Exception  {
+        String text = getConfigMessage();
+        boolean topic = false;
+
+        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
+                                                                                ACTIVEMQ_SERVER,
+                                                                                topic,
+                                                                                this.getEmbeddedBroker());
+
+        Session session = ServerConnectionFactory.createSession(connection,
+                                                                TRANSACTED_FALSE,
+                                                                ACTIVEMQ_SERVER,
+                                                                topic);
+
+        Destination destination = ServerConnectionFactory.createDestination(session,
+                                                                            CONFIG_SUBJECT,
+                                                                            this.getURL(),
+                                                                            ACTIVEMQ_SERVER,
+                                                                            topic);
+
+        MessageProducer publisher = session.createProducer(destination);
+
+        publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+        publishConfigMessage(connection, session, publisher, text);
+    }
+
+    /**
+     * Sends the config information.
+     *
+     * @param connection
+     * @param session
+     * @param publisher
+     * @param text
+     * @throws JMSException
+     */
+    protected void publishConfigMessage(Connection connection, Session session, MessageProducer publisher, String text)
+        throws JMSException {
+
+        Message message = session.createTextMessage(text);
+        publisher.send(message);
+
+        // Close the connection and session after sending the config message
+        ServerConnectionFactory.close(connection, session);
+    }
+
+    /**
+     * Creates the publishers then publish the test messages.
+     *
+     * @throws JMSException
+     */
+    protected void publish() throws JMSException {
+        String subjects[] = getSubjects();
+
+        for( int i=0;i<getNoProducer();i++) {
+            final int  x = i;
+            final String subject = subjects[i % subjects.length];
+
+            Thread thread = new Thread() {
+
+            public void run() {
+              try {
+                   publish(x, subject);
+
+              } catch (Exception e) {
+                 e.printStackTrace();
+              }
+            }
+            };
+
+            thread.start();
+        }
+    }
+
+    /**
+     *  Sends the the information from the client via tcp.
+     *
+     * @param x
+     * @param subject
+     * @throws Exception
+     */
+    protected void publish(int x, String subject) throws Exception {
+        MessageProducer publisher = null;
+
+        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
+                                                                                ACTIVEMQ_SERVER,
+                                                                                this.getTopic(),
+                                                                                this.getEmbeddedBroker());
+
+        if (this.getDurable()) {
+            IdGenerator idGenerator = new IdGenerator();
+            connection.setClientID(idGenerator.generateId());
+        }
+
+        Session session = ServerConnectionFactory.createSession(connection,
+                                                                TRANSACTED_FALSE,
+                                                                ACTIVEMQ_SERVER,
+                                                                this.getTopic());
+
+        Destination destination = ServerConnectionFactory.createDestination(session,
+                                                                            subject,
+                                                                            this.getURL(),
+                                                                            ACTIVEMQ_SERVER,
+                                                                            this.getTopic());
+
+        publisher = session.createProducer(destination);
+
+
+        if (getDurable()) {
+            publisher.setDeliveryMode(DeliveryMode.PERSISTENT);
+        } else {
+            publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+        }
+
+        StringBuffer sb = new StringBuffer();
+
+        for (int i=0; i < this.getNoMessages()-1; ++i){
+             sb.append("PROD");
+             sb.append(x);
+             sb.append("#BODY");
+             sb.append("#");
+             sb.append(i + 1);
+
+             TextMessage message = session.createTextMessage(sb.toString());
+             publisher.send(message);
+
+             sb.delete(0, sb.length());
+         }
+
+         sb.append("PROD");
+         sb.append(x);
+         sb.append("#");
+         sb.append(LAST_MESSAGE);
+         sb.append("#");
+         sb.append(this.getNoMessages());
+
+         TextMessage message = session.createTextMessage(sb.toString());
+
+         publisher.send(message);
+    }
+
+    /**
+     *  Subscribe to the confirmation message that the consumer received the config message.
+     *
+     * @throws JMSException
+     */
+    protected void subscribe() throws JMSException {
+        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
+                                                                                ACTIVEMQ_SERVER,
+                                                                                this.getTopic(),
+                                                                                this.getEmbeddedBroker());
+
+        if (this.getDurable()) {
+            IdGenerator idGenerator = new IdGenerator();
+            connection.setClientID(idGenerator.generateId());
+
+        }
+
+        // Start connection before receiving messages.
+        connection.start();
+
+        Session session = ServerConnectionFactory.createSession(connection,
+                                                                TRANSACTED_FALSE,
+                                                                this.getMQServer(),
+                                                                this.getTopic());
+
+        Destination destination = ServerConnectionFactory.createDestination(session,
+                                                                            CONFIRM_SUBJECT,
+                                                                            this.getURL(),
+                                                                            ACTIVEMQ_SERVER,
+                                                                            this.getTopic());
+
+        MessageConsumer consumer = null;
+
+
+        if (this.getDurable() && this.getTopic()) {
+            consumer = session.createDurableSubscriber((Topic) destination, getClass().getName());
+        } else {
+            consumer = session.createConsumer(destination);
+        }
+
+        consumer.setMessageListener(this);
+        addResource(consumer);
+    }
+
+    /**
+     * Runs and publish the message.
+     *
+     * @throws Exception
+     */
+    public void run() throws Exception {
+
+        // Publish the config message.
+        publishConfigMessage();
+
+        // Wait for the confirmation message
+        subscribe();
+    }
+
+    /**
+     * Retrieves the sample as SampleResult object. There are times that this
+     * is ignored.
+     *
+     * @param e - Entry object.
+     * @return Returns the sample result.
+     */
+    public SampleResult sample(Entry e) { // Entry tends to be ignored ...
+        SampleResult res = new SampleResult();
+        res.setSampleLabel(getName());
+        res.setSamplerData(getURL());
+        res.sampleStart();
+
+        try {
+            // Run the benchmark tool code
+            this.run();
+        } catch (Exception ex) {
+            log.debug("Error running producer ", ex);
+            res.setResponseCode("500");
+            res.setResponseMessage(ex.toString());
+        }
+
+        // Calculate response time
+        res.sampleEnd();
+
+        // Set if we were successful or not
+        res.setSuccessful(true);
+
+        return res;
+    }
+
+    public void onMessage(Message message) {
+        try {
+
+            TextMessage textMessage = (TextMessage) message;
+
+            String confirmMsg = textMessage.getText();
+
+            if (confirmMsg.equals(PUBLISH_MSG)) {
+                publish();
+            }
+
+        } catch (JMSException e) {
+            log.error("Unable to force deserialize the content", e);
+        }
+    }
+}

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ProducerSysTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Sampler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/SamplerClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/SamplerClientImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/SamplerConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ConsumerConfigGui.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ConsumerSysTestConfigGui.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ConsumerSysTestConfigGui.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ConsumerSysTestConfigGui.java (original)
+++ incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ConsumerSysTestConfigGui.java Tue Feb 21 15:12:56 2006
@@ -1,372 +1,372 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * 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.activemq.sampler.config.gui;
-
-import org.apache.jmeter.config.ConfigTestElement;
-import org.apache.jmeter.config.gui.AbstractConfigGui;
-import org.apache.jmeter.gui.util.VerticalPanel;
-import org.apache.jmeter.testelement.TestElement;
-import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.util.JOrphanUtils;
-import org.activemq.sampler.ConsumerSysTest;
-
-
-import javax.swing.JTextField;
-import javax.swing.JComboBox;
-import javax.swing.JRadioButton;
-import javax.swing.JPanel;
-import javax.swing.JLabel;
-
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-/**
- * Consumer configuration gui bean.
- */
-public class ConsumerSysTestConfigGui extends AbstractConfigGui {
-
-    //private final static String FILENAME = "filename";
-    private final static String URL = "url";
-    private final static String DURABLE = "durable";
-    private final static String NONDURABLE = "nondurable";
-    private final static String TOPIC = "topic";
-    private final static String QUEUE = "queue";
-    private final static String NOCONSUMER = "noconsumer";
-    private final static String NOSUBJECT = "nosubject";
-    private final static String CONSUMER_SYS_TEST_CONFIG_TITLE = "consumer_sys_test_config_title";
-
-    private JTextField setURL;
-    private JTextField setNoConsumer;
-    private JTextField setNoSubject;
-
-    private JRadioButton setDurable;
-    private JRadioButton setNonDurable;
-    private JRadioButton setTopic;
-    private JRadioButton setQueue;
-
-    private boolean displayName = true;
-
-    /**
-     * Default constructor.
-     */
-    public ConsumerSysTestConfigGui() {
-        this(true);
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param displayName - whether to display the name of the consumer.
-     */
-    public ConsumerSysTestConfigGui(boolean displayName) {
-        this.displayName = displayName;
-        init();
-    }
-
-    /**
-     * Returns the consumer configuration title.
-     *
-     * @return consumer configuration title
-     */
-    public String getLabelResource() {
-        return CONSUMER_SYS_TEST_CONFIG_TITLE;
-    }
-
-    /**
-     * Configures the ConsumerConfigGui bean.
-     *
-     * @param element - consumer sampler properties.
-     */
-    public void configure(TestElement element) {
-        super.configure(element);
-
-        setURL.setText(element.getPropertyAsString(ConsumerSysTest.URL));
-
-        if (element.getProperty(ConsumerSysTest.DURABLE) == null) {
-            setDurable.setSelected(false);
-            setNonDurable.setSelected(true);
-        } else {
-            if (element.getPropertyAsBoolean(ConsumerSysTest.DURABLE)) {
-                setDurable.setSelected(true);
-                setNonDurable.setSelected(false);
-            } else {
-                setDurable.setSelected(false);
-                setNonDurable.setSelected(true);
-            }
-        }
-
-        if (element.getProperty(ConsumerSysTest.TOPIC) == null) {
-            setTopic.setSelected(true);
-            setQueue.setSelected(false);
-        } else {
-            if (element.getPropertyAsBoolean(ConsumerSysTest.TOPIC)) {
-                setTopic.setSelected(true);
-                setQueue.setSelected(false);
-            } else {
-                setTopic.setSelected(false);
-                setQueue.setSelected(true);
-            }
-        }
-
-        setNoConsumer.setText(element.getPropertyAsString(ConsumerSysTest.NOCONSUMER));
-        setNoSubject.setText(element.getPropertyAsString(ConsumerSysTest.NOSUBJECT));
-    }
-
-    /**
-     * Creates a test element.
-     *
-     * @return element
-     */
-    public TestElement createTestElement() {
-        ConfigTestElement element = new ConfigTestElement();
-        modifyTestElement(element);
-
-        return element;
-    }
-
-    /**
-     * Sets the consumer sampler properties to the test element.
-     *
-     * @param element
-     */
-    public void modifyTestElement(TestElement element) {
-        configureTestElement(element);
-
-        element.setProperty(ConsumerSysTest.URL, setURL.getText());
-        element.setProperty(ConsumerSysTest.DURABLE, JOrphanUtils.booleanToString(setDurable.isSelected()));
-        element.setProperty(ConsumerSysTest.TOPIC, JOrphanUtils.booleanToString(setTopic.isSelected()));
-        element.setProperty(ConsumerSysTest.NOCONSUMER , setNoConsumer.getText());
-        element.setProperty(ConsumerSysTest.NOSUBJECT, setNoSubject.getText());
-    }
-
-    /**
-     * Creates the URL panel.
-     *
-     * @return urlPanel
-     */
-    private JPanel createURLPanel() {
-        JLabel label = new JLabel(JMeterUtils.getResString("form_url"));
-        setURL = new JTextField(10);
-        setURL.setName(URL);
-        label.setLabelFor(setURL);
-
-        JPanel urlPanel = new JPanel(new BorderLayout(5, 0));
-        urlPanel.add(label, BorderLayout.WEST);
-        urlPanel.add(setURL, BorderLayout.CENTER);
-
-        return urlPanel;
-    }
-
-    /**
-     * Creates the durable panel.
-     *
-     * @return durablePanel
-     */
-    private JPanel createDurablePanel() {
-        JLabel labelDeliveryMode = new JLabel(JMeterUtils.getResString("form_delivery_mode"));
-
-        JLabel labelDurable = new JLabel(JMeterUtils.getResString("form_durable"));
-        setDurable = new JRadioButton();
-        setDurable.setName(DURABLE);
-        labelDurable.setLabelFor(setDurable);
-        setDurable.setActionCommand(DURABLE);
-        setDurable.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformedDelivery(evt);
-            }
-        });
-        setDurable.setSelected(false);
-
-        JLabel labelNonDurable = new JLabel(JMeterUtils.getResString("form_non_durable"));
-        setNonDurable = new JRadioButton();
-        setNonDurable.setName(NONDURABLE);
-        labelNonDurable.setLabelFor(setNonDurable);
-        setNonDurable.setActionCommand(NONDURABLE);
-        setNonDurable.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformedDelivery(evt);
-            }
-        });
-        setNonDurable.setSelected(true);
-
-        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
-        flow.setHgap(0);
-        flow.setVgap(0);
-
-        JPanel durablePanel = new JPanel(flow);
-        durablePanel.add(labelDeliveryMode);
-        durablePanel.add(new JLabel("  "));
-        durablePanel.add(setDurable);
-        durablePanel.add(labelDurable);
-        durablePanel.add(new JLabel("   "));
-        durablePanel.add(setNonDurable);
-        durablePanel.add(labelNonDurable);
-
-        return durablePanel;
-    }
-
-    /**
-     * Creates the topic panel.
-     *
-     * @return topicPanel
-     */
-    private JPanel createTopicPanel() {
-        JLabel labelMessagingDomain = new JLabel(JMeterUtils.getResString("messaging_domain"));
-
-        JLabel labelTopic = new JLabel(JMeterUtils.getResString("form_topic"));
-        setTopic = new JRadioButton();
-        setTopic.setName(TOPIC);
-        labelTopic.setLabelFor(setTopic);
-        setTopic.setActionCommand(TOPIC);
-        setTopic.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformed(evt);
-            }
-        });
-        setTopic.setSelected(true);
-
-        JLabel labelQueue = new JLabel(JMeterUtils.getResString("form_queue"));
-        setQueue = new JRadioButton();
-        setQueue.setName(QUEUE);
-        labelQueue.setLabelFor(setQueue);
-        setQueue.setActionCommand(QUEUE);
-        setQueue.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformed(evt);
-            }
-        });
-        setQueue.setSelected(false);
-
-        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
-        flow.setHgap(0);
-        flow.setVgap(0);
-
-        JPanel topicPanel = new JPanel(flow);
-        topicPanel.add(labelMessagingDomain);
-        topicPanel.add(new JLabel("  "));
-        topicPanel.add(setTopic);
-        topicPanel.add(labelTopic);
-        topicPanel.add(new JLabel("   "));
-        topicPanel.add(setQueue);
-        topicPanel.add(labelQueue);
-
-
-        return topicPanel;
-    }
-
-    /**
-     * Creates the no consumer panel.
-     *
-     * @return noConsumerPanel
-     */
-    private JPanel createNoConsumerPanel() {
-        JLabel label = new JLabel(JMeterUtils.getResString("form_no_consumer"));
-        setNoConsumer = new JTextField(10);
-        setNoConsumer.setName(NOCONSUMER);
-        label.setLabelFor(setNoConsumer);
-
-        JPanel noConsumerPanel = new JPanel(new BorderLayout(5, 0));
-        noConsumerPanel.add(label, BorderLayout.WEST);
-        noConsumerPanel.add(setNoConsumer, BorderLayout.CENTER);
-
-        return noConsumerPanel;
-    }
-
-    /**
-     * Creates the no subject panel.
-     *
-     * @return noSubjectPanel
-     */
-    private JPanel createNoSubjectPanel() {
-        JLabel label = new JLabel(JMeterUtils.getResString("form_no_subject"));
-        setNoSubject = new JTextField(10);
-        setNoSubject.setName(NOSUBJECT);
-        label.setLabelFor(setNoSubject);
-
-        JPanel noSubjectPanel = new JPanel(new BorderLayout(5, 0));
-        noSubjectPanel.add(label, BorderLayout.WEST);
-        noSubjectPanel.add(setNoSubject, BorderLayout.CENTER);
-
-        return noSubjectPanel;
-    }
-
-    /**
-     * Initializes the gui components.
-     */
-    private void init() {
-        setLayout(new BorderLayout(0, 5));
-
-        if (displayName) {
-            setBorder(makeBorder());
-            add(makeTitlePanel(), BorderLayout.NORTH);
-        }
-
-        VerticalPanel mainPanel = new VerticalPanel();
-
-        mainPanel.add(createURLPanel());
-        mainPanel.add(createNoConsumerPanel());
-        mainPanel.add(createNoSubjectPanel());
-        mainPanel.add(createDurablePanel());
-        mainPanel.add(createTopicPanel());
-
-        add(mainPanel, BorderLayout.CENTER);
-    }
-
-    /**
-     * Listener action for selecting Messaging Domain.
-     *
-     * @param evt - event triggered.
-     */
-    private void jRadioButtonActionPerformed(ActionEvent evt) {
-        String evtActionCommand = evt.getActionCommand();
-
-        if (evtActionCommand.equals(TOPIC)) {
-            setTopic.setSelected(true);
-            setQueue.setSelected(false);
-            setDurable.setEnabled(true);
-            setNonDurable.setEnabled(true);
-            setNonDurable.setSelected(true);
-        } else if (evtActionCommand.equals(QUEUE)) {
-            setTopic.setSelected(false);
-            setQueue.setSelected(true);
-            setDurable.setSelected(false);
-            setDurable.setEnabled(false);
-            setNonDurable.setSelected(false);
-            setNonDurable.setEnabled(false);
-        }
-    }
-
-    /**
-     * Listener action for selecting Delivery Mode.
-     *
-     * @param evt - event triggered.
-     */
-    private void jRadioButtonActionPerformedDelivery(ActionEvent evt) {
-        String evtActionCommand = evt.getActionCommand();
-
-        if (evtActionCommand.equals(DURABLE)) {
-            setDurable.setSelected(true);
-            setNonDurable.setSelected(false);
-        } else if (evtActionCommand.equals(NONDURABLE)) {
-            setDurable.setSelected(false);
-            setNonDurable.setSelected(true);
-        }
-    }
-
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * 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.activemq.sampler.config.gui;
+
+import org.apache.jmeter.config.ConfigTestElement;
+import org.apache.jmeter.config.gui.AbstractConfigGui;
+import org.apache.jmeter.gui.util.VerticalPanel;
+import org.apache.jmeter.testelement.TestElement;
+import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.util.JOrphanUtils;
+import org.activemq.sampler.ConsumerSysTest;
+
+
+import javax.swing.JTextField;
+import javax.swing.JComboBox;
+import javax.swing.JRadioButton;
+import javax.swing.JPanel;
+import javax.swing.JLabel;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * Consumer configuration gui bean.
+ */
+public class ConsumerSysTestConfigGui extends AbstractConfigGui {
+
+    //private final static String FILENAME = "filename";
+    private final static String URL = "url";
+    private final static String DURABLE = "durable";
+    private final static String NONDURABLE = "nondurable";
+    private final static String TOPIC = "topic";
+    private final static String QUEUE = "queue";
+    private final static String NOCONSUMER = "noconsumer";
+    private final static String NOSUBJECT = "nosubject";
+    private final static String CONSUMER_SYS_TEST_CONFIG_TITLE = "consumer_sys_test_config_title";
+
+    private JTextField setURL;
+    private JTextField setNoConsumer;
+    private JTextField setNoSubject;
+
+    private JRadioButton setDurable;
+    private JRadioButton setNonDurable;
+    private JRadioButton setTopic;
+    private JRadioButton setQueue;
+
+    private boolean displayName = true;
+
+    /**
+     * Default constructor.
+     */
+    public ConsumerSysTestConfigGui() {
+        this(true);
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param displayName - whether to display the name of the consumer.
+     */
+    public ConsumerSysTestConfigGui(boolean displayName) {
+        this.displayName = displayName;
+        init();
+    }
+
+    /**
+     * Returns the consumer configuration title.
+     *
+     * @return consumer configuration title
+     */
+    public String getLabelResource() {
+        return CONSUMER_SYS_TEST_CONFIG_TITLE;
+    }
+
+    /**
+     * Configures the ConsumerConfigGui bean.
+     *
+     * @param element - consumer sampler properties.
+     */
+    public void configure(TestElement element) {
+        super.configure(element);
+
+        setURL.setText(element.getPropertyAsString(ConsumerSysTest.URL));
+
+        if (element.getProperty(ConsumerSysTest.DURABLE) == null) {
+            setDurable.setSelected(false);
+            setNonDurable.setSelected(true);
+        } else {
+            if (element.getPropertyAsBoolean(ConsumerSysTest.DURABLE)) {
+                setDurable.setSelected(true);
+                setNonDurable.setSelected(false);
+            } else {
+                setDurable.setSelected(false);
+                setNonDurable.setSelected(true);
+            }
+        }
+
+        if (element.getProperty(ConsumerSysTest.TOPIC) == null) {
+            setTopic.setSelected(true);
+            setQueue.setSelected(false);
+        } else {
+            if (element.getPropertyAsBoolean(ConsumerSysTest.TOPIC)) {
+                setTopic.setSelected(true);
+                setQueue.setSelected(false);
+            } else {
+                setTopic.setSelected(false);
+                setQueue.setSelected(true);
+            }
+        }
+
+        setNoConsumer.setText(element.getPropertyAsString(ConsumerSysTest.NOCONSUMER));
+        setNoSubject.setText(element.getPropertyAsString(ConsumerSysTest.NOSUBJECT));
+    }
+
+    /**
+     * Creates a test element.
+     *
+     * @return element
+     */
+    public TestElement createTestElement() {
+        ConfigTestElement element = new ConfigTestElement();
+        modifyTestElement(element);
+
+        return element;
+    }
+
+    /**
+     * Sets the consumer sampler properties to the test element.
+     *
+     * @param element
+     */
+    public void modifyTestElement(TestElement element) {
+        configureTestElement(element);
+
+        element.setProperty(ConsumerSysTest.URL, setURL.getText());
+        element.setProperty(ConsumerSysTest.DURABLE, JOrphanUtils.booleanToString(setDurable.isSelected()));
+        element.setProperty(ConsumerSysTest.TOPIC, JOrphanUtils.booleanToString(setTopic.isSelected()));
+        element.setProperty(ConsumerSysTest.NOCONSUMER , setNoConsumer.getText());
+        element.setProperty(ConsumerSysTest.NOSUBJECT, setNoSubject.getText());
+    }
+
+    /**
+     * Creates the URL panel.
+     *
+     * @return urlPanel
+     */
+    private JPanel createURLPanel() {
+        JLabel label = new JLabel(JMeterUtils.getResString("form_url"));
+        setURL = new JTextField(10);
+        setURL.setName(URL);
+        label.setLabelFor(setURL);
+
+        JPanel urlPanel = new JPanel(new BorderLayout(5, 0));
+        urlPanel.add(label, BorderLayout.WEST);
+        urlPanel.add(setURL, BorderLayout.CENTER);
+
+        return urlPanel;
+    }
+
+    /**
+     * Creates the durable panel.
+     *
+     * @return durablePanel
+     */
+    private JPanel createDurablePanel() {
+        JLabel labelDeliveryMode = new JLabel(JMeterUtils.getResString("form_delivery_mode"));
+
+        JLabel labelDurable = new JLabel(JMeterUtils.getResString("form_durable"));
+        setDurable = new JRadioButton();
+        setDurable.setName(DURABLE);
+        labelDurable.setLabelFor(setDurable);
+        setDurable.setActionCommand(DURABLE);
+        setDurable.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformedDelivery(evt);
+            }
+        });
+        setDurable.setSelected(false);
+
+        JLabel labelNonDurable = new JLabel(JMeterUtils.getResString("form_non_durable"));
+        setNonDurable = new JRadioButton();
+        setNonDurable.setName(NONDURABLE);
+        labelNonDurable.setLabelFor(setNonDurable);
+        setNonDurable.setActionCommand(NONDURABLE);
+        setNonDurable.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformedDelivery(evt);
+            }
+        });
+        setNonDurable.setSelected(true);
+
+        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
+        flow.setHgap(0);
+        flow.setVgap(0);
+
+        JPanel durablePanel = new JPanel(flow);
+        durablePanel.add(labelDeliveryMode);
+        durablePanel.add(new JLabel("  "));
+        durablePanel.add(setDurable);
+        durablePanel.add(labelDurable);
+        durablePanel.add(new JLabel("   "));
+        durablePanel.add(setNonDurable);
+        durablePanel.add(labelNonDurable);
+
+        return durablePanel;
+    }
+
+    /**
+     * Creates the topic panel.
+     *
+     * @return topicPanel
+     */
+    private JPanel createTopicPanel() {
+        JLabel labelMessagingDomain = new JLabel(JMeterUtils.getResString("messaging_domain"));
+
+        JLabel labelTopic = new JLabel(JMeterUtils.getResString("form_topic"));
+        setTopic = new JRadioButton();
+        setTopic.setName(TOPIC);
+        labelTopic.setLabelFor(setTopic);
+        setTopic.setActionCommand(TOPIC);
+        setTopic.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformed(evt);
+            }
+        });
+        setTopic.setSelected(true);
+
+        JLabel labelQueue = new JLabel(JMeterUtils.getResString("form_queue"));
+        setQueue = new JRadioButton();
+        setQueue.setName(QUEUE);
+        labelQueue.setLabelFor(setQueue);
+        setQueue.setActionCommand(QUEUE);
+        setQueue.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformed(evt);
+            }
+        });
+        setQueue.setSelected(false);
+
+        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
+        flow.setHgap(0);
+        flow.setVgap(0);
+
+        JPanel topicPanel = new JPanel(flow);
+        topicPanel.add(labelMessagingDomain);
+        topicPanel.add(new JLabel("  "));
+        topicPanel.add(setTopic);
+        topicPanel.add(labelTopic);
+        topicPanel.add(new JLabel("   "));
+        topicPanel.add(setQueue);
+        topicPanel.add(labelQueue);
+
+
+        return topicPanel;
+    }
+
+    /**
+     * Creates the no consumer panel.
+     *
+     * @return noConsumerPanel
+     */
+    private JPanel createNoConsumerPanel() {
+        JLabel label = new JLabel(JMeterUtils.getResString("form_no_consumer"));
+        setNoConsumer = new JTextField(10);
+        setNoConsumer.setName(NOCONSUMER);
+        label.setLabelFor(setNoConsumer);
+
+        JPanel noConsumerPanel = new JPanel(new BorderLayout(5, 0));
+        noConsumerPanel.add(label, BorderLayout.WEST);
+        noConsumerPanel.add(setNoConsumer, BorderLayout.CENTER);
+
+        return noConsumerPanel;
+    }
+
+    /**
+     * Creates the no subject panel.
+     *
+     * @return noSubjectPanel
+     */
+    private JPanel createNoSubjectPanel() {
+        JLabel label = new JLabel(JMeterUtils.getResString("form_no_subject"));
+        setNoSubject = new JTextField(10);
+        setNoSubject.setName(NOSUBJECT);
+        label.setLabelFor(setNoSubject);
+
+        JPanel noSubjectPanel = new JPanel(new BorderLayout(5, 0));
+        noSubjectPanel.add(label, BorderLayout.WEST);
+        noSubjectPanel.add(setNoSubject, BorderLayout.CENTER);
+
+        return noSubjectPanel;
+    }
+
+    /**
+     * Initializes the gui components.
+     */
+    private void init() {
+        setLayout(new BorderLayout(0, 5));
+
+        if (displayName) {
+            setBorder(makeBorder());
+            add(makeTitlePanel(), BorderLayout.NORTH);
+        }
+
+        VerticalPanel mainPanel = new VerticalPanel();
+
+        mainPanel.add(createURLPanel());
+        mainPanel.add(createNoConsumerPanel());
+        mainPanel.add(createNoSubjectPanel());
+        mainPanel.add(createDurablePanel());
+        mainPanel.add(createTopicPanel());
+
+        add(mainPanel, BorderLayout.CENTER);
+    }
+
+    /**
+     * Listener action for selecting Messaging Domain.
+     *
+     * @param evt - event triggered.
+     */
+    private void jRadioButtonActionPerformed(ActionEvent evt) {
+        String evtActionCommand = evt.getActionCommand();
+
+        if (evtActionCommand.equals(TOPIC)) {
+            setTopic.setSelected(true);
+            setQueue.setSelected(false);
+            setDurable.setEnabled(true);
+            setNonDurable.setEnabled(true);
+            setNonDurable.setSelected(true);
+        } else if (evtActionCommand.equals(QUEUE)) {
+            setTopic.setSelected(false);
+            setQueue.setSelected(true);
+            setDurable.setSelected(false);
+            setDurable.setEnabled(false);
+            setNonDurable.setSelected(false);
+            setNonDurable.setEnabled(false);
+        }
+    }
+
+    /**
+     * Listener action for selecting Delivery Mode.
+     *
+     * @param evt - event triggered.
+     */
+    private void jRadioButtonActionPerformedDelivery(ActionEvent evt) {
+        String evtActionCommand = evt.getActionCommand();
+
+        if (evtActionCommand.equals(DURABLE)) {
+            setDurable.setSelected(true);
+            setNonDurable.setSelected(false);
+        } else if (evtActionCommand.equals(NONDURABLE)) {
+            setDurable.setSelected(false);
+            setNonDurable.setSelected(true);
+        }
+    }
+
+}

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ConsumerSysTestConfigGui.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ProducerConfigGui.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ProducerSysTestConfigGui.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ProducerSysTestConfigGui.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ProducerSysTestConfigGui.java (original)
+++ incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ProducerSysTestConfigGui.java Tue Feb 21 15:12:56 2006
@@ -1,446 +1,446 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * 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.activemq.sampler.config.gui;
-
-import org.apache.jmeter.config.ConfigTestElement;
-import org.apache.jmeter.config.gui.AbstractConfigGui;
-import org.apache.jmeter.gui.util.VerticalPanel;
-import org.apache.jmeter.testelement.TestElement;
-import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.util.JOrphanUtils;
-import org.activemq.sampler.Producer;
-import org.activemq.sampler.ProducerSysTest;
-
-import javax.swing.JTextField;
-import javax.swing.JComboBox;
-import javax.swing.JRadioButton;
-import javax.swing.JPanel;
-import javax.swing.JLabel;
-
-import java.awt.BorderLayout;
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-/**
- * Producer configuration gui bean.
- */
-public class ProducerSysTestConfigGui extends AbstractConfigGui {
-
-    private static final String URL = "url";
-    private static final String DURABLE = "durable";
-    private static final String NONDURABLE = "nondurable";
-    private static final String TOPIC = "topic";
-    private static final String QUEUE = "queue";
-    private static final String NOPRODUCER = "noproducer";
-    private static final String NOSUBJECT = "nosubject";
-    private static final String PRODUCER_SYS_TEST_CONFIG_TITLE = "producer_sys_test_config_title";
-    private static final String NOMESSAGES = "nomessages";
-
-
-    private JTextField setURL;
-    private JTextField setNoProducer;
-    private JTextField setNoSubject;
-    private JRadioButton setDurable;
-    private JRadioButton setNonDurable;
-    private JRadioButton setTopic;
-    private JRadioButton setQueue;
-    private JTextField setNoMessages;
-
-    private boolean displayName = true;
-
-    /**
-     * Default constructor.
-     */
-    public ProducerSysTestConfigGui() {
-        this(true);
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param displayName - whether to display the name of the producer.
-     */
-    public ProducerSysTestConfigGui(boolean displayName) {
-        this.displayName = displayName;
-        init();
-    }
-
-    /**
-     * Returns the producer configuration title.
-     *
-     * @return producer configuration title
-     */
-    public String getLabelResource() {
-        return PRODUCER_SYS_TEST_CONFIG_TITLE;
-    }
-
-    /**
-     * Configures the ProducerConfigGui bean.
-     *
-     * @param element - producer sampler properties.
-     */
-    public void configure(TestElement element) {
-        super.configure(element);
-
-        setURL.setText(element.getPropertyAsString(ProducerSysTest.URL));
-        //setDuration.setText(element.getPropertyAsString(ProducerSysTest.DURATION));
-        //setRampUp.setText(element.getPropertyAsString(ProducerSysTest.RAMP_UP));
-
-        if (element.getProperty(ProducerSysTest.DURABLE) == null) {
-            setDurable.setSelected(true);
-            setNonDurable.setSelected(false);
-        } else {
-            if (element.getPropertyAsBoolean(ProducerSysTest.DURABLE)) {
-                setDurable.setSelected(true);
-                setNonDurable.setSelected(false);
-            } else {
-                setDurable.setSelected(false);
-                setNonDurable.setSelected(true);
-            }
-        }
-
-        if (element.getProperty(ProducerSysTest.TOPIC) == null) {
-            setTopic.setSelected(true);
-            setQueue.setSelected(false);
-        } else {
-            if (element.getPropertyAsBoolean(ProducerSysTest.TOPIC)) {
-                setTopic.setSelected(true);
-                setQueue.setSelected(false);
-            } else {
-                setTopic.setSelected(false);
-                setQueue.setSelected(true);
-            }
-        }
-
-        //setMsgSize.setText(element.getPropertyAsString(ProducerSysTest.MSGSIZE));
-        setNoProducer.setText(element.getPropertyAsString(ProducerSysTest.NOPRODUCER));
-        setNoSubject.setText(element.getPropertyAsString(ProducerSysTest.NOSUBJECT));
-        //setMsgSize.setText(element.getPropertyAsString(ProducerSysTest.MSGSIZE));
-        setNoMessages.setText(element.getPropertyAsString(ProducerSysTest.NOMESSAGES));
-
-        /*
-        if (element.getProperty(ProducerSysTest.DEFMSGINTERVAL) == null) {
-            setDefMsgInterval.setSelected(true);
-            setCusMsgInterval.setSelected(false);
-            setMsgInterval.setEnabled(false);
-        } else {
-            if (element.getPropertyAsBoolean(ProducerSysTest.DEFMSGINTERVAL)) {
-                setDefMsgInterval.setSelected(true);
-                setCusMsgInterval.setSelected(false);
-                setMsgInterval.setEnabled(false);
-            } else {
-                setDefMsgInterval.setSelected(false);
-                setCusMsgInterval.setSelected(true);
-                setMsgInterval.setEnabled(true);
-                setMsgInterval.setText(element.getPropertyAsString(ProducerSysTest.MSGINTERVAL));
-            }
-        }
-        */
-        /*
-        setMQServer.setSelectedItem(element.getPropertyAsString(ProducerSysTest.MQSERVER));
-
-
-        if (element.getProperty(ProducerSysTest.TRANSACTED) == null) {
-            setTransacted.setSelected(false);
-            setNonTransacted.setSelected(true);
-            setBatchSize.setEnabled(false);
-        } else {
-            if (element.getPropertyAsBoolean(ProducerSysTest.TRANSACTED)) {
-                setTransacted.setSelected(true);
-                setNonTransacted.setSelected(false);
-                setBatchSize.setEnabled(true);
-                setBatchSize.setText(element.getPropertyAsString(ProducerSysTest.BATCHSIZE));
-            } else {
-                setTransacted.setSelected(false);
-                setNonTransacted.setSelected(true);
-                setBatchSize.setEnabled(false);
-                setBatchSize.setText("");
-            }
-        }
-        */
-
-    }
-
-    /**
-     * Creates a test element.
-     *
-     * @return element
-     */
-    public TestElement createTestElement() {
-        ConfigTestElement element = new ConfigTestElement();
-        modifyTestElement(element);
-
-        return element;
-    }
-
-    /**
-     * Sets the producer sampler properties to the test element.
-     *
-     * @param element
-     */
-    public void modifyTestElement(TestElement element) {
-        configureTestElement(element);
-
-        element.setProperty(ProducerSysTest.URL, setURL.getText());
-        //element.setProperty(ProducerSysTest.DURATION, setDuration.getText());
-        //element.setProperty(ProducerSysTest.RAMP_UP, setRampUp.getText());
-        element.setProperty(ProducerSysTest.DURABLE, JOrphanUtils.booleanToString(setDurable.isSelected()));
-        element.setProperty(ProducerSysTest.TOPIC, JOrphanUtils.booleanToString(setTopic.isSelected()));
-        //element.setProperty(ProducerSysTest.MSGSIZE, setMsgSize.getText());
-        element.setProperty(ProducerSysTest.NOPRODUCER, setNoProducer.getText());
-        element.setProperty(ProducerSysTest.NOSUBJECT, setNoSubject.getText());
-        element.setProperty(ProducerSysTest.NOMESSAGES, setNoMessages.getText());
-        //element.setProperty(ProducerSysTest.DEFMSGINTERVAL, JOrphanUtils.booleanToString(setDefMsgInterval.isSelected()));
-        //element.setProperty(ProducerSysTest.MSGINTERVAL, setMsgInterval.getText());
-        //element.setProperty(ProducerSysTest.MQSERVER, setMQServer.getSelectedItem().toString());
-        //element.setProperty(ProducerSysTest.TRANSACTED, JOrphanUtils.booleanToString(setTransacted.isSelected()));
-        //element.setProperty(ProducerSysTest.BATCHSIZE, setBatchSize.getText());
-    }
-
-    /**
-     * Creates the URL panel.
-     *
-     * @return urlPanel
-     */
-    private JPanel createURLPanel() {
-        JLabel label = new JLabel(JMeterUtils.getResString("form_url"));
-        setURL = new JTextField(10);
-        setURL.setName(URL);
-        label.setLabelFor(setURL);
-
-        JPanel urlPanel = new JPanel(new BorderLayout(5, 0));
-        urlPanel.add(label, BorderLayout.WEST);
-        urlPanel.add(setURL, BorderLayout.CENTER);
-
-        return urlPanel;
-    }
-
-    /**
-     * Creates the durable panel.
-     *
-     * @return durablePanel
-     */
-    private JPanel createDurablePanel() {
-        JLabel labelDeliveryMode = new JLabel(JMeterUtils.getResString("form_delivery_mode"));
-
-        JLabel labelDurable = new JLabel(JMeterUtils.getResString("form_persistent"));
-        setDurable = new JRadioButton();
-        setDurable.setName(DURABLE);
-        labelDurable.setLabelFor(setDurable);
-        setDurable.setActionCommand(DURABLE);
-        setDurable.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformedDelivery(evt);
-            }
-        });
-        setDurable.setSelected(false);
-
-        JLabel labelNonDurable = new JLabel(JMeterUtils.getResString("form_non_persistent"));
-        setNonDurable = new JRadioButton();
-        setNonDurable.setName(NONDURABLE);
-        labelNonDurable.setLabelFor(setNonDurable);
-        setNonDurable.setActionCommand(NONDURABLE);
-        setNonDurable.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformedDelivery(evt);
-            }
-        });
-        setNonDurable.setSelected(true);
-
-        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
-        flow.setHgap(0);
-        flow.setVgap(0);
-
-        JPanel durablePanel = new JPanel(flow);
-        durablePanel.add(labelDeliveryMode);
-        durablePanel.add(new JLabel("  "));
-        durablePanel.add(setDurable);
-        durablePanel.add(labelDurable);
-        durablePanel.add(new JLabel("   "));
-        durablePanel.add(setNonDurable);
-        durablePanel.add(labelNonDurable);
-
-        return durablePanel;
-    }
-
-    /**
-     * Creates the topic panel.
-     *
-     * @return topicPanel
-     */
-    private JPanel createTopicPanel() {
-        JLabel labelMessagingDomain = new JLabel(JMeterUtils.getResString("messaging_domain"));
-
-        JLabel labelTopic = new JLabel(JMeterUtils.getResString("form_topic"));
-        setTopic = new JRadioButton();
-        setTopic.setName(TOPIC);
-        labelTopic.setLabelFor(setTopic);
-        setTopic.setActionCommand(TOPIC);
-        setTopic.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformed(evt);
-            }
-        });
-        setTopic.setSelected(true);
-
-        JLabel labelQueue = new JLabel(JMeterUtils.getResString("form_queue"));
-        setQueue = new JRadioButton();
-        setQueue.setName(QUEUE);
-        labelQueue.setLabelFor(setQueue);
-        setQueue.setActionCommand(QUEUE);
-        setQueue.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                jRadioButtonActionPerformed(evt);
-            }
-        });
-        setQueue.setSelected(false);
-
-        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
-        flow.setHgap(0);
-        flow.setVgap(0);
-
-        JPanel topicPanel = new JPanel(flow);
-        topicPanel.add(labelMessagingDomain);
-        topicPanel.add(new JLabel("  "));
-        topicPanel.add(setTopic);
-        topicPanel.add(labelTopic);
-        topicPanel.add(new JLabel("   "));
-        topicPanel.add(setQueue);
-        topicPanel.add(labelQueue);
-
-        return topicPanel;
-    }
-
-    /**
-     * Creates the no prod panel.
-     *
-     * @return noProdPanel
-     */
-    private JPanel createNoProducerPanel() {
-        JLabel label = new JLabel(JMeterUtils.getResString("form_no_producer"));
-        setNoProducer = new JTextField(10);
-        setNoProducer.setName(NOPRODUCER);
-        label.setLabelFor(setNoProducer);
-
-        JPanel noProdPanel = new JPanel(new BorderLayout(5, 0));
-        noProdPanel.add(label, BorderLayout.WEST);
-        noProdPanel.add(setNoProducer, BorderLayout.CENTER);
-
-        return noProdPanel;
-    }
-
-    /**
-     * Creates the number subject panel.
-     *
-     * @return noSubjectPanel
-     */
-    private JPanel createNoSubjectPanel() {
-        JLabel label = new JLabel(JMeterUtils.getResString("form_no_subject"));
-        setNoSubject = new JTextField(10);
-        setNoSubject.setName(NOSUBJECT);
-        label.setLabelFor(setNoSubject);
-
-        JPanel noSubjectPanel = new JPanel(new BorderLayout(5, 0));
-        noSubjectPanel.add(label, BorderLayout.WEST);
-        noSubjectPanel.add(setNoSubject, BorderLayout.CENTER);
-
-        return noSubjectPanel;
-    }
-
-    /**
-     * Creates the number of messages panel.
-     *
-     * @return noMessagesPanel
-     */
-    private JPanel createNoMessagesPanel() {
-        JLabel label = new JLabel(JMeterUtils.getResString("form_no_messages"));
-        setNoMessages = new JTextField(10);
-        setNoMessages.setName(NOMESSAGES);
-        label.setLabelFor(setNoMessages);
-
-        JPanel noMessagesPanel = new JPanel(new BorderLayout(5, 0));
-        noMessagesPanel.add(label, BorderLayout.WEST);
-        noMessagesPanel.add(setNoMessages, BorderLayout.CENTER);
-
-        return noMessagesPanel;
-    }
-
-    /**
-     * Initializes the gui components.
-     */
-    private void init() {
-        setLayout(new BorderLayout(0, 5));
-
-        if (displayName) {
-            setBorder(makeBorder());
-            add(makeTitlePanel(), BorderLayout.NORTH);
-        }
-
-        VerticalPanel mainPanel = new VerticalPanel();
-
-        mainPanel.add(createURLPanel());
-        //mainPanel.add(createDurationPanel());
-        //mainPanel.add(createRampUpPanel());
-        mainPanel.add(createNoProducerPanel());
-        mainPanel.add(createNoSubjectPanel());
-        mainPanel.add(createNoMessagesPanel());
-        //mainPanel.add(createMsgSizePanel());
-        mainPanel.add(createDurablePanel());
-        mainPanel.add(createTopicPanel());
-        //mainPanel.add(createTransactedPanel());
-        //mainPanel.add(createDefMsgIntervalPanel());
-        //mainPanel.add(createMQServerPanel());
-
-        add(mainPanel, BorderLayout.CENTER);
-    }
-
-    /**
-     * Listener action for selecting Messaging Domain.
-     *
-     * @param evt - event triggered.
-     */
-    private void jRadioButtonActionPerformed(ActionEvent evt) {
-        String evtActionCommand = evt.getActionCommand();
-
-        if (evtActionCommand.equals(TOPIC)) {
-            setTopic.setSelected(true);
-            setQueue.setSelected(false);
-        } else if (evtActionCommand.equals(QUEUE)) {
-            setTopic.setSelected(false);
-            setQueue.setSelected(true);
-        }
-    }
-    
-    /**
-     * Listener action for selecting Delivery Mode.
-     *
-     * @param evt - event triggered.
-     */
-    private void jRadioButtonActionPerformedDelivery(ActionEvent evt) {
-        String evtActionCommand = evt.getActionCommand();
-
-        if (evtActionCommand.equals(DURABLE)) {
-            setDurable.setSelected(true);
-            setNonDurable.setSelected(false);
-        } else if (evtActionCommand.equals(NONDURABLE)) {
-            setDurable.setSelected(false);
-            setNonDurable.setSelected(true);
-        }
-    }
-
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * 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.activemq.sampler.config.gui;
+
+import org.apache.jmeter.config.ConfigTestElement;
+import org.apache.jmeter.config.gui.AbstractConfigGui;
+import org.apache.jmeter.gui.util.VerticalPanel;
+import org.apache.jmeter.testelement.TestElement;
+import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.util.JOrphanUtils;
+import org.activemq.sampler.Producer;
+import org.activemq.sampler.ProducerSysTest;
+
+import javax.swing.JTextField;
+import javax.swing.JComboBox;
+import javax.swing.JRadioButton;
+import javax.swing.JPanel;
+import javax.swing.JLabel;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * Producer configuration gui bean.
+ */
+public class ProducerSysTestConfigGui extends AbstractConfigGui {
+
+    private static final String URL = "url";
+    private static final String DURABLE = "durable";
+    private static final String NONDURABLE = "nondurable";
+    private static final String TOPIC = "topic";
+    private static final String QUEUE = "queue";
+    private static final String NOPRODUCER = "noproducer";
+    private static final String NOSUBJECT = "nosubject";
+    private static final String PRODUCER_SYS_TEST_CONFIG_TITLE = "producer_sys_test_config_title";
+    private static final String NOMESSAGES = "nomessages";
+
+
+    private JTextField setURL;
+    private JTextField setNoProducer;
+    private JTextField setNoSubject;
+    private JRadioButton setDurable;
+    private JRadioButton setNonDurable;
+    private JRadioButton setTopic;
+    private JRadioButton setQueue;
+    private JTextField setNoMessages;
+
+    private boolean displayName = true;
+
+    /**
+     * Default constructor.
+     */
+    public ProducerSysTestConfigGui() {
+        this(true);
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param displayName - whether to display the name of the producer.
+     */
+    public ProducerSysTestConfigGui(boolean displayName) {
+        this.displayName = displayName;
+        init();
+    }
+
+    /**
+     * Returns the producer configuration title.
+     *
+     * @return producer configuration title
+     */
+    public String getLabelResource() {
+        return PRODUCER_SYS_TEST_CONFIG_TITLE;
+    }
+
+    /**
+     * Configures the ProducerConfigGui bean.
+     *
+     * @param element - producer sampler properties.
+     */
+    public void configure(TestElement element) {
+        super.configure(element);
+
+        setURL.setText(element.getPropertyAsString(ProducerSysTest.URL));
+        //setDuration.setText(element.getPropertyAsString(ProducerSysTest.DURATION));
+        //setRampUp.setText(element.getPropertyAsString(ProducerSysTest.RAMP_UP));
+
+        if (element.getProperty(ProducerSysTest.DURABLE) == null) {
+            setDurable.setSelected(true);
+            setNonDurable.setSelected(false);
+        } else {
+            if (element.getPropertyAsBoolean(ProducerSysTest.DURABLE)) {
+                setDurable.setSelected(true);
+                setNonDurable.setSelected(false);
+            } else {
+                setDurable.setSelected(false);
+                setNonDurable.setSelected(true);
+            }
+        }
+
+        if (element.getProperty(ProducerSysTest.TOPIC) == null) {
+            setTopic.setSelected(true);
+            setQueue.setSelected(false);
+        } else {
+            if (element.getPropertyAsBoolean(ProducerSysTest.TOPIC)) {
+                setTopic.setSelected(true);
+                setQueue.setSelected(false);
+            } else {
+                setTopic.setSelected(false);
+                setQueue.setSelected(true);
+            }
+        }
+
+        //setMsgSize.setText(element.getPropertyAsString(ProducerSysTest.MSGSIZE));
+        setNoProducer.setText(element.getPropertyAsString(ProducerSysTest.NOPRODUCER));
+        setNoSubject.setText(element.getPropertyAsString(ProducerSysTest.NOSUBJECT));
+        //setMsgSize.setText(element.getPropertyAsString(ProducerSysTest.MSGSIZE));
+        setNoMessages.setText(element.getPropertyAsString(ProducerSysTest.NOMESSAGES));
+
+        /*
+        if (element.getProperty(ProducerSysTest.DEFMSGINTERVAL) == null) {
+            setDefMsgInterval.setSelected(true);
+            setCusMsgInterval.setSelected(false);
+            setMsgInterval.setEnabled(false);
+        } else {
+            if (element.getPropertyAsBoolean(ProducerSysTest.DEFMSGINTERVAL)) {
+                setDefMsgInterval.setSelected(true);
+                setCusMsgInterval.setSelected(false);
+                setMsgInterval.setEnabled(false);
+            } else {
+                setDefMsgInterval.setSelected(false);
+                setCusMsgInterval.setSelected(true);
+                setMsgInterval.setEnabled(true);
+                setMsgInterval.setText(element.getPropertyAsString(ProducerSysTest.MSGINTERVAL));
+            }
+        }
+        */
+        /*
+        setMQServer.setSelectedItem(element.getPropertyAsString(ProducerSysTest.MQSERVER));
+
+
+        if (element.getProperty(ProducerSysTest.TRANSACTED) == null) {
+            setTransacted.setSelected(false);
+            setNonTransacted.setSelected(true);
+            setBatchSize.setEnabled(false);
+        } else {
+            if (element.getPropertyAsBoolean(ProducerSysTest.TRANSACTED)) {
+                setTransacted.setSelected(true);
+                setNonTransacted.setSelected(false);
+                setBatchSize.setEnabled(true);
+                setBatchSize.setText(element.getPropertyAsString(ProducerSysTest.BATCHSIZE));
+            } else {
+                setTransacted.setSelected(false);
+                setNonTransacted.setSelected(true);
+                setBatchSize.setEnabled(false);
+                setBatchSize.setText("");
+            }
+        }
+        */
+
+    }
+
+    /**
+     * Creates a test element.
+     *
+     * @return element
+     */
+    public TestElement createTestElement() {
+        ConfigTestElement element = new ConfigTestElement();
+        modifyTestElement(element);
+
+        return element;
+    }
+
+    /**
+     * Sets the producer sampler properties to the test element.
+     *
+     * @param element
+     */
+    public void modifyTestElement(TestElement element) {
+        configureTestElement(element);
+
+        element.setProperty(ProducerSysTest.URL, setURL.getText());
+        //element.setProperty(ProducerSysTest.DURATION, setDuration.getText());
+        //element.setProperty(ProducerSysTest.RAMP_UP, setRampUp.getText());
+        element.setProperty(ProducerSysTest.DURABLE, JOrphanUtils.booleanToString(setDurable.isSelected()));
+        element.setProperty(ProducerSysTest.TOPIC, JOrphanUtils.booleanToString(setTopic.isSelected()));
+        //element.setProperty(ProducerSysTest.MSGSIZE, setMsgSize.getText());
+        element.setProperty(ProducerSysTest.NOPRODUCER, setNoProducer.getText());
+        element.setProperty(ProducerSysTest.NOSUBJECT, setNoSubject.getText());
+        element.setProperty(ProducerSysTest.NOMESSAGES, setNoMessages.getText());
+        //element.setProperty(ProducerSysTest.DEFMSGINTERVAL, JOrphanUtils.booleanToString(setDefMsgInterval.isSelected()));
+        //element.setProperty(ProducerSysTest.MSGINTERVAL, setMsgInterval.getText());
+        //element.setProperty(ProducerSysTest.MQSERVER, setMQServer.getSelectedItem().toString());
+        //element.setProperty(ProducerSysTest.TRANSACTED, JOrphanUtils.booleanToString(setTransacted.isSelected()));
+        //element.setProperty(ProducerSysTest.BATCHSIZE, setBatchSize.getText());
+    }
+
+    /**
+     * Creates the URL panel.
+     *
+     * @return urlPanel
+     */
+    private JPanel createURLPanel() {
+        JLabel label = new JLabel(JMeterUtils.getResString("form_url"));
+        setURL = new JTextField(10);
+        setURL.setName(URL);
+        label.setLabelFor(setURL);
+
+        JPanel urlPanel = new JPanel(new BorderLayout(5, 0));
+        urlPanel.add(label, BorderLayout.WEST);
+        urlPanel.add(setURL, BorderLayout.CENTER);
+
+        return urlPanel;
+    }
+
+    /**
+     * Creates the durable panel.
+     *
+     * @return durablePanel
+     */
+    private JPanel createDurablePanel() {
+        JLabel labelDeliveryMode = new JLabel(JMeterUtils.getResString("form_delivery_mode"));
+
+        JLabel labelDurable = new JLabel(JMeterUtils.getResString("form_persistent"));
+        setDurable = new JRadioButton();
+        setDurable.setName(DURABLE);
+        labelDurable.setLabelFor(setDurable);
+        setDurable.setActionCommand(DURABLE);
+        setDurable.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformedDelivery(evt);
+            }
+        });
+        setDurable.setSelected(false);
+
+        JLabel labelNonDurable = new JLabel(JMeterUtils.getResString("form_non_persistent"));
+        setNonDurable = new JRadioButton();
+        setNonDurable.setName(NONDURABLE);
+        labelNonDurable.setLabelFor(setNonDurable);
+        setNonDurable.setActionCommand(NONDURABLE);
+        setNonDurable.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformedDelivery(evt);
+            }
+        });
+        setNonDurable.setSelected(true);
+
+        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
+        flow.setHgap(0);
+        flow.setVgap(0);
+
+        JPanel durablePanel = new JPanel(flow);
+        durablePanel.add(labelDeliveryMode);
+        durablePanel.add(new JLabel("  "));
+        durablePanel.add(setDurable);
+        durablePanel.add(labelDurable);
+        durablePanel.add(new JLabel("   "));
+        durablePanel.add(setNonDurable);
+        durablePanel.add(labelNonDurable);
+
+        return durablePanel;
+    }
+
+    /**
+     * Creates the topic panel.
+     *
+     * @return topicPanel
+     */
+    private JPanel createTopicPanel() {
+        JLabel labelMessagingDomain = new JLabel(JMeterUtils.getResString("messaging_domain"));
+
+        JLabel labelTopic = new JLabel(JMeterUtils.getResString("form_topic"));
+        setTopic = new JRadioButton();
+        setTopic.setName(TOPIC);
+        labelTopic.setLabelFor(setTopic);
+        setTopic.setActionCommand(TOPIC);
+        setTopic.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformed(evt);
+            }
+        });
+        setTopic.setSelected(true);
+
+        JLabel labelQueue = new JLabel(JMeterUtils.getResString("form_queue"));
+        setQueue = new JRadioButton();
+        setQueue.setName(QUEUE);
+        labelQueue.setLabelFor(setQueue);
+        setQueue.setActionCommand(QUEUE);
+        setQueue.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                jRadioButtonActionPerformed(evt);
+            }
+        });
+        setQueue.setSelected(false);
+
+        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
+        flow.setHgap(0);
+        flow.setVgap(0);
+
+        JPanel topicPanel = new JPanel(flow);
+        topicPanel.add(labelMessagingDomain);
+        topicPanel.add(new JLabel("  "));
+        topicPanel.add(setTopic);
+        topicPanel.add(labelTopic);
+        topicPanel.add(new JLabel("   "));
+        topicPanel.add(setQueue);
+        topicPanel.add(labelQueue);
+
+        return topicPanel;
+    }
+
+    /**
+     * Creates the no prod panel.
+     *
+     * @return noProdPanel
+     */
+    private JPanel createNoProducerPanel() {
+        JLabel label = new JLabel(JMeterUtils.getResString("form_no_producer"));
+        setNoProducer = new JTextField(10);
+        setNoProducer.setName(NOPRODUCER);
+        label.setLabelFor(setNoProducer);
+
+        JPanel noProdPanel = new JPanel(new BorderLayout(5, 0));
+        noProdPanel.add(label, BorderLayout.WEST);
+        noProdPanel.add(setNoProducer, BorderLayout.CENTER);
+
+        return noProdPanel;
+    }
+
+    /**
+     * Creates the number subject panel.
+     *
+     * @return noSubjectPanel
+     */
+    private JPanel createNoSubjectPanel() {
+        JLabel label = new JLabel(JMeterUtils.getResString("form_no_subject"));
+        setNoSubject = new JTextField(10);
+        setNoSubject.setName(NOSUBJECT);
+        label.setLabelFor(setNoSubject);
+
+        JPanel noSubjectPanel = new JPanel(new BorderLayout(5, 0));
+        noSubjectPanel.add(label, BorderLayout.WEST);
+        noSubjectPanel.add(setNoSubject, BorderLayout.CENTER);
+
+        return noSubjectPanel;
+    }
+
+    /**
+     * Creates the number of messages panel.
+     *
+     * @return noMessagesPanel
+     */
+    private JPanel createNoMessagesPanel() {
+        JLabel label = new JLabel(JMeterUtils.getResString("form_no_messages"));
+        setNoMessages = new JTextField(10);
+        setNoMessages.setName(NOMESSAGES);
+        label.setLabelFor(setNoMessages);
+
+        JPanel noMessagesPanel = new JPanel(new BorderLayout(5, 0));
+        noMessagesPanel.add(label, BorderLayout.WEST);
+        noMessagesPanel.add(setNoMessages, BorderLayout.CENTER);
+
+        return noMessagesPanel;
+    }
+
+    /**
+     * Initializes the gui components.
+     */
+    private void init() {
+        setLayout(new BorderLayout(0, 5));
+
+        if (displayName) {
+            setBorder(makeBorder());
+            add(makeTitlePanel(), BorderLayout.NORTH);
+        }
+
+        VerticalPanel mainPanel = new VerticalPanel();
+
+        mainPanel.add(createURLPanel());
+        //mainPanel.add(createDurationPanel());
+        //mainPanel.add(createRampUpPanel());
+        mainPanel.add(createNoProducerPanel());
+        mainPanel.add(createNoSubjectPanel());
+        mainPanel.add(createNoMessagesPanel());
+        //mainPanel.add(createMsgSizePanel());
+        mainPanel.add(createDurablePanel());
+        mainPanel.add(createTopicPanel());
+        //mainPanel.add(createTransactedPanel());
+        //mainPanel.add(createDefMsgIntervalPanel());
+        //mainPanel.add(createMQServerPanel());
+
+        add(mainPanel, BorderLayout.CENTER);
+    }
+
+    /**
+     * Listener action for selecting Messaging Domain.
+     *
+     * @param evt - event triggered.
+     */
+    private void jRadioButtonActionPerformed(ActionEvent evt) {
+        String evtActionCommand = evt.getActionCommand();
+
+        if (evtActionCommand.equals(TOPIC)) {
+            setTopic.setSelected(true);
+            setQueue.setSelected(false);
+        } else if (evtActionCommand.equals(QUEUE)) {
+            setTopic.setSelected(false);
+            setQueue.setSelected(true);
+        }
+    }
+    
+    /**
+     * Listener action for selecting Delivery Mode.
+     *
+     * @param evt - event triggered.
+     */
+    private void jRadioButtonActionPerformedDelivery(ActionEvent evt) {
+        String evtActionCommand = evt.getActionCommand();
+
+        if (evtActionCommand.equals(DURABLE)) {
+            setDurable.setSelected(true);
+            setNonDurable.setSelected(false);
+        } else if (evtActionCommand.equals(NONDURABLE)) {
+            setDurable.setSelected(false);
+            setNonDurable.setSelected(true);
+        }
+    }
+
+}

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/config/gui/ProducerSysTestConfigGui.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/control/gui/ConsumerSamplerGui.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message