I've started to clean up my crude unit test application into something
much better.  You can see it here:

  http://www.inuus.com/os/unittest-os.xml

I've settled on the Scriptaculous Unit test framework.  It's pretty
simple and straightforward.  Here's a test stanza:

        testPrefs: function () { with(this) {
           var p = new gadgets.Prefs()
           assertNotNull(p, "cannot get gadgets.Prefs()");

           assertNotNull(p.getCountry());
           assertNotEqual(p.getCountry(), 'all', 'country cannot be "all"');
           testoutput("Found country: '" + p.getCountry() + "'");

           assertNotNull(p.getLang());
           assertNotEqual(p.getLang(), 'all', 'lang cannot be "all"');
           testoutput("Found language: '" + p.getLang() + "'");
        }}


Note that I had patch the gadget server to add a modern doctype (see
patch below).  I recommend we commit this, since it also gets rid of
quirks mode in most browsers.  (See http://en.wikipedia.org/wiki/Quirks_mode)


Index: 
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/GadgetRenderingServlet.java
===================================================================
--- 
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/GadgetRenderingServlet.java
      (revision 619978)
+++ 
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/GadgetRenderingServlet.java
      (working copy)
@@ -158,7 +158,9 @@
     resp.setContentType("text/html");
 
     StringBuilder markup = new StringBuilder();
-    markup.append("<html><head>");
+    markup.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 
Transitional//EN\"\n")
+          
.append("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\";>\n")
+          .append("<html xmlns=\"http://www.w3.org/1999/xhtml\";><head>");
     // TODO: This is so wrong.
     markup.append("<style type=\"text/css\">" +
                   "body,td,div,span,p{font-family:arial,sans-serif;}" +




-- 
Paul Lindner
hi5 Architect
[EMAIL PROTECTED]

Attachment: pgpGAy50oRvar.pgp
Description: PGP signature

Reply via email to