Index: /trunk/autoquest-plugin-http-test/.classpath
===================================================================
--- /trunk/autoquest-plugin-http-test/.classpath	(revision 1369)
+++ /trunk/autoquest-plugin-http-test/.classpath	(revision 1369)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
Index: /trunk/autoquest-plugin-http-test/.project
===================================================================
--- /trunk/autoquest-plugin-http-test/.project	(revision 1369)
+++ /trunk/autoquest-plugin-http-test/.project	(revision 1369)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>autoquest-plugin-http-test</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+	</natures>
+</projectDescription>
Index: /trunk/autoquest-plugin-http-test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /trunk/autoquest-plugin-http-test/.settings/org.eclipse.jdt.core.prefs	(revision 1369)
+++ /trunk/autoquest-plugin-http-test/.settings/org.eclipse.jdt.core.prefs	(revision 1369)
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.7
Index: /trunk/autoquest-plugin-http-test/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- /trunk/autoquest-plugin-http-test/.settings/org.eclipse.m2e.core.prefs	(revision 1369)
+++ /trunk/autoquest-plugin-http-test/.settings/org.eclipse.m2e.core.prefs	(revision 1369)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Index: /trunk/autoquest-plugin-http-test/pom.xml
===================================================================
--- /trunk/autoquest-plugin-http-test/pom.xml	(revision 1369)
+++ /trunk/autoquest-plugin-http-test/pom.xml	(revision 1369)
@@ -0,0 +1,22 @@
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+>
+    <parent>
+      <groupId>de.ugoe.cs.autoquest</groupId>
+      <artifactId>autoquest-test</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>autoquest-plugin-http-test</artifactId>
+    <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+    </licenses>
+    <properties>
+        <tested-artifactId>autoquest-plugin-http</tested-artifactId>
+    </properties>
+</project>
Index: /trunk/autoquest-plugin-http-test/src/test/java/de/ugoe/cs/autoquest/http/HTTPLogParserTest.java
===================================================================
--- /trunk/autoquest-plugin-http-test/src/test/java/de/ugoe/cs/autoquest/http/HTTPLogParserTest.java	(revision 1369)
+++ /trunk/autoquest-plugin-http-test/src/test/java/de/ugoe/cs/autoquest/http/HTTPLogParserTest.java	(revision 1369)
@@ -0,0 +1,164 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   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 de.ugoe.cs.autoquest.http;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Level;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import javax.xml.transform.stream.StreamResult;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.httpmonitor.exchange.ObjectFactory;
+import de.ugoe.cs.autoquest.httpmonitor.exchange.Session;
+import de.ugoe.cs.autoquest.plugin.http.HTTPLogParser;
+import de.ugoe.cs.autoquest.plugin.http.HTTPUtils;
+import de.ugoe.cs.autoquest.plugin.http.eventcore.HTTPEventType;
+import de.ugoe.cs.autoquest.plugin.http.eventcore.HTTPTarget;
+import de.ugoe.cs.util.console.TextConsole;
+
+/**
+ * Test for the new HTMLLogParser
+ * @author Fabian Glaser
+ *
+ */
+public class HTTPLogParserTest {
+    
+    /**
+     * 
+     */
+    private final static String LOG_FILE_DIR = "target/tmp/logfiles/";
+
+    /**
+     *
+     */
+    @Before
+    public void setUp() {
+        new TextConsole(Level.FINEST);
+    }
+
+    /**
+     *
+     */
+    @After
+    public void tearDown() throws Exception {
+        deleteFiles(new File(LOG_FILE_DIR));
+    }
+    
+    /**
+     * Tests the parseFile method with a given trace file.
+     * @throws Exception
+     */
+    @Test
+    public void testParseFile_1() throws Exception {
+        for (int i = 0; i < 20; i++) {
+            File logFile = new File(LOG_FILE_DIR, "session" + i + ".xml");
+
+            Session session = HTTPTestUtils.createRandomSession(100); 
+            writeToFile(session, logFile);
+
+            System.out.println("calling parser");
+            HTTPLogParser parser = new HTTPLogParser();
+            parser.parseFile(logFile);
+
+            System.out.println("evaluating events");
+            Collection<List<Event>> events = parser.getSequences();
+
+            assertNotNull(events);
+
+            if (session.getHttpExchange().size() > 0) {
+                assertEquals(1, events.size());
+
+                Iterator<List<Event>> iterator = events.iterator();
+                assertNotNull(iterator);
+                List<Event> sequence = iterator.next();
+                assertEquals(session.getHttpExchange().size(), sequence.size());
+                assertFalse(iterator.hasNext());
+
+                System.out.println("{");
+                System.out.println("  {");
+                for (int j = 0; j < sequence.size(); j++) {
+                    System.out.print("    ");
+                    System.out.print(sequence.get(j));
+                    System.out.println(",");
+
+                    assertNotNull(sequence.get(j));
+                    assertNotNull(sequence.get(j).getType());
+                    assertTrue(sequence.get(j).getType() instanceof HTTPEventType);
+
+                    assertNotNull(sequence.get(j).getTarget());
+                    assertTrue(sequence.get(j).getTarget() instanceof HTTPTarget);
+
+                    HTTPTestUtils.assertExchangeEquals
+                        (session.getHttpExchange().get(j),
+                         ((HTTPEventType) sequence.get(j).getType()).getExchange());
+
+                    assertEquals(HTTPUtils.toString(session.getHttpExchange().get(j).getReceiver()),
+                                 ((HTTPTarget) sequence.get(j).getTarget()).getStringIdentifier());
+                }
+                System.out.println("  }");
+                System.out.println("}");
+                System.out.println("\n\n");
+            }
+        }
+    }
+
+    /**
+     *
+     */
+    private void writeToFile(Session session, File logFile) throws Exception {
+        System.out.println("writing session to " + logFile);
+        
+        logFile.getParentFile().mkdirs();
+        
+        JAXBContext jaxbContext = JAXBContext.newInstance(Session.class.getPackage().getName());
+        Marshaller marshaller = jaxbContext.createMarshaller();
+        StreamResult result = new StreamResult(new FileOutputStream(logFile));
+        marshaller.marshal(new ObjectFactory().createSession(session), result);
+        
+        result.getOutputStream().close();
+    }
+
+    /**
+     *
+     */
+    private void deleteFiles(File file) {
+        if (file.exists()) {
+            if (file.isDirectory()) {
+                for (File child : file.listFiles()) {
+                    deleteFiles(child);
+                }
+            }
+            
+            try {
+                file.delete();
+            }
+            catch (Exception e) {
+                // ignore and delete as much as possible
+            }
+        }
+    }
+}
