cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject cvs commit: xml-cocoon2/src/test/org/apache/cocoon/components/resolver/test ResolverImplTestCase.java ResolverImplTestCase.xtest package.html
Date Sat, 19 Jan 2002 05:57:19 GMT
crossley    02/01/18 21:57:19

  Modified:    src/test CatalogManager.properties
               src/test/org/apache/cocoon/components/resolver/test
                        ResolverImplTestCase.java
                        ResolverImplTestCase.xtest package.html
  Log:
  Tidy the initial test cases for entity resolver and add more Javadoc stuff.
  
  Revision  Changes    Path
  1.2       +10 -53    xml-cocoon2/src/test/CatalogManager.properties
  
  Index: CatalogManager.properties
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/test/CatalogManager.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CatalogManager.properties	3 Jan 2002 12:31:38 -0000	1.1
  +++ CatalogManager.properties	19 Jan 2002 05:57:18 -0000	1.2
  @@ -1,61 +1,18 @@
  -# CatalogManager.properties
  +# CatalogManager.properties for JUnit test cases
   #
  -# This CatalogManager.properties is loaded by the Resolver used
  -# by the ResolverImpl test case
  +# This CatalogManager.properties is loaded by the Resolver that is
  +# used by the ResolverImpl test case. It is deliberately minimal.
  +# See the main properties file at webapp/resources/entities/
  +#
  +# The definitions here are usually over-ridden by the settings
  +# of each test case. An automatically created OASIS catalog will be
  +# loaded, so there is no need to define one here.
   #
  -# The definition here are usually overridden by the settings
  -# of the single test cases.
  -# version $Id: CatalogManager.properties,v 1.1 2002/01/03 12:31:38 giacomo Exp $
  -# author Bernhard Huber berni_huber@a1.net
  -#
  -# This is the default properties file for Apache Cocoon. This facilitates local
  -# configuration of application-specific catalogs.
  -#
  -# Apache Cocoon will automatically load a default catalog from
  -#  the testcases for ResolverImpl, and CatalogResolver.
  -#
  -# Loading this properties files requires to have the directory
  -# this file residing included in the classpath.
  -#
  -# See the documentation catalog.html, and the resolver documentation
  -# of sun, and Cocoon.
  +# See the Apache Cocoon documentation userdocs/concepts/catalog.html
  +# and thence the Resolver API and accompanying documentation.
   
  -# verbosity ... level of messages for status/debug (messages go to STDOUT)
  -# 0 (none) .. 3 (maximum)
  -# The following messages are provided ...
  -#  0 = none
  -#  1 = ?
  -#  2 = 1+, Loading catalog, Resolved public, Resolved system
  -#  3 = 2+, Catalog does not exist, resolvePublic, resolveSystem
  -#  TODO: determine all messages at each level
  -#
   verbosity=3
  -
  -# catalogs ... list of additional catalogs to load
  -# use full pathnames
  -# pathname separator is always semi-colon (;) regardless of operating system
  -# directory separator is always slash (/) regardless of operating system
  -#
  -#catalogs=/path/to/local/catalog
   catalogs=
  -
  -# prefer ... we prefer to use Public Identifiers for entity resolution
  -#
   prefer=public
  -
  -# static-catalog ... see the Sun doco
  -#  TODO: ? what impact does this setting have for Apache Cocoon
  -#
   static-catalog=yes
  -
  -# allow-oasis-xml-catalog-pi ... see the Sun doco
  -#  TODO: ? what impact does this setting have for Apache Cocoon
  -#
   allow-oasis-xml-catalog-pi=yes
  -
  -# catalog-class-name ... specify an alternate class name to use
  -#  Apache Cocoon does not need this setting - we already have a named class
  -#
  -# catalog-class-name=com.sun.resolver.Resolver
  -
  -
  
  
  
  1.2       +159 -196  xml-cocoon2/src/test/org/apache/cocoon/components/resolver/test/ResolverImplTestCase.java
  
  Index: ResolverImplTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/test/org/apache/cocoon/components/resolver/test/ResolverImplTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResolverImplTestCase.java	3 Jan 2002 12:31:38 -0000	1.1
  +++ ResolverImplTestCase.java	19 Jan 2002 05:57:18 -0000	1.2
  @@ -11,18 +11,13 @@
   import java.io.File;
   import java.io.IOException;
   import java.io.InputStream;
  -
   import java.util.HashMap;
   import java.util.Properties;
  -
   import junit.framework.TestCase;
   import junit.swingui.TestRunner;
  -
   import org.apache.avalon.excalibur.testcase.CascadingAssertionFailedError;
  -
   import org.apache.avalon.excalibur.testcase.ExcaliburTestCase;
   import org.apache.avalon.framework.activity.Disposable;
  -
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -30,216 +25,184 @@
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.parameters.Parameters;
  -
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.resolver.*;
   import org.apache.cocoon.environment.commandline.CommandlineContext;
   import org.apache.cocoon.util.IOUtils;
  -
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
   /**
  - * A simple test case for SimpleLuceneCocoonIndexerImpl.
  + * A test case for components/resolver/ResolverImpl
    *
  - * @author     <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
  - * @version    CVS $Id: ResolverImplTestCase.java,v 1.1 2002/01/03 12:31:38 giacomo Exp
$
  + * @author <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
  + * @version CVS $Id: ResolverImplTestCase.java,v 1.2 2002/01/19 05:57:18 crossley Exp $
    */
   public final class ResolverImplTestCase
            extends ExcaliburTestCase
            implements Initializable, Disposable
   {
       /**
  -     *Description of the Field
  +     * The name of the temporary OASIS Catalog file.
  +     * The file will be automatically created, then removed when the
  +     * test is finished.
        *
        * @since
        */
       protected final static String CATALOG_FILE_NAME = "catalog";
  +
       /**
  -     *Description of the Field
  +     * The name of a temporary character entity set, here ISOnum.
  +     * The file will be automatically created, then removed when the
  +     * test is finished.
        *
        * @since
        */
       protected final static String CATALOG_ISONUM_PEN_FILE_NAME = "ISOnum.pen";
  +
       /**
  -     *Description of the Field
  +     * The contents of the temporary OASIS Catalog file, with just
  +     * sufficient definitions for testing purposes.
        *
        * @since
        */
       protected final static String CATALOG =
  -            "-- this is the default OASIS catalog for Apache Cocoon --\n" +
  -            "\n" +
  -            "OVERRIDE YES\n" +
  -            "\n" +
  -            "-- ISO public identifiers for sets of character entities --\n" +
  -            "PUBLIC \"ISO 8879-1986//ENTITIES Added Latin 1//EN//XML\" \"ISOlat1.pen\"\n"
+
  -            "PUBLIC \"ISO 8879:1986//ENTITIES Added Latin 1//EN//XML\" \"ISOlat1.pen\"\n"
+
  -            "PUBLIC \"ISO 9573-15:1993//ENTITIES Greek Letters//EN//XML\" \"ISOgrk1.pen\"\n"
+
  -            "PUBLIC \"ISO 8879:1986//ENTITIES Publishing//EN//XML\" \"ISOpub.pen\"\n" +
  -            "PUBLIC \"ISO 8879:1986//ENTITIES General Technical//EN//XML\" \"ISOtech.pen\"\n"
+
  -            "PUBLIC \"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML\" \"ISOnum.pen\"\n"
+
  -            "\n" +
  -            "-- Document Type Definitions --\n" +
  -            "PUBLIC \"-//APACHE//DTD Documentation V1.0//EN\" \"document-v10.dtd\"\n" +
  -            "PUBLIC \"-//APACHE//DTD Changes V1.0//EN\" \"changes-v10.dtd\"\n" +
  -            "PUBLIC \"-//APACHE//DTD FAQ V1.0//EN\" \"faq-v10.dtd\"\n" +
  -            "PUBLIC \"-//APACHE//DTD JavaDoc V1.0//EN\" \"javadoc-v04draft.dtd\"\n" +
  -            "PUBLIC \"-//APACHE//DTD Specification V1.0//EN\" \"specification-v10.dtd\"\n"
+
  -            "PUBLIC \"-//APACHE//DTD Todo V1.0//EN\" \"todo-v10.dtd\"\n" +
  -            "PUBLIC \"-//APACHE//DTD Cocoon Sitemap V0.2//EN\" \"sitemap-v02.dtd\"\n" +
  -            "\n" +
  -            "-- enabling validation during Cocoon's own \"build docs\" --\n" +
  -            "--   all *.xml require DTD for validation during \"build docs\" --\n" +
  -            "PUBLIC \"-//APACHE//DTD Cocoon Documentation Book V1.0//EN\" \"book-cocoon-v10.dtd\"\n"
+
  -            "\n" +
  -            "--   Cocoon has extra <label/> element for documentation/svg/label-*.xml
--\n" +
  -            "--   which breaks validation against official svg10.dtd (why extra label?)
--\n" +
  -            "PUBLIC \"-//APACHE//DTD Cocoon SVG minimal V1.1//EN\" \"svg-cocoon-v11.dtd\"\n"
+
  -            "PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"svg10.dtd\"\n" +
  -            "\n" +
  -            "-- other DTDs that are yet without a Public Identifier --\n" +
  -            "-- XMLSchema.dtd .. what is its purpose ? --\n" +
  -            "\n" +
  -            "-- Character entity set that is referenced by some DTDs --\n" +
  -            "-- characters.ent --\n" +
  -            "-- ... has no public identifier --\n" +
  -            "-- should be OK because it will be resolved relative to the DTD --\n" +
  -            "-- ... perhaps the DTD should use the ISO*.pen sets instead? --\n" +
  -            "\n" +
  -            "-- these entries are used for the catalog-demo sample application --\n" +
  -            "OVERRIDE NO\n" +
  -            "PUBLIC \"-//Arbortext//TEXT Test Override//EN\" \"catalog-demo/override.xml\"\n"
+
  -            "OVERRIDE YES\n" +
  -            "PUBLIC \"-//Arbortext//TEXT Test Public Identifier//EN\" \"catalog-demo/testpub.xml\"\n"
+
  -            "SYSTEM \"urn:x-arbortext:test-system-identifier\" \"catalog-demo/testsys.xml\"\n"
+
  -            "PUBLIC \"-//Indexgeo//DTD Catalog Demo v1.0//EN\" \"catalog-demo/catalog-demo-v10.dtd\"\n"
+
  -            "-- end of entries for the catalog-demo sample application --\n" +
  -            "";
  +        "-- OASIS catalog for Apache Cocoon testing purposes --\n" +
  +        "\n" +
  +        "OVERRIDE YES\n" +
  +        "\n" +
  +        "-- ISO public identifiers for sets of character entities --\n" +
  +        "PUBLIC \"ISO 8879:1986//ENTITIES Publishing//EN//XML\" \"ISOpub.pen\"\n" +
  +        "PUBLIC \"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML\" \"ISOnum.pen\"\n"
+
  +        "\n" +
  +        "-- Document Type Definitions --\n" +
  +        "PUBLIC \"-//APACHE//DTD Documentation V1.0//EN\" \"document-v10.dtd\"\n" +
  +        "\n" +
  +        "";
   
       /**
  -     *Description of the Field
  +     * The actual ISOnum character entity set.
        *
        * @since
        */
       protected final static String CATALOG_ISONUM_PEN =
  -            "<!-- (C) International Organization for Standardization 1986\n" +
  -            "Permission to copy in any form is granted for use with\n" +
  -            "conforming SGML systems and applications as defined in\n" +
  -            "ISO 8879, provided this notice is included in all copies.\n" +
  -            "-->\n" +
  -            "<!-- Character entity set. Typical invocation:\n" +
  -            "<!ENTITY % ISOnum PUBLIC\n" +
  -            "\"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML\">\n" +
  -            "%ISOnum;\n" +
  -            "-->\n" +
  -            "<!-- This version of the entity set can be used with any SGML document\n"
+
  -            "which uses ISO 10646 as its document character set.\n" +
  -            "This includes XML documents and ISO HTML documents.\n" +
  -            "This entity set uses hexadecimal numeric character references.\n" +
  -            "          \n" +
  -            "Creator: Rick Jelliffe, Allette Systems\n" +
  -            "     \n" +
  -            "Version: 1997-07-07\n" +
  -            "-->\n" +
  -            "\n" +
  -            "<!ENTITY half   \"&#189;\" ><!--=fraction one-half-->\n" +
  -            "<!ENTITY frac12 \"&#189;\" ><!--=fraction one-half-->\n" +
  -            "<!ENTITY frac14 \"&#188;\" ><!--=fraction one-quarter-->\n"
+
  -            "<!ENTITY frac34 \"&#190;\" ><!--=fraction three-quarters-->\n"
+
  -            "<!ENTITY frac18 \"&#x215B;\" >\n" +
  -            "<!-- or \"&#xB1;&#x202;&#x2044;&#x2088;\" --><!--=fraction
one-eighth-->\n" +
  -            "<!ENTITY frac38 \"&#x215C;\" >\n" +
  -            "<!-- or \"&#xB3;&#x2044;&#x2088;\" --><!--=fraction three-eighths-->\n"
+
  -            "<!ENTITY frac58 \"&#x215D;\" >\n" +
  -            "<!-- or \"&#x2075;&#x2044;&#x2088;\" --><!--=fraction
five-eighths-->\n" +
  -            "<!ENTITY frac78 \"&#x215E;\" >\n" +
  -            "<!-- or \"&#x2077;&#x2044;&#x2088;\" --><!--=fraction
seven-eighths-->\n" +
  -            "\n" +
  -            "<!ENTITY sup1   \"&#185;\" ><!--=superscript one-->\n" +
  -            "<!ENTITY sup2   \"&#178;\" ><!--=superscript two-->\n" +
  -            "<!ENTITY sup3   \"&#179;\" ><!--=superscript three-->\n" +
  -            "\n" +
  -            "<!ENTITY plus   \"+\" ><!--=plus sign B:-->\n" +
  -            "<!ENTITY plusmn \"&#xB1;\" ><!--/pm B: =plus-or-minus sign-->\n"
+
  -            "<!ENTITY lt     \"&#38;#60;\"      ><!--=less-than sign R:-->\n"
+
  -            "<!ENTITY equals \"=\"      ><!--=equals sign R:-->\n" +
  -            "<!ENTITY gt     \">\"      ><!--=greater-than sign R:-->\n"
+
  -            "<!ENTITY divide \"&#247;\" ><!--/div B: =divide sign-->\n"
+
  -            "<!ENTITY times  \"&#215;\" ><!--/times B: =multiply sign-->\n"
+
  -            "\n" +
  -            "<!ENTITY curren \"&#164;\" ><!--=general currency sign-->\n"
+
  -            "<!ENTITY pound  \"&#163;\" ><!--=pound sign-->\n" +
  -            "<!ENTITY dollar \"$\"      ><!--=dollar sign-->\n" +
  -            "<!ENTITY cent   \"&#162;\" ><!--=cent sign-->\n" +
  -            "<!ENTITY yen    \"&#165;\" ><!--/yen =yen sign-->\n" +
  -            "\n" +
  -            "<!ENTITY num    \"#\" ><!--=number sign-->\n" +
  -            "<!ENTITY percnt \"&#37;\" ><!--=percent sign-->\n" +
  -            "<!ENTITY amp    \"&#38;#38;\" ><!--=ampersand-->\n" +
  -            "<!ENTITY ast    \"*\" ><!--/ast B: =asterisk-->\n" +
  -            "<!ENTITY commat \"@\" ><!--=commercial at-->\n" +
  -            "<!ENTITY lsqb   \"[\" ><!--/lbrack O: =left square bracket-->\n"
+
  -            "<!ENTITY bsol   \"\\\" ><!--/backslash =reverse solidus-->\n"
+
  -            "<!ENTITY rsqb   \"]\" ><!--/rbrack C: =right square bracket-->\n"
+
  -            "<!ENTITY lcub   \"{\" ><!--/lbrace O: =left curly bracket-->\n"
+
  -            "<!ENTITY horbar \"&#x2015;\" ><!--=horizontal bar-->\n" +
  -            "<!ENTITY verbar \"|\" ><!--/vert =vertical bar-->\n" +
  -            "<!ENTITY rcub   \"}\" ><!--/rbrace C: =right curly bracket-->\n"
+
  -            "<!ENTITY micro  \"&#181;\" ><!--=micro sign-->\n" +
  -            "<!ENTITY ohm    \"&#2126;\" ><!--=ohm sign-->\n" +
  -            "<!ENTITY deg    \"&#176;\" ><!--=degree sign-->\n" +
  -            "<!ENTITY ordm   \"&#186;\" ><!--=ordinal indicator, masculine-->\n"
+
  -            "<!ENTITY ordf   \"&#170;\" ><!--=ordinal indicator, feminine-->\n"
+
  -            "<!ENTITY sect   \"&#167;\" ><!--=section sign-->\n" +
  -            "<!ENTITY para   \"&#182;\" ><!--=pilcrow (paragraph sign)-->\n"
+
  -            "<!ENTITY middot \"&#183;\" ><!--/centerdot B: =middle dot-->\n"
+
  -            "<!ENTITY larr   \"&#x2190;\" ><!--/leftarrow /gets A: =leftward
arrow-->\n" +
  -            "<!ENTITY rarr   \"&#x2192;\" ><!--/rightarrow /to A: =rightward
arrow-->\n" +
  -            "<!ENTITY uarr   \"&#x2191;\" ><!--/uparrow A: =upward arrow-->\n"
+
  -            "<!ENTITY darr   \"&#x2193;\" ><!--/downarrow A: =downward arrow-->\n"
+
  -            "<!ENTITY copy   \"&#169;\" ><!--=copyright sign-->\n" +
  -            "<!ENTITY reg    \"&#174;\" ><!--/circledR =registered sign-->\n"
+
  -            "<!ENTITY trade  \"&#8482;\" ><!--=trade mark sign-->\n" +
  -            "<!ENTITY brvbar \"&#xA6;\" ><!--=bren (vertical) bar-->\n"
+
  -            "<!ENTITY not    \"&#xAC;\" ><!--/neg /lnot =not sign-->\n"
+
  -            "<!ENTITY sung   \"&#x266A;\" ><!--=music note (sung text sign)-->\n"
+
  -            "\n" +
  -            "<!ENTITY excl   \"!\" ><!--=exclamation mark-->\n" +
  -            "<!ENTITY iexcl  \"&#xA1;\" ><!--=inverted exclamation mark-->\n"
+
  -            "<!ENTITY quot   '\"' ><!--=quotation mark-->\n" +
  -            "<!ENTITY apos   \"'\" ><!--=apostrophe-->\n" +
  -            "<!ENTITY lpar   \"(\" ><!--O: =left parenthesis-->\n" +
  -            "<!ENTITY rpar   \")\" ><!--C: =right parenthesis-->\n" +
  -            "<!ENTITY comma  \",\" ><!--P: =comma-->\n" +
  -            "<!ENTITY lowbar \"_\" ><!--=low line-->\n" +
  -            "<!ENTITY hyphen \"&#x2010;\" ><!--=hyphen-->\n" +
  -            "<!ENTITY period \".\" ><!--=full stop, period-->\n" +
  -            "<!ENTITY sol    \"/\" ><!--=solidus-->\n" +
  -            "<!ENTITY colon  \":\" ><!--/colon P:-->\n" +
  -            "<!ENTITY semi   \";\" ><!--=semicolon P:-->\n" +
  -            "<!ENTITY quest  \"?\" ><!--=question mark-->\n" +
  -            "<!ENTITY iquest \"&#xBF;\" ><!--=inverted question mark-->\n"
+
  -            "<!ENTITY laquo  \"&#x2039;\" ><!--=angle quotation mark, left\n"
+
  -            "But note that Unicode 1 & Maler & el Andaloussi give &#xAB; -->\n"
+
  -            "<!ENTITY raquo  \"&#x203A;\" ><!--=angle quotation mark, right\n"
+
  -            "But note that Unicode 1 & Maler & el Andaloussi give &#xBB; -->\n"
+
  -            "<!ENTITY lsquo  \"&#x2018;\" ><!--=single quotation mark, left-->\n"
+
  -            "<!ENTITY rsquo  \"&#x2019;\" ><!--=single quotation mark, right-->\n"
+
  -            "<!ENTITY ldquo  \"&#x201C;\" ><!--=double quotation mark, left-->\n"
+
  -            "<!ENTITY rdquo  \"&#x201D;\" ><!--=double quotation mark, right-->\n"
+
  -            "<!ENTITY nbsp   \"&#160;\" ><!--=no break (required) space-->\n"
+
  -            "<!ENTITY shy    \"&#173;\" ><!--=soft hyphen-->\n" +
  -            "";
  +        "<!-- (C) International Organization for Standardization 1986\n" +
  +        "Permission to copy in any form is granted for use with\n" +
  +        "conforming SGML systems and applications as defined in\n" +
  +        "ISO 8879, provided this notice is included in all copies.\n" +
  +        "-->\n" +
  +        "<!-- Character entity set. Typical invocation:\n" +
  +        "<!ENTITY % ISOnum PUBLIC\n" +
  +        "\"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML\">\n" +
  +        "%ISOnum;\n" +
  +        "-->\n" +
  +        "<!-- This version of the entity set can be used with any SGML document\n" +
  +        "which uses ISO 10646 as its document character set.\n" +
  +        "This includes XML documents and ISO HTML documents.\n" +
  +        "This entity set uses hexadecimal numeric character references.\n" +
  +        "          \n" +
  +        "Creator: Rick Jelliffe, Allette Systems\n" +
  +        "     \n" +
  +        "Version: 1997-07-07\n" +
  +        "-->\n" +
  +        "\n" +
  +        "<!ENTITY half   \"&#189;\" ><!--=fraction one-half-->\n" +
  +        "<!ENTITY frac12 \"&#189;\" ><!--=fraction one-half-->\n" +
  +        "<!ENTITY frac14 \"&#188;\" ><!--=fraction one-quarter-->\n" +
  +        "<!ENTITY frac34 \"&#190;\" ><!--=fraction three-quarters-->\n"
+
  +        "<!ENTITY frac18 \"&#x215B;\" >\n" +
  +        "<!-- or \"&#xB1;&#x202;&#x2044;&#x2088;\" --><!--=fraction
one-eighth-->\n" +
  +        "<!ENTITY frac38 \"&#x215C;\" >\n" +
  +        "<!-- or \"&#xB3;&#x2044;&#x2088;\" --><!--=fraction three-eighths-->\n"
+
  +        "<!ENTITY frac58 \"&#x215D;\" >\n" +
  +        "<!-- or \"&#x2075;&#x2044;&#x2088;\" --><!--=fraction five-eighths-->\n"
+
  +        "<!ENTITY frac78 \"&#x215E;\" >\n" +
  +        "<!-- or \"&#x2077;&#x2044;&#x2088;\" --><!--=fraction seven-eighths-->\n"
+
  +        "\n" +
  +        "<!ENTITY sup1   \"&#185;\" ><!--=superscript one-->\n" +
  +        "<!ENTITY sup2   \"&#178;\" ><!--=superscript two-->\n" +
  +        "<!ENTITY sup3   \"&#179;\" ><!--=superscript three-->\n" +
  +        "\n" +
  +        "<!ENTITY plus   \"+\" ><!--=plus sign B:-->\n" +
  +        "<!ENTITY plusmn \"&#xB1;\" ><!--/pm B: =plus-or-minus sign-->\n"
+
  +        "<!ENTITY lt     \"&#38;#60;\"      ><!--=less-than sign R:-->\n"
+
  +        "<!ENTITY equals \"=\"      ><!--=equals sign R:-->\n" +
  +        "<!ENTITY gt     \">\"      ><!--=greater-than sign R:-->\n" +
  +        "<!ENTITY divide \"&#247;\" ><!--/div B: =divide sign-->\n" +
  +        "<!ENTITY times  \"&#215;\" ><!--/times B: =multiply sign-->\n"
+
  +        "\n" +
  +        "<!ENTITY curren \"&#164;\" ><!--=general currency sign-->\n" +
  +        "<!ENTITY pound  \"&#163;\" ><!--=pound sign-->\n" +
  +        "<!ENTITY dollar \"$\"      ><!--=dollar sign-->\n" +
  +        "<!ENTITY cent   \"&#162;\" ><!--=cent sign-->\n" +
  +        "<!ENTITY yen    \"&#165;\" ><!--/yen =yen sign-->\n" +
  +        "\n" +
  +        "<!ENTITY num    \"#\" ><!--=number sign-->\n" +
  +        "<!ENTITY percnt \"&#37;\" ><!--=percent sign-->\n" +
  +        "<!ENTITY amp    \"&#38;#38;\" ><!--=ampersand-->\n" +
  +        "<!ENTITY ast    \"*\" ><!--/ast B: =asterisk-->\n" +
  +        "<!ENTITY commat \"@\" ><!--=commercial at-->\n" +
  +        "<!ENTITY lsqb   \"[\" ><!--/lbrack O: =left square bracket-->\n" +
  +        "<!ENTITY bsol   \"\\\" ><!--/backslash =reverse solidus-->\n" +
  +        "<!ENTITY rsqb   \"]\" ><!--/rbrack C: =right square bracket-->\n"
+
  +        "<!ENTITY lcub   \"{\" ><!--/lbrace O: =left curly bracket-->\n" +
  +        "<!ENTITY horbar \"&#x2015;\" ><!--=horizontal bar-->\n" +
  +        "<!ENTITY verbar \"|\" ><!--/vert =vertical bar-->\n" +
  +        "<!ENTITY rcub   \"}\" ><!--/rbrace C: =right curly bracket-->\n" +
  +        "<!ENTITY micro  \"&#181;\" ><!--=micro sign-->\n" +
  +        "<!ENTITY ohm    \"&#2126;\" ><!--=ohm sign-->\n" +
  +        "<!ENTITY deg    \"&#176;\" ><!--=degree sign-->\n" +
  +        "<!ENTITY ordm   \"&#186;\" ><!--=ordinal indicator, masculine-->\n"
+
  +        "<!ENTITY ordf   \"&#170;\" ><!--=ordinal indicator, feminine-->\n"
+
  +        "<!ENTITY sect   \"&#167;\" ><!--=section sign-->\n" +
  +        "<!ENTITY para   \"&#182;\" ><!--=pilcrow (paragraph sign)-->\n"
+
  +        "<!ENTITY middot \"&#183;\" ><!--/centerdot B: =middle dot-->\n"
+
  +        "<!ENTITY larr   \"&#x2190;\" ><!--/leftarrow /gets A: =leftward arrow-->\n"
+
  +        "<!ENTITY rarr   \"&#x2192;\" ><!--/rightarrow /to A: =rightward arrow-->\n"
+
  +        "<!ENTITY uarr   \"&#x2191;\" ><!--/uparrow A: =upward arrow-->\n"
+
  +        "<!ENTITY darr   \"&#x2193;\" ><!--/downarrow A: =downward arrow-->\n"
+
  +        "<!ENTITY copy   \"&#169;\" ><!--=copyright sign-->\n" +
  +        "<!ENTITY reg    \"&#174;\" ><!--/circledR =registered sign-->\n"
+
  +        "<!ENTITY trade  \"&#8482;\" ><!--=trade mark sign-->\n" +
  +        "<!ENTITY brvbar \"&#xA6;\" ><!--=bren (vertical) bar-->\n" +
  +        "<!ENTITY not    \"&#xAC;\" ><!--/neg /lnot =not sign-->\n" +
  +        "<!ENTITY sung   \"&#x266A;\" ><!--=music note (sung text sign)-->\n"
+
  +        "\n" +
  +        "<!ENTITY excl   \"!\" ><!--=exclamation mark-->\n" +
  +        "<!ENTITY iexcl  \"&#xA1;\" ><!--=inverted exclamation mark-->\n"
+
  +        "<!ENTITY quot   '\"' ><!--=quotation mark-->\n" +
  +        "<!ENTITY apos   \"'\" ><!--=apostrophe-->\n" +
  +        "<!ENTITY lpar   \"(\" ><!--O: =left parenthesis-->\n" +
  +        "<!ENTITY rpar   \")\" ><!--C: =right parenthesis-->\n" +
  +        "<!ENTITY comma  \",\" ><!--P: =comma-->\n" +
  +        "<!ENTITY lowbar \"_\" ><!--=low line-->\n" +
  +        "<!ENTITY hyphen \"&#x2010;\" ><!--=hyphen-->\n" +
  +        "<!ENTITY period \".\" ><!--=full stop, period-->\n" +
  +        "<!ENTITY sol    \"/\" ><!--=solidus-->\n" +
  +        "<!ENTITY colon  \":\" ><!--/colon P:-->\n" +
  +        "<!ENTITY semi   \";\" ><!--=semicolon P:-->\n" +
  +        "<!ENTITY quest  \"?\" ><!--=question mark-->\n" +
  +        "<!ENTITY iquest \"&#xBF;\" ><!--=inverted question mark-->\n"
+
  +        "<!ENTITY laquo  \"&#x2039;\" ><!--=angle quotation mark, left\n"
+
  +        "But note that Unicode 1 & Maler & el Andaloussi give &#xAB; -->\n"
+
  +        "<!ENTITY raquo  \"&#x203A;\" ><!--=angle quotation mark, right\n"
+
  +        "But note that Unicode 1 & Maler & el Andaloussi give &#xBB; -->\n"
+
  +        "<!ENTITY lsquo  \"&#x2018;\" ><!--=single quotation mark, left-->\n"
+
  +        "<!ENTITY rsquo  \"&#x2019;\" ><!--=single quotation mark, right-->\n"
+
  +        "<!ENTITY ldquo  \"&#x201C;\" ><!--=double quotation mark, left-->\n"
+
  +        "<!ENTITY rdquo  \"&#x201D;\" ><!--=double quotation mark, right-->\n"
+
  +        "<!ENTITY nbsp   \"&#160;\" ><!--=no break (required) space-->\n"
+
  +        "<!ENTITY shy    \"&#173;\" ><!--=soft hyphen-->\n" +
  +        "";
       private DefaultContext context;
       private ResolverImpl resolverImpl;
       private File workDir;
       private File commandlineContextDir;
   
   
  -
       /**
  -     * Constructor for the SearchGeneratorTestCase object
  +     * Constructor for the ResolverImplTestCase object
        *
        * @since
        */
  @@ -249,7 +212,7 @@
   
   
       /**
  -     * Constructor for the SearchGeneratorTestCase object
  +     * Constructor for the ResolverImplTestCase object
        *
        * @param  name  Description of Parameter
        * @since
  @@ -261,7 +224,7 @@
   
   
       /**
  -     *The main program for the SearchGeneratorTestCase class
  +     * The main program for the ResolverImplTestCase class.
        *
        * @param  args           The command line arguments
        * @exception  Exception  Description of Exception
  @@ -272,9 +235,8 @@
           TestRunner.main(testCaseName);
       }
   
  -
       /**
  -     * The JUnit setup method
  +     * The JUnit setup method. Lookup the resolver role.
        *
        * @exception  Exception  Description of Exception
        * @since
  @@ -282,13 +244,11 @@
       public void setUp() throws Exception {
           super.setUp();
   
  -        // (2) lookup resolver, catalog should exist already
           String role = Resolver.ROLE;
           resolverImpl = (ResolverImpl) manager.lookup(role);
           assertNotNull("ResolverImpl is null", resolverImpl);
       }
   
  -
       /**
        * Invoked before components are created.
        *
  @@ -296,30 +256,31 @@
        * @since
        */
       public void initialize() throws Exception {
  -        workDir = new File(System.getProperty("java.io.tmpdir"), Constants.DEFAULT_WORK_DIR);
  +        workDir = new File(System.getProperty("java.io.tmpdir"),
  +            Constants.DEFAULT_WORK_DIR);
           commandlineContextDir = new File(workDir.getAbsolutePath());
   
           // create catalog releated files in context dir
  -        getLogger().debug("Creating catalog files");
  +        getLogger().debug("Creating test catalog files");
           File f;
           f = IOUtils.createFile(commandlineContextDir, CATALOG_FILE_NAME);
           IOUtils.serializeString(f, CATALOG);
   
  -        f = IOUtils.createFile(commandlineContextDir, CATALOG_ISONUM_PEN_FILE_NAME);
  +        f = IOUtils.createFile(commandlineContextDir,
  +                CATALOG_ISONUM_PEN_FILE_NAME);
           IOUtils.serializeString(f, CATALOG_ISONUM_PEN);
       }
   
  -
       /**
  -     * Invoked after components has been disposed.
  +     * Invoked after components have been disposed.
        *
        * @since
        */
       public void dispose() {
           assertTrue( resolverImpl == null );
   
  -        // remove catalog releated files in context dir
  -        getLogger().debug("Removing catalog files");
  +        // remove catalog related files in context dir
  +        getLogger().debug("Removing test catalog files");
   
           File f;
           f = new File(commandlineContextDir, CATALOG_ISONUM_PEN_FILE_NAME);
  @@ -341,7 +302,6 @@
           }
       }
   
  -
       /**
        * The teardown method for JUnit
        *
  @@ -357,14 +317,17 @@
           }
       }
   
  -
       /**
  -     *A unit test for JUnit
  +     * JUnit test case:
  +     * Ensure CatalogManager.properties configuration file is available.
  +     * This is a mandatory file which must be available on the classpath.
  +     * The properties that are defined for resolver can also be over-ridden
  +     * via cocoon.xconf
        *
        * @exception  Exception  Description of Exception
        * @since
        */
  -    public void testCatalogProperiesAvailable() throws Exception {
  +    public void testCatalogPropertiesAvailable() throws Exception {
           Class clazz = this.getClass();
           String catalog_manager_props_name = "/CatalogManager.properties";
           InputStream is = clazz.getResourceAsStream(catalog_manager_props_name);
  @@ -375,9 +338,9 @@
           is.close();
       }
   
  -
       /**
  -     * A unit test for JUnit
  +     * JUnit test case:
  +     * Ask for an entity using the proper publicId and systemId
        *
        * @exception  Exception  Description of Exception
        * @since
  @@ -396,6 +359,7 @@
                   "'" + system_id + "'", is);
                   
           // close the entity stream, otherwise removing it will fail
  +        // (note that normally the parser would handle this)
           java.io.Reader entity_r = is.getCharacterStream();
           if (entity_r != null) {
               entity_r.close();
  @@ -407,9 +371,9 @@
           is = null;
       }
   
  -
       /**
  -     * A unit test for JUnit
  +     * JUnit test case:
  +     * Ask for an entity using deliberately non-existent publicId and systemId
        *
        * @exception  Exception  Description of Exception
        * @since
  @@ -419,15 +383,14 @@
           String public_id;
           String system_id;
           InputSource is;
  -        public_id = "public-id which does not exist";
  -        system_id = "system-id which does not exist";
  +        public_id = "publicId which does not exist";
  +        system_id = "systemId which does not exist";
           is = resolverImpl.resolveEntity(public_id, system_id);
           assertEquals("InputSource is null for " +
                   "'" + public_id + "'" + ", " +
                   "'" + system_id + "'", null, is);
           is = null;
       }
  -
   
       /**
        * This method may be overwritten by subclasses to put additional objects
  
  
  
  1.2       +1 -2      xml-cocoon2/src/test/org/apache/cocoon/components/resolver/test/ResolverImplTestCase.xtest
  
  Index: ResolverImplTestCase.xtest
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/test/org/apache/cocoon/components/resolver/test/ResolverImplTestCase.xtest,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResolverImplTestCase.xtest	3 Jan 2002 12:31:38 -0000	1.1
  +++ ResolverImplTestCase.xtest	19 Jan 2002 05:57:18 -0000	1.2
  @@ -85,7 +85,7 @@
   
   <testcase>
     <annotation>
  -    Resolver Tests
  +    Test Cases: Catalog Entity Resolver 
     </annotation>
     <logkit>
       <factories>
  @@ -121,7 +121,6 @@
       <resolver>
         <parameter name="verbosity" value="10"/>
         <parameter name="catalog" value="/catalog"/>
  -      <parameter name="local-catalog" value="/local-catalog"/>
       </resolver>
     </components>
   </testcase>
  
  
  
  1.2       +8 -7      xml-cocoon2/src/test/org/apache/cocoon/components/resolver/test/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/test/org/apache/cocoon/components/resolver/test/package.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- package.html	3 Jan 2002 12:31:38 -0000	1.1
  +++ package.html	19 Jan 2002 05:57:18 -0000	1.2
  @@ -1,19 +1,20 @@
   <html>
   <head>
  -  <title>Search</title>
  +  <title>Test Cases: Catalog Entity Resolver</title>
   </head>
   <body>
  -  <h1>Test Cases Search</h1>
  +  <h1>Test Cases: Catalog Entity Resolver</h1>
     <p>
  -    This package provides Cocoon search test cases.
  +    This package provides test cases for the Catalog Entity Resolver.
  +    The API documentation explains each test.
     </p>
  +
  +  <h2>Configuration</h2>
     <p>
       The test cases extends ExcaliburTestCase. 
       Each test case has an associated <code>xtest</code> file, defining
  -    the avalon components needed for the test case.
  -  </p>
  -  <p>
  +    the Avalon components needed for the test case.
       For more information about ExcaliburTestCase see the 
  -    avalon api documentation.
  +    Avalon api documentation.
     </p>
   </body>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message