Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 524006425 for ; Wed, 22 Jun 2011 11:53:55 +0000 (UTC) Received: (qmail 21430 invoked by uid 500); 22 Jun 2011 11:53:55 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 21353 invoked by uid 500); 22 Jun 2011 11:53:54 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 21346 invoked by uid 99); 22 Jun 2011 11:53:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 11:53:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 11:53:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4920B23889EC; Wed, 22 Jun 2011 11:53:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1138415 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java Date: Wed, 22 Jun 2011 11:53:33 -0000 To: commits@sling.apache.org From: bdelacretaz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110622115333.4920B23889EC@eris.apache.org> Author: bdelacretaz Date: Wed Jun 22 11:53:32 2011 New Revision: 1138415 URL: http://svn.apache.org/viewvc?rev=1138415&view=rev Log: Make test more robust w.r.t. timing Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java?rev=1138415&r1=1138414&r2=1138415&view=diff ============================================================================== --- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java (original) +++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java Wed Jun 22 11:53:32 2011 @@ -78,7 +78,8 @@ public class JspScriptingTest extends Js } } - /* Verify that overwriting a JSP script changes the output immediately */ + /* Verify that overwriting a JSP script changes the output within a reasonable time + * (might not be immediate as there's some observation and caching involved) */ public void testChangingJsp() throws Exception { String toDelete = null; @@ -86,8 +87,16 @@ public class JspScriptingTest extends Js final String [] scripts = { "jsp1.jsp", "jsp2.jsp" }; for(String script : scripts) { toDelete = uploadTestScript(unstructuredNode.scriptPath, script, "html.jsp"); - final String content = getContent(unstructuredNode.nodeUrl + ".html", CONTENT_TYPE_HTML); + String content = null; final String expected = "text from " + script + ":" + unstructuredNode.testText; + final long timeout = System.currentTimeMillis() + 2000L; + while(System.currentTimeMillis() < timeout) { + content = getContent(unstructuredNode.nodeUrl + ".html", CONTENT_TYPE_HTML); + if(content.contains(expected)) { + break; + } + Thread.sleep(100L); + } assertTrue("Content contains '" + expected + "'(" + content + ")", content.contains(expected)); } } finally {