package org.owasp.appsensor.storage;

import java.nio.file.Files;

import org.junit.Before;
import org.owasp.appsensor.AppSensorServer;
import org.owasp.appsensor.analysis.ReferenceStatisticalEventAnalysisEngineTest;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * Test basic FileBased * Store's by extending the ReferenceStatisticalEventAnalysisEngineTest
 * and only doing the file based setup. All of the same tests execute, but with the file
 * based stores instead of the memory based stores.
 * 
 * @author John Melton (jtmelton@gmail.com) http://www.jtmelton.com/
 * @author Raphaël Taban
 */
public class FileBasedEventStorageTest extends ReferenceStatisticalEventAnalysisEngineTest {

	@Autowired
	private AppSensorServer appSensorServer;
	
	@Before
	public void deleteTestFiles() throws Exception {
		FileBasedEventStore eventStore = (FileBasedEventStore)appSensorServer.getEventStore();
		FileBasedAttackStore attackStore = (FileBasedAttackStore)appSensorServer.getAttackStore();
		FileBasedResponseStore responseStore = (FileBasedResponseStore)appSensorServer.getResponseStore();

		Files.deleteIfExists(eventStore.getPath());
		Files.deleteIfExists(attackStore.getPath());
		Files.deleteIfExists(responseStore.getPath());
	}
	
}

@@ -60,16 +60,45 @@
 Files;%0A%0A
+import javax.inject.Inject;%0A%0A
 import o
@@ -243,71 +243,8 @@
 st;%0A
-import org.springframework.beans.factory.annotation.Autowired;%0A
 %0A%0A/*
@@ -683,17 +683,14 @@
 %0A%0A%09@
-Autowired
+Inject
 %0A%09pr

move to Inject from Autowired