Exemplo n.º 1
0
        public virtual void testCreateJMF()
        {
            JDFJMF jmf = JDFJMF.createJMF(EnumFamily.Response, EnumType.AbortQueueEntry);

            Assert.AreEqual(EnumType.AbortQueueEntry, jmf.getResponse(0).getEnumType());
            Assert.AreEqual("Response", jmf.getResponse(0).LocalName);
        }
Exemplo n.º 2
0
        private JDFResourceCmdParams createResourceParams(string strJobPartID, string strResourceID, JDFAttributeMap amParts, JDFAttributeMap amAttr)
        {
            JDFJMF jmf = JDFJMF.createJMF(EnumFamily.Command, JDFMessage.EnumType.Resource);

            JDFCommand cmd = jmf.getCommand(0);

            JDFResourceCmdParams @params = cmd.appendResourceCmdParams();

            const string strJobID      = "RefJob-1";
            const string strPartIDKeys = "SignatureName SheetName Side";

            @params.setJobID(strJobID);
            @params.setJobPartID(strJobPartID);
            @params.setResourceID(strResourceID);
            @params.setResourceName("NodeInfo");
            @params.setUpdateMethod(EnumUpdateMethod.Incremental);

            @params.setPartMap(amParts);

            JDFResource nodeInfo = @params.appendResource("NodeInfo");

            JDFResource resLeaf = nodeInfo.getCreatePartition(amParts, new VString(strPartIDKeys, null));

            resLeaf.setAttributes(amAttr);

            return(@params);
        }
Exemplo n.º 3
0
        public virtual void testSenderIDBlank()
        {
            JDFJMF.setTheSenderID("a b");
            JDFJMF      jmf      = JDFJMF.createJMF(EnumFamily.Response, EnumType.AbortQueueEntry);
            JDFResponse response = jmf.getResponse(0);

            Assert.IsTrue(response.getID().IndexOf(".ab.") > 0, "thge sender id was added but stripped");
        }
Exemplo n.º 4
0
        public virtual void testCopyToResponse()
        {
            JDFResponse    r  = JDFJMF.createJMF(JDFMessage.EnumFamily.Response, EnumType.AbortQueueEntry).getResponse(0);
            JDFQueueFilter qf = (JDFQueueFilter) new JDFDoc(ElementName.QUEUEFILTER).getRoot();

            qf.setMaxEntries(3);
            JDFQueue q2 = q.copyToResponse(r, qf);

            Assert.AreEqual(r.getQueue(0), q2);
            Assert.AreEqual(3, q2.numEntries(null));
            Assert.AreNotEqual(q, q2);
            Assert.IsTrue(q.numEntries(null) > 3);
            q2 = q.copyToResponse(r, qf);
            Assert.AreEqual(r.getQueue(0), q2);
            Assert.IsNull(r.getElement("Queue", null, 1));
            Assert.AreEqual(3, q2.numEntries(null));
            Assert.AreNotEqual(q, q2);
            Assert.IsTrue(q.numEntries(null) > 3);
        }
Exemplo n.º 5
0
        public virtual void testCreateResponse()
        {
            JDFJMF queries = JDFJMF.createJMF(EnumFamily.Query, EnumType.Status);

            queries.appendCommand(EnumType.Resource);
            queries.appendCommand(EnumType.Resource);
            queries.appendRegistration(EnumType.Resource);

            JDFJMF   responses      = queries.createResponse();
            VElement messageVector  = queries.getMessageVector(null, null);
            VElement responseVector = responses.getMessageVector(null, null);

            Assert.AreEqual(responseVector.Count, 4);
            for (int i = 0; i < responseVector.Count; i++)
            {
                JDFResponse r = (JDFResponse)responseVector[i];
                JDFMessage  m = (JDFMessage)messageVector[i];
                Assert.AreEqual(r.getrefID(), m.getID());
                Assert.AreEqual(r.getType(), m.getType());
            }
        }