Package org.opensaml.core.testing

# Class XMLObjectProviderBaseTestCase

java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.core.testing.XMLObjectProviderBaseTestCase

public abstract class XMLObjectProviderBaseTestCase extends XMLObjectBaseTestCase
Base test case for `XMLObject`s in XMLTooling for which we need a full set of object provider tests, i.e marshalling and unmarshalling of single elements; with optional attributes; and with child elements.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`childElementsFile`
Location of file containing a single element with child elements.
`protected Document`
`expectedChildElementsDOM`
The expected result of a marshalled single element with child elements.
`protected Document`
`expectedDOM`
The expected result of a marshalled single element with no optional attributes.
`protected Document`
`expectedOptionalAttributesDOM`
The expected result of a marshalled single element with all optional attributes.
`protected Document`
`expectedUnknownAttributesDOM`
The expected result of a marshalled single element some unknown attributes.
`protected Document`
`invalidDOM`
The result of parsing the invalid file.
`protected String`
`invalidFile`
Location of file containing some kind of invalid content.
`protected String`
`singleElementFile`
Location of file containing a single element with NO optional attributes.
`protected String`
`singleElementOptionalAttributesFile`
Location of file containing a single element with all optional attributes.
`protected String`
`singleElementUnknownAttributesFile`
Location of file containing a single element with some unknown attributes.

### Fields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase

`builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory`

## Constructor Summary

Constructors
Constructor
Description
`XMLObjectProviderBaseTestCase()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`initXMLObjectProviderTestingSupprt()`
Init testing fields.
`void`
`testAttributeIDnessMarshall(XMLObject target, String idValue)`
Test marshalling of attribute IDness.
`void`
`testChildElementsMarshall()`
Tests marshalling the contents of a single element with child elements to a DOM document.
`void`
`testChildElementsUnmarshall()`
Tests unmarshalling a document that contains a single element with children.
`abstract void`
`testSingleElementMarshall()`
Tests marshalling the contents of a single element, with no optional attributes, to a DOM document.
`void`
`testSingleElementOptionalAttributesMarshall()`
Tests marshalling the contents of a single element, with all optional attributes, to a DOM document.
`void`
`testSingleElementOptionalAttributesUnmarshall()`
Tests unmarshalling a document that contains a single element (no children) with all that element's optional attributes.
`void`
`testSingleElementUnknownAttributesMarshall()`
Tests marshalling the contents of a single element, some unknown attributes, to a DOM document.
`void`
`testSingleElementUnknownAttributesUnmarshall()`
Tests unmarshalling a document that contains a single element (no children) with all that element's optional attributes.
`abstract void`
`testSingleElementUnmarshall()`
Tests unmarshalling a document that contains a single element (no children) with no optional attributes.

### Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase

`assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement`

### Methods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase

`initOpenSAML`

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

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

## Field Details

### singleElementFile

protected String singleElementFile
Location of file containing a single element with NO optional attributes.

### singleElementOptionalAttributesFile

protected String singleElementOptionalAttributesFile
Location of file containing a single element with all optional attributes.

### singleElementUnknownAttributesFile

protected String singleElementUnknownAttributesFile
Location of file containing a single element with some unknown attributes.

### childElementsFile

protected String childElementsFile
Location of file containing a single element with child elements.

### invalidFile

protected String invalidFile
Location of file containing some kind of invalid content.

### expectedDOM

protected Document expectedDOM
The expected result of a marshalled single element with no optional attributes.

### expectedOptionalAttributesDOM

protected Document expectedOptionalAttributesDOM
The expected result of a marshalled single element with all optional attributes.

### expectedUnknownAttributesDOM

protected Document expectedUnknownAttributesDOM
The expected result of a marshalled single element some unknown attributes.

### expectedChildElementsDOM

protected Document expectedChildElementsDOM
The expected result of a marshalled single element with child elements.

### invalidDOM

protected Document invalidDOM
The result of parsing the invalid file.

## Constructor Details

### XMLObjectProviderBaseTestCase

public XMLObjectProviderBaseTestCase()

## Method Details

### initXMLObjectProviderTestingSupprt

@BeforeClass protected void initXMLObjectProviderTestingSupprt() throws Exception
Init testing fields.

Throws:
  `Exception` - on error

### testSingleElementUnmarshall

public abstract void testSingleElementUnmarshall()
Tests unmarshalling a document that contains a single element (no children) with no optional attributes.

### testSingleElementOptionalAttributesUnmarshall

public void testSingleElementOptionalAttributesUnmarshall()
Tests unmarshalling a document that contains a single element (no children) with all that element's optional attributes.

### testSingleElementUnknownAttributesUnmarshall

public void testSingleElementUnknownAttributesUnmarshall()
Tests unmarshalling a document that contains a single element (no children) with all that element's optional attributes.

### testChildElementsUnmarshall

public void testChildElementsUnmarshall()
Tests unmarshalling a document that contains a single element with children.

### testSingleElementMarshall

public abstract void testSingleElementMarshall()
Tests marshalling the contents of a single element, with no optional attributes, to a DOM document.

### testSingleElementOptionalAttributesMarshall

public void testSingleElementOptionalAttributesMarshall()
Tests marshalling the contents of a single element, with all optional attributes, to a DOM document.

### testSingleElementUnknownAttributesMarshall

public void testSingleElementUnknownAttributesMarshall()
Tests marshalling the contents of a single element, some unknown attributes, to a DOM document.

### testChildElementsMarshall

public void testChildElementsMarshall()
Tests marshalling the contents of a single element with child elements to a DOM document.

### testAttributeIDnessMarshall

public void testAttributeIDnessMarshall(@Nonnull XMLObject target, String idValue) throws MarshallingException, XMLParserException
Test marshalling of attribute IDness.

Parameters:
  `target` - target object
  `idValue` - ID value
Throws:
  `MarshallingException`
  `XMLParserException`