Exemple #1
0
        public virtual void testAppendDevCapInPool_JMF()
        {
            JDFDoc            doc = new JDFDoc("MessageService");
            JDFMessageService ms  = (JDFMessageService)doc.getRoot();
            JDFDevCaps        dcs = ms.appendDevCaps();

            dcs.setName("foo");
            JDFDevCap dc = dcs.appendDevCapInPool();

            Assert.AreEqual(dc, dcs.getDevCap());
            Assert.AreEqual(dc.getName(), dcs.getName());
        }
Exemple #2
0
        ///
        ///	 <summary> * Gets the NamePath of this DevCap in form "
        ///	 * <code>DevCapsName/SubelemName1/SubelemName2/...</code>"<br>
        ///	 * If this DevCap is located in DevCapPool and not in a DevCaps, it
        ///	 * describes the reusable resource. In this case DevCap root will have the
        ///	 * attribute "Name" = value of DevCaps/@Name, but will have no info about
        ///	 * <code>DevCaps/@Context</code> or <code>DevCaps/@LinkUsage</code>.
        ///	 * <p>
        ///	 * default: getNamePath(false)
        ///	 *  </summary>
        ///	 * <param name="bRecurse">
        ///	 *            if true, returns "
        ///	 *            <code>DevCapsName/SubelemName1/SubelemName2/...</code>" </param>
        ///	 * <returns> String - NamePath of this DevCap </returns>
        ///
        public VString getNamePathVector()
        {
            string      result  = getDevCapsName();
            EnumContext cont    = getContext();
            VString     vResult = new VString();

            if (cont.Equals(EnumContext.JMF) && (ParentNode is JDFMessageService) && result.Length > 4)
            {
                JDFMessageService serv = (JDFMessageService)ParentNode;
                List <EnumFamily> vf   = serv.getFamilies();
                if (vf != null)
                {
                    int size = vf.Count;
                    for (int i = 0; i < size; i++)
                    {
                        vResult.Add("JMF/" + vf[i].getName() + "/" + result.Substring(4));
                    }
                }

                if (EnumJMFRole.Sender.Equals(serv.getJMFRole()))
                {
                    vResult.Add("JMF/Response/" + result.Substring(4));
                }
            }
            else
            {
                if (cont.Equals(EnumContext.Link))
                {
                    result = ElementName.JDF + "/" + ElementName.RESOURCELINKPOOL + "/" + result;
                }
                else if (cont.Equals(EnumContext.Resource))
                {
                    string nam = result;
                    result = ElementName.JDF + "/" + ElementName.RESOURCEPOOL + "/" + result;
                    for (int i = 0; i < 6; i++)
                    {
                        vResult.Add(result);
                        result = result + "/" + nam;
                    }
                }

                vResult.Add(result);
            }
            return(vResult);
        }
Exemple #3
0
        public virtual void testGetMessageServiceForJMFType()
        {
            JDFMessage        m    = JDFJMF.createJMF(JDFMessage.EnumFamily.Acknowledge, EnumType.KnownDevices).getMessageElement(null, null, 0);
            JDFResponse       resp = JDFJMF.createJMF(JDFMessage.EnumFamily.Response, EnumType.KnownMessages).getResponse(0);
            JDFMessageService ms   = resp.appendMessageService();

            ms.setType(EnumType.AbortQueueEntry);
            ms.setAcknowledge(true);
            Assert.IsNull(JDFDeviceCap.getMessageServiceForJMFType(m, resp), "wrong type");
            JDFMessageService ms2 = resp.appendMessageService();

            ms2.setType(EnumType.KnownDevices);
            ms2.setQuery(true);
            Assert.IsNull(JDFDeviceCap.getMessageServiceForJMFType(m, resp), "wrong type");
            JDFMessageService ms3 = resp.appendMessageService();

            ms3.setType(EnumType.KnownDevices);
            ms3.setAcknowledge(true);
            Assert.AreEqual(ms3, JDFDeviceCap.getMessageServiceForJMFType(m, resp), "family and type match");
        }