jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugo A. Garcia" <hgar...@oogo.net>
Subject Testing Meta Tags
Date Mon, 08 Jul 2002 13:25:43 GMT

Hi

I am using cactus and I am trying to test a meta tag BUT I continously
get a false for isHtml() or an execpection telling me that the content
is not text/html but text/plain.

How do i test meta tags?

here is the code...

import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.cactus.*;
import junit.framework.*;

/**
 * @author Hugo A. Garcia
 * Jul 8, 2002
 **/
public class SimpleTest extends ServletTestCase {

        /**
         * Constructor for SimpleTest.
         * @param arg0
         */
        public SimpleTest(String arg0) {
                super(arg0);
        }

        public void testSendParams() {
                Browse servlet = (Browse) WikiStrategy.create("Browse");
               
        }

        public void endSendParams(com.meterware.httpunit.WebResponse
aWebResponse) {

                assertTrue(aWebResponse.isHTML());

                /*
                try {
                        
                        String[] commandAttribute = null;
                        commandAttribute =
aWebResponse.getMetaTagContent("name", "command");
                        assertEquals("Browse", commandAttribute[0]);
                } catch (SAXException e) {
                        e.printStackTrace();
                }
                */
        }
}


-------------

import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.cactus.*;
import junit.framework.*;

/**
 * @author Hugo A. Garcia
 * Jul 8, 2002
 **/
public class SimpleTest extends ServletTestCase {

        /**
         * Constructor for SimpleTest.
         * @param arg0
         */
        public SimpleTest(String arg0) {
                super(arg0);
        }

        public void testSendParams() {
                Simple servlet = new Simple();                
        }

        public void endSendParams(com.meterware.httpunit.WebResponse
aWebResponse) {

                assertTrue(aWebResponse.isHTML());

                /*
                try {
                        
                        String[] commandAttribute = null;
                        commandAttribute =
aWebResponse.getMetaTagContent("name", "command");
                        assertEquals("Browse", commandAttribute[0]);
                } catch (SAXException e) {
                        e.printStackTrace();
                }
                */
        }
} 


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message