use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeBadSection.
@Test
public void testGetCapabilitiesTypeBadSection() {
// Shouldn't return any sections
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList("bad"));
gct.setSections(stv);
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
verifyFilterCapabilities(ct);
assertThat(ct.getServiceIdentification(), nullValue());
assertThat(ct.getServiceProvider(), nullValue());
assertThat(ct.getOperationsMetadata(), nullValue());
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException in project ddf by codice.
the class TestCswEndpoint method testCapabilitiesRequestBadSection.
@Test
public void testCapabilitiesRequestBadSection() {
// Shouldn't return any sections
GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
gcr.setSections("bad");
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gcr);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
assertThat(ct.getOperationsMetadata(), nullValue());
assertThat(ct.getServiceIdentification(), nullValue());
assertThat(ct.getServiceProvider(), nullValue());
verifyFilterCapabilities(ct);
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException in project ddf by codice.
the class TestCswEndpoint method testPostDescribeRecordRequestGMDTypePassed.
@Test
public void testPostDescribeRecordRequestGMDTypePassed() {
DescribeRecordType drt = createDefaultDescribeRecordType();
List<QName> typeNames = new ArrayList<>();
typeNames.add(new QName(GmdConstants.GMD_NAMESPACE, GmdConstants.GMD_LOCAL_NAME, GmdConstants.GMD_PREFIX));
drt.setTypeName(typeNames);
DescribeRecordResponseType drrt = null;
try {
drrt = csw.describeRecord(drt);
} catch (CswException e) {
fail("CswException caught during describeRecord POST request: " + 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.CswException 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.CswException in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeServiceIdentification.
@Test
public void testGetCapabilitiesTypeServiceIdentification() {
// Should only return the ServiceIdentification section
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList(CswEndpoint.SERVICE_IDENTIFICATION));
gct.setSections(stv);
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
verifyServiceIdentification(ct);
verifyFilterCapabilities(ct);
assertThat(ct.getServiceProvider(), nullValue());
assertThat(ct.getOperationsMetadata(), nullValue());
}
Aggregations