mstover1 2003/01/30 05:56:21
Modified: src/protocol/http/org/apache/jmeter/protocol/http/proxy
Daemon.java Proxy.java ProxyControl.java
Log:
Minor changes that don't mean anything yet
Revision Changes Path
1.4 +9 -1
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Daemon.java
Index: Daemon.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Daemon.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Daemon.java 29 Aug 2002 18:17:42 -0000 1.3
+++ Daemon.java 30 Jan 2003 13:56:21 -0000 1.4
@@ -39,6 +39,7 @@
private boolean running;
ProxyControl target;
private Socket ClientSocket;
+ static private Class proxyClass = Proxy.class;
public Daemon()
{
@@ -49,6 +50,12 @@
this.target = target;
configureProxy(port);
}
+
+ public Daemon(int port,ProxyControl target,Class proxyClass) throws
UnknownHostException
+ {
+ this(port,target);
+ Daemon.proxyClass = proxyClass;
+ }
/************************************************************
* Description of the Method
@@ -146,7 +153,8 @@
// Listen on main socket
Socket ClientSocket = MainSocket.accept();
// Pass request to new proxy thread
- Proxy thd = new Proxy(ClientSocket, cache,
config,target,cookieManager);
+ Proxy thd = (Proxy)proxyClass.newInstance();
+ thd.configure(ClientSocket, cache,
config,target,cookieManager);
thd.start();
}
log.info("Proxy Server stopped");
1.4 +25 -12
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
Index: Proxy.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Proxy.java 29 Aug 2002 18:17:42 -0000 1.3
+++ Proxy.java 30 Jan 2003 13:56:21 -0000 1.4
@@ -108,21 +108,34 @@
// UrlConfig object for saving test cases
ProxyControl target;
CookieManager cookieManager;
- //
- // Public member methods
- //
- //
- // Constructor
- //
- Proxy(
+
+
+ /**
+ * Constructor. Configures Proxy at same time.
+ * @param clientSocket
+ * @param CacheManager
+ * @param configObject
+ * @param target
+ * @param cookieManager
+ */
+ Proxy(Socket clientSocket,Cache CacheManager,Config configObject,
+ ProxyControl target,CookieManager cookieManager)
+ {
+ configure(clientSocket,CacheManager,configObject,target,cookieManager);
+ }
+
+ public Proxy()
+ {
+
+ }
+
+ public void configure(
Socket clientSocket,
Cache CacheManager,
Config configObject,
ProxyControl target,
- CookieManager cookieManager) {
- //
- // Initialize member variables
- //
+ CookieManager cookieManager)
+ {
this.cookieManager = cookieManager;
this.target = target;
config = configObject;
@@ -158,7 +171,7 @@
writeToClient(serverResponse,
new
BufferedOutputStream(ClientSocket.getOutputStream()));
headers.removeHeaderNamed("cookie");
- target.deliverSampler(sampler,new TestElement[]{headers});
+ target.deliverSampler(sampler,new
TestElement[]{headers},serverResponse);
} catch (UnknownHostException uhe) {
log.warn("Server Not Found.",uhe);
try {
1.9 +13 -8
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Index: ProxyControl.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ProxyControl.java 16 Jan 2003 00:13:21 -0000 1.8
+++ ProxyControl.java 30 Jan 2003 13:56:21 -0000 1.9
@@ -245,12 +245,17 @@
{
getIncludePatterns().clear();
}
- /************************************************************
- * !ToDo (Method description)
- *
- *@param config !ToDo (Parameter description)
- ***********************************************************/
- public void deliverSampler(HTTPSampler sampler, TestElement[] subConfigs)
+
+ /**
+ * Receives the recorded sampler from the proxy server for placing in the
+ * test tree
+ * @param sampler
+ * @param subConfigs
+ * @param serverResponse Added to allow saving of the server's response while
+ * recording. A future consideration.
+ */
+ public void deliverSampler(HTTPSampler sampler, TestElement[] subConfigs,
+ byte[] serverResponse)
{
if (filterUrl(sampler))
{
@@ -267,7 +272,7 @@
server.stopServer();
}
}
- private boolean filterUrl(HTTPSampler sampler)
+ protected boolean filterUrl(HTTPSampler sampler)
{
boolean ok = false;
if (sampler.getDomain() == null || sampler.getDomain().equals(""))
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]