com.verisign.epp.util

## Class XMLParserTst

- java.lang.Object
- - junit.framework.Assert
  - - junit.framework.TestCase
    - - com.verisign.epp.util.XMLParserTst

- All Implemented Interfaces:
    junit.framework.Test

      public class XMLParserTst
      extends junit.framework.TestCase

  JUnit test of XML Parsing implementations used by the EPP SDK. The Test uses a pool of parsers an outputs various performance metrics. Requires the following System Properties to be defined: eppsdk.gen.xml.dir - the directory where EPP XML instance documents are located eppsdk.gen.xml.instance - the XML document to use for the parsing tests eppsdk.gen.xml.test.parserImpl - the DocumentBuilder instance to test eppsdk.gen.xml.test.iterations - the number of times to parse the instance doc per thread. eppsdk.gen.xml.test.threads - the number of threads to use in the test

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `NUM_PARSERS_IN_POOL` Number of parsers that are in the pool used by this test
    `static java.lang.String` | `POOL_NAME` The name of the pool that this test uses to get XML Parsers

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLParserTst(java.lang.String aName, java.lang.String aXmlFile)` Create a new instance of the JUnit test XMLParserTst

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getFileContents(java.lang.String aFilename)` Returns the contents of a file as a `String`
    `static void` | `printResults(java.io.PrintWriter out, java.lang.String uri, long time, int repetition)` Prints the results.
    `protected void` | `setUp()` Setup the test
    `static junit.framework.Test` | `suite()` DOCUMENT ME!
    `protected void` | `tearDown()` Teardown the test
    `void` | `testDomParser()` Tests that a non validating DOMParser instance from Xerces will return a DOM Document
    `void` | `testLockSchemaCache()` Future test
    `void` | `testParsing()` Test using a parser from the pool with multiple threads.
    `void` | `testSchemaNotFoundInClasspath()` Future test
    `void` | `testSetNoSymbolTableSize()` Set the symbol table size to 0 and test parsing with an XMLGrammarCachingConfiguration.
    `void` | `testSetSymbolTableSize()` DOCUMENT ME!
    `void` | `testTurnOffValidation()` Tests turning of the validation feature of the parser

    - ### Methods inherited from class junit.framework.TestCase

      `countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString`

    - ### Methods inherited from class junit.framework.Assert

      `assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### POOL_NAME

          public static final java.lang.String POOL_NAME

      The name of the pool that this test uses to get XML Parsers
      See Also:
        Constant Field Values

    - #### NUM_PARSERS_IN_POOL

          public static final int NUM_PARSERS_IN_POOL

      Number of parsers that are in the pool used by this test
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### XMLParserTst

          public XMLParserTst(java.lang.String aName,
                              java.lang.String aXmlFile)

      Create a new instance of the JUnit test XMLParserTst
      Parameters:
        `aName` - Name of test
        `aXmlFile` - XML file to parse

  - ### Method Detail

    - #### printResults

          public static void printResults(java.io.PrintWriter out,
                                          java.lang.String uri,
                                          long time,
                                          int repetition)

      Prints the results.
      Parameters:
        `out` - Where to print results
        `uri` - Input file
        `time` - Time in millisecond to parse
        `repetition` - How many times processed

    - #### testTurnOffValidation

          public void testTurnOffValidation()

      Tests turning of the validation feature of the parser

    - #### testParsing

          public void testParsing()

      Test using a parser from the pool with multiple threads. Test just displays parse times for the default configuration.

    - #### testSetSymbolTableSize

          public void testSetSymbolTableSize()

      DOCUMENT ME!

    - #### testSetNoSymbolTableSize

          public void testSetNoSymbolTableSize()

      Set the symbol table size to 0 and test parsing with an XMLGrammarCachingConfiguration. Verify the memory usage is low.

    - #### testLockSchemaCache

          public void testLockSchemaCache()

      Future test

    - #### testSchemaNotFoundInClasspath

          public void testSchemaNotFoundInClasspath()

      Future test

    - #### testDomParser

          public void testDomParser()

      Tests that a non validating DOMParser instance from Xerces will return a DOM Document

    - #### suite

          public static junit.framework.Test suite()

      DOCUMENT ME!
      Returns:
        DOCUMENT ME!

    - #### getFileContents

          public java.lang.String getFileContents(java.lang.String aFilename)

      Returns the contents of a file as a `String`
      Parameters:
        `aFilename` - File name to read
      Returns:
        File contents as a `String` if no error; empty string otherwise.

    - #### setUp

          protected void setUp()
                        throws java.lang.Exception

      Setup the test
      Overrides:
        `setUp` in class `junit.framework.TestCase`
      Throws:
        `java.lang.Exception` - Error with setup

    - #### tearDown

          protected void tearDown()
                           throws java.lang.Exception

      Teardown the test
      Overrides:
        `tearDown` in class `junit.framework.TestCase`
      Throws:
        `java.lang.Exception` - Error with teardown