117118119120121122123124125126127
} public void testDoubleStart() throws Exception { SequentialFileFactory factory = new FakeSequentialFileFactory(); AddressSettings addressSettings = new AddressSettings(); addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE); PagingStore storeImpl = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
153154155156157158159160161162163
testConcurrentPaging(new NIOSequentialFileFactory(getTestDir()), 1); } public void testStore() throws Exception { SequentialFileFactory factory = new FakeSequentialFileFactory(); PagingStoreFactory storeFactory = new FakeStoreFactory(factory); AddressSettings addressSettings = new AddressSettings(); addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
216217218219220221222223224225226
} public void testDepageOnCurrentPage() throws Exception { SequentialFileFactory factory = new FakeSequentialFileFactory(); SimpleString destination = new SimpleString("test"); PagingStoreFactory storeFactory = new FakeStoreFactory(factory);
293294295296297298299300301302303
} public void testDepageMultiplePages() throws Exception { SequentialFileFactory factory = new FakeSequentialFileFactory(); SimpleString destination = new SimpleString("test"); PagingStoreFactory storeFactory = new FakeStoreFactory(factory); AddressSettings addressSettings = new AddressSettings();
422423424425426427428429430
} public void testConcurrentDepage() throws Exception { SequentialFileFactory factory = new FakeSequentialFileFactory(1, false); testConcurrentPaging(factory, 10); }
596061626364656667
} } public void testCleanOnFake() { SequentialFileFactory factory = new FakeSequentialFileFactory(); testBuffer(factory); }
220221222223224225226227228229230
// Private ------------------------------------------------------- private void setupJournal(final int journalSize, final int alignment, final int numberOfMinimalFiles) throws Exception { if (factory == null) { factory = new FakeSequentialFileFactory(alignment, true); } if (journalImpl != null) { journalImpl.stop();
27282930313233
public class FakeJournalImplTest extends JournalImplTestUnit { @Override protected SequentialFileFactory getFileFactory() throws Exception { return new FakeSequentialFileFactory(); }
9596979899100101102103104105106107
// This test just validates basic alignment on the FakeSequentialFile itself public void testBasicAlignment() throws Exception { FakeSequentialFileFactory factory = new FakeSequentialFileFactory(200, true); SequentialFile file = factory.createSequentialFile("test1", 1); file.open(); try {
143144145146147148149150151152153
} } public void testInconsistentAlignment() throws Exception { factory = new FakeSequentialFileFactory(512, true); try { journalImpl = new JournalImpl(2000, 2, 0, 0, factory, "tt", "tt", 1000); Assert.fail("Supposed to throw an exception");