use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswCqlFilter method testPropertyIsLessThanOrEqualToFloatLiteral.
@Test
public void testPropertyIsLessThanOrEqualToFloatLiteral() throws UnsupportedQueryException {
FilterType filterType = cswFilterDelegate.propertyIsLessThanOrEqualTo(propertyName, floatLiteral);
String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
assertThat(propertyIsLessThanOrEqualToWithDecimal, is(cqlText));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswCqlFilter method testDuring.
@Test
public void testDuring() throws UnsupportedQueryException {
DateTime startDate = new DateTime(2013, 5, 1, 0, 0, 0, 0);
DateTime endDate = new DateTime(2013, 12, 31, 0, 0, 0, 0);
CswSourceConfiguration cswSourceConfiguration = initCswSourceConfiguration(CswAxisOrder.LAT_LON, CswConstants.CSW_TYPE, effectiveDateMapping, createdDateMapping, modifiedDateMapping, CswConstants.CSW_IDENTIFIER);
CswFilterDelegate cswFilterDelegate = initDefaultCswFilterDelegate(cswSourceConfiguration);
FilterType filterType = cswFilterDelegate.during(propertyNameModified, startDate.toCalendar(null).getTime(), endDate.toCalendar(null).getTime());
String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
String startDateStr = fmt.print(startDate);
String endDateStr = fmt.print(endDate);
String testResponse = during.replace(REPLACE_START_DATE, startDateStr).replace(REPLACE_END_DATE, endDateStr).replace(REPLACE_TEMPORAL_PROPERTY, modifiedDateMapping);
assertThat(testResponse, is(cqlText));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswCqlFilter method testPropertyIsEqualToStringLiteralType.
@Test
public void testPropertyIsEqualToStringLiteralType() throws UnsupportedQueryException {
FilterType filterType = cswFilterDelegate.propertyIsEqualTo(Metacard.CONTENT_TYPE, contentTypeLiteral, isCaseSensitive);
String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
assertThat(propertyIsEqualToContentType, is(cqlText));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswCqlFilter method testDuringAlteredEffectiveDateMapping.
@Test
public void testDuringAlteredEffectiveDateMapping() throws UnsupportedQueryException {
DateTime startDate = new DateTime(2013, 5, 1, 0, 0, 0, 0);
DateTime endDate = new DateTime(2013, 12, 31, 0, 0, 0, 0);
String replacedTemporalProperty = "myEffectiveDate";
CswSourceConfiguration cswSourceConfiguration = initCswSourceConfiguration(CswAxisOrder.LAT_LON, CswConstants.CSW_TYPE, replacedTemporalProperty, createdDateMapping, modifiedDateMapping, CswConstants.CSW_IDENTIFIER);
CswFilterDelegate cswFilterDelegate = initDefaultCswFilterDelegate(cswSourceConfiguration);
FilterType filterType = cswFilterDelegate.during(propertyNameEffective, startDate.toCalendar(null).getTime(), endDate.toCalendar(null).getTime());
String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
String startDateStr = fmt.print(startDate);
String endDateStr = fmt.print(endDate);
String testResponse = during.replace(REPLACE_START_DATE, startDateStr).replace(REPLACE_END_DATE, endDateStr).replace(REPLACE_TEMPORAL_PROPERTY, replacedTemporalProperty);
assertThat(testResponse, is(cqlText));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswCqlFilter method testPropertyIsEqualToDateLiteral.
/**
* Verify that when given a non ISO 8601 formatted date, the CswFilterDelegate converts the date
* to ISO 8601 format (ie. the xml generated off of the filterType should have an ISO 8601
* formatted date in it).
*/
@Test
public void testPropertyIsEqualToDateLiteral() throws UnsupportedQueryException {
LOGGER.debug("Input date: {}", date);
LOGGER.debug("ISO 8601 formatted date: {}", convertDateToIso8601Format(getDate()));
FilterType filterType = cswFilterDelegate.propertyIsEqualTo(propertyName, date);
String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
assertThat(propertyIsEqualToWithDate, is(cqlText));
}
Aggregations