return super.resolveEntity(publicId, systemId);
}
}
});
JNDIBindings bindings = (JNDIBindings) unmarshaller.unmarshal(is2,
new SchemaBindingResolver(){
public String getBaseURI()
{
throw new UnsupportedOperationException("getBaseURI is not implemented.");
}
public void setBaseURI(String baseURI)
{
throw new UnsupportedOperationException("setBaseURI is not implemented.");
}
public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
{
return XsdBinder.bind(url.toExternalForm() + schemaLocation, this);
}
public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
{
throw new UnsupportedOperationException("resolveAsLSInput is not implemented.");
}
});
is2.close();
// Validate the bindings
JNDIBinding[] values = bindings.getBindings();
assertTrue("There are 5 bindings("+values.length+")", values.length == 5);
JNDIBinding key1 = values[0];
assertTrue("values[0] name is ctx1/key1", key1.getName().equals("ctx1/key1"));
assertTrue("values[0] is string of value1", key1.getText().equals("value1"));