use of ddf.catalog.source.SourceDescriptor in project ddf by codice.
the class SourceInfoResponseImplTest method testSourceInfoResponse.
@Test
public void testSourceInfoResponse() {
SourceDescriptor[] expectedDescriptorArr = new SourceDescriptor[] { firstSource, nextSource, lastSource };
SourceInfoResponse response = new SourceInfoResponseImpl(new SourceInfoRequestLocal(false), null, sourceDescriptors);
Set<SourceDescriptor> sources = response.getSourceInfo();
assertArrayEquals(expectedDescriptorArr, sources.toArray(new SourceDescriptor[sources.size()]));
}
use of ddf.catalog.source.SourceDescriptor in project ddf by codice.
the class SourceInfoResponseImplTest method setup.
@Before
public void setup() {
firstSource = new SourceDescriptorImpl("aSource", null);
nextSource = new SourceDescriptorImpl("BSource", null);
lastSource = new SourceDescriptorImpl("cSource", null);
sourceDescriptors = new TreeSet<SourceDescriptor>(new SourceDescriptorComparator());
sourceDescriptors.add(lastSource);
sourceDescriptors.add(firstSource);
sourceDescriptors.add(nextSource);
}
use of ddf.catalog.source.SourceDescriptor in project ddf by codice.
the class SourceInfoResponseImplTest method testSourceInfoResponseNullSourceId.
@Test
public void testSourceInfoResponseNullSourceId() {
SourceDescriptor desc = new SourceDescriptorImpl(null, null);
sourceDescriptors.add(desc);
SourceDescriptor[] expectedDescriptorArr = new SourceDescriptor[] { firstSource, nextSource, lastSource, desc };
SourceInfoResponse response = new SourceInfoResponseImpl(new SourceInfoRequestLocal(true), null, sourceDescriptors);
Set<SourceDescriptor> sources = response.getSourceInfo();
assertArrayEquals(expectedDescriptorArr, sources.toArray(new SourceDescriptor[sources.size()]));
}
Aggregations