public void testWaveletRoundtrip() throws Exception { WaveletData expected = TestDataUtil.createSimpleWaveletData(); WaveletName name = WaveletName.of(expected.getWaveId(), expected.getWaveletId()); HashedVersion version = HASH_FACTORY.createVersionZero(name); WaveletSnapshot snapshot = SnapshotSerializer.serializeWavelet(expected, version); WaveletData actual = SnapshotSerializer.deserializeWavelet(snapshot, expected.getWaveId()); TestDataUtil.checkSerializedWavelet(expected, actual); } }
public void testWaveletRoundtrip() throws Exception { WaveletData expected = TestDataUtil.createSimpleWaveletData(); WaveletName name = WaveletName.of(expected.getWaveId(), expected.getWaveletId()); HashedVersion version = HASH_FACTORY.createVersionZero(name); WaveletSnapshot snapshot = SnapshotSerializer.serializeWavelet(expected, version); WaveletData actual = SnapshotSerializer.deserializeWavelet(snapshot, expected.getWaveId()); TestDataUtil.checkSerializedWavelet(expected, actual); } }
/** * Round-trip a wavelet and make sure all the fields match. * We only check the fields that WaveletSnapshot serializes. * @throws Exception */ public void testGetWavelet() throws Exception { WaveletData wavelet = waveletProvider.getHostedWavelet(); WaveRef waveref = WaveRef.of(wavelet.getWaveId(), wavelet.getWaveletId()); WaveletSnapshot snapshot = fetchWaverRefAndParse(waveref, WaveletSnapshot.class); WaveletData roundtripped = SnapshotSerializer.deserializeWavelet(snapshot, waveref.getWaveId()); // We have just round-tripped wavelet through the servlet. wavelet and // roundtripped should be identical in all the fields that get serialized. TestDataUtil.checkSerializedWavelet(wavelet, roundtripped); // TODO(josephg): Enable this test when the persistence store is in place. // assertEquals(snapshot.getVersion(), waveletProvider.getCommittedVersion()); }
/** * Round-trip a wavelet and make sure all the fields match. * We only check the fields that WaveletSnapshot serializes. * @throws Exception */ public void testGetWavelet() throws Exception { WaveletData wavelet = waveletProvider.getHostedWavelet(); WaveRef waveref = WaveRef.of(wavelet.getWaveId(), wavelet.getWaveletId()); WaveletSnapshot snapshot = fetchWaverRefAndParse(waveref, WaveletSnapshot.class); WaveletData roundtripped = SnapshotSerializer.deserializeWavelet(snapshot, waveref.getWaveId()); // We have just round-tripped wavelet through the servlet. wavelet and // roundtripped should be identical in all the fields that get serialized. TestDataUtil.checkSerializedWavelet(wavelet, roundtripped); // TODO(josephg): Enable this test when the persistence store is in place. // assertEquals(snapshot.getVersion(), waveletProvider.getCommittedVersion()); }