Examples of Conversation


Examples of org.simpleframework.http.core.Conversation

   public void testTransferEncoding() throws IOException {
      MockChannel channel = new MockChannel(null);
      MockMonitor monitor = new MockMonitor();
      MockRequest request = new MockRequest();
      MockResponse response = new MockResponse();
      Conversation support = new Conversation(request, response);
      Transfer transfer = new Transfer(response, support, channel, monitor);
     
      // Start a HTTP/1.1 conversation
      request.setMajor(1);
      request.setMinor(1);
      transfer.start();
     
      assertEquals(response.getValue("Connection"), "keep-alive");
      assertEquals(response.getValue("Transfer-Encoding"), "chunked");
      assertEquals(response.getValue("Content-Length"), null);
      assertEquals(response.getContentLength(), -1);
      assertTrue(response.isCommitted());
     
      channel = new MockChannel(null);
      monitor = new MockMonitor();
      request = new MockRequest();
      response = new MockResponse();
      support = new Conversation(request, response);
      transfer = new Transfer(response, support, channel, monitor);
     
      // Start a HTTP/1.0 conversation
      request.setMajor(1);
      request.setMinor(0);
View Full Code Here

Examples of org.springframework.webflow.conversation.Conversation

    ExternalContextHolder.setExternalContext(null);
  }

  public void testConversationLifeCycle() {
    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    ConversationId conversationId = conversation.getId();
    assertNotNull(conversationManager.getConversation(conversationId));
    conversation.lock();
    conversation.end();
    conversation.unlock();
    try {
      conversationManager.getConversation(conversationId);
      fail("Conversation should have ben removed");
    } catch (ConversationException e) {
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

    }
  }

  public void testPutNonTemporaryBlip() throws Exception {
    // Non temporary blip is ignored
    Conversation conversation = mock(Conversation.class);
    ConversationBlip blip = mock(ConversationBlip.class);
    String blipId = "b+1234";
    when(blip.getId()).thenReturn(blipId);
    when(conversation.getBlip(blipId)).thenReturn(blip);

    operationContext.putBlip(blip.getId(), blip);
    assertEquals(operationContext.getBlip(conversation, blipId), blip);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

    operationContext.putBlip(blip.getId(), blip);
    assertEquals(operationContext.getBlip(conversation, blipId), blip);
  }

  public void testPutTemporaryBlip() throws Exception {
    Conversation conversation = mock(Conversation.class);
    ConversationBlip blip = mock(ConversationBlip.class);
    String tempBlipId = OperationContextImpl.TEMP_ID_MARKER + "random";
    String blipId = "b+1234";
    when(blip.getId()).thenReturn(blipId);
    when(conversation.getBlip(blipId)).thenReturn(blip);

    operationContext.putBlip(tempBlipId, blip);
    assertEquals("Expected blip for the given tempId",
        operationContext.getBlip(conversation, tempBlipId), blip);
    assertEquals("Expected blip when its non temporary id is given",
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

  }

  @Override
  public R render(ConversationView wave) {
    IdentityMap<Conversation, R> conversations = CollectionUtils.createIdentityMap();
    Conversation c = structure.getMainConversation();
    if (c != null) {
      conversations.put(c, render(c));
    }
    return builders.render(wave, conversations);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

      WaveViewImpl<?> wave = WaveViewImpl.create(
          waveletFactory, waveData.getWaveId(), gen, sampleAuthor, WaveletConfigurator.ADD_CREATOR);

      // Build a conversation in that wave.
      ConversationView v = WaveBasedConversationView.create(wave, gen);
      Conversation c = v.createRoot();
      ConversationThread root = c.getRootThread();
      sampleReply(root.appendBlip());
      write(root.appendBlip());
      write(root.appendBlip());
      write(root.appendBlip());
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

    processConversationView(model);
  }

  public void processConversationView(ConversationView view) {
    generator.startView(view);
    Conversation root = structure.getMainConversation();
    if (root != null) {
      processConversation(root);
    }
    generator.endView(view);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

  protected abstract BlockStructure create(ConversationView model);

  private static ConversationView createSample() {
    ConversationView v = FakeConversationView.builder().build();
    Conversation c = v.createRoot();
    ConversationThread root = c.getRootThread();
    sampleReply(root.appendBlip());
    root.appendBlip();
    root.appendBlip();
    biggerSampleReply(root.appendBlip());
    root.appendBlip();
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

        timer, wave, views, populator, replyHandler, readMonitor, profiles, supplement).init();
  }

  private FakeConversationView createWave() {
    FakeConversationView wave = FakeConversationView.builder().build();
    Conversation c = wave.createRoot();
    ConversationBlip b1 = c.getRootThread().appendBlip();
    ConversationBlip b2 = c.getRootThread().appendBlip();
    write(b1, "First blip");
    write(b2, "Second blip");
    ConversationThread b1t1 = b1.addReplyThread(5);
    write(b1t1.appendBlip(), "First reply");
    ConversationThread b1t2 = b1.addReplyThread();
View Full Code Here

Examples of org.waveprotocol.wave.model.conversation.Conversation

  @Override
  protected void setUp() {
    traverser = new ViewTraverser();
    wave = org.waveprotocol.wave.model.conversation.testing.FakeConversationView.builder().build();
    Conversation main = wave.createRoot();
    renderer = FakeRenderer.create(wave);
    c = (FakeTopConversationView) renderer.render(main);
  }
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.