commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/jelly/src/test/org/apache/commons/jelly/core TestFileTag.java
Date Thu, 02 Sep 2004 04:01:24 GMT
dion        2004/09/01 21:01:24

  Modified:    jelly/src/test/org/apache/commons/jelly/core
                        TestFileTag.java
  Log:
  Test showing dom4j is ok and that the bug is with Jelly
  
  Revision  Changes    Path
  1.3       +27 -4     jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestFileTag.java
  
  Index: TestFileTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/core/TestFileTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestFileTag.java	12 Aug 2004 07:03:47 -0000	1.2
  +++ TestFileTag.java	2 Sep 2004 04:01:24 -0000	1.3
  @@ -18,10 +18,16 @@
   import java.io.FileInputStream;
   import java.io.IOException;
   import java.io.InputStream;
  +import java.io.StringWriter;
   
   import junit.framework.TestSuite;
   
   import org.apache.commons.jelly.Script;
  +import org.apache.commons.jelly.XMLOutput;
  +import org.dom4j.io.HTMLWriter;
  +import org.dom4j.io.OutputFormat;
  +import org.dom4j.io.XMLWriter;
  +import org.xml.sax.SAXException;
   
   /**
    * @author <a href="mailto:robert@bull-enterprises.com">Robert McIntosh</a>
  @@ -53,9 +59,7 @@
   
   
           //FIXME This doesn't take into account attribute ordering
  -        //assertEquals("target/testFileTag.tmp", "<html xmlns=\"http://www.w3.org/1999/xhtml\"
 xml:lang=\"en\"  lang=\"en\"></html>", data);
  -
  -        //assertTrue( System.getProperty( "java.runtime.version" ).equals( getJellyContext().getVariable("propertyName"
) ) );
  +        assertEquals("target/testFileTag.tmp", "<html xmlns=\"http://www.w3.org/1999/xhtml\"
 xml:lang=\"en\"  lang=\"en\"></html>", data);
       }
   
       /**
  @@ -78,6 +82,25 @@
               buffer.append(s);
           }
           return buffer.toString();
  +    }
  +
  +    public void testDom4Xmlns() throws SAXException {
  +        StringWriter writer = new StringWriter();
  +        OutputFormat format = new OutputFormat();
  +        final XMLWriter xmlWriter = new HTMLWriter(writer, format);
  +        xmlWriter.setEscapeText(false);
  +
  +        XMLOutput output = new XMLOutput(xmlWriter, xmlWriter);
  +
  +        String golden = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"
lang=\"en\">\n";
  +        golden += "<html>";
  +
  +        output.startDocument();
  +        output.write(golden);
  +        output.endDocument();
  +        System.err.println("output was: '" + writer.toString() +"'");
  +        System.err.println("golden is : '" + golden +"'");
  +        assertEquals("output should contain the namespaces", golden, writer.toString());
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message