xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mk...@apache.org
Subject cvs commit: xml-xalan/test/java/src/org/apache/qetest/xslwrapper XTWrapper.java
Date Wed, 02 Apr 2003 16:15:08 GMT
mkwan       2003/04/02 08:15:07

  Modified:    test/java/src/org/apache/qetest/trax ExamplesTest.java
               test/java/src/org/apache/qetest/xalanj2
                        LoggingPrintTraceListener.java
                        LoggingTraceListener.java SmoketestOuttakes.java
               test/java/src/org/apache/qetest/xsl XSLTestAntTask.java
               test/java/src/org/apache/qetest/xsltc TimeXSLTCDom.java
               test/java/src/org/apache/qetest/xslwrapper XTWrapper.java
  Log:
  Merging XSLTC_DTM and common serializer to the head
  
  Update in the java source files for qetest.
  The changes are required by the new serializer because of
  class refactoring.
  
  Revision  Changes    Path
  1.17      +9 -8      xml-xalan/test/java/src/org/apache/qetest/trax/ExamplesTest.java
  
  Index: ExamplesTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/ExamplesTest.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ExamplesTest.java	31 Jan 2003 15:47:17 -0000	1.16
  +++ ExamplesTest.java	2 Apr 2003 16:15:06 -0000	1.17
  @@ -62,6 +62,7 @@
    */
   package org.apache.qetest.trax;
   
  +// Support for test reporting and harness classes
   import java.io.BufferedInputStream;
   import java.io.BufferedReader;
   import java.io.File;
  @@ -99,9 +100,9 @@
   import org.apache.qetest.OutputNameManager;
   import org.apache.qetest.QetestUtils;
   import org.apache.qetest.xsl.XSLTestfileInfo;
  -import org.apache.xalan.serialize.Serializer;
  -import org.apache.xalan.serialize.SerializerFactory;
  -import org.apache.xalan.templates.OutputProperties;
  +import org.apache.xml.serializer.OutputPropertiesFactory;
  +import org.apache.xml.serializer.Serializer;
  +import org.apache.xml.serializer.SerializerFactory;
   import org.w3c.dom.Node;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  @@ -543,7 +544,7 @@
   
             // Set the result handling to be a serialization to the file output stream.
             Serializer serializer = SerializerFactory.getSerializer
  -                                  (OutputProperties.getDefaultMethodProperties("xml"));
  +                                  (OutputPropertiesFactory.getDefaultMethodProperties("xml"));
             FileOutputStream fos = new FileOutputStream(outNames.nextName());
             serializer.setOutputStream(fos);
             reporter.logStatusMsg("Test-output-to: new FileOutputStream(" + outNames.currentName());
  @@ -616,7 +617,7 @@
             
             // Set the result handling to be a serialization to the file output stream.
             Serializer serializer = SerializerFactory.getSerializer
  -                                  (OutputProperties.getDefaultMethodProperties("xml"));
  +                                  (OutputPropertiesFactory.getDefaultMethodProperties("xml"));
             FileOutputStream fos = new FileOutputStream(outNames.nextName());           
            
             serializer.setOutputStream(fos);
             reporter.logStatusMsg("Test-output-to: new FileOutputStream(" + outNames.currentName());
  @@ -672,7 +673,7 @@
   
             // Set the result handling to be a serialization to the file output stream.
             Serializer serializer = SerializerFactory.getSerializer
  -                                  (OutputProperties.getDefaultMethodProperties("xml"));
  +                                  (OutputPropertiesFactory.getDefaultMethodProperties("xml"));
             FileOutputStream fos = new FileOutputStream(outNames.nextName());
             serializer.setOutputStream(fos);
             reporter.logStatusMsg("Test-output-to: new FileOutputStream(" + outNames.currentName());
  @@ -784,7 +785,7 @@
   
             // Set the result handling to be a serialization to the file output stream.
             Serializer serializer = SerializerFactory.getSerializer
  -                                  (OutputProperties.getDefaultMethodProperties("xml"));
  +                                  (OutputPropertiesFactory.getDefaultMethodProperties("xml"));
             FileOutputStream fos = new FileOutputStream(outNames.nextName());
             serializer.setOutputStream(fos);
             reporter.logStatusMsg("Test-output-to: new FileOutputStream(" + outNames.currentName());
  
  
  
  1.4       +12 -11    xml-xalan/test/java/src/org/apache/qetest/xalanj2/LoggingPrintTraceListener.java
  
  Index: LoggingPrintTraceListener.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xalanj2/LoggingPrintTraceListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LoggingPrintTraceListener.java	31 Jan 2003 15:47:19 -0000	1.3
  +++ LoggingPrintTraceListener.java	2 Apr 2003 16:15:06 -0000	1.4
  @@ -71,6 +71,7 @@
   import org.apache.xalan.trace.PrintTraceListener;
   import org.apache.xalan.trace.SelectionEvent;
   import org.apache.xalan.trace.TracerEvent;
  +import org.apache.xml.serializer.SerializerTrace;
   import org.apache.xpath.axes.ContextNodeList;
   import org.w3c.dom.Node;
   import org.w3c.dom.traversal.NodeIterator;
  @@ -421,45 +422,45 @@
           StringBuffer buf = new StringBuffer("generated:");
           switch (generateEvent.m_eventtype)
           {
  -            case GenerateEvent.EVENTTYPE_STARTDOCUMENT :
  +            case SerializerTrace.EVENTTYPE_STARTDOCUMENT :
                   buf.append("STARTDOCUMENT");
               break;
   
  -            case GenerateEvent.EVENTTYPE_ENDDOCUMENT :
  +            case SerializerTrace.EVENTTYPE_ENDDOCUMENT :
                   buf.append("ENDDOCUMENT");
               break;
   
  -            case GenerateEvent.EVENTTYPE_STARTELEMENT :
  +            case SerializerTrace.EVENTTYPE_STARTELEMENT :
                   buf.append("STARTELEMENT[" + generateEvent.m_name + "]"); // just hardcode
[ LBRACKET ] RBRACKET here
               break;
   
  -            case GenerateEvent.EVENTTYPE_ENDELEMENT :
  +            case SerializerTrace.EVENTTYPE_ENDELEMENT :
                   buf.append("ENDELEMENT[" + generateEvent.m_name + "]");
               break;
   
  -            case GenerateEvent.EVENTTYPE_CHARACTERS :
  +            case SerializerTrace.EVENTTYPE_CHARACTERS :
                   String chars1 = new String(generateEvent.m_characters, generateEvent.m_start,
generateEvent.m_length);
                   buf.append("CHARACTERS[" + chars1 + "]");
               break;
   
  -            case GenerateEvent.EVENTTYPE_CDATA :
  +            case SerializerTrace.EVENTTYPE_CDATA :
                   String chars2 = new String(generateEvent.m_characters, generateEvent.m_start,
generateEvent.m_length);
                   buf.append("CDATA[" + chars2 + "]");
               break;
   
  -            case GenerateEvent.EVENTTYPE_COMMENT :
  +            case SerializerTrace.EVENTTYPE_COMMENT :
                   buf.append("COMMENT[" + generateEvent.m_data + "]");
               break;
   
  -            case GenerateEvent.EVENTTYPE_PI :
  +            case SerializerTrace.EVENTTYPE_PI :
                   buf.append("PI[" + generateEvent.m_name + ", " + generateEvent.m_data +
"]");
               break;
   
  -            case GenerateEvent.EVENTTYPE_ENTITYREF :
  +            case SerializerTrace.EVENTTYPE_ENTITYREF :
                   buf.append("ENTITYREF[" + generateEvent.m_name + "]");
               break;
   
  -            case GenerateEvent.EVENTTYPE_IGNORABLEWHITESPACE :
  +            case SerializerTrace.EVENTTYPE_IGNORABLEWHITESPACE :
                   buf.append("IGNORABLEWHITESPACE");
               break;
           }
  
  
  
  1.8       +12 -11    xml-xalan/test/java/src/org/apache/qetest/xalanj2/LoggingTraceListener.java
  
  Index: LoggingTraceListener.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xalanj2/LoggingTraceListener.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LoggingTraceListener.java	31 Jan 2003 15:47:19 -0000	1.7
  +++ LoggingTraceListener.java	2 Apr 2003 16:15:06 -0000	1.8
  @@ -73,6 +73,7 @@
   import org.apache.xalan.trace.SelectionEvent;
   import org.apache.xalan.trace.TraceListener;
   import org.apache.xalan.trace.TracerEvent;
  +import org.apache.xml.serializer.SerializerTrace;
   import org.apache.xpath.axes.ContextNodeList;
   import org.w3c.dom.Node;
   import org.w3c.dom.traversal.NodeIterator;
  @@ -358,45 +359,45 @@
           StringBuffer buf = new StringBuffer("  <eventtype ");
           switch (generateEvent.m_eventtype)
           {
  -            case GenerateEvent.EVENTTYPE_STARTDOCUMENT :
  +            case SerializerTrace.EVENTTYPE_STARTDOCUMENT :
                   buf.append("type=\"STARTDOCUMENT\">");
               break;
   
  -            case GenerateEvent.EVENTTYPE_ENDDOCUMENT :
  +            case SerializerTrace.EVENTTYPE_ENDDOCUMENT :
                   buf.append("type=\"ENDDOCUMENT\">");
               break;
   
  -            case GenerateEvent.EVENTTYPE_STARTELEMENT :
  +            case SerializerTrace.EVENTTYPE_STARTELEMENT :
                   buf.append("type=\"STARTELEMENT\">" + generateEvent.m_name);
               break;
   
  -            case GenerateEvent.EVENTTYPE_ENDELEMENT :
  +            case SerializerTrace.EVENTTYPE_ENDELEMENT :
                   buf.append("type=\"ENDELEMENT\">" + generateEvent.m_name);
               break;
   
  -            case GenerateEvent.EVENTTYPE_CHARACTERS :
  +            case SerializerTrace.EVENTTYPE_CHARACTERS :
                   String chars1 = new String(generateEvent.m_characters, generateEvent.m_start,
generateEvent.m_length);
                   buf.append("type=\"CHARACTERS\">" + chars1);
               break;
   
  -            case GenerateEvent.EVENTTYPE_CDATA :
  +            case SerializerTrace.EVENTTYPE_CDATA :
                   String chars2 = new String(generateEvent.m_characters, generateEvent.m_start,
generateEvent.m_length);
                   buf.append("type=\"CDATA\">" + chars2);
               break;
   
  -            case GenerateEvent.EVENTTYPE_COMMENT :
  +            case SerializerTrace.EVENTTYPE_COMMENT :
                   buf.append("type=\"COMMENT\">" + generateEvent.m_data);
               break;
   
  -            case GenerateEvent.EVENTTYPE_PI :
  +            case SerializerTrace.EVENTTYPE_PI :
                   buf.append("type=\"PI\">" + generateEvent.m_name + ", " + generateEvent.m_data);
               break;
   
  -            case GenerateEvent.EVENTTYPE_ENTITYREF :
  +            case SerializerTrace.EVENTTYPE_ENTITYREF :
                   buf.append("type=\"ENTITYREF\">" + generateEvent.m_name);
               break;
   
  -            case GenerateEvent.EVENTTYPE_IGNORABLEWHITESPACE :
  +            case SerializerTrace.EVENTTYPE_IGNORABLEWHITESPACE :
                   buf.append("type=\"IGNORABLEWHITESPACE\">");
               break;
           }
  
  
  
  1.9       +6 -5      xml-xalan/test/java/src/org/apache/qetest/xalanj2/SmoketestOuttakes.java
  
  Index: SmoketestOuttakes.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xalanj2/SmoketestOuttakes.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SmoketestOuttakes.java	31 Jan 2003 15:47:19 -0000	1.8
  +++ SmoketestOuttakes.java	2 Apr 2003 16:15:07 -0000	1.9
  @@ -62,6 +62,7 @@
    */
   package org.apache.qetest.xalanj2;
   
  +// Support for test reporting and harness classes
   import java.io.File;
   import java.io.FileOutputStream;
   import java.io.IOException;
  @@ -96,9 +97,9 @@
   import org.apache.qetest.trax.LoggingURIResolver;
   import org.apache.qetest.xsl.LoggingSAXErrorHandler;
   import org.apache.qetest.xsl.XSLTestfileInfo;
  -import org.apache.xalan.serialize.Serializer;
  -import org.apache.xalan.serialize.SerializerFactory;
  -import org.apache.xalan.templates.OutputProperties;
  +import org.apache.xml.serializer.OutputPropertiesFactory;
  +import org.apache.xml.serializer.Serializer;
  +import org.apache.xml.serializer.SerializerFactory;
   import org.w3c.dom.Document;
   import org.w3c.dom.DocumentFragment;
   import org.w3c.dom.Element;
  @@ -213,7 +214,7 @@
   
             // Set the result handling to be a serialization to the file output stream.
             Serializer serializer = SerializerFactory.getSerializer
  -                                  (OutputProperties.getDefaultMethodProperties("xml"));
  +            (OutputPropertiesFactory.getDefaultMethodProperties("xml"));
             FileOutputStream fos = new FileOutputStream(outNames.nextName());
             serializer.setOutputStream(fos);
             reporter.logStatusMsg("Test-output-to: new FileOutputStream(" + outNames.currentName());
  
  
  
  1.8       +17 -15    xml-xalan/test/java/src/org/apache/qetest/xsl/XSLTestAntTask.java
  
  Index: XSLTestAntTask.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/XSLTestAntTask.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSLTestAntTask.java	31 Jan 2003 15:47:22 -0000	1.7
  +++ XSLTestAntTask.java	2 Apr 2003 16:15:07 -0000	1.8
  @@ -56,29 +56,31 @@
    */
   package org.apache.qetest.xsl;
   
  -import java.io.File;
  -import java.io.FileOutputStream;
  -import java.io.IOException;
  -import java.io.PrintStream;
  -import java.util.Enumeration;
  -import java.util.Hashtable;
  -import java.util.Properties;
  -import java.util.Vector;
  -
   import org.apache.qetest.FileBasedTest;
   import org.apache.qetest.Logger;
  +import org.apache.qetest.QetestUtils;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
  -import org.apache.tools.ant.taskdefs.Execute;
  -import org.apache.tools.ant.taskdefs.ExecuteJava;
  -import org.apache.tools.ant.taskdefs.LogStreamHandler;
  -import org.apache.tools.ant.taskdefs.PumpStreamHandler;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Environment;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
  +import org.apache.tools.ant.taskdefs.Execute;
  +import org.apache.tools.ant.taskdefs.ExecuteJava;
  +import org.apache.tools.ant.taskdefs.LogStreamHandler;
  +import org.apache.tools.ant.taskdefs.PumpStreamHandler;
  +
  +import java.io.File;
  +import java.io.FileOutputStream;
  +import java.io.IOException;
  +import java.io.PrintStream;
  +
  +import java.util.Enumeration;
  +import java.util.Hashtable;
  +import java.util.Properties;
  +import java.util.Vector;
   
   /**
    * Execute an instance of an org.apache.qetest.xsl.XSLProcessorTestBase.
  
  
  
  1.4       +7 -17     xml-xalan/test/java/src/org/apache/qetest/xsltc/TimeXSLTCDom.java
  
  Index: TimeXSLTCDom.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsltc/TimeXSLTCDom.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TimeXSLTCDom.java	31 Jan 2003 15:47:24 -0000	1.3
  +++ TimeXSLTCDom.java	2 Apr 2003 16:15:07 -0000	1.4
  @@ -76,10 +76,9 @@
   import org.apache.xalan.xsltc.compiler.XSLTC;
   import org.apache.xalan.xsltc.dom.Axis;
   import org.apache.xalan.xsltc.dom.DOMImpl;
  -import org.apache.xalan.xsltc.dom.DTDMonitor;
   import org.apache.xalan.xsltc.runtime.AbstractTranslet;
  -import org.apache.xalan.xsltc.runtime.DefaultSAXOutputHandler;
  -import org.apache.xalan.xsltc.runtime.TextOutput;
  +import org.apache.xml.serializer.SerializationHandler;
  +import org.apache.xml.serializer.ToTextStream;
   import org.xml.sax.SAXException;
   import org.xml.sax.XMLReader;
   
  @@ -275,20 +274,11 @@
   
   private void doTransform(Translet translet, DOMImpl dom) 
   {
  -    DefaultSAXOutputHandler outputhandlr = null;
  -    TextOutput textoutput = null;
  -    try 
  -    {
  -      outputhandlr= new DefaultSAXOutputHandler(System.out, "utf-8");
  -      textoutput = new TextOutput(outputhandlr, "utf-8");
  -    } 
  +    SerializationHandler textoutput;
       
  -    catch (IOException e) 
  -    {
  -      System.err.println("Could not create SAX Output Handler."+
  -                          e.getMessage());
  -      System.exit(1);
  -    }
  +    textoutput = new ToTextStream();
  +    textoutput.setOutputStream(System.out);
  +    textoutput.setEncoding("utf-8");
     
       // for XSL keys
       AbstractTranslet absTranslet = (AbstractTranslet)translet;
  @@ -308,4 +298,4 @@
       }
   }
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +1 -10     xml-xalan/test/java/src/org/apache/qetest/xslwrapper/XTWrapper.java
  
  Index: XTWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xslwrapper/XTWrapper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XTWrapper.java	27 Jan 2003 18:33:08 -0000	1.3
  +++ XTWrapper.java	2 Apr 2003 16:15:07 -0000	1.4
  @@ -58,20 +58,11 @@
   package org.apache.qetest.xslwrapper;
   
   import java.io.File;
  -import java.io.PrintWriter;
  -
   import java.net.URL;
   import java.util.Hashtable;
   import java.util.Properties;
   
  -// The XT (James Clark) implementation
   import org.xml.sax.InputSource;
  -import org.xml.sax.Parser;
  -
  -import com.jclark.xsl.sax.XMLProcessorEx;
  -import com.jclark.xsl.sax.XSLProcessorImpl;
  -import com.jclark.xsl.sax.OutputMethodHandlerImpl;
  -import com.jclark.xsl.sax.FileDestination;
   
   /**
    * Implementation of TransformWrapper that uses the simplest method 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message