sebb 2004/01/13 06:49:18 Modified: src/core/org/apache/jmeter/threads/gui ThreadGroupGui.java src/core/org/apache/jmeter/threads ThreadGroup.java Log: Added startup delay to thread group Revision Changes Path 1.23 +20 -1 jakarta-jmeter/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java Index: ThreadGroupGui.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- ThreadGroupGui.java 24 Oct 2003 00:55:49 -0000 1.22 +++ ThreadGroupGui.java 13 Jan 2004 14:49:18 -0000 1.23 @@ -111,6 +111,7 @@ private JDateField end; private JCheckBox scheduler; private JTextField duration; + private JTextField delay; //Relative start-up time // Sampler error action buttons private JRadioButton continueBox; @@ -164,6 +165,7 @@ new StringProperty( ThreadGroup.ON_SAMPLE_ERROR,onSampleError())); tg.setProperty(ThreadGroup.DURATION, duration.getText()); + tg.setProperty(ThreadGroup.DELAY, delay.getText()); } private void setSampleErrorBoxes(ThreadGroup te){ @@ -203,6 +205,7 @@ start.setDate(new Date(tg.getPropertyAsLong(ThreadGroup.START_TIME))); end.setDate(new Date(tg.getPropertyAsLong(ThreadGroup.END_TIME))); duration.setText(tg.getPropertyAsString(ThreadGroup.DURATION)); + delay.setText(tg.getPropertyAsString(ThreadGroup.DELAY)); setSampleErrorBoxes((ThreadGroup) tg); } @@ -299,6 +302,21 @@ return panel; } + /** + * Create a panel containing the Duration field and corresponding label. + * + * @return a GUI panel containing the Duration field + */ + private JPanel createDelayPanel() + { + JPanel panel = new JPanel(new BorderLayout(5, 0)); + JLabel label = new JLabel(JMeterUtils.getResString("delay")); + panel.add(label, BorderLayout.WEST); + delay = new JTextField(); + panel.add(delay, BorderLayout.CENTER); + return panel; + } + public String getStaticLabel() { return JMeterUtils.getResString("threadgroup"); @@ -397,6 +415,7 @@ mainPanel.add(createStartTimePanel()); mainPanel.add(createEndTimePanel()); mainPanel.add(createDurationPanel()); + mainPanel.add(createDelayPanel()); mainPanel.setVisible(false); VerticalPanel intgrationPanel = new VerticalPanel(); intgrationPanel.add(threadPropsPanel); 1.22 +25 -2 jakarta-jmeter/src/core/org/apache/jmeter/threads/ThreadGroup.java Index: ThreadGroup.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/ThreadGroup.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ThreadGroup.java 22 Nov 2003 03:25:25 -0000 1.21 +++ ThreadGroup.java 13 Jan 2004 14:49:18 -0000 1.22 @@ -97,6 +97,7 @@ public final static String START_TIME= "ThreadGroup.start_time"; public final static String END_TIME= "ThreadGroup.end_time"; public final static String DURATION = "ThreadGroup.duration"; + public final static String DELAY = "ThreadGroup.delay"; /* Action to be taken when a Sampler error occurs*/ @@ -199,6 +200,28 @@ { setProperty(new LongProperty(DURATION,duration)); } + + /** + * Get the delay + * + * @return the delay (in secs) + */ + public long getDelay() + { + return getPropertyAsLong(DELAY); + } + + /** + * Set the delay + * + * @param delay in seconds + */ + public void setDelay(long delay) + { + setProperty(new LongProperty(DELAY,delay)); + } + + /** * Set the EndTime value.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]