Search in sources :

Example 1 with ComponentWithXmlOffshootJ

use of alma.demo.ComponentWithXmlOffshootJ in project ACS by ACS-Community.

the class ComponentWithXmlOffshootClientTest method testOffshootJFromComponentJ.

public void testOffshootJFromComponentJ() throws Exception {
    ComponentWithXmlOffshootJ componentWithXmlOffshootJ = getContainerServices().getTransparentXmlWrapper(ComponentWithXmlOffshootJ.class, componentWithXmlOffshoot, ComponentWithXmlOffshootOperations.class);
    assertNotNull(componentWithXmlOffshootJ);
// The code below is commented since getting the offshootJ from the
// componentJ is not yet supported.
// Once supported, this code should work fine, and the test should pass
/*
		XmlOffshootJ shootJ = xmlComponentJ.getOffshoot();
		assertNotNull(shootJ);
		assertNotNull(shootJ.getObsProposal());
		assertNotNull(shootJ.getSchedBlock());

		// these values are hardcoded in the m_offshoot implementation
		ObsProposal obsProposal = shootJ.getObsProposal();
		assertEquals("rtobar", obsProposal.getPI());
		assertEquals("2010.0045.34S", obsProposal.getCode());
		assertEquals("just for fun", obsProposal.getScientificJustification());

		SchedBlock sb = shootJ.getSchedBlock();
		assertEquals("holography", sb.getName());
		assertEquals("DONE", sb.getStatus());
		assertEquals(true, sb.getStandardMode());

		// deactivate the m_offshoot on the server-side
		xmlComponentJ.deactivateOffshoot();
		try {
			shootJ.getObsProposal();
			fail("m_offshoot should be deactivated, I shouldn't be able to use it");
		} catch(org.omg.CORBA.OBJECT_NOT_EXIST e) {}
		*/
}
Also used : ComponentWithXmlOffshootJ(alma.demo.ComponentWithXmlOffshootJ)

Aggregations

ComponentWithXmlOffshootJ (alma.demo.ComponentWithXmlOffshootJ)1