-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix read aggregate to stop searching if the last event has same seque…
…nce number as the last snapshot (#535) make number of segments to check when a domain event with aggregate number 0 is stored configurable fix unit for timeout
- Loading branch information
Showing
11 changed files
with
128 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
axonserver/src/test/java/io/axoniq/axonserver/localstorage/EventWriteStorageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.axoniq.axonserver.localstorage; | ||
|
||
import io.axoniq.axonserver.exception.ErrorCode; | ||
import io.axoniq.axonserver.exception.MessagingPlatformException; | ||
import io.axoniq.axonserver.localstorage.file.PrimaryEventStore; | ||
import org.junit.AfterClass; | ||
import org.junit.Before; | ||
import org.junit.BeforeClass; | ||
import org.junit.ClassRule; | ||
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class EventWriteStorageTest { | ||
@ClassRule | ||
public static TemporaryFolder tempFolder = new TemporaryFolder(); | ||
private static TestInputStreamStorageContainer container; | ||
|
||
@BeforeClass | ||
public static void setUp() throws Exception { | ||
container = new TestInputStreamStorageContainer(tempFolder.getRoot(), embeddedDBProperties -> { | ||
embeddedDBProperties.getEvent().setSegmentsForSequenceNumberCheck(100); | ||
return embeddedDBProperties; | ||
}); | ||
container.createDummyEvents(1000, 150, "sample"); | ||
container.getEventWriter().clearSequenceNumberCache(); | ||
PrimaryEventStore primaryEventStore = (PrimaryEventStore)container.getPrimary(); | ||
while( primaryEventStore.activeSegmentCount() > 1 ) { | ||
Thread.sleep(10); | ||
} | ||
|
||
} | ||
|
||
@Test | ||
public void store() { | ||
try { | ||
container.createDummyEvents(1, 100, "sample"); | ||
fail("should not be able to store new event with sequence number 0 for existing aggregate"); | ||
} catch (MessagingPlatformException messagingPlatformException) { | ||
assertEquals(ErrorCode.INVALID_SEQUENCE, messagingPlatformException.getErrorCode()); | ||
} | ||
} | ||
|
||
@AfterClass | ||
public static void close() { | ||
container.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters