Search in sources :

Example 6 with EntityT

use of alma.entities.commonentity.EntityT in project ACS by ACS-Community.

the class XmlComponentClient method testCreateObsProposal.

/**
	 * Makes sure the obs proposal exists and checks its entity id.
	 */
public void testCreateObsProposal() {
    ObsProposal obsProp = m_xmlCompJ.createObsProposal();
    assertNotNull(obsProp);
    EntityT ent = obsProp.getObsProposalEntity();
    assertNotNull(ent);
    String id = ent.getEntityId();
    assertNotNull(id);
    System.out.println("received ObsProposal with id " + id);
}
Also used : EntityT(alma.entities.commonentity.EntityT) ObsProposal(alma.xmljbind.test.obsproposal.ObsProposal)

Example 7 with EntityT

use of alma.entities.commonentity.EntityT in project ACS by ACS-Community.

the class UIDLibraryTest method testAllocateDefaultID.

public void testAllocateDefaultID() throws Exception {
    UIDLibrary lib = new UIDLibrary(logger);
    EntityT e = new EntityT();
    // assign and check a UID
    lib.assignUniqueEntityId(e, ident);
    String uid = e.getEntityId();
    logger.info("Got a new UID for an entity object: " + uid);
    assertEquals("uid://X01/Xaabb/X1", uid);
    // try to reassign a UID
    try {
        lib.assignUniqueEntityId(e, ident);
        fail("expected AcsJUidAlreadyExistsEx");
    } catch (AcsJUidAlreadyExistsEx ex) {
    // fine
    }
    // verify that the exception did not change the old ID
    assertEquals(uid, e.getEntityId());
    // try a null identifier archive
    try {
        lib.assignUniqueEntityId(e, (IdentifierJ) null);
        fail("Expected AcsJIdentifierUnavailableEx when using a null Identifier archive.");
    } catch (AcsJIdentifierUnavailableEx ex) {
    // fine
    }
}
Also used : AcsJUidAlreadyExistsEx(alma.ArchiveIdentifierError.wrappers.AcsJUidAlreadyExistsEx) EntityT(alma.entities.commonentity.EntityT) AcsJIdentifierUnavailableEx(alma.ArchiveIdentifierError.wrappers.AcsJIdentifierUnavailableEx)

Example 8 with EntityT

use of alma.entities.commonentity.EntityT 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

EntityT (alma.entities.commonentity.EntityT)8 XmlEntityStruct (alma.xmlentity.XmlEntityStruct)2 ObsProposal (alma.xmljbind.test.obsproposal.ObsProposal)2 AcsJIdentifierUnavailableEx (alma.ArchiveIdentifierError.wrappers.AcsJIdentifierUnavailableEx)1 AcsJUidAlreadyExistsEx (alma.ArchiveIdentifierError.wrappers.AcsJUidAlreadyExistsEx)1 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)1 EntityException (alma.acs.entityutil.EntityException)1 MyNestedDataT (alma.acscourse.xmlbinding.myxmlconfigdata.MyNestedDataT)1 MyXmlConfigData (alma.acscourse.xmlbinding.myxmlconfigdata.MyXmlConfigData)1 SchedBlockHolder (alma.demo.SchedBlockHolder)1 SchedBlock (alma.xmljbind.test.schedblock.SchedBlock)1 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 Method (java.lang.reflect.Method)1 Marshaller (org.exolab.castor.xml.Marshaller)1 Unmarshaller (org.exolab.castor.xml.Unmarshaller)1