1 16 package org.apache.cocoon; 17 18 23 public class Bug26186InternalRequestMemoryLeakTestCase 24 extends HtmlUnitTestCase 25 { 26 static final String pageurl = "/samples/blocks/xsp/java/resolver"; 27 28 public void testMemoryLeak() 29 throws Exception 30 { 31 final int iterations = Integer.parseInt(System.getProperty("htmlunit.test.Bug26186InternalRequestMemoryLeak.iterations")); 32 33 final String phrase = "An XSP Page using a source"; 34 for( int i = 0; i < iterations; i++ ) { 35 loadResponse(pageurl); 36 assertEquals("Status code", 200, response.getStatusCode()); 37 assertTrue("Content should contain: "+phrase, 38 response.getContentAsString().indexOf(phrase) != -1); 39 40 if( (i+1)%100 == 0 ) { 41 logger.info("Memory leak checking "+(i+1)+" of "+iterations+" iterations"); 42 } 43 } 44 } 45 } 46 | Popular Tags |