Search in sources :

Example 96 with Result

use of ddf.catalog.data.Result in project ddf by codice.

the class MetacardValidityFilterPluginTest method testFilterNone.

@Test
public void testFilterNone() throws Exception {
    Result result = mock(Result.class);
    PolicyResponse response = filterPluginResponseHelper(result, getErrorsMetacard(), false, false);
    assertThat(response.itemPolicy().size(), is(0));
    response = filterPluginResponseHelper(result, getWarningsMetacard(), false, false);
    assertThat(response.itemPolicy().size(), is(0));
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) Result(ddf.catalog.data.Result) Test(org.junit.Test)

Example 97 with Result

use of ddf.catalog.data.Result in project ddf by codice.

the class MetacardValidityFilterPluginTest method testInvalidMetacards.

@Test
public void testInvalidMetacards() throws Exception {
    Result result = mock(Result.class);
    PolicyResponse response = filterPluginResponseHelper(result, getErrorsMetacard(), true, false);
    assertThat(response.itemPolicy().get("sample").contains("test1"), is(true));
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) Result(ddf.catalog.data.Result) Test(org.junit.Test)

Example 98 with Result

use of ddf.catalog.data.Result in project ddf by codice.

the class MetacardValidityFilterPluginTest method testFilterErrorsOnly.

@Test
public void testFilterErrorsOnly() throws Exception {
    Result result = mock(Result.class);
    PolicyResponse response = filterPluginResponseHelper(result, getErrorsMetacard(), true, false);
    assertThat(response.itemPolicy().get("sample").contains("test1"), is(true));
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) Result(ddf.catalog.data.Result) Test(org.junit.Test)

Example 99 with Result

use of ddf.catalog.data.Result in project ddf by codice.

the class MetacardValidityFilterPluginTest method testNullMetacard.

@Test
public void testNullMetacard() throws Exception {
    Result result = mock(Result.class);
    PolicyResponse response = filterPluginResponseHelper(result, null, true, false);
    assertThat(response.itemPolicy().isEmpty(), is(true));
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) Result(ddf.catalog.data.Result) Test(org.junit.Test)

Example 100 with Result

use of ddf.catalog.data.Result in project ddf by codice.

the class MetacardValidityFilterPluginTest method testValidMetacards.

@Test
public void testValidMetacards() throws Exception {
    Result result = mock(Result.class);
    PolicyResponse response = filterPluginResponseHelper(result, getValidMetacard(), true, false);
    assertThat(response.itemPolicy().size(), is(0));
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) Result(ddf.catalog.data.Result) Test(org.junit.Test)

Aggregations

Result (ddf.catalog.data.Result)361 Test (org.junit.Test)205 Metacard (ddf.catalog.data.Metacard)159 SourceResponse (ddf.catalog.operation.SourceResponse)153 ArrayList (java.util.ArrayList)137 ResultImpl (ddf.catalog.data.impl.ResultImpl)120 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)119 QueryRequestImpl (ddf.catalog.operation.impl.QueryRequestImpl)102 QueryImpl (ddf.catalog.operation.impl.QueryImpl)91 Filter (org.opengis.filter.Filter)91 QueryResponse (ddf.catalog.operation.QueryResponse)87 QueryRequest (ddf.catalog.operation.QueryRequest)84 QueryResponseImpl (ddf.catalog.operation.impl.QueryResponseImpl)50 Serializable (java.io.Serializable)50 BinaryContent (ddf.catalog.data.BinaryContent)48 HashMap (java.util.HashMap)45 SourceResponseImpl (ddf.catalog.operation.impl.SourceResponseImpl)43 UnsupportedQueryException (ddf.catalog.source.UnsupportedQueryException)39 Map (java.util.Map)36 DateTime (org.joda.time.DateTime)33