use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class NsiliSourceTest method testQueryAnyText.
@Test
public void testQueryAnyText() throws Exception {
QueryImpl propertyIsLikeQuery = new QueryImpl(builder.attribute(Metacard.ANY_TEXT).is().like().text("%"));
SourceResponse sourceResponse = source.query(new QueryRequestImpl(propertyIsLikeQuery));
ArgumentCaptor<Query> argumentCaptor = ArgumentCaptor.forClass(Query.class);
verify(catalogMgr).submit_query(argumentCaptor.capture(), any(String[].class), any(SortAttribute[].class), any(NameValue[].class));
assertThat(sourceResponse.getHits(), is(LONG));
assertThat(argumentCaptor.getValue().bqs_query, is(GMTI_LIKE_FILTER));
}
use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class AccessManagerImplTest method setUp.
@Before
public void setUp() throws Exception {
setupCommonMocks();
setupAccessMgrMocks();
try {
setupOrb();
orbRunThread = new Thread(() -> orb.run());
orbRunThread.start();
} catch (InvalidName | AdapterInactive | WrongPolicy | ServantNotActive e) {
LOGGER.error("Unable to start the CORBA server", e);
} catch (IOException e) {
LOGGER.error("Unable to generate the IOR file", e);
} catch (SecurityServiceException e) {
LOGGER.error("Unable to setup guest security credentials", e);
}
testQuery = new Query(NsiliConstants.NSIL_ALL_VIEW, bqsQuery);
String managerId = UUID.randomUUID().toString();
accessManager = new AccessManagerImpl();
accessManager.setFilterBuilder(new GeotoolsFilterBuilder());
accessManager.setCatalogFramework(mockCatalogFramework);
if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), accessManager);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.error("Error activating ProductMgr: {}", e);
}
}
rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
}
use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class CatalogMgrImplTest method setUp.
@Before
public void setUp() throws Exception {
setupCommonMocks();
setupCatalogMgrMocks();
try {
setupOrb();
orbRunThread = new Thread(() -> orb.run());
orbRunThread.start();
} catch (InvalidName | AdapterInactive | WrongPolicy | ServantNotActive e) {
LOGGER.error("Unable to start the CORBA server", e);
} catch (IOException e) {
LOGGER.error("Unable to generate the IOR file", e);
} catch (SecurityServiceException e) {
LOGGER.error("Unable to setup guest security credentials", e);
}
testQuery = new Query(NsiliConstants.NSIL_ALL_VIEW, bqsQuery);
catalogMgr = new CatalogMgrImpl(rootPOA, new GeotoolsFilterBuilder(), null);
catalogMgr.setCatalogFramework(mockCatalogFramework);
}
use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class StandingQueryMgrImplTest method testSubmitStandingQuery.
@Test
public void testSubmitStandingQuery() throws InvalidInputParameter, SystemFault, ProcessingFault {
String[] resultAttributes = new String[0];
SortAttribute[] sortAttributes = new SortAttribute[0];
LifeEvent start = new LifeEvent();
start.at(LifeEventType.ABSOLUTE_TIME, new AbsTime(new Date((short) 2016, (short) 05, (short) 01), new Time((short) 00, (short) 00, (short) 00)));
LifeEvent stop = new LifeEvent();
stop.at(LifeEventType.ABSOLUTE_TIME, new AbsTime(new Date((short) 2050, (short) 05, (short) 01), new Time((short) 00, (short) 00, (short) 00)));
LifeEvent frequency1 = new LifeEvent();
frequency1.rt(LifeEventType.RELATIVE_TIME, new Time((short) 00, (short) 01, (short) 00));
LifeEvent[] frequency = new LifeEvent[] { frequency1 };
QueryLifeSpan lifeSpan = new QueryLifeSpan(start, stop, frequency);
Query query = new Query(NsiliConstants.NSIL_ALL_VIEW, bqsQuery);
SubmitStandingQueryRequest request = standingQueryMgr.submit_standing_query(query, resultAttributes, sortAttributes, lifeSpan, new NameValue[0]);
assertThat(request, notNullValue());
}
use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class SubmitStandingQueryRequestImplTest method getQuery.
private Query getQuery() {
Query query = new Query();
query.bqs_query = "NSIL_CARD.identifier like '%'";
query.view = NsiliConstants.NSIL_ALL_VIEW;
return query;
}
Aggregations