Examples of WaveletId


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

      // are immutable. This also means we don't need a DocumentBased
      // implementation of WantedEvaluation.

      // TODO(user): work out what to do if wavelet id is missing.
      ObservableMutableDocument<? super E, E, ?> document = router.getDocument();
      WaveletId waveletId =
          WaveletIdSerializer.INSTANCE.fromString(document.getAttribute(element, WAVELET_ID_ATTR));
      boolean wanted =
          Serializer.BOOLEAN.fromString(document.getAttribute(element, WANTED_ATTR), false);
      double certainty =
          Serializer.DOUBLE.fromString(document.getAttribute(element, CERTAINTY_ATTR), 0.0);
View Full Code Here

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

  // listener. Enable when either the op-based wavelet installs itself
  // as a listener or the model test setup is refactored to allow this.
  public void testDefaults() {

    // Default read versions are all NO_VERSION
    WaveletId wavelet1 = WaveletId.of("google.com", "wavelet1");
    String blip1 = "blip1";
    assertEquals(PrimitiveSupplement.NO_VERSION, target.getLastReadBlipVersion(wavelet1, blip1));
    assertEquals(PrimitiveSupplement.NO_VERSION, target.getLastReadParticipantsVersion(wavelet1));
    assertEquals(PrimitiveSupplement.NO_VERSION, target.getLastReadWaveletVersion(wavelet1));
View Full Code Here

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

    // Gadget states are not defined.
    assertTrue(target.getGadgetState("Gadget #1").isEmpty());
  }

  public void testInboxing() {
    WaveletId wavelet1 = WaveletId.of("google.com", "wavelet1");
    WaveletId wavelet2 = WaveletId.of("google.com", "wavelet2");

    target.archiveAtVersion(wavelet1, 10);
    assertEquals(10, target.getArchiveWaveletVersion(wavelet1));
    target.archiveAtVersion(wavelet2, 5);
    assertEquals(5, target.getArchiveWaveletVersion(wavelet2));
View Full Code Here

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

    assertEquals(PrimitiveSupplement.NO_VERSION, target.getArchiveWaveletVersion(wavelet1));
    assertEquals(PrimitiveSupplement.NO_VERSION, target.getArchiveWaveletVersion(wavelet2));
  }

  public void testClearReadState() {
    WaveletId wavelet1 = WaveletId.of("google.com", "wavelet1");
    WaveletId wavelet2 = WaveletId.of("google.com", "wavelet2");
    String blip1 = "blip1";
    String blip2 = "blip2";

    target.setLastReadBlipVersion(wavelet1, blip1, 23);
    target.setLastReadBlipVersion(wavelet2, blip2, 43);
View Full Code Here

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

    assertEquals(34, target.getLastReadBlipVersion(wavelet1, blip1));
    assertEquals(PrimitiveSupplement.NO_VERSION, target.getLastReadBlipVersion(wavelet2, blip2));
  }

  public void testClearBlipReadState() {
    WaveletId wavelet1 = WaveletId.of("google.com", "wavelet1");
    String blip1 = "blip1";
    String blip2 = "blip2";

    target.setLastReadBlipVersion(wavelet1, blip1, 23);
    target.setLastReadBlipVersion(wavelet1, blip2, 43);
View Full Code Here

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

    target.setLastReadBlipVersion(wavelet1, blip1, 10);
    assertEquals(10, target.getLastReadBlipVersion(wavelet1, blip1));
  }

  public void testSeenVersions() {
    WaveletId wavelet1 = WaveletId.of("example.com", "wavelet1");
    WaveletId wavelet2 = WaveletId.of("example.com", "wavelet2");
    HashedVersion aSeenVersion = HashedVersion.of(213819238L, new byte[] {1});

    target.setSeenVersion(wavelet1, aSeenVersion);

    assertEquals(aSeenVersion, target.getSeenVersion(wavelet1));
View Full Code Here

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

  // which there are
  // too many to test), we test some random scenarios.
  //

  public void testRandom() {
    WaveletId wavelet1 = WaveletId.of("google.com", "wavelet1");
    WaveletId wavelet2 = WaveletId.of("google.com", "wavelet2");
    String blip1 = "blip1";
    String blip2 = "blip2";
    String thread1 = "thread1";
    String thread2 = "thread2";
View Full Code Here

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

    assertEquals(null, target.getThreadState(wavelet2, thread2));
    assertEquals(null, target.getThreadState(wavelet2, thread1));
  }

  public void testAbuse() {
    WaveletId wavelet1 = WaveletId.of("google.com", "wavelet1");
    final String adder = "evilbob@evil.com";
    WantedEvaluation eval1 =
        new SimpleWantedEvaluation(
            wavelet1, adder, true, 0.1f, 1234L, "agent1", false, "no comment");
    WantedEvaluation eval2 =
View Full Code Here

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

  }

  public void testGetMissingDataReturnsForbidden() throws Exception {
    WaveletData wavelet = waveletProvider.getHostedWavelet();
    WaveId waveId = wavelet.getWaveId();
    WaveletId waveletId = wavelet.getWaveletId();

    WaveRef unknownWave = WaveRef.of(WaveId.of(waveId.getDomain(), waveId.getId() + "junk"));
    verifyServletReturnsForbiddenForWaveref(unknownWave);
    WaveRef unknownWavelet = WaveRef.of(waveId, WaveletId.of(waveletId.getDomain(), waveletId.getId() + "junk"));
    verifyServletReturnsForbiddenForWaveref(unknownWavelet);
    WaveRef unknownDocument = WaveRef.of(waveId, waveletId, "madeupdocid");
    verifyServletReturnsForbiddenForWaveref(unknownDocument);
  }
View Full Code Here

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

      listener.onArchiveClearChanged(oldValue, newValue);
    }
  }

  private void triggerOnWantedEvaluationAdded(WantedEvaluation newEvaluation) {
    WaveletId waveletId = newEvaluation.getWaveletId();
    if (waveletId == null) {
      return;
    }
    for (Listener listener : listeners) {
      listener.onWantedEvaluationsChanged(waveletId);
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.