Index: trunk/autoquest-httpmonitor-test/src/test/java/de/ugoe/cs/autoquest/httpmonitor/HttpMonitoringProxyTest.java
===================================================================
--- trunk/autoquest-httpmonitor-test/src/test/java/de/ugoe/cs/autoquest/httpmonitor/HttpMonitoringProxyTest.java	(revision 1563)
+++ trunk/autoquest-httpmonitor-test/src/test/java/de/ugoe/cs/autoquest/httpmonitor/HttpMonitoringProxyTest.java	(revision 1614)
@@ -48,5 +48,4 @@
 import de.ugoe.cs.autoquest.plugin.http.HTTPLogParser;
 import de.ugoe.cs.autoquest.plugin.http.logdata.HttpExchange;
-import de.ugoe.cs.autoquest.plugin.http.logdata.Method;
 import dummyservice.DummyService;
 import dummyservice.DummyServicePortType;
@@ -111,4 +110,7 @@
     }
     
+    /**
+     *
+     */
     @Test(expected=java.lang.IllegalArgumentException.class)
     public void test_InvalidInitialization_01() throws Exception {
@@ -116,4 +118,7 @@
     }
     
+    /**
+     *
+     */
     @Test
     public void test_SimpleText_Local() throws Exception {
@@ -127,5 +132,5 @@
         String message = "dummy message";
         String expectedResponse = "response content";
-        String response = sendDummyMessage("POST", message, expectedResponse);
+        String response = sendDummyMessage("POST", null, message, expectedResponse);
         
         assertEquals(expectedResponse, response);
@@ -156,7 +161,10 @@
         assertEquals(1, sequence.size());
 
-        assertEvent(sequence.get(0), "POST", message, expectedResponse);
-    }
-
+        assertEvent(sequence.get(0), "POST", null, message, expectedResponse);
+    }
+    
+    /**
+     *
+     */
     @Test
     public void test_SimpleText_Remote() throws Exception {
@@ -170,5 +178,5 @@
         String message = "dummy message";
         String expectedResponse = "response content";
-        String response = sendDummyMessage("POST", message, expectedResponse);
+        String response = sendDummyMessage("POST", null, message, expectedResponse);
         
         assertEquals(expectedResponse, response);
@@ -176,4 +184,5 @@
         // give the proxy some time to send the copy of the message
         while(messages.size() < 1) {
+            System.out.println("waiting for message to be send by the proxy");
             Thread.sleep(1000);
         }
@@ -188,10 +197,10 @@
             (JAXBElement<HttpExchange>) unmarshaller.unmarshal(new StringReader(messages.get(0)));
         
-        HttpExchange exchange = jaxObject.getValue();
-        
-        assertEquals(message, exchange.getRequest().getContent().getData());
-        assertEquals(response, exchange.getResponse().getContent().getData());
-    }
-    
+        assertExchange(jaxObject.getValue(), "POST", null, message, expectedResponse);
+    }
+    
+    /**
+     *
+     */
     @Test
     public void test_XMLMessage_Local() throws Exception {
@@ -238,5 +247,5 @@
             "</httpEvent>";
 
-        String response = sendDummyMessage("POST", message, expectedResponse);
+        String response = sendDummyMessage("POST", null, message, expectedResponse);
         
         assertEquals(expectedResponse, response);
@@ -267,7 +276,10 @@
         assertEquals(1, sequence.size());
 
-        assertEvent(sequence.get(0), "POST", message, expectedResponse);
-    }
-    
+        assertEvent(sequence.get(0), "POST", null, message, expectedResponse);
+    }
+    
+    /**
+     *
+     */
     @Test
     public void test_XMLMessage_Remote() throws Exception {
@@ -314,5 +326,5 @@
             "</httpEvent>";
 
-        String response = sendDummyMessage("POST", message, expectedResponse);
+        String response = sendDummyMessage("POST", null, message, expectedResponse);
         
         assertEquals(expectedResponse, response);
@@ -320,4 +332,5 @@
         // give the proxy some time to send the copy of the message
         while(messages.size() < 1) {
+            System.out.println("waiting for message to be send by the proxy");
             Thread.sleep(1000);
         }
@@ -332,10 +345,10 @@
             (JAXBElement<HttpExchange>) unmarshaller.unmarshal(new StringReader(messages.get(0)));
         
-        HttpExchange exchange = jaxObject.getValue();
-        
-        assertEquals(message, exchange.getRequest().getContent().getData());
-        assertEquals(response, exchange.getResponse().getContent().getData());
-    }
-    
+        assertExchange(jaxObject.getValue(), "POST", null, message, expectedResponse);
+    }
+    
+    /**
+     *
+     */
     @Test
     public void test_SOAP_Local() throws Exception {
@@ -384,8 +397,11 @@
         assertEquals(2, sequence.size());
 
-        assertEvent(sequence.get(0), "GET", null, null); // get WSDL
-        assertEvent(sequence.get(1), "POST", null, null); // send request
-    }
-    
+        assertEvent(sequence.get(0), "GET", "wsdl", null, null); // get WSDL
+        assertEvent(sequence.get(1), "POST", null, null, null); // send request
+    }
+    
+    /**
+     *
+     */
     @SuppressWarnings("unchecked")
     @Test
@@ -415,4 +431,5 @@
         // give the proxy some time to send the copy of the message
         while(messages.size() < 1) {
+            System.out.println("waiting for message to be send by the proxy");
             Thread.sleep(1000);
         }
@@ -426,22 +443,15 @@
             (JAXBElement<HttpExchange>) unmarshaller.unmarshal(new StringReader(messages.get(0)));
         
-        HttpExchange exchange = jaxObject.getValue();
-        
-        assertEquals(Method.GET, exchange.getRequest().getMethod());
-
-        assertNull(exchange.getRequest().getContent());
-        assertNotNull(exchange.getResponse().getContent().getData());
+        assertExchange(jaxObject.getValue(), "GET", "wsdl", null, null);
 
         jaxObject =
             (JAXBElement<HttpExchange>) unmarshaller.unmarshal(new StringReader(messages.get(1)));
             
-        exchange = jaxObject.getValue();
-            
-        assertEquals(Method.POST, exchange.getRequest().getMethod());
-
-        assertNotNull(exchange.getRequest().getContent().getData());
-        assertNotNull(exchange.getResponse().getContent().getData());
-    }
-    
+        assertExchange(jaxObject.getValue(), "POST", null, null, null);
+    }
+    
+    /**
+     *
+     */
     @Test
     public void test_LargeRequest_Local() throws Exception {
@@ -461,5 +471,6 @@
         }
         
-        String response = sendDummyMessage("POST", message.toString(), expectedResponse.toString());
+        String response =
+            sendDummyMessage("POST", null, message.toString(), expectedResponse.toString());
         
         assertEquals(expectedResponse.toString(), response);
@@ -490,7 +501,10 @@
         assertEquals(1, sequence.size());
 
-        assertEvent(sequence.get(0), "POST", message.toString(), expectedResponse.toString());
-    }
-
+        assertEvent(sequence.get(0), "POST", null, message.toString(), expectedResponse.toString());
+    }
+    
+    /**
+     *
+     */
     @Test
     public void test_LargeRequest_Remote() throws Exception {
@@ -511,5 +525,6 @@
         }
         
-        String response = sendDummyMessage("POST", message.toString(), expectedResponse.toString());
+        String response =
+            sendDummyMessage("POST", null, message.toString(), expectedResponse.toString());
         
         assertEquals(expectedResponse.toString(), response);
@@ -517,4 +532,5 @@
         // give the proxy some time to send the copy of the message
         while(messages.size() < 1) {
+            System.out.println("waiting for message to be send by the proxy");
             Thread.sleep(1000);
         }
@@ -529,8 +545,90 @@
             (JAXBElement<HttpExchange>) unmarshaller.unmarshal(new StringReader(messages.get(0)));
         
-        HttpExchange exchange = jaxObject.getValue();
-        
-        assertEquals(message.toString(), exchange.getRequest().getContent().getData());
-        assertEquals(response.toString(), exchange.getResponse().getContent().getData());
+        assertExchange(jaxObject.getValue(), "POST", null,
+                       message.toString(), expectedResponse.toString());
+    }
+    
+    /**
+     *
+     */
+    @Test
+    public void test_Query_Local() throws Exception {
+        proxy = new HttpMonitoringProxy
+            (new String[] { LOG_FILE_DIR, PROXY_PORT + "", "localhost:" + DUMMY_SERVER_PORT,
+                            "local" });
+
+        proxy.init();
+        proxy.start();
+        
+        String message = "dummy message";
+        String expectedResponse = "response content";
+        String query = "key=value&key2=value2&key3=%3E%3CXXX";
+        String response = sendDummyMessage("POST", query, message, expectedResponse);
+        
+        assertEquals(expectedResponse, response);
+        
+        proxy.stop();
+        proxy = null;
+
+        File logFile = new File(LOG_FILE_DIR + File.separator + "httpmonitor_000.log");
+        
+        assertTrue(logFile.exists());
+        
+        HTTPLogParser parser = new HTTPLogParser();
+
+        parser.parseFile(logFile);
+
+        // check the sequences
+        Collection<List<Event>> sequences = parser.getSequences();
+
+        assertNotNull(sequences);
+
+        Iterator<List<Event>> iterator = sequences.iterator();
+        assertTrue(iterator.hasNext());
+
+        List<Event> sequence = iterator.next();
+        assertFalse(iterator.hasNext());
+
+        assertNotNull(sequence);
+        assertEquals(1, sequence.size());
+
+        assertEvent(sequence.get(0), "POST", query, message, expectedResponse);
+    }
+    
+    /**
+     *
+     */
+    @Test
+    public void test_Query_Remote() throws Exception {
+        proxy = new HttpMonitoringProxy
+            (new String[] { LOG_FILE_DIR, PROXY_PORT + "",
+                            "localhost:" + DUMMY_SERVER_PORT, "localhost:" + MONITOR_PORT });
+
+        proxy.init();
+        proxy.start();
+        
+        String message = "dummy message";
+        String expectedResponse = "response content";
+        String query = "key=value&key2=value2&key3=%3E%3CXXX";
+        String response = sendDummyMessage("POST", query, message, expectedResponse);
+        
+        assertEquals(expectedResponse, response);
+        
+        // give the proxy some time to send the copy of the message
+        while(messages.size() < 1) {
+            System.out.println("waiting for message to be send by the proxy");
+            Thread.sleep(1000);
+        }
+        
+        assertEquals(1, messages.size());
+        
+        JAXBContext jaxbContext = JAXBContext.newInstance(HttpExchange.class.getPackage().getName());
+        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+        
+        @SuppressWarnings("unchecked")
+        JAXBElement<HttpExchange> jaxObject =
+            (JAXBElement<HttpExchange>) unmarshaller.unmarshal(new StringReader(messages.get(0)));
+        
+        assertExchange(jaxObject.getValue(), "POST", query, message, expectedResponse);
     }
 
@@ -553,4 +651,5 @@
             
             resp.setStatus(HttpServletResponse.SC_OK);
+            System.out.println("send ok response");
         }
         
