View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2007 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.impl.wsdl.loadtest.strategy;
14  
15  import java.beans.PropertyChangeListener;
16  import java.beans.PropertyChangeSupport;
17  
18  import javax.swing.JComponent;
19  
20  import org.apache.xmlbeans.XmlObject;
21  
22  import com.eviware.soapui.model.testsuite.LoadTestRunContext;
23  import com.eviware.soapui.model.testsuite.LoadTestRunner;
24  import com.eviware.soapui.model.testsuite.TestRunContext;
25  import com.eviware.soapui.model.testsuite.TestRunner;
26  import com.eviware.soapui.model.testsuite.TestStep;
27  import com.eviware.soapui.model.testsuite.TestStepResult;
28  
29  /***
30   * LoadStrategy allowing maximum runs and request delays
31   * 
32   * @author Ole.Matzura
33   */
34  
35  public abstract class AbstractLoadStrategy implements LoadStrategy
36  {
37  	private PropertyChangeSupport propertyChangeSupport;
38  	private final String type;
39  	
40  	public AbstractLoadStrategy( String type )
41  	{
42  		this.type = type;
43  		propertyChangeSupport = new PropertyChangeSupport( this );
44  	}
45  	
46  	public XmlObject getConfig()
47  	{
48        return null;
49  	}
50  
51  	public JComponent getConfigurationPanel()
52  	{
53  		return null;
54  	}
55  
56  	public String getType()
57  	{
58  		return type;
59  	}
60  
61  	public void addConfigurationChangeListener(PropertyChangeListener listener)
62  	{
63  		propertyChangeSupport.addPropertyChangeListener( CONFIGURATION_PROPERTY, listener );
64  	}
65  
66  	public void removeConfigurationChangeListener(PropertyChangeListener listener)
67  	{
68  		propertyChangeSupport.removePropertyChangeListener( CONFIGURATION_PROPERTY, listener );
69  	}
70  
71  	public void notifyConfigurationChanged()
72  	{
73  		propertyChangeSupport.firePropertyChange( CONFIGURATION_PROPERTY, null, null );
74  	}
75  	
76  	public boolean allowThreadCountChangeDuringRun()
77  	{
78  		return true;
79  	}
80  
81  	public void afterLoadTest(LoadTestRunner loadTestRunner, LoadTestRunContext context)
82  	{
83  	}
84  
85  	public void afterTestCase(LoadTestRunner loadTestRunner, LoadTestRunContext context, TestRunner testRunner, TestRunContext runContext)
86  	{
87  	}
88  
89  	public void afterTestStep(LoadTestRunner loadTestRunner, LoadTestRunContext context, TestRunner testRunner, TestRunContext runContext, TestStepResult testStepResult)
90  	{
91  	}
92  
93  	public void beforeLoadTest(LoadTestRunner loadTestRunner, LoadTestRunContext context)
94  	{
95  	}
96  
97  	public void beforeTestCase(LoadTestRunner loadTestRunner, LoadTestRunContext context, TestRunner testRunner, TestRunContext runContext)
98  	{
99  	}
100 
101 	public void beforeTestStep(LoadTestRunner loadTestRunner, LoadTestRunContext context, TestRunner testRunner, TestRunContext runContext, TestStep testStep)
102 	{
103 	}
104 	
105 	public void loadTestStarted(LoadTestRunner loadTestRunner, LoadTestRunContext context)
106 	{
107 	}
108 
109 	public void loadTestStopped(LoadTestRunner loadTestRunner, LoadTestRunContext context)
110 	{
111 	}
112 
113 	public void updateConfig( XmlObject config )
114 	{
115 	}
116 }