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);
}
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
}
}
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);
}
Aggregations