public virtual void testGetLinkRootJMF() { JDFDoc d = new JDFDoc("JMF"); JDFJMF jmf = d.getJMFRoot(); jmf.setSenderID("Elvis"); JDFCommand c = jmf.appendCommand(); c.setType("PipePull"); JDFPipeParams pp = c.appendPipeParams(); pp.setAttribute(AttributeName.PIPEID, "foo", null); JDFRunList ruli = (JDFRunList)pp.appendResource(ElementName.RUNLIST); JDFResourceLink rl = pp.appendResourceLink("RunListLink", true); rl.setrRef(ruli.getID()); Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete), "valid param"); Assert.AreEqual(rl.getTarget(), ruli); }
public virtual void testStatusEquals() { // test if the auto classes implement the correct status // compare EnumNodeStatus JDFAuditPool myAuditPool = null; JDFDoc jdfDoc = new JDFDoc(ElementName.JDF); JDFNode jdfRoot = (JDFNode)jdfDoc.getRoot(); Assert.IsTrue(jdfRoot != null, "No Root found"); if (jdfRoot == null) { return; // soothe findbugs ;) } JDFAncestor ancestor = jdfRoot.appendAncestorPool().appendAncestor(); ancestor.setStatus(EnumNodeStatus.Completed); myAuditPool = jdfRoot.getCreateAuditPool(); JDFPhaseTime phaseTime = myAuditPool.addPhaseTime(JDFElement.EnumNodeStatus.Completed, null, null); JDFSpawned spawned = myAuditPool.addSpawned(jdfRoot, null, null, null, null); spawned.setStatus(JDFElement.EnumNodeStatus.Completed); Assert.AreEqual(spawned.getStatus(), phaseTime.getStatus()); Assert.AreEqual(spawned.getStatus(), ancestor.getStatus()); JDFDoc jmfDoc = new JDFDoc(ElementName.JMF); JDFJMF jmfRoot = jmfDoc.getJMFRoot(); Assert.IsTrue(jmfRoot != null, "No Root found"); if (jmfRoot == null) { return; // soothe findbugs ;) } JDFAcknowledge acknowledge = jmfRoot.appendAcknowledge(); acknowledge.setType("PipePush"); // Type is required and its existance // is validated for messages JDFJobPhase jobPhase = acknowledge.appendJobPhase(); jobPhase.setStatus(EnumNodeStatus.Completed); JDFMessage message = jmfRoot.appendMessageElement(EnumFamily.Command, null); message.setType("PipePush"); // Type is required and its existance is // validated for messages JDFPipeParams pipeParams = message.appendPipeParams(); pipeParams.setStatus(EnumNodeStatus.Completed); Assert.AreEqual(jobPhase.getStatus(), pipeParams.getStatus()); Assert.AreEqual(spawned.getStatus(), pipeParams.getStatus()); // compare EnumResStatus JDFDoc responseDoc = new JDFDoc(ElementName.RESPONSE); JDFResponse responseRoot = (JDFResponse)responseDoc.getRoot(); Assert.IsTrue(responseRoot != null, "No Root found"); if (responseRoot == null) { return; // soothe findbugs ;) } responseRoot.setType(ElementName.RESOURCE); JDFResourceInfo resInfo = responseRoot.appendResourceInfo(); resInfo.setResStatus(EnumResStatus.Available); JDFDoc commandDoc = new JDFDoc(ElementName.COMMAND); JDFCommand commandRoot = (JDFCommand)commandDoc.getRoot(); Assert.IsTrue(commandRoot != null, "No Root found"); if (commandRoot == null) { return; // soothe findbugs ;) } commandRoot.setType(ElementName.RESOURCE); JDFResourceCmdParams resCmdParams = commandRoot.appendResourceCmdParams(); resCmdParams.setResStatus(EnumResStatus.Available); Assert.AreEqual(resInfo.getStatus(), resCmdParams.getStatus()); // check EnumQueueStatus JDFDoc queueDoc = new JDFDoc(ElementName.QUEUE); JDFQueue queueRoot = (JDFQueue)queueDoc.getRoot(); Assert.IsTrue(queueRoot != null, "No Root found"); if (queueRoot == null) { return; // soothe findbugs ;) } queueRoot.setQueueStatus(EnumQueueStatus.Running); // check EnumQueueEntryStatus JDFQueueEntry queueEntry = queueRoot.appendQueueEntry(); queueEntry.setQueueEntryStatus(EnumQueueEntryStatus.Running); }