Package

com.github.eerohele

expek

Permalink

package expek

Visibility
  1. Public
  2. All

Type Members

  1. case class MockFile(uri: URI, elem: Elem)(fs: FileSystem) extends Product with Serializable

    Permalink

    A mock file that lives in a Jimfs file system.

    A mock file that lives in a Jimfs file system.

    uri

    The URI of the mock file.

    elem

    The XML (Elem) content of the file.

  2. sealed class SchemaAwareFactoryAdapter extends NoBindingFactoryAdapter

    Permalink
  3. sealed class SchemaValidationMatcher[T <: Transformation] extends Matcher[T] with MatchResultCombinators

    Permalink

    A specs2 matcher that validates the result of an XSLT transformation against an XML Schema.

    A specs2 matcher that validates the result of an XSLT transformation against an XML Schema.

    To validate an element against an XML Schema, that element must have a top-level definition in the schema.

  4. trait SchemaValidationMatchers extends AnyRef

    Permalink

    Specs2 matchers that validate the result of an XSLT transformation against an XML Schema.

  5. trait Transformation extends AnyRef

    Permalink

    A trait that represents an XML transformation.

    A trait that represents an XML transformation. Any class that wants to be matched by a XsltResultMatchers must extends this trait.

  6. class TransientOutputURIResolver extends StandardOutputResolver

    Permalink

    A StandardOutputResolver that resolves all URIs to point to a new file on the supplied Jimfs file system.

    A StandardOutputResolver that resolves all URIs to point to a new file on the supplied Jimfs file system.

    If you configure Saxon to use this URI resolver, any document created via <xsl:result-document> will be saved on the given transient file system.

  7. class TransientURIResolver extends CatalogResolver

    Permalink

    A CatalogResolver that resolves any URI that uses the Jimfs.URI_SCHEME scheme against a Jimfs filesystem.

    A CatalogResolver that resolves any URI that uses the Jimfs.URI_SCHEME scheme against a Jimfs filesystem.

    For any other type of URI, it delegates to CatalogResolver.

  8. trait ValidatingXsltSpecification extends XsltSpecification with SchemaValidationMatchers

    Permalink

    An XsltSpecification that validates the result against outputSchema without having to explicitly add beValid to every test.

  9. class XPathResultMatcher[T <: Transformation] extends Matcher[T] with MatchResultCombinators

    Permalink

    A specs2 matcher that validates the result of an XSLT transformation against an XPath expression.

    A specs2 matcher that validates the result of an XSLT transformation against an XPath expression.

    TODO: There's duplicate code between this and SchemaValidationMatcher.

  10. trait XPathSupport extends AnyRef

    Permalink

    A trait that contains XPath-related methods.

  11. sealed class XsltResultMatcher[T <: Transformation] extends Matcher[T] with MatchResultCombinators

    Permalink

    A specs2 matcher that matches against the result of an XSLT transformation.

    A specs2 matcher that matches against the result of an XSLT transformation.

    The result of an XSLT transformation can either be a node, which can be one of:

    • Element
    • Document
    • Processing instruction
    • Text
    • Attribute
    • Comment

    Or it can be an atomic value, which, when converted into a native Java type, can be one of:

    • String
    • BigInteger
    • BigDecimal
    • Double
    • Float
    • Boolean
    • QName
    • URI

    Element and document nodes are converted into Source so that we can compare them with XMLUnit.

    Node instances in the expected Vector are also converted into a Source so that we can compare those to XSLT transformation results.

    Other node types are kept as is and we compare their string representations.

    Atomic values that are the result of an XSLT transformation are converted to native Java types with Saxon's XdmAtomicValue.getValue() method and compared to the expected values.

  12. trait XsltResultMatchers extends AnyRef

    Permalink

    A trait you can mix in to your specs2 specification to compare the results of Transformation instances to a sequence of expected values.

  13. trait XsltSpecification extends XsltResultMatchers with XPathSupport with XsltSupport

    Permalink

    A specification for testing an XSLT stylesheet.

    A specification for testing an XSLT stylesheet.

    Classes that mix in this trait must define stylesheet, which is a File instance that points to the stylesheet that you want to test.

  14. trait XsltSupport extends AnyRef

    Permalink

    A trait that lets you run XSLT transformations.

Value Members

  1. object Any2Xdm

    Permalink

    Methods for converting Java values into XML data model (XDM) values.

  2. object MockFile extends Serializable

    Permalink
  3. object ResolvingXMLLoader

    Permalink

    Functions for converting an XML file into a Node with catalog resolving enabled.

    Functions for converting an XML file into a Node with catalog resolving enabled.

    You must set the xml.catalog.files system property for this to work at all.

    Code 100% stolen from http://horstmann.com/unblog/2011-12-12/catalog.html.

  4. object SchemaAwareXMLLoader

    Permalink

    An XML loader that takes a Node and an XML Schema and returns the same node after validating it and loading any possible default attributes that the schema defines for the input node.

    An XML loader that takes a Node and an XML Schema and returns the same node after validating it and loading any possible default attributes that the schema defines for the input node.

    Example:

    SchemaAwareXMLLoader(<ph> ... </ph>, Input.fromFile("/path/to/dita/topic.xsd"))
    // The  element with the default DITA @class attribute value loaded from the given schema.
    => <ph class="- topic/ph "> ... </ph>
  5. object TransientFileSystem

    Permalink

    Functions for operating on files in a Jimfs file system.

Ungrouped