01: package org.nanocontainer.webcontainer;
02:
03: import java.io.IOException;
04: import java.net.URL;
05:
06: import junit.framework.TestCase;
07:
08: import org.mortbay.util.IO;
09:
10: public abstract class WebContainerTestCase extends TestCase {
11:
12: protected String getPage(String url) throws IOException,
13: InterruptedException {
14: try {
15: return IO.toString(new URL(url).openStream());
16: } catch (Exception e) {
17: Thread.sleep(2 * 1000);
18: try {
19: return IO.toString(new URL(url).openStream());
20: } catch (Exception e1) {
21: return e1.getClass().getName() + ":" + e1.getMessage();
22: }
23: }
24: }
25:
26: }
|