Search in sources :

Example 1 with FilterToTextDelegate

use of ddf.catalog.filter.delegate.FilterToTextDelegate in project ddf by codice.

the class FilterAdapterTest method assertFilterEquals.

private void assertFilterEquals(String expected, Filter filter) {
    FilterDelegate<String> delegate = new FilterToTextDelegate();
    FilterAdapter fa = new GeotoolsFilterAdapterImpl();
    String result = null;
    try {
        result = fa.adapt(filter, delegate);
    } catch (UnsupportedQueryException e) {
        fail(e.getMessage());
    }
    assertThat(result, is(expected));
}
Also used : FilterToTextDelegate(ddf.catalog.filter.delegate.FilterToTextDelegate) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) FilterAdapter(ddf.catalog.filter.FilterAdapter) GeotoolsFilterAdapterImpl(ddf.catalog.filter.proxy.adapter.GeotoolsFilterAdapterImpl)

Example 2 with FilterToTextDelegate

use of ddf.catalog.filter.delegate.FilterToTextDelegate in project ddf by codice.

the class FilterAdapterTest method assertFilterFails.

private void assertFilterFails(Filter filter) {
    FilterDelegate<String> delegate = new FilterToTextDelegate();
    FilterAdapter fa = new GeotoolsFilterAdapterImpl();
    try {
        fa.adapt(filter, delegate);
        fail("Expected UnsupportedQueryException");
    } catch (UnsupportedQueryException e) {
    // pass
    }
}
Also used : FilterToTextDelegate(ddf.catalog.filter.delegate.FilterToTextDelegate) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) FilterAdapter(ddf.catalog.filter.FilterAdapter) GeotoolsFilterAdapterImpl(ddf.catalog.filter.proxy.adapter.GeotoolsFilterAdapterImpl)

Aggregations

FilterAdapter (ddf.catalog.filter.FilterAdapter)2 FilterToTextDelegate (ddf.catalog.filter.delegate.FilterToTextDelegate)2 GeotoolsFilterAdapterImpl (ddf.catalog.filter.proxy.adapter.GeotoolsFilterAdapterImpl)2 UnsupportedQueryException (ddf.catalog.source.UnsupportedQueryException)2