Examples of JavaSerializer


Examples of org.prevayler.foundation.serialization.JavaSerializer

        : readSnapshot(latestSnapshot);
    _recoveredPrevalentSystem = new PrevalentSystemGuard<P>(recoveredPrevalentSystem, recoveredVersion, journalSerializer);
  }

  GenericSnapshotManager(P newPrevalentSystem) {
    _strategies = Collections.singletonMap("snapshot", new JavaSerializer());
    _primarySuffix = "snapshot";
    _directory = null;
    _recoveredPrevalentSystem = new PrevalentSystemGuard<P>(newPrevalentSystem, 0, new JavaSerializer());
  }
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

public class DeepCopierTest extends TestCase {

  public void testNormal() {
    Object original = "foo";
    Object copy = DeepCopier.deepCopy(original, new JavaSerializer());

    assertEquals(original, copy);
    assertNotSame(original, copy);
  }
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

    assertNotSame(original, copy);
  }

  public void testParallel() throws Exception {
    Object original = "foo";
    Object copy = DeepCopier.deepCopyParallel(original, new JavaSerializer());

    assertEquals(original, copy);
    assertNotSame(original, copy);
  }
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

  }

  public void testBadSuffix() {
    PrevaylerFactory factory = new PrevaylerFactory();
    try {
      factory.configureSnapshotSerializer("SNAPSHOT", new JavaSerializer());
      fail();
    } catch (IllegalArgumentException exception) {
      assertEquals("Snapshot filename suffix must match /[a-zA-Z0-9]*[Ss]napshot/, but 'SNAPSHOT' does not", exception.getMessage());
    }
  }
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

import org.prevayler.foundation.serialization.XStreamSerializer;

public class TransactionWithQueryTest extends FileIOTest {

  public void testJavaJournal() throws Exception {
    Serializer strategy = new JavaSerializer();

    startAndCrash(strategy);
    recover(strategy);
  }
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

import java.io.IOException;

public class GenericSnapshotManagerTest extends FileIOTest {

  public void testNoExistingSnapshot() throws Exception {
    Prevayler<StringBuffer> prevayler = createPrevayler("snapshot", new JavaSerializer());
    assertEquals("initial", prevayler.prevalentSystem().toString());
  }
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

    Prevayler<StringBuffer> prevayler = createPrevayler("snapshot", new JavaSerializer());
    assertEquals("initial", prevayler.prevalentSystem().toString());
  }

  public void testRoundtripJava() throws Exception {
    checkRoundtrip("snapshot", new JavaSerializer());
  }
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

  public void testDetectExistingSnapshotFromUnknownSnapshotManager() throws Exception {
    Prevayler<StringBuffer> first = createPrevayler("xstreamsnapshot", new XStreamSerializer());
    appendTakeSnapshotAndClose(first);

    try {
      createPrevayler("snapshot", new JavaSerializer());
      fail();
    } catch (IOException e) {
      // This is good because if we only looked for .snapshot files we could silently ignore an existing snapshot.
      assertTrue("Actual message was <" + e.getMessage() + ">",
          e.getMessage().endsWith("0000000000000000002.xstreamsnapshot cannot be read; only [snapshot] supported"));
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

    checkCanReadSnapshotWithMultipleStrategies();
  }

  public void testMultipleSerializationStrategiesFromJava() throws Exception {
    Prevayler<StringBuffer> prevayler = createPrevayler("snapshot", new JavaSerializer());
    appendTakeSnapshotAndClose(prevayler);

    checkSnapshotAndDeleteJournal("0000000000000000002.snapshot", "0000000000000000001.journal");

    checkCanReadSnapshotWithMultipleStrategies();
View Full Code Here

Examples of org.prevayler.foundation.serialization.JavaSerializer

  private Prevayler<StringBuffer> createPrevaylerMulti() throws Exception {
    PrevaylerFactory<StringBuffer> factory = new PrevaylerFactory<StringBuffer>();
    factory.configurePrevalentSystem(new StringBuffer("initial"));
    factory.configurePrevalenceDirectory(_testDirectory);
    factory.configureSnapshotSerializer("xstreamsnapshot", new XStreamSerializer());
    factory.configureSnapshotSerializer("snapshot", new JavaSerializer());
    return factory.create();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.