use of alma.demo.XmlComponentOperations in project ACS by ACS-Community.
the class DynamicProxyFactoryTest method testCallGetEntireTreeInAStruct.
public void testCallGetEntireTreeInAStruct() throws DynWrapperException {
XmlComponentOperations serverProxy = createServerProxy();
assertNotNull(serverProxy);
ObsProjectTree struct = serverProxy.getEntireTreeInAStruct();
assertNotNull("returned ObsProjectTree object not null", struct);
assertNotNull("ObsProposal not null", struct.prop);
System.out.println("received ObsProposal as XML: " + struct.prop.xmlString);
assertNotNull("SchedBlockArray not null", struct.schedBlocks);
assertTrue("SchedBlockArray not empty", struct.schedBlocks.length > 0);
// System.out.println();
}
use of alma.demo.XmlComponentOperations in project ACS by ACS-Community.
the class DynamicProxyFactoryTest method testNullXmlEntityReturned.
/**
* When the inner interface returns a <code>null</code> for an XML entity,
* we must still return a non-null XmlEntityStruct, or else
* we'd get a NullPointerException in XmlEntityStructHelper#write
* See http://jira.alma.cl/browse/COMP-1336
*/
public void testNullXmlEntityReturned() throws Exception {
XmlTestComponent compImplWithNullReturn = new DynamicProxyFactoryTest.XmlTestComponent() {
@Override
public SchedBlock getBestSchedBlock() {
// here we return a null instead of a SchedBlock xml binding object
return null;
}
};
XmlComponentOperations serverProxy = (XmlComponentOperations) DynamicProxyFactory.getDynamicProxyFactory(m_logger).createServerProxy(corbaIF, compImplWithNullReturn, compIF);
assertNotNull(serverProxy);
XmlEntityStruct entStruct = serverProxy.getBestSchedBlock();
assertNotNull(entStruct);
assertTrue(entStruct.xmlString.isEmpty());
System.out.println("A null from getBestSchedBlock() was translated to an empty XmlEntityStruct.");
}
use of alma.demo.XmlComponentOperations in project ACS by ACS-Community.
the class DynamicProxyFactoryTest method testCallGetAllSchedBlocks.
public void testCallGetAllSchedBlocks() throws DynWrapperException {
XmlComponentOperations serverProxy = createServerProxy();
assertNotNull(serverProxy);
XmlEntityStruct[] entStructSchedBlocks = serverProxy.getAllSchedBlocks();
assertNotNull(entStructSchedBlocks);
System.out.println("received SchedBlocks as XML: ");
for (int i = 0; i < entStructSchedBlocks.length; i++) {
XmlEntityStruct structSB = entStructSchedBlocks[i];
assertNotNull(structSB);
assertNotNull(structSB.xmlString);
System.out.println(structSB.xmlString);
}
}
use of alma.demo.XmlComponentOperations in project ACS by ACS-Community.
the class DynamicProxyFactoryTest method testCallCreateObsProposal.
public void testCallCreateObsProposal() throws DynWrapperException {
XmlComponentOperations serverProxy = createServerProxy();
assertNotNull(serverProxy);
XmlEntityStruct entStruct = serverProxy.createObsProposal();
assertNotNull(entStruct);
assertNotNull(entStruct.xmlString);
System.out.println("received ObsProposal as XML: " + entStruct.xmlString);
}
Aggregations