Return-Path: Delivered-To: apmail-incubator-ace-commits-archive@minotaur.apache.org Received: (qmail 48754 invoked from network); 4 Oct 2009 19:13:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Oct 2009 19:13:25 -0000 Received: (qmail 44610 invoked by uid 500); 4 Oct 2009 19:13:25 -0000 Delivered-To: apmail-incubator-ace-commits-archive@incubator.apache.org Received: (qmail 44591 invoked by uid 500); 4 Oct 2009 19:13:25 -0000 Mailing-List: contact ace-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ace-dev@incubator.apache.org Delivered-To: mailing list ace-commits@incubator.apache.org Received: (qmail 44581 invoked by uid 99); 4 Oct 2009 19:13:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Oct 2009 19:13:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Sun, 04 Oct 2009 19:13:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 190C4238889C; Sun, 4 Oct 2009 19:12:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r821579 - /incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java Date: Sun, 04 Oct 2009 19:12:31 -0000 To: ace-commits@incubator.apache.org From: marrs@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091004191231.190C4238889C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: marrs Date: Sun Oct 4 19:12:30 2009 New Revision: 821579 URL: http://svn.apache.org/viewvc?rev=821579&view=rev Log: Updated the LogIntegrationTest to really retry reading the audit log and not breaking the loop by putting asserts inside it. Modified: incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java Modified: incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java?rev=821579&r1=821578&r2=821579&view=diff ============================================================================== --- incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java (original) +++ incubator/ace/trunk/test/src/org/apache/ace/test/log/LogIntegrationTest.java Sun Oct 4 19:12:30 2009 @@ -77,21 +77,25 @@ boolean found = false; long startTime = System.currentTimeMillis(); - while ((!found) && (System.currentTimeMillis() - startTime < 2000)) { + while ((!found) && (System.currentTimeMillis() - startTime < 5000)) { // synchronize again m_auditLogSyncTask.run(); // get and evaluate results (note that there is some concurrency that might interfere with this test) List ranges2 = m_serverStore.getDescriptors(); - assert ranges2.size() == 1 : "We should still have audit log events for one gateway on the server, but found " + ranges2.size(); - LogDescriptor range = ranges2.get(0); - List events = m_serverStore.get(range); - assert events.size() > 1 : "We should have a couple of events, at least more than the one we added ourselves."; - for (LogEvent event : events) { - if (event.getType() == 12345) { - assert event.getProperties().get("two").equals("value2") : "We could not retrieve a property of our audit log event."; - found = true; - break; + if (ranges2.size() > 0) { +// assert ranges2.size() == 1 : "We should still have audit log events for one gateway on the server, but found " + ranges2.size(); + LogDescriptor range = ranges2.get(0); + List events = m_serverStore.get(range); + if (events.size() > 1) { +// assert events.size() > 1 : "We should have a couple of events, at least more than the one we added ourselves."; + for (LogEvent event : events) { + if (event.getType() == 12345) { + assert event.getProperties().get("two").equals("value2") : "We could not retrieve a property of our audit log event."; + found = true; + break; + } + } } } @@ -100,7 +104,7 @@ try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException ie) {} } } - assert found : "We could not retrieve our audit log event (after 2 seconds)."; + assert found : "We could not retrieve our audit log event (after 5 seconds)."; } public void testServlet() throws Exception {