use of org.codice.alliance.nsili.common.UCO.DAGHolder in project alliance by codice.
the class ProductMgrImplTest method testGetParametersNullDesiredParams.
@Test
public void testGetParametersNullDesiredParams() throws Exception {
MetacardImpl testMetacard = new MetacardImpl();
testMetacard.setId(testMetacardId);
testMetacard.setTitle("JUnit Test Card");
Result testResult = new ResultImpl(testMetacard);
DAG dag = ResultDAGConverter.convertResult(testResult, orb, rootPOA, new ArrayList<>(), new HashMap<>());
Product product = ProductHelper.extract(dag.nodes[0].value);
GetParametersRequest parametersRequest = productMgr.get_parameters(product, null, null);
assertThat(parametersRequest, notNullValue());
DAGHolder dagHolder = new DAGHolder();
parametersRequest.complete(dagHolder);
assertThat(dagHolder, notNullValue());
}
use of org.codice.alliance.nsili.common.UCO.DAGHolder in project alliance by codice.
the class ProductMgrImplTest method testGetParameters.
@Test
public void testGetParameters() throws Exception {
MetacardImpl testMetacard = new MetacardImpl();
testMetacard.setId(testMetacardId);
testMetacard.setTitle("JUnit Test Card");
Result testResult = new ResultImpl(testMetacard);
DAG dag = ResultDAGConverter.convertResult(testResult, orb, rootPOA, new ArrayList<>(), new HashMap<>());
Product product = ProductHelper.extract(dag.nodes[0].value);
GetParametersRequest parametersRequest = productMgr.get_parameters(product, new String[] { "ALL" }, null);
assertThat(parametersRequest, notNullValue());
DAGHolder dagHolder = new DAGHolder();
parametersRequest.complete(dagHolder);
assertThat(dagHolder, notNullValue());
}
use of org.codice.alliance.nsili.common.UCO.DAGHolder in project alliance by codice.
the class SampleNsiliClient method getParameters.
public DAG getParameters(Product product) throws InvalidInputParameter, SystemFault, ProcessingFault {
if (productMgr != null) {
LOGGER.info("Sending Get Parameters Request...");
// CORE, ALL, ORDER
String[] desiredParameters = new String[] { "CORE", "ALL", "ORDER" };
NameValue[] properties = new NameValue[0];
GetParametersRequest getParametersRequest = productMgr.get_parameters(product, desiredParameters, properties);
getParametersRequest.set_user_info(ALLIANCE);
DAGHolder dagHolder = new DAGHolder();
getParametersRequest.complete(dagHolder);
LOGGER.info("Resulting Parameters From Server :");
DAG dag = dagHolder.value;
printDagAttributes(dag);
return dag;
} else {
LOGGER.warn("ProductMgr is not initialized, unable to get parameters");
}
return null;
}
Aggregations