Package org.prevayler.foundation.serialization

Examples of org.prevayler.foundation.serialization.XStreamSerializer


      assertEquals("Snapshot filename suffix must match /[a-zA-Z0-9]*[Ss]napshot/, but 'SNAPSHOT' does not", exception.getMessage());
    }
  }

  public void testXStreamSnapshot() throws Exception {
    Serializer serializer = new XStreamSerializer();

    takeSnapshot(serializer);
    recover(serializer);
  }
View Full Code Here


    startAndCrash(strategy);
    recover(strategy);
  }

  public void testXStreamJournal() throws Exception {
    Serializer strategy = new XStreamSerializer();

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

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

  public void testRoundtripXStream() throws Exception {
    checkRoundtrip("xstreamsnapshot", new XStreamSerializer());
  }
View Full Code Here

    assertEquals("initial one two", second.prevalentSystem().toString());
    second.close();
  }

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

    try {
      createPrevayler("snapshot", new JavaSerializer());
      fail();
View Full Code Here

          e.getMessage().endsWith("0000000000000000002.xstreamsnapshot cannot be read; only [snapshot] supported"));
    }
  }

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

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

    checkCanReadSnapshotWithMultipleStrategies();
View Full Code Here

  public void testUsePrimaryForWritingSnapshot() throws Exception {
    Prevayler<StringBuffer> first = createPrevaylerMulti();
    appendTakeSnapshotAndClose(first);
    checkSnapshotAndDeleteJournal("0000000000000000002.xstreamsnapshot", "0000000000000000001.journal");

    Prevayler<StringBuffer> second = createPrevayler("xstreamsnapshot", new XStreamSerializer());
    assertEquals("initial one two", second.prevalentSystem().toString());
    second.close();
  }
View Full Code Here

  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

  }

  public void testTheBaptismProblem() throws Exception {
    PrevaylerFactory<CampGuide> factory = new PrevaylerFactory<CampGuide>();
    factory.configureJournalSerializer(new XStreamSerializer());
    factory.configureSnapshotSerializer(new XStreamSerializer());
    factory.configureSnapshotSerializer(new JavaSerializer());
    factory.configurePrevalentSystem(new CampGuideImpl());
    Prevayler prevayler = factory.create();
    CampGuide guide = (CampGuide)
        PrevaylerTransactionsFacade.create
View Full Code Here

TOP

Related Classes of org.prevayler.foundation.serialization.XStreamSerializer

Copyright © 2018 www.massapicom. 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.