Search in sources :

Example 6 with ObsProposal

use of alma.xmljbind.test.obsproposal.ObsProposal in project ACS by ACS-Community.

the class ComponentWithXmlOffshootClientTest method testOffshootJ.

public void testOffshootJ() throws Exception {
    XmlOffshoot shoot = componentWithXmlOffshoot.getOffshoot();
    assertNotNull(shoot);
    XmlOffshootJ shootJ = getContainerServices().getTransparentXmlWrapper(XmlOffshootJ.class, shoot, XmlOffshootOperations.class);
    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
    componentWithXmlOffshoot.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 : ObsProposal(alma.xmljbind.test.obsproposal.ObsProposal) SchedBlock(alma.xmljbind.test.schedblock.SchedBlock) ComponentWithXmlOffshoot(alma.demo.ComponentWithXmlOffshoot) XmlOffshoot(alma.demo.XmlOffshoot) ComponentWithXmlOffshootJ(alma.demo.ComponentWithXmlOffshootJ) XmlOffshootJ(alma.demo.XmlOffshootJ)

Example 7 with ObsProposal

use of alma.xmljbind.test.obsproposal.ObsProposal in project ACS by ACS-Community.

the class TestEntityFactory method getObsProposal.

ObsProposal getObsProposal() {
    ObsProposal prop = null;
    prop = new ObsProposal();
    ObsProposalEntityT entity = new ObsProposalEntityT();
    prop.setObsProposalEntity(entity);
    entity.setEntityId("uid://X1230000000000000/X00000002");
    ObsProjectRefT ref = new ObsProjectRefT();
    ref.setEntityId("uid://X1230000000000000/X00000001");
    prop.setObsProjectRef(ref);
    return prop;
}
Also used : ObsProjectRefT(alma.xmljbind.test.obsproject.ObsProjectRefT) ObsProposalEntityT(alma.xmljbind.test.obsproposal.ObsProposalEntityT) ObsProposal(alma.xmljbind.test.obsproposal.ObsProposal)

Example 8 with ObsProposal

use of alma.xmljbind.test.obsproposal.ObsProposal in project ACS by ACS-Community.

the class EntityRefFinderTest method testObsProposal.

public void testObsProposal() throws Throwable {
    ObsProposal prop = m_entityFactory.getObsProposal();
    EntityRefT[] refs = m_entityRefFinder.findEntityReferences(prop);
    assertNotNull(refs);
//		assertTrue("one entity reference", (refs.length == 1 && refs[0] != null) );
//		assertTrue("reference to ObsProject", refs[0] instanceof ObsProjectRefT);
//		String projId = ((ObsProjectRefT) refs[0]).getEntityId();
//		assertEquals("correct id", "dummyObsProjectId", projId);
}
Also used : ObsProposal(alma.xmljbind.test.obsproposal.ObsProposal) EntityRefT(alma.entities.commonentity.EntityRefT)

Example 9 with ObsProposal

use of alma.xmljbind.test.obsproposal.ObsProposal in project ACS by ACS-Community.

the class EntitySerializerTest method testSerializeObsProposal.

public void testSerializeObsProposal() throws EntityException {
    ObsProposal obsProp = m_entityFactory.getObsProposal();
    String obsPropXml = m_serializer.serializeEntity(obsProp).xmlString;
    assertNotNull(obsPropXml);
    System.out.println(obsPropXml);
}
Also used : ObsProposal(alma.xmljbind.test.obsproposal.ObsProposal)

Example 10 with ObsProposal

use of alma.xmljbind.test.obsproposal.ObsProposal in project ACS by ACS-Community.

the class XmlComponentClient method testXmlInOutMethod.

public void testXmlInOutMethod() {
    ObsProposal obsProp = m_xmlCompJ.createObsProposal();
    assertNotNull(obsProp);
    SchedBlockHolder sbh = new SchedBlockHolder();
    m_xmlCompJ.xmlInOutMethod(obsProp, sbh);
    SchedBlock schedBlock = sbh.value;
    assertNotNull(schedBlock);
    EntityT ent = schedBlock.getSchedBlockEntity();
    assertNotNull(ent);
    String id = ent.getEntityId();
    assertNotNull(id);
    System.out.println("received out-param SchedBlock with id " + id);
}
Also used : EntityT(alma.entities.commonentity.EntityT) ObsProposal(alma.xmljbind.test.obsproposal.ObsProposal) SchedBlock(alma.xmljbind.test.schedblock.SchedBlock) SchedBlockHolder(alma.demo.SchedBlockHolder)

Aggregations

ObsProposal (alma.xmljbind.test.obsproposal.ObsProposal)11 SchedBlock (alma.xmljbind.test.schedblock.SchedBlock)3 XmlOffshoot (alma.demo.XmlOffshoot)2 XmlOffshootJ (alma.demo.XmlOffshootJ)2 EntityT (alma.entities.commonentity.EntityT)2 ObsProposalEntityT (alma.xmljbind.test.obsproposal.ObsProposalEntityT)2 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)1 ComponentWithXmlOffshoot (alma.demo.ComponentWithXmlOffshoot)1 ComponentWithXmlOffshootJ (alma.demo.ComponentWithXmlOffshootJ)1 SchedBlockHolder (alma.demo.SchedBlockHolder)1 EntityRefT (alma.entities.commonentity.EntityRefT)1 ObsProjectRefT (alma.xmljbind.test.obsproject.ObsProjectRefT)1 File (java.io.File)1 FileReader (java.io.FileReader)1 Reader (java.io.Reader)1 Unmarshaller (org.exolab.castor.xml.Unmarshaller)1