Package org.waveprotocol.wave.model.id

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


    assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT));
  }

  public void testPutTemporaryWavelet() throws Exception {
    OpBasedWavelet opBasedWavelet = wavelet.getOpBasedWavelet(PARTICIPANT);
    WaveId tempWaveId = WaveId.of("example.com", OperationContextImpl.TEMP_ID_MARKER + "random");
    WaveletId tempWaveletId = WaveletId.of("example.com", "conv+root");
    operationContext.putWavelet(tempWaveId, tempWaveletId, wavelet);
    assertEquals(
        opBasedWavelet, operationContext.openWavelet(tempWaveId, tempWaveletId, PARTICIPANT));
    assertEquals(opBasedWavelet, operationContext.openWavelet(WAVE_ID, WAVELET_ID, PARTICIPANT));
View Full Code Here


    JsonRpcResponse response = context.getResponse(OPERATION_ID);
    assertFalse(response.isError());
    Map<ParamsProperty, Object> responseData = response.getData();
    assertEquals("Expected message to be set", MESSAGE, responseData.get(ParamsProperty.MESSAGE));

    WaveId waveId = ApiIdSerializer.instance().deserialiseWaveId(
        (String)responseData.get(ParamsProperty.WAVE_ID));
    WaveletId waveletId = ApiIdSerializer.instance().deserialiseWaveletId(
        (String) responseData.get(ParamsProperty.WAVELET_ID));
    RobotWaveletData newWavelet = context.getOpenWavelets().get(WaveletName.of(waveId, waveletId));
    assertNotNull("A new wavelet must be open", newWavelet);
View Full Code Here

  private WaveletData wavelet;

  @Override
  public void setUp() {
    WaveId waveId = WaveId.of("example.com", "c+123");
    WaveletId waveletId = WaveletId.of("example.com", IdConstants.CONVERSATION_ROOT_WAVELET);
    wavelet = new WaveletDataImpl(waveletId, CREATOR, 0L, 0L,
        HashedVersion.unsigned(0), 0L, waveId,
        BasicFactories.pluggableMutableDocumentFactory());
  }
View Full Code Here

  private MockViewChannelListener viewOpenListener;
  private MockWaveViewService waveViewService;

  @Override
  protected void setUp() {
    WaveId waveId = WaveId.of("example.com", "waveid");
    ViewChannelImpl.setMaxViewChannelsPerWave(Integer.MAX_VALUE);
    waveViewService = new MockWaveViewService();
    viewOpenListener = new MockViewChannelListener();
    channel = new ViewChannelImpl(waveId, waveViewService, logger);
  }
View Full Code Here

    viewOpenListener.expectedCall(MockViewChannelListener.MethodCall.ON_CLOSED);
  }

  public void testCannotCreateTooManyChannels() {
    ViewChannelImpl.setMaxViewChannelsPerWave(4);
    WaveId waveId = WaveId.of("example.com", "toomanywaveid");
    for  (int i = 0; i < 4; i++) {
      channel = new ViewChannelImpl(waveId, waveViewService, logger);
    }
    try {
      channel = new ViewChannelImpl(waveId, waveViewService, logger);
View Full Code Here

      // expected
    }
  }

  public void testClosingOneChannelMakesRoomForAnother() {
    WaveId waveId = WaveId.of("example.com", "makeroomwaveid");
    ViewChannelImpl.setMaxViewChannelsPerWave(4);
    for (int i = 0; i < 4; i++) {
      channel = new ViewChannelImpl(waveId, waveViewService, logger);
    }
    channel.close(); // Close the last channel, making room for another.
View Full Code Here

    int clientInstanceId = 1234;
    GadgetUserPrefs userPrefs = GadgetUserPrefs.create();
    userPrefs.put("pref1", "value1");
    userPrefs.put("pref2", "value2");
    GadgetMetadata metadata = getTestMetadata(xmlSource);
    WaveId waveId = WaveId.of("wave.google.com", "123");
    WaveletId waveletId = WaveletId.of("wave.google.com", "conv+root");
    WaveletName name = WaveletName.of(waveId, waveletId);
    String securityToken = "SECURITY";
    GadgetWidget gadget = GadgetWidget.createForTesting(
        clientInstanceId, userPrefs, name, securityToken, new FakeLocale());
View Full Code Here

  }

  @Override
  public void execute(OperationRequest operation, OperationContext context, ParticipantId participant)
      throws InvalidRequestException {
    WaveId waveId;
    WaveletId waveletId;
    try {
      waveId = ApiIdSerializer.instance().deserialiseWaveId(
        OperationUtil.<String>getRequiredParameter(operation, ParamsProperty.WAVE_ID));
      waveletId = ApiIdSerializer.instance().deserialiseWaveletId(
View Full Code Here

    }

    // Store the temporary id of the wavelet and rootblip so that future
    // operations can reference it.
    try {
      WaveId waveId = ApiIdSerializer.instance().deserialiseWaveId(waveletData.getWaveId());
      WaveletId waveletId =
          ApiIdSerializer.instance().deserialiseWaveletId(waveletData.getWaveletId());
      context.putWavelet(waveId, waveletId, newWavelet);
    } catch (InvalidIdException e) {
      throw new InvalidRequestException("Invalid id", operation, e);
View Full Code Here

  @Override
  protected void setUp() throws Exception {
  }

  public void testConvertOfWaveId() {
    WaveId waveId = DomainConverter.convertWaveId(FROM_WAVE_ID, DOMAIN);
    assertEquals(WAVE_ID, waveId);
  }
View Full Code Here

TOP

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

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.