001    package com.mockrunner.base;
002    
003    import java.io.BufferedReader;
004    
005    /**
006     * Delegator for {@link HTMLOutputModule}. The corresponding
007     * adapters extend this class. This class is used for the standard
008     * adapter versions, that extend {@link BaseTestCase}.
009     */
010    public abstract class HTMLOutputTestCase extends WebTestCase
011    {
012        public HTMLOutputTestCase()
013        {
014    
015        }
016    
017        public HTMLOutputTestCase(String arg0)
018        {
019            super(arg0);
020        }
021    
022        protected WebTestModule getWebTestModule()
023        {
024            return getHTMLOutputModule();
025        }
026        
027        /**
028         * Implemented by concrete subclasses.
029         */ 
030        protected abstract HTMLOutputModule getHTMLOutputModule();
031        
032        /**
033         * Delegates to {@link HTMLOutputModule#getOutput}
034         */ 
035        protected String getOutput()
036        {
037            return getHTMLOutputModule().getOutput();
038        }
039    
040        /**
041         * Delegates to {@link HTMLOutputModule#getOutputAsBufferedReader}
042         */
043        protected BufferedReader getOutputAsBufferedReader()
044        {
045            return getHTMLOutputModule().getOutputAsBufferedReader();  
046        }
047    
048        /**
049         * Delegates to {@link HTMLOutputModule#getOutputAsW3CDocument}
050         */
051        protected org.w3c.dom.Document getOutputAsW3CDocument()
052        {
053            return getHTMLOutputModule().getOutputAsW3CDocument();
054        }
055    
056        /**
057         * Delegates to {@link HTMLOutputModule#getOutputAsJDOMDocument}
058         */
059        protected org.jdom.Document getOutputAsJDOMDocument()
060        {
061            return getHTMLOutputModule().getOutputAsJDOMDocument();
062        }
063    
064        /**
065         * Delegates to {@link HTMLOutputModule#getOutputAsWellformedXML}
066         */
067        protected String getOutputAsWellformedXML()
068        {
069            return getHTMLOutputModule().getOutputAsWellformedXML();
070        }
071        
072        /**
073         * Delegates to {@link HTMLOutputModule#setCaseSensitive}
074         */
075        protected void setCaseSensitive(boolean caseSensitive)
076        {
077            getHTMLOutputModule().setCaseSensitive(caseSensitive);
078        }
079        
080        /**
081         * Delegates to {@link HTMLOutputModule#verifyOutput}
082         */
083        protected void verifyOutput(String expectedOutput)
084        {
085            getHTMLOutputModule().verifyOutput(expectedOutput);
086        }
087        
088        /**
089         * Delegates to {@link HTMLOutputModule#verifyOutputContains}
090         */
091        protected void verifyOutputContains(String expectedOutput)
092        {
093            getHTMLOutputModule().verifyOutputContains(expectedOutput);
094        }
095        
096        /**
097         * Delegates to {@link HTMLOutputModule#verifyOutputRegularExpression}
098         */
099        protected void verifyOutputRegularExpression(String expression)
100        {
101            getHTMLOutputModule().verifyOutputRegularExpression(expression);
102        }
103    }