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 wo...@apache.org on 2005/09/21 21:38:30 UTC

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/control/gui TestPlanGui.java

woolfel     2005/09/21 12:38:30

  Modified:    src/core/org/apache/jmeter/util Tag: rel-2-1
                        JMeterVersion.java
               src/core/org/apache/jmeter/resources Tag: rel-2-1
                        messages.properties
               src/core/org/apache/jmeter Tag: rel-2-1
                        DynamicClassLoader.java NewDriver.java
               src/core/org/apache/jmeter/testelement Tag: rel-2-1
                        TestPlan.java
               src/core/org/apache/jmeter/control/gui Tag: rel-2-1
                        TestPlanGui.java
  Log:
  checking in the changes for the new Classpath feature. need to update the docs
  tonight and explain how it works, so that users don't get confused
  peter
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.37.2.2  +1 -1      jakarta-jmeter/src/core/org/apache/jmeter/util/JMeterVersion.java
  
  Index: JMeterVersion.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/util/JMeterVersion.java,v
  retrieving revision 1.37.2.1
  retrieving revision 1.37.2.2
  diff -u -r1.37.2.1 -r1.37.2.2
  --- JMeterVersion.java	12 Aug 2005 01:14:11 -0000	1.37.2.1
  +++ JMeterVersion.java	21 Sep 2005 19:38:29 -0000	1.37.2.2
  @@ -41,7 +41,7 @@
   	 * JMeterUtils This ensures that JMeterUtils always gets the correct
   	 * version, even if it is not re-compiled during the build.
   	 */
  -	private static final String VERSION = "2.1";
  +	private static final String VERSION = "2.1.20050921";
   
   	static final String COPYRIGHT = "Copyright (c) 1998-2005 The Apache Software Foundation";
   
  
  
  
  No                   revision
  No                   revision
  1.151.2.7 +3 -0      jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties,v
  retrieving revision 1.151.2.6
  retrieving revision 1.151.2.7
  diff -u -r1.151.2.6 -r1.151.2.7
  --- messages.properties	15 Sep 2005 23:39:47 -0000	1.151.2.6
  +++ messages.properties	21 Sep 2005 19:38:29 -0000	1.151.2.7
  @@ -18,6 +18,7 @@
   aggregate_graph_ms=Milliseconds
   aggregate_graph_response_time=Response Time
   aggregate_graph_save=Save Graph
  +aggregate_graph_save_table=Save Table Data
   aggregate_graph_title=Aggregate Graph
   aggregate_graph_user_title=Title for Graph
   aggregate_graph_width=Width
  @@ -257,6 +258,7 @@
   invalid_mail_server=Problem contacting the e-mail server (see JMeter log file)
   iteration_counter_arg_1=TRUE, for each user to have own counter, FALSE for a global counter
   iterator_num=Loop Count\:
  +jar_file=Jar Files
   java_request=Java Request
   java_request_defaults=Java Request Defaults
   jms_auth_not_required=Not Required
  @@ -640,6 +642,7 @@
   test_action_title=Test Action
   test_configuration=Test Configuration
   test_plan=Test Plan
  +test_plan_classpath_browse=Add directory or jar to classpath
   testplan.serialized=Run each Thread Group separately (i.e. run one group before starting the next)
   testplan_comments=Comments\:
   testt=Test
  
  
  
  No                   revision
  No                   revision
  1.4.2.2   +7 -7      jakarta-jmeter/src/core/org/apache/jmeter/DynamicClassLoader.java
  
  Index: DynamicClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/DynamicClassLoader.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- DynamicClassLoader.java	2 Sep 2005 00:58:06 -0000	1.4.2.1
  +++ DynamicClassLoader.java	21 Sep 2005 19:38:29 -0000	1.4.2.2
  @@ -31,16 +31,16 @@
   	/**
   	 * @param arg0
   	 */
  -	public DynamicClassLoader(URL[] arg0) {
  -		super(arg0);
  +	public DynamicClassLoader(URL[] urls) {
  +		super(urls);
   	}
   
   	/**
   	 * @param arg0
   	 * @param arg1
   	 */
  -	public DynamicClassLoader(URL[] arg0, ClassLoader arg1) {
  -		super(arg0, arg1);
  +	public DynamicClassLoader(URL[] urls, ClassLoader parent) {
  +		super(urls, parent);
   	}
   
   	/**
  @@ -48,9 +48,9 @@
   	 * @param arg1
   	 * @param arg2
   	 */
  -	public DynamicClassLoader(URL[] arg0, ClassLoader arg1,
  -			URLStreamHandlerFactory arg2) {
  -		super(arg0, arg1, arg2);
  +	public DynamicClassLoader(URL[] urls, ClassLoader parent,
  +			URLStreamHandlerFactory factory) {
  +		super(urls, parent, factory);
   	}
   
       public void addURL(URL url) {
  
  
  
  1.8.2.2   +2 -3      jakarta-jmeter/src/core/org/apache/jmeter/NewDriver.java
  
  Index: NewDriver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/NewDriver.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- NewDriver.java	2 Sep 2005 00:58:06 -0000	1.8.2.1
  +++ NewDriver.java	21 Sep 2005 19:38:29 -0000	1.8.2.2
  @@ -100,7 +100,6 @@
   
   		System.setProperty("java.class.path", System.getProperty("java.class.path") + classpath.toString());
   		loader = new DynamicClassLoader((URL[]) jars.toArray(new URL[0]));
  -
   	}
   
   	/**
  
  
  
  No                   revision
  No                   revision
  1.17.2.2  +50 -2     jakarta-jmeter/src/core/org/apache/jmeter/testelement/TestPlan.java
  
  Index: TestPlan.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testelement/TestPlan.java,v
  retrieving revision 1.17.2.1
  retrieving revision 1.17.2.2
  diff -u -r1.17.2.1 -r1.17.2.2
  --- TestPlan.java	18 Aug 2005 17:21:52 -0000	1.17.2.1
  +++ TestPlan.java	21 Sep 2005 19:38:30 -0000	1.17.2.2
  @@ -25,6 +25,7 @@
   import java.util.List;
   import java.util.Map;
   
  +import org.apache.jmeter.NewDriver;
   import org.apache.jmeter.config.Arguments;
   import org.apache.jmeter.config.ConfigElement;
   import org.apache.jmeter.engine.event.LoopIterationEvent;
  @@ -36,6 +37,7 @@
   import org.apache.jmeter.threads.ThreadGroup;
   import org.apache.jmeter.util.JMeterUtils;
   import org.apache.jorphan.logging.LoggingManager;
  +import org.apache.jorphan.util.JOrphanUtils;
   import org.apache.log.Logger;
   
   /**
  @@ -53,6 +55,8 @@
   
   	public final static String SERIALIZE_THREADGROUPS = "TestPlan.serialize_threadgroups";
   
  +    public final static String CLASSPATHS = "TestPlan.user_define_classpath";
  +    
   	public final static String COMMENTS = "TestPlan.comments";
   
   	public final static String BASEDIR = "basedir";
  @@ -146,6 +150,45 @@
   	public void setSerialized(boolean serializeTGs) {
   		setProperty(new BooleanProperty(SERIALIZE_THREADGROUPS, serializeTGs));
   	}
  +    
  +    /**
  +     * Set the classpath for the test plan
  +     * @param text
  +     */
  +    public void setTestPlanClasspath(String text) {
  +        setProperty(CLASSPATHS,text);
  +    }
  +    
  +    public void setTestPlanClasspath(String[] text) {
  +        for (int idx=0; idx < text.length; idx++) {
  +            NewDriver.addURL(text[idx]);
  +        }
  +        String cat = "";
  +        if (text.length > 1) {
  +            for (int idx=0; idx < text.length; idx++) {
  +                if (idx > 0) {
  +                    cat += "," + text[idx];
  +                } else {
  +                    cat += text[idx];
  +                }
  +            }
  +        } else if (text != null && text.length == 1){
  +            cat = text[0];
  +        }
  +        this.setTestPlanClasspath(cat);
  +    }
  +    
  +    public String[] getTestPlanClasspathArray() {
  +        return JOrphanUtils.split(this.getTestPlanClasspath(),",");
  +    }
  +    
  +    /**
  +     * Returns a string in CSV format
  +     * @return
  +     */
  +    public String getTestPlanClasspath() {
  +        return getPropertyAsString(CLASSPATHS);
  +    }
   
   	/**
   	 * Fetch the serialize threadgroups property
  @@ -258,6 +301,10 @@
   				log.error("Failed to set file server base dir with " + getBasedir(), e);
   			}
   		}
  +        String propClasspath = JMeterUtils.getPropDefault("user.classpath","");
  +        if (propClasspath.length() > 0) {
  +            NewDriver.addURL(propClasspath);
  +        }
   	}
   
   	/*
  @@ -268,4 +315,5 @@
   	public void testStarted(String host) {
   		testStarted();
   	}
  +    
   }
  
  
  
  No                   revision
  No                   revision
  1.19.2.1  +14 -3     jakarta-jmeter/src/core/org/apache/jmeter/control/gui/TestPlanGui.java
  
  Index: TestPlanGui.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/control/gui/TestPlanGui.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- TestPlanGui.java	12 Jul 2005 20:50:35 -0000	1.19
  +++ TestPlanGui.java	21 Sep 2005 19:38:30 -0000	1.19.2.1
  @@ -32,6 +32,7 @@
   import org.apache.jmeter.config.Arguments;
   import org.apache.jmeter.config.gui.ArgumentsPanel;
   import org.apache.jmeter.gui.AbstractJMeterGuiComponent;
  +import org.apache.jmeter.gui.util.FileListPanel;
   import org.apache.jmeter.gui.util.MenuFactory;
   import org.apache.jmeter.gui.util.VerticalPanel;
   import org.apache.jmeter.testelement.AbstractTestElement;
  @@ -62,7 +63,9 @@
   	/** A panel to contain comments on the test plan. */
   	private JTextArea commentPanel;
   
  -	/**
  +    FileListPanel browseJar = null;
  +
  +    /**
   	 * Create a new TestPlanGui.
   	 */
   	public TestPlanGui() {
  @@ -113,6 +116,7 @@
   			tp.setSerialized(serializedMode.isSelected());
   			tp.setUserDefinedVariables((Arguments) argsPanel.createTestElement());
   			tp.setProperty(TestPlan.COMMENTS, commentPanel.getText());
  +            tp.setTestPlanClasspath(browseJar.getFiles());
   		}
   	}
   
  @@ -151,6 +155,7 @@
   			argsPanel.configure((Arguments) el.getProperty(TestPlan.USER_DEFINED_VARIABLES).getObjectValue());
   		}
   		commentPanel.setText(el.getPropertyAsString(TestPlan.COMMENTS));
  +        browseJar.setFiles( ((TestPlan)el).getTestPlanClasspathArray() );
   	}
   
   	/**
  @@ -173,6 +178,11 @@
   		panel.add(commentPanel);
   		return panel;
   	}
  +    
  +    protected Container createClassPathPanel() {
  +        browseJar = new FileListPanel(JMeterUtils.getResString("test_plan_classpath_browse"), ".jar");
  +        return browseJar;
  +    }
   
   	/**
   	 * Initialize the components and layout of this component.
  @@ -194,6 +204,7 @@
   		explain.setEditable(false);
   		explain.setBackground(this.getBackground());
   		southPanel.add(explain);
  +        southPanel.add(createClassPathPanel());
   
   		add(southPanel, BorderLayout.SOUTH);
   	}
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org