Examples of waitForDone()


Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                    // Create the session on node1
                    ContentExchange exchange1 = new ContentExchange(true);
                    exchange1.setMethod(HttpMethods.GET);
                    exchange1.setURL(urls[0] + "?action=init");
                    client.send(exchange1);
                    exchange1.waitForDone();
                    assert exchange1.getResponseStatus() == HttpServletResponse.SC_OK;
                    String sessionCookie = exchange1.getResponseFields().getStringField("Set-Cookie");
                    assert sessionCookie != null;
                    // Mangle the cookie, replacing Path with $Path, etc.
                    sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path=");
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                    ContentExchange exchange2 = new ContentExchange(true);
                    exchange2.setMethod(HttpMethods.GET);
                    exchange2.setURL(urls[1] + "?action=increment");
                    exchange2.getRequestFields().add("Cookie", sessionCookie);
                    client.send(exchange2);
                    exchange2.waitForDone();
                    assert exchange2.getResponseStatus() == HttpServletResponse.SC_OK;

                    // Invalidate on node1
                    exchange1 = new ContentExchange(true);
                    exchange1.setMethod(HttpMethods.GET);
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                    exchange2 = new ContentExchange(true);
                    exchange2.setMethod(HttpMethods.GET);
                    exchange2.setURL(urls[1] + "?action=test");
                    exchange2.getRequestFields().add("Cookie", sessionCookie);
                    client.send(exchange2);
                    exchange2.waitForDone();
                    assert exchange2.getResponseStatus() == HttpServletResponse.SC_OK;
                }
                finally
                {
                    client.stop();
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                    // Connect to server1 to create a session and get its session cookie
                    ContentExchange exchange1 = new ContentExchange(true);
                    exchange1.setMethod(HttpMethods.GET);
                    exchange1.setURL("http://localhost:" + port1 + contextPath + servletMapping + "?action=init");
                    client.send(exchange1);
                    exchange1.waitForDone();
                    assert exchange1.getResponseStatus() == HttpServletResponse.SC_OK;
                    String sessionCookie = exchange1.getResponseFields().getStringField("Set-Cookie");
                    assert sessionCookie != null;
                    // Mangle the cookie, replacing Path with $Path, etc.
                    sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path=");
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                    ContentExchange exchange2 = new ContentExchange(true);
                    exchange2.setMethod(HttpMethods.GET);
                    exchange2.setURL("http://localhost:" + port2 + contextPath + servletMapping + "?action=check");
                    exchange2.getRequestFields().add("Cookie", sessionCookie);
                    client.send(exchange2);
                    exchange2.waitForDone();
                    assert exchange2.getResponseStatus() == HttpServletResponse.SC_OK;
                }
                finally
                {
                    client.stop();
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

            {
                ContentExchange exchange = new ContentExchange(true);
                exchange.setMethod(HttpMethods.GET);
                exchange.setURL("http://localhost:" + port + contextPath + servletMapping + "?action=create");
                client.send(exchange);
                exchange.waitForDone();
                assert exchange.getResponseStatus() == HttpServletResponse.SC_OK;
                String sessionCookie = exchange.getResponseFields().getStringField("Set-Cookie");
                assert sessionCookie != null;
                // Mangle the cookie, replacing Path with $Path, etc.
                sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path=");
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                exchange = new ContentExchange(true);
                exchange.setMethod(HttpMethods.GET);
                exchange.setURL("http://localhost:" + port + contextPath + servletMapping + "?action=old-create");
                exchange.getRequestFields().add("Cookie", sessionCookie);
                client.send(exchange);
                exchange.waitForDone();
                assert exchange.getResponseStatus() == HttpServletResponse.SC_OK;
            }
            finally
            {
                client.stop();
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                        ContentExchange exchange1 = new ContentExchange( true );
                        exchange1.setMethod( HttpMethods.GET );
                        exchange1.setURL( urls[0] + "?action=init" );
                        client.send( exchange1 );
                        exchange1.waitForDone();
                        assert exchange1.getResponseStatus() == HttpServletResponse.SC_OK;
                        String sessionCookie = exchange1.getResponseFields().getStringField( "Set-Cookie" );
                        assert sessionCookie != null;
                        // Mangle the cookie, replacing Path with $Path, etc.
                        sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path=");
View Full Code Here

Examples of org.mortbay.jetty.client.ContentExchange.waitForDone()

                        ContentExchange exchange2 = new ContentExchange( true );
                        exchange2.setMethod( HttpMethods.GET );
                        exchange2.setURL( urls[0] + "?action=result" );
                        exchange2.getRequestFields().add( "Cookie", sessionCookie );
                        client.send( exchange2 );
                        exchange2.waitForDone();
                        assert exchange2.getResponseStatus() == HttpServletResponse.SC_OK;
                        String response = exchange2.getResponseContent();
                        System.out.println( "get = " + response );
                        assert response.trim().equals( String.valueOf( clientsCount * requestsCount ) );
                    }
View Full Code Here

Examples of org.olat.repository.async.SetAccessBackgroundTask.waitForDone()

  }

  public void setAccess(final RepositoryEntry re, int access ) {
    SetAccessBackgroundTask task = new SetAccessBackgroundTask(re, access);
    BackgroundTaskQueueManager.getInstance().addTask(task);
    task.waitForDone();
  }

  public void setDescriptionAndName(final RepositoryEntry re, String displayName, String description ) {
    SetDescriptionNameBackgroundTask task = new SetDescriptionNameBackgroundTask(re, displayName, description);
    BackgroundTaskQueueManager.getInstance().addTask(task);
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.