Examples of WaveletId


Examples of org.waveprotocol.wave.model.id.WaveletId

    PrimitiveSupplement primitiveSupplement = mock(PrimitiveSupplement.class);
    SupplementWaveView supplementedView = mock(SupplementWaveView.class);

    final HashedVersion signature1 = HashedVersion.of(234L, new byte[] { 1 }),
        signature2 = HashedVersion.of(12828L, new byte[] { 2 });
    WaveletId waveletId1 = WaveletId.of("example.com", "somewaveletid1");
    when(supplementedView.getSignature(waveletId1)).thenReturn(signature1);

    WaveletId waveletId2 = WaveletId.of("example.com", "somewaveletid2");
    when(supplementedView.getSignature(waveletId2)).thenReturn(signature2);

    when(supplementedView.getWavelets()).thenReturn(Arrays.asList(waveletId1, waveletId2));

    SupplementedWaveImpl supplementedWave = new SupplementedWaveImpl(
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

  public void testGetSeenVersionReturnsSeenSignature() {
    PrimitiveSupplement primitiveSupplement = mock(PrimitiveSupplement.class);
    SupplementWaveView supplementedView = mock(SupplementWaveView.class);

    WaveletId waveletId1 = WaveletId.of("example.com", "somewaveletid1");
    HashedVersion wavelet1SeenVersion = HashedVersion.of(12312L, new byte[] { 1 });

    when(supplementedView.getWavelets()).thenReturn(Arrays.asList(waveletId1));
    when(primitiveSupplement.getSeenVersion(waveletId1)).thenReturn(
        wavelet1SeenVersion);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

  public void testHasBeenSeen() {
    PrimitiveSupplement primitiveSupplement = mock(PrimitiveSupplement.class);
    SupplementWaveView supplementedView = mock(SupplementWaveView.class);

    final HashedVersion signature1 = HashedVersion.of(234L, new byte[] { 1 });
    WaveletId waveletId1 = WaveletId.of("google.com", "somewaveletid1");
    when(supplementedView.getSignature(waveletId1)).thenReturn(signature1);

    when(supplementedView.getWavelets()).thenReturn(Arrays.asList(waveletId1));

    SupplementedWave supplementedWave =
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

    final long VERSION_1 = 234L;
    final long VERSION_2 = 12828L;

    final HashedVersion signature1 = HashedVersion.of(VERSION_1, SIGNATURE),
        signature2 = HashedVersion.of(VERSION_2, SIGNATURE);
    WaveletId waveletId1 = WaveletId.of("example.com", "somewaveletid1");
    when(supplementedView.getSignature(waveletId1)).thenReturn(signature1);

    WaveletId waveletId2 = WaveletId.of("example.com", "somewaveletid2");
    when(supplementedView.getSignature(waveletId2)).thenReturn(signature2);

    when(supplementedView.getWavelets()).thenReturn(Arrays.asList(waveletId1, waveletId2));

    when(primitiveSupplement.getNotifiedWavelets())
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

    final byte[] SIGNATURE = new byte[] { 1 };
    final long VERSION_1 = 234L;

    final HashedVersion signature1 = HashedVersion.of(VERSION_1, SIGNATURE);
    WaveletId waveletId1 = WaveletId.of("example.com", "somewaveletid1");
    when(supplementedView.getSignature(waveletId1)).thenReturn(signature1);
    when(primitiveSupplement.getNotifiedWavelets())
        .thenReturn(CollectionUtils.<WaveletId>immutableSet())
        .thenReturn(CollectionUtils.immutableSet(waveletId1));
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

    assert container == getDocument().getParentElement(element);
    if (!WaveletBasedSupplement.WAVELET_TAG.equals(getDocument().getTagName(element))) {
      return;
    }

    WaveletId waveletId = valueOf(element);
    if (waveletId != null) {
      WaveletReadState existing = waveletSupplements.get(waveletId);
      if (existing == null) {
        WaveletReadState read =
            DocumentBasedWaveletReadState.create(router, element, waveletId, listener);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

    }
  }

  public void onElementRemoved(E element) {
    if (WaveletBasedSupplement.WAVELET_TAG.equals(getDocument().getTagName(element))) {
      WaveletId waveletId = valueOf(element);
      if (waveletId != null) {
        WaveletReadState state = waveletSupplements.remove(waveletId);
        if (state == null) {
          // Not good - there was a read-state element and we weren't tracking
          // it...
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

   * resulting path has the correct format of
   * waveDomain/waveId[/~/waveletId/[documentId]]
   */
  public void testPathEncodeGetsCalledWithWaveRefInput() {
    WaveId waveId = WaveId.of("www.example.com", "abcdEFGH");
    WaveletId waveletId = WaveletId.of("www.example.com", "conv+root");
    String documentId = "b+1234";

    WaveRef waveIdOnly = WaveRef.of(waveId);
    WaveRef waveIdPlusWaveletId = WaveRef.of(waveId, waveletId);
    WaveRef fullySpecified = WaveRef.of(waveId, waveletId, documentId);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

   * resulting path has the correct format of
   * waveDomain/waveId[/~/waveletId/[documentId]]
   */
  public void testQueryEncodeGetsCalledWithWaveRefInput() {
    WaveId waveId = WaveId.of("www.example.com", "abcdEFGH");
    WaveletId waveletId = WaveletId.of("www.example.com", "conv+root");
    String documentId = "b+1234";

    WaveRef waveIdOnly = WaveRef.of(waveId);
    WaveRef waveIdPlusWaveletId = WaveRef.of(waveId, waveletId);
    WaveRef fullySpecified = WaveRef.of(waveId, waveletId, documentId);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveletId

      ProtocolHashedVersion end) {
    return WaveletOperationSerializer.deserialize(delta, deserialize(end));
  }

  private ObservableWaveletData deserialize(WaveId waveId, WaveletSnapshot snapshot) {
    WaveletId id;
    try {
      id = ModernIdSerialiser.INSTANCE.deserialiseWaveletId(snapshot.getWaveletId());
    } catch (InvalidIdException e) {
      throw new IllegalArgumentException(e);
    }
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.