Skip to content

Commit

Permalink
Merge pull request #49 from mahmoodm2/master
Browse files Browse the repository at this point in the history
"FileBasedEventStorageCustomLocationTest" test not passed in Windows
  • Loading branch information
jtmelton committed Jun 7, 2016
2 parents 0891a1d + 5bad813 commit c2b81be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.owasp.appsensor.storage.file;

import javax.inject.Inject;
import java.nio.file.Paths;
import java.nio.file.Path;

import org.junit.Assert;
import org.junit.Test;
Expand All @@ -27,13 +29,16 @@ public class FileBasedEventStorageCustomLocationTest {

@Test
public void deleteTestFiles() throws Exception {

Path tempDir = Paths.get(System.getProperty("java.io.tmpdir"));

FileBasedEventStore eventStore = (FileBasedEventStore)appSensorServer.getEventStore();
FileBasedAttackStore attackStore = (FileBasedAttackStore)appSensorServer.getAttackStore();
FileBasedResponseStore responseStore = (FileBasedResponseStore)appSensorServer.getResponseStore();

Assert.assertEquals("/tmp/as_events.txt", eventStore.getPath().toString());
Assert.assertEquals("/tmp/as_attacks.txt", attackStore.getPath().toString());
Assert.assertEquals("/tmp/as_responses.txt", responseStore.getPath().toString());
Assert.assertEquals(tempDir.resolve("as_events.txt").toString(), eventStore.getPath().toString());
Assert.assertEquals(tempDir.resolve("as_attacks.txt").toString(), attackStore.getPath().toString());
Assert.assertEquals(tempDir.resolve("as_responses.txt").toString(), responseStore.getPath().toString());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd">

<bean class="org.owasp.appsensor.storage.file.FileBasedEventStore">
<property name="filePath" value="/tmp"/>

<property name="fileName" value="as_events.txt"/>
</bean>

<bean class="org.owasp.appsensor.storage.file.FileBasedAttackStore">
<property name="filePath" value="/tmp"/>

<property name="fileName" value="as_attacks.txt"/>
</bean>

<bean class="org.owasp.appsensor.storage.file.FileBasedResponseStore">
<property name="filePath" value="/tmp"/>

<property name="fileName" value="as_responses.txt"/>
</bean>

Expand Down

0 comments on commit c2b81be

Please sign in to comment.