1 12 13 17 package com.openedit.page.finder; 18 19 import com.openedit.BaseTestCase; 20 import com.openedit.OpenEditException; 21 import com.openedit.WebPageRequest; 22 23 24 29 public class InfiniteLoopTest extends BaseTestCase 30 { 31 32 37 public InfiniteLoopTest(String arg0) 38 { 39 super(arg0); 40 } 41 42 47 public void testLoadingATemplate() throws Throwable 48 { 49 String path = "/normal.html"; 50 51 loadPage(path); 52 } 53 54 59 public void XXXtestLoop() throws Throwable 60 { 61 String path = "/selfreferingtest1.html"; 62 boolean exceptionThrown = false; 63 try 64 { 65 loadPage(path); 66 } 67 catch (OpenEditException e) 68 { 69 exceptionThrown = true; 70 } 71 assertTrue(exceptionThrown); 72 } 73 74 79 public void testNormalTemplatedPage() throws Throwable 80 { 81 String path = "/defaulttemplate.html"; 82 83 loadPage(path); 84 } 85 86 protected void loadPage(String path) throws Exception , OpenEditException, Throwable 87 { 88 WebPageRequest context = getFixture().createPageRequest(path); 89 90 getFixture().getEngine().beginRender(context); 91 String pageContents = context.getWriter().toString(); 92 assertTrue(pageContents.length() < 100000); } 94 } 95 | Popular Tags |