Package org.waveprotocol.wave.model.id

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


    }

    /** @return a sample wave with a conversation in it. */
    private static WaveViewData createSampleWave() {
      final ParticipantId sampleAuthor = ParticipantId.ofUnsafe("nobody@example.com");
      IdGenerator gen = FakeIdGenerator.create();
      final WaveViewDataImpl waveData = WaveViewDataImpl.create(gen.newWaveId());
      final DocumentFactory<?> docFactory = BasicFactories.fakeDocumentFactory();
      final ObservableWaveletData.Factory<?> waveletDataFactory =
          new ObservableWaveletData.Factory<WaveletDataImpl>() {
            private final ObservableWaveletData.Factory<WaveletDataImpl> inner =
                WaveletDataImpl.Factory.create(docFactory);
View Full Code Here


  private ObservableWavelet destWavelet;
  private ObservableWavelet sourceWavelet;

  @Override
  protected void setUp() throws Exception {
    IdGenerator idGenerator = FakeIdGenerator.create();
    ObservableWaveView waveView = ConversationTestUtils.createWaveView(idGenerator);
    WaveBasedConversationView conversationView = WaveBasedConversationView
        .create(waveView, idGenerator);
    destWavelet = ConversationTestUtils.createWaveView(idGenerator).createRoot();
    source = conversationView.createConversation();
View Full Code Here

        BlipIterators.breadthFirst(conversation));
    assertEquals(Arrays.asList(b1, b3, b1t1b1, b1t1b2, b1t2b1, b3t1b1), actual);
  }

  private Conversation buildConversation() {
    IdGenerator idGenerator = FakeIdGenerator.create();
    ObservableWaveView waveView = ConversationTestUtils.createWaveView(idGenerator);
    ConversationView convView = WaveBasedConversationView.create(waveView, idGenerator);
    Conversation conv = convView.createRoot();
    b1 = conv.getRootThread().appendBlip();
    ConversationThread b1t1 = b1.addReplyThread();
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();

    ParticipantId viewer = new ParticipantId("nobody@nowhere.com");
    String adder = "evilbob@evil.com";
    IdGenerator idgen = FakeIdGenerator.create();
    view = BasicFactories.fakeWaveViewBuilder().with(idgen).build();
    userDataWavelet = view.createUserData();
    rootWavelet = view.createRoot();
    rootId = rootWavelet.getId();
    otherWavelet = view.createWavelet();
View Full Code Here

    return new Builder(schemas);
  }

  @Override
  public OpBasedWavelet create() {
    IdGenerator gen = FakeIdGenerator.create();
    return create(gen.newWaveId(), gen.newConversationWaveletId(), FAKE_PARTICIPANT);
  }
View Full Code Here

    when(mockWavelet.getDocumentIds()).thenReturn(Collections.<String>emptySet());
    return mockWavelet;
  }

  private Conversation makeConversation() {
    IdGenerator idGenerator = FakeIdGenerator.create();
    ObservableWaveView waveView = BasicFactories.fakeWaveViewBuilder().with(idGenerator).build();
    ConversationView convView = WaveBasedConversationView.create(waveView, idGenerator);
    Conversation conversation = convView.createRoot();
    conversation.getRootThread().appendBlip();
    conversation.getRootThread().appendBlip();
View Full Code Here

    assertEquals(reply.getId(), children.get(1).getId());
    assertEquals(secondReply.getId(), children.get(2).getId());
  }

  private static Conversation makeConversation() {
    IdGenerator idGenerator = FakeIdGenerator.create();
    ObservableWaveView waveView = BasicFactories.fakeWaveViewBuilder().with(idGenerator).build();
    ConversationView convView = WaveBasedConversationView.create(waveView, idGenerator);
    Conversation conversation = convView.createRoot();
    // Force empty document.
    ConversationBlip blip = conversation.getRootThread().appendBlip(
View Full Code Here

    assertSame(secondReply, EventDataConverterV21.findNextSibling(reply));
    assertNull(EventDataConverterV21.findNextSibling(secondReply));
  }

  private static Conversation makeConversation() {
    IdGenerator idGenerator = FakeIdGenerator.create();
    ObservableWaveView waveView = BasicFactories.fakeWaveViewBuilder().with(idGenerator).build();
    ConversationView convView = WaveBasedConversationView.create(waveView, idGenerator);
    Conversation conversation = convView.createRoot();
    // Force empty document.
    conversation.getRootThread().appendBlip(new DocInitializationBuilder().build());
View Full Code Here

          throw new UnsupportedOperationException();
        }
    };

  @Nullable private Conversation getConversation(WaveletDataImpl convData) {
    IdGenerator idGenerator = new IdHack.MinimalIdGenerator(
        convData.getWaveletId(),
        IdHack.FAKE_WAVELET_NAME.waveletId,
        random);
    WaveViewImpl<OpBasedWavelet> waveView = WaveViewImpl.create(STUB_FACTORY,
        convData.getWaveId(), idGenerator,
View Full Code Here

      @Override public void consume(WaveletOperation op) {
        ops.add(op);
      }
    };

    IdGenerator gen = new IdHack.MinimalIdGenerator(
        // Fake wavelet ID since we always use fake wavelet IDs on the server
        // side (they are never persisted).  The UDW ID is not needed in the
        // code below but the model code asks for it anyway.  We arbitrarily use
        // DISABLED_UDW_ID.
        IdHack.FAKE_WAVELET_NAME.waveletId, IdHack.DISABLED_UDW_ID,
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.id.IdGenerator

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.