Examples of ConversationID


Examples of org.owasp.webscarab.model.ConversationID

   
    public void run() {
        _runThread = Thread.currentThread();
        _model.setRunning(true);
        int count = 0;
        ConversationID id = null;
        ConversationModel cmodel = _model.getConversationModel();
        while (!_model.isStopping()) {
            try {
                synchronized(_lock) {
                    _lock.wait();
                }
                if (id != _selected) {
                    id = _selected;
                    _model.setBusy(true);
                    HttpUrl baseUrl = cmodel.getRequestUrl(id);
                    if (baseUrl.getQuery() != null)
                      baseUrl = baseUrl.getParentUrl();
                    Response baseResponse = cmodel.getResponse(id);
                    byte[] baseBytes = baseResponse.getContent();
                    String type = baseResponse.getHeader("Content-Type");
                    if (type == null || !type.startsWith("text")) {
                        _logger.warning("Base response is not text, skipping!");
                        return;
                    }
                    List<String> baseline = tokenize(baseBytes);
                    _diff = new LevenshteinDistance<String>(baseline);
                   
                    count = cmodel.getConversationCount();
                    _logger.info("Checking " + count + " conversaitons");
                    for (int i=0; i<count; i++) {
                        ConversationID cid = cmodel.getConversationAt(i);
                        HttpUrl curl = cmodel.getRequestUrl(cid);
                        if (curl.getQuery() != null)
                          curl = curl.getParentUrl();
                        if (!curl.equals(baseUrl))
                          continue;
                        _logger.info("Checking conversation " + i + " == " + cid);
                        if (cid.equals(id)) {
                            _model.setDistance(cid, 0);
                        } else {
                            Response response = cmodel.getResponse(cid);
                            String ctype = response.getHeader("Content-Type");
                            _logger.info("Content-type is " + ctype);
View Full Code Here

Examples of org.owasp.webscarab.model.ConversationID

    }//GEN-END:initComponents
   
    private void requestComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
        Object o = requestComboBox.getSelectedItem();
        if (o instanceof ConversationID) {
            ConversationID id = (ConversationID) o;
            Request request = _model.getConversationModel().getRequest(id);
            _manualRequest.setRequest(request);
        }
    }
View Full Code Here

Examples of org.owasp.webscarab.model.ConversationID

                _logger.info("Selection changed");
                if (e.getValueIsAdjusting()) return;
                int row = conversationTable.getSelectedRow();
                TableModel tm = conversationTable.getModel();
                if (row >-1) {
                    ConversationID id = (ConversationID) tm.getValueAt(row, 0); // UGLY hack! FIXME!!!!
                    _showAction.putValue("CONVERSATION", id);
                    _logger.info("Conversation " + id + " selected");
                } else {
                    _showAction.putValue("CONVERSATION", null);
                }
View Full Code Here

Examples of org.springframework.webflow.conversation.ConversationId

  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 {
View Full Code Here

Examples of org.springframework.webflow.conversation.ConversationId

    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();

    Conversation conversation2 = conversationManager.getConversation(conversationId);
    assertSame(conversation, conversation2);
    conversation2.lock();
    assertEquals("testValue", conversation2.getAttribute("testAttribute"));
View Full Code Here

Examples of org.springframework.webflow.conversation.ConversationId

    ExternalContextHolder.setExternalContext(externalContext);
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();
    ExternalContextHolder.setExternalContext(null);
    // simulate write out of session
    byte[] passiveSession = passivate(externalContext.getSessionMap());

    // simulate start-up of server
    conversationManager = new SessionBindingConversationManager();
    String id = conversationId.toString();
    conversationId = conversationManager.parseConversationId(id);

    // simulate restore of session
    externalContext.setSessionMap(activate(passiveSession));
    ExternalContextHolder.setExternalContext(externalContext);
View Full Code Here

Examples of org.springframework.webflow.conversation.ConversationId

   * @return the governing conversation
   * @throws NoSuchFlowExecutionException when the conversation for identified flow execution cannot be found
   */
  protected Conversation getConversation(FlowExecutionKey key) throws NoSuchFlowExecutionException {
    try {
      ConversationId conversationId = (ConversationId) ((CompositeFlowExecutionKey) key).getExecutionId();
      return conversationManager.getConversation(conversationId);
    } catch (NoSuchConversationException e) {
      throw new NoSuchFlowExecutionException(key, e);
    }
  }
View Full Code Here

Examples of org.springframework.webflow.conversation.ConversationId

  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 {
View Full Code Here

Examples of org.springframework.webflow.conversation.ConversationId

    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();

    Conversation conversation2 = conversationManager.getConversation(conversationId);
    assertSame(conversation, conversation2);
    conversation2.lock();
    assertEquals("testValue", conversation2.getAttribute("testAttribute"));
View Full Code Here

Examples of org.springframework.webflow.conversation.ConversationId

    ExternalContextHolder.setExternalContext(externalContext);
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();
    ExternalContextHolder.setExternalContext(null);
    // simulate write out of session
    byte[] passiveSession = passivate(externalContext.getSessionMap());

    // simulate start-up of server
    conversationManager = new SessionBindingConversationManager();
    String id = conversationId.toString();
    conversationId = conversationManager.parseConversationId(id);

    // simulate restore of session
    externalContext.setSessionMap(activate(passiveSession));
    ExternalContextHolder.setExternalContext(externalContext);
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.