public virtual void testError() { JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); JDFResponse r = (JDFResponse)jmf.appendMessageElement(EnumFamily.Response, null); r.setType("Status"); r.setrefID("r1"); JDFNotification n = r.setErrorText("blub"); Assert.AreEqual("blub", n.getComment(0).getText(), "get comment text"); Assert.AreEqual("Error", n.getType(), "type"); Assert.IsTrue(r.isValid(EnumValidationLevel.Complete)); jmf.setSenderID("S1"); Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete)); }
/// /// <summary> * add a queueentry to a queue based on the parameters of this you can get the new queueentry by {@link} /// * getQueueEntry(0) on the response /// * </summary> /// * <param name="theQueue"> the queue to submit to, note that the queue IS modified by this call </param> /// * <param name="responseIn"> the jmf that serves as a container for the new response /// * </param> /// * <returns> the response jmf to the submission message </returns> /// public virtual JDFResponse addEntry(JDFQueue theQueue, JDFJMF responseIn) { JDFCommand command = (JDFCommand)getParentNode_KElement(); JDFJMF jmf = command.createResponse(); JDFResponse resp = jmf.getResponse(0); if (responseIn != null) { resp = (JDFResponse)responseIn.copyElement(resp, null); } if (theQueue == null) { resp.setErrorText("No Queue specified"); resp.setReturnCode(2); return(resp); } if (!theQueue.canAccept()) { resp.setReturnCode(112); resp.copyElement(theQueue, null); return(resp); } JDFQueueEntry qe = theQueue.createQueueEntry(getHold()); string[] copyAtts = new string[] { AttributeName.GANGNAME, AttributeName.GANGPOLICY }; for (int i = 0; i < copyAtts.Length; i++) { if (hasAttribute(copyAtts[i])) { qe.copyAttribute(copyAtts[i], this, null, null, null); } } // TODO more attributes e.g prev. next... if (hasAttribute(AttributeName.PRIORITY)) { qe.setPriority(getPriority()); // calls the automated function, } // therfore not in the list above resp.copyElement(theQueue, null); resp.copyElement(qe, null); return(resp); }