use of org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest in project ddf by codice.
the class TestCswEndpoint method testDescribeRecordMultipleTypesMultipleNamespacesNominal.
@Test
public void testDescribeRecordMultipleTypesMultipleNamespacesNominal() {
DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
drr.setTypeName(VALID_PREFIX_LOCAL_TYPE + ",csw:test");
drr.setNamespace("xmlns(" + VALID_PREFIX + "=" + CswConstants.CSW_OUTPUT_SCHEMA + ")");
DescribeRecordResponseType drrt = null;
try {
drrt = csw.describeRecord(drr);
} catch (CswException e) {
fail("DescribeRecord failed with message '" + e.getMessage() + "'");
}
assertThat(drrt, notNullValue());
assertThat(drrt.getSchemaComponent(), notNullValue());
List<SchemaComponentType> schemaComponents = drrt.getSchemaComponent();
assertThat(schemaComponents.size(), is(1));
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest in project ddf by codice.
the class TestCswEndpoint method testDescribeRecordValidSchemaLanguage.
@Test
public void testDescribeRecordValidSchemaLanguage() {
DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
drr.setTypeName(VALID_PREFIX_LOCAL_TYPE);
drr.setSchemaLanguage(CswConstants.SCHEMA_LANGUAGE_X_SCHEMA);
DescribeRecordResponseType drrt = null;
try {
drrt = csw.describeRecord(drr);
} catch (CswException e) {
fail("DescribeRecord failed with message '" + e.getMessage() + "'");
}
assertThat(drrt, notNullValue());
assertThat(drrt.getSchemaComponent(), notNullValue());
List<SchemaComponentType> schemaComponents = drrt.getSchemaComponent();
assertThat(schemaComponents.size(), is(1));
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest in project ddf by codice.
the class TestCswEndpoint method testDescribeRecordMultipleTypesMultipleNamespacesMultiplePrefixesMismatchedPrefix.
@Test
public void testDescribeRecordMultipleTypesMultipleNamespacesMultiplePrefixesMismatchedPrefix() {
DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
drr.setTypeName(VALID_PREFIX_LOCAL_TYPE + ",csw3:test4");
drr.setNamespace("xmlns(" + VALID_PREFIX + "=" + CswConstants.CSW_OUTPUT_SCHEMA + ")" + "," + "xmlns(" + "csw2" + "=" + CswConstants.CSW_OUTPUT_SCHEMA + "2" + ")");
try {
csw.describeRecord(drr);
fail("Should have thrown an exception indicating an invalid type.");
} catch (CswException e) {
LOGGER.info("Correctly got exception " + e.getMessage());
return;
}
fail("Should have gotten exception.");
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest in project ddf by codice.
the class TestCswEndpoint method testDescribeRecordOnlyLocalPartMultipleTypes.
@Test(expected = CswException.class)
public void testDescribeRecordOnlyLocalPartMultipleTypes() throws CswException {
DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
drr.setTypeName(VALID_TYPE + ",test,test2");
drr.setNamespace(null);
csw.describeRecord(drr);
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest in project ddf by codice.
the class TestCswEndpoint method testDescribeRecordMultipleTypesMultipleNamespacesMultiplePrefixes.
@Test
public void testDescribeRecordMultipleTypesMultipleNamespacesMultiplePrefixes() {
DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
drr.setTypeName(VALID_PREFIX_LOCAL_TYPE + ",csw2:test4");
drr.setNamespace("xmlns(" + VALID_PREFIX + "=" + CswConstants.CSW_OUTPUT_SCHEMA + ")" + "," + "xmlns(" + "csw2" + "=" + CswConstants.CSW_OUTPUT_SCHEMA + "2" + ")");
DescribeRecordResponseType drrt = null;
try {
drrt = csw.describeRecord(drr);
} catch (CswException e) {
fail("DescribeRecord failed with message '" + e.getMessage() + "'");
}
assertThat(drrt, notNullValue());
assertThat(drrt.getSchemaComponent(), notNullValue());
List<SchemaComponentType> schemaComponents = drrt.getSchemaComponent();
assertThat(schemaComponents.size(), is(1));
}
Aggregations