Search in sources :

Example 6 with XmlComponentOperations

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();
}
Also used : XmlComponentOperations(alma.demo.XmlComponentOperations) ObsProjectTree(alma.demo.ObsProjectTree)

Example 7 with XmlComponentOperations

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.");
}
Also used : XmlComponentOperations(alma.demo.XmlComponentOperations) XmlEntityStruct(alma.xmlentity.XmlEntityStruct)

Example 8 with XmlComponentOperations

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);
    }
}
Also used : XmlComponentOperations(alma.demo.XmlComponentOperations) XmlEntityStruct(alma.xmlentity.XmlEntityStruct)

Example 9 with XmlComponentOperations

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);
}
Also used : XmlComponentOperations(alma.demo.XmlComponentOperations) XmlEntityStruct(alma.xmlentity.XmlEntityStruct)

Aggregations

XmlComponentOperations (alma.demo.XmlComponentOperations)9 XmlEntityStruct (alma.xmlentity.XmlEntityStruct)6 XmlEntityStructHolder (alma.xmlentity.XmlEntityStructHolder)3 AcsJJavaComponentHelperEx (alma.JavaContainerError.wrappers.AcsJJavaComponentHelperEx)1 ObsProjectTree (alma.demo.ObsProjectTree)1 XmlComponentJ (alma.demo.XmlComponentJ)1 AcsJComponentCreationEx (alma.maciErrType.wrappers.AcsJComponentCreationEx)1 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)1 MarshalException (org.exolab.castor.xml.MarshalException)1