Search in sources :

Example 31 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class ProcessingDetailsImplTest method testInequalityOfHashCodesForUnequalExceptions.

@Test
public void testInequalityOfHashCodesForUnequalExceptions() {
    String sourceId = "test source";
    List<String> warning = Collections.singletonList("warning");
    Exception exception = new UnsupportedQueryException("We do not support this query");
    Exception differentException = new UnsupportedQueryException("We do not support this query either");
    ProcessingDetails processingDetails = new ProcessingDetailsImpl(sourceId, exception, warning);
    ProcessingDetails processingDetailsWithDifferentException = new ProcessingDetailsImpl(sourceId, differentException, warning);
    assertThat("\nThe hashCodes of ProcessingDetails with unequal exceptions should\n" + "not have been equal, but were.\n", processingDetails.hashCode(), not(processingDetailsWithDifferentException.hashCode()));
}
Also used : UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl) Test(org.junit.Test)

Example 32 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class ProcessingDetailsImplTest method testInequalityOfExceptions.

@Test
public void testInequalityOfExceptions() {
    String sourceId = "test source";
    List<String> warning = Collections.singletonList("warning");
    Exception exception = new UnsupportedQueryException("We do not support this query");
    Exception differentException = new UnsupportedQueryException("We do not support this query either");
    ProcessingDetails processingDetails = new ProcessingDetailsImpl(sourceId, exception, warning);
    ProcessingDetails processingDetailsWithDifferentException = new ProcessingDetailsImpl(sourceId, differentException, warning);
    assertThat(processingDetails, is(not(processingDetailsWithDifferentException)));
}
Also used : UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl) Test(org.junit.Test)

Example 33 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class ProcessingDetailsImplTest method testInequalityOfHashCodesForUnequalSourceIds.

@Test
public void testInequalityOfHashCodesForUnequalSourceIds() {
    String sourceId = "test source";
    String differentSourceId = "different test source";
    Exception exception = new UnsupportedQueryException("We do not support this query");
    List<String> warning = Collections.singletonList("warning");
    ProcessingDetails processingDetails = new ProcessingDetailsImpl(sourceId, exception, warning);
    ProcessingDetails processingDetailsWithDifferentSourceId = new ProcessingDetailsImpl(differentSourceId, exception, warning);
    assertThat("\nThe hashCodes of ProcessingDetails with unequal sourceIds should\n" + "not have been equal, but were.\n", processingDetails.hashCode(), not(processingDetailsWithDifferentSourceId.hashCode()));
}
Also used : UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl) Test(org.junit.Test)

Example 34 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class ProcessingDetailsImplTest method testEquality.

@Test
public void testEquality() {
    Exception exception = new UnsupportedQueryException("We do not support this query");
    ProcessingDetails processingDetails = new ProcessingDetailsImpl("test source", exception, "warning");
    ProcessingDetails identicalProcessingDetails = new ProcessingDetailsImpl("test source", exception, "warning");
    assertThat(processingDetails, is(identicalProcessingDetails));
}
Also used : UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl) Test(org.junit.Test)

Example 35 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class ProcessingDetailsImplTest method testInequalityOfHashCodesForUnequalWarnings.

@Test
public void testInequalityOfHashCodesForUnequalWarnings() {
    String sourceId = "test source";
    Exception exception = new UnsupportedQueryException("We do not support this query");
    List<String> warning = Collections.singletonList("warning");
    List<String> differentWarning = Collections.singletonList("different warning");
    ProcessingDetails processingDetails = new ProcessingDetailsImpl(sourceId, exception, warning);
    ProcessingDetails processingDetailsWithDifferentWarnings = new ProcessingDetailsImpl(sourceId, exception, differentWarning);
    assertThat("\nThe hashCodes of ProcessingDetails with unequal warnings should not\n" + "have been equal, but were.\n", processingDetails.hashCode(), not(processingDetailsWithDifferentWarnings.hashCode()));
}
Also used : UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl) Test(org.junit.Test)

Aggregations

ProcessingDetailsImpl (ddf.catalog.operation.impl.ProcessingDetailsImpl)37 Test (org.junit.Test)19 UnsupportedQueryException (ddf.catalog.source.UnsupportedQueryException)18 ProcessingDetails (ddf.catalog.operation.ProcessingDetails)13 QueryResponseImpl (ddf.catalog.operation.impl.QueryResponseImpl)8 IngestException (ddf.catalog.source.IngestException)8 HashSet (java.util.HashSet)8 QueryRequest (ddf.catalog.operation.QueryRequest)7 SourceResponse (ddf.catalog.operation.SourceResponse)6 Serializable (java.io.Serializable)6 HashMap (java.util.HashMap)6 Tag (io.micrometer.core.instrument.Tag)5 ArrayList (java.util.ArrayList)5 Metacard (ddf.catalog.data.Metacard)4 QueryResponse (ddf.catalog.operation.QueryResponse)4 QueryRequestImpl (ddf.catalog.operation.impl.QueryRequestImpl)4 CatalogStore (ddf.catalog.source.CatalogStore)3 SourceUnavailableException (ddf.catalog.source.SourceUnavailableException)3 ExecutionException (java.util.concurrent.ExecutionException)3 TimeoutException (java.util.concurrent.TimeoutException)3