assertFalse("Missing namespace.", namespace.trim().isEmpty());
/*
* Get the namespace declared at the package level, and ensure the the
* given namespace is not redundant with that package-level namespace.
*/
final XmlSchema schema = impl.getPackage().getAnnotation(XmlSchema.class);
assertNotNull("Missing @XmlSchema package annotation.", schema);
final String schemaNamespace = schema.namespace();
assertFalse("Missing namespace in @XmlSchema package annotation.", schemaNamespace.trim().isEmpty());
assertFalse("Namespace declaration is redundant with @XmlSchema.", namespace.equals(schemaNamespace));
/*
* Check that the namespace is declared in the package-level @XmlNs annotation.
* We do not verify the validity of those @XmlNs annotations, since this is the
* purpose of the 'testPackageAnnotations()' method.
*/
if (!DEFAULT.equals(namespace)) {
boolean found = false;
for (final XmlNs ns : schema.xmlns()) {
if (namespace.equals(ns.namespaceURI())) {
found = true;
break;
}
}