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/01 06:02:22 UTC

cvs commit: jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/tree ReportTreeModel.java

woolfel     2005/08/31 21:02:22

  Modified:    src/reports/org/apache/jmeter/control/gui ReportGui.java
               src/reports/org/apache/jmeter/report/gui/tree
                        ReportTreeModel.java
  Added:       src/reports/org/apache/jmeter/testelement AbstractTable.java
                        Table.java AbstractChart.java
               src/reports/org/apache/jmeter/report/gui TableGui.java
  Log:
  more updates to the reporting tool
  peter
  
  Revision  Changes    Path
  1.1                  jakarta-jmeter/src/reports/org/apache/jmeter/testelement/AbstractTable.java
  
  Index: AbstractTable.java
  ===================================================================
  //$Header:
  /*
   * Copyright 2005 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.apache.jmeter.testelement;
  
  /**
   * AbstractTable is the base Element for different kinds of report tables.
   * @author pete
   *
   */
  public abstract class AbstractTable extends AbstractTestElement {
  
      public static final String REPORT_TABLE_MEAN = "ReportTable.mean";
      public static final String REPORT_TABLE_MEDIAN = "ReportTable.median";
      public static final String REPORT_TABLE_MAX = "ReportTable.max";
      public static final String REPORT_TABLE_MIN = "ReportTable.min";
      public static final String REPORT_TABLE_RESPONSE_RATE = "ReportTable.response.rate";
      public static final String REPORT_TABLE_TRANSFER_RATE = "ReportTable.transfer.rate";
      public static final String REPORT_TABLE_50_PERCENT = "ReportTable.50.percent";
      public static final String REPORT_TABLE_90_PERCENT = "ReportTable.90.percent";
      public static final String REPORT_TABLE_ERROR_RATE = "ReportTable.error.rate";
  
      public AbstractTable() {
  		super();
  	}
  
      public boolean getMean() {
      	return getPropertyAsBoolean(REPORT_TABLE_MEAN);
      }
      
      public void setMean(String set) {
      	setProperty(REPORT_TABLE_MEAN,set);
      }
      
      public boolean getMedian() {
      	return getPropertyAsBoolean(REPORT_TABLE_MEDIAN);
      }
      
      public void setMedian(String set) {
      	setProperty(REPORT_TABLE_MEDIAN,set);
      }
      
      public boolean getMax() {
      	return getPropertyAsBoolean(REPORT_TABLE_MAX);
      }
      
      public void setMax(String set) {
      	setProperty(REPORT_TABLE_MAX,set);
      }
      
      public boolean getMin() {
      	return getPropertyAsBoolean(REPORT_TABLE_MIN);
      }
      
      public void setMin(String set) {
      	setProperty(REPORT_TABLE_MIN,set);
      }
      
      public boolean getResponseRate() {
      	return getPropertyAsBoolean(REPORT_TABLE_RESPONSE_RATE);
      }
      
      public void setResponseRate(String set) {
      	setProperty(REPORT_TABLE_RESPONSE_RATE,set);
      }
      
      public boolean getTransferRate() {
      	return getPropertyAsBoolean(REPORT_TABLE_TRANSFER_RATE);
      }
      
      public void setTransferRate(String set) {
      	setProperty(REPORT_TABLE_TRANSFER_RATE,set);
      }
      
      public boolean get50Percent() {
      	return getPropertyAsBoolean(REPORT_TABLE_50_PERCENT);
      }
      
      public void set50Percent(String set) {
      	setProperty(REPORT_TABLE_50_PERCENT,set);
      }
      
      public boolean get90Percent() {
      	return getPropertyAsBoolean(REPORT_TABLE_50_PERCENT);
      }
      
      public void set90Percent(String set) {
      	setProperty(REPORT_TABLE_50_PERCENT,set);
      }
      
      public boolean getErrorRate() {
      	return getPropertyAsBoolean(REPORT_TABLE_ERROR_RATE);
      }
      
      public void setErrorRate(String set) {
      	setProperty(REPORT_TABLE_ERROR_RATE,set);
      }
  }
  
  
  
  1.1                  jakarta-jmeter/src/reports/org/apache/jmeter/testelement/Table.java
  
  Index: Table.java
  ===================================================================
  //$Header:
  /*
   * Copyright 2005 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.apache.jmeter.testelement;
  
  public class Table extends AbstractTable {
  
  	public Table() {
  		super();
  	}
  
  }
  
  
  
  1.1                  jakarta-jmeter/src/reports/org/apache/jmeter/testelement/AbstractChart.java
  
  Index: AbstractChart.java
  ===================================================================
  //$Header:
  /*
   * Copyright 2005 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.apache.jmeter.testelement;
  
  public class AbstractChart extends AbstractTestElement {
  
  	public AbstractChart() {
  		super();
  	}
  
  }
  
  
  
  1.1                  jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/TableGui.java
  
  Index: TableGui.java
  ===================================================================
  //$Header:
  /*
   * Copyright 2005 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.apache.jmeter.report.gui;
  
  import javax.swing.JCheckBox;
  
  import org.apache.jmeter.testelement.Table;
  import org.apache.jmeter.testelement.TestElement;
  import org.apache.jmeter.util.JMeterUtils;
  
  public class TableGui extends AbstractReportGui {
  
      private JCheckBox meanCheck = new JCheckBox(JMeterUtils.getResString("average"));
      private JCheckBox medianCheck = new JCheckBox(JMeterUtils.getResString("graph_results_median"));
      private JCheckBox maxCheck = new JCheckBox(JMeterUtils.getResString("aggregate_report_max"));
      private JCheckBox minCheck = new JCheckBox(JMeterUtils.getResString("aggregate_report_min"));
      private JCheckBox responseRateCheck = 
      	new JCheckBox(JMeterUtils.getResString("aggregate_report_rate"));
      private JCheckBox transferRateCheck = 
      	new JCheckBox(JMeterUtils.getResString("aggregate_report_bandwidth"));
      private JCheckBox fiftypercentCheck = 
      	new JCheckBox(JMeterUtils.getResString("monitor_label_left_middle"));
      private JCheckBox nintypercentCheck = 
      	new JCheckBox(JMeterUtils.getResString("aggregate_report_90%_line"));
      private JCheckBox errorRateCheck = new JCheckBox(JMeterUtils.getResString("aggregate_report_error"));
  
      public TableGui() {
  		super();
  	}
  
  	public TestElement createTestElement() {
  		return new Table() ;
  	}
  
  	public void modifyTestElement(TestElement element) {
  		this.configureTestElement(element);
  		Table tb = (Table)element;
  		tb.set50Percent(String.valueOf(fiftypercentCheck.isSelected()));
  		tb.set90Percent(String.valueOf(nintypercentCheck.isSelected()));
  		tb.setErrorRate(String.valueOf(errorRateCheck.isSelected()));
  		tb.setMax(String.valueOf(maxCheck.isSelected()));
  		tb.setMean(String.valueOf(meanCheck.isSelected()));
  		tb.setMedian(String.valueOf(medianCheck.isSelected()));
  		tb.setMin(String.valueOf(minCheck.isSelected()));
  	}
  
  }
  
  
  
  1.7       +4 -4      jakarta-jmeter/src/reports/org/apache/jmeter/control/gui/ReportGui.java
  
  Index: ReportGui.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/control/gui/ReportGui.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ReportGui.java	31 Aug 2005 04:52:13 -0000	1.6
  +++ ReportGui.java	1 Sep 2005 04:02:21 -0000	1.7
  @@ -88,9 +88,9 @@
   	public void modifyTestElement(TestElement plan) {
   		super.configureTestElement(plan);
   		if (plan instanceof ReportPlan) {
  -			ReportPlan tp = (ReportPlan) plan;
  -			tp.setUserDefinedVariables((Arguments) argsPanel.createTestElement());
  -			tp.setProperty(ReportPlan.COMMENTS, commentPanel.getText());
  +			ReportPlan rp = (ReportPlan) plan;
  +			rp.setUserDefinedVariables((Arguments) argsPanel.createTestElement());
  +			rp.setProperty(ReportPlan.COMMENTS, commentPanel.getText());
   		}
   	}
   
  
  
  
  1.4       +10 -8     jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java
  
  Index: ReportTreeModel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReportTreeModel.java	31 Aug 2005 04:52:12 -0000	1.3
  +++ ReportTreeModel.java	1 Sep 2005 04:02:21 -0000	1.4
  @@ -27,7 +27,7 @@
   import org.apache.jmeter.config.gui.AbstractConfigGui;
   import org.apache.jmeter.control.gui.ReportGui;
   import org.apache.jmeter.exceptions.IllegalUserActionException;
  -import org.apache.jmeter.gui.GuiPackage;
  +import org.apache.jmeter.gui.ReportGuiPackage;
   import org.apache.jmeter.gui.JMeterGUIComponent;
   import org.apache.jmeter.report.gui.tree.ReportTreeNode;
   import org.apache.jmeter.testelement.TestElement;
  @@ -84,7 +84,9 @@
   						.getPropertyAsString(TestElement.NAME));
   				addSubTree(subTree.getTree(item), current);
   			} else {
  -				addSubTree(subTree.getTree(item), addComponent(item, current));
  +				if (subTree.getTree(item) != null) {
  +					addSubTree(subTree.getTree(item), addComponent(item, current));
  +				}
   			}
   		}
   		return getCurrentSubTree(current);
  @@ -99,11 +101,11 @@
   		component.setProperty(TestElement.GUI_CLASS, NameUpdater
   				.getCurrentName(component
   						.getPropertyAsString(TestElement.GUI_CLASS)));
  -		GuiPackage.getInstance().updateCurrentNode();
  -		JMeterGUIComponent guicomp = GuiPackage.getInstance().getGui(component);
  +		ReportGuiPackage.getInstance().updateCurrentNode();
  +		JMeterGUIComponent guicomp = ReportGuiPackage.getInstance().getGui(component);
   		guicomp.configure(component);
   		guicomp.modifyTestElement(component);
  -		GuiPackage.getInstance().getCurrentGui(); // put the gui object back
  +		ReportGuiPackage.getInstance().getCurrentGui(); // put the gui object back
   		// to the way it was.
   		ReportTreeNode newNode = new ReportTreeNode(component, this);
   
  @@ -177,8 +179,8 @@
   	}
   
   	private void initTree() {
  -		TestElement wb = new ReportGui().createTestElement();
  -		this.insertNodeInto(new ReportTreeNode(wb, this),
  +		TestElement rp = new ReportGui().createTestElement();
  +		this.insertNodeInto(new ReportTreeNode(rp, this),
   				(ReportTreeNode) getRoot(), 0);
   	}
   }
  
  
  

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