public void testSkipComments()
throws Exception
{
//
// Create our PropertyMap (null node).
final PropertyMap properties = new SimplePropertyMap(null);
//
// Create our reader.
final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
new XMLPropertyReaderImpl()
);
//
// Parse the test XML.
reader.read(
new StringResource(
"<!-- skip this comment -->"
+ "<properties xmlns='urn:metagrid'>"
+ " <!-- skip this comment -->"
+ " <property type='urn:metagrid/property/type/frog'>property.frog</property>"
+ " <!-- skip this comment -->"
+ " <property type='urn:metagrid/property/type/toad'>property.toad</property>"
+ " <!-- skip this comment -->"
+ "</properties>"
+ "<!-- skip this comment -->"
).reader(),
properties
);
//
// Check the property values.
assertEquals(
"property.frog",
properties.get(
new URI(
"urn:metagrid/property/type/frog"
)
).value()
);
assertEquals(
"property.toad",
properties.get(
new URI(
"urn:metagrid/property/type/toad"
)
).value()
);