Esempio n. 1
0
        public virtual void testConvertResponse()
        {
            JDFDoc      doc  = new JDFDoc(ElementName.JMF);
            JDFJMF      jmf  = doc.getJMFRoot();
            JDFDoc      doc2 = new JDFDoc(ElementName.JMF);
            JDFJMF      jmf2 = doc2.getJMFRoot();
            JDFSignal   s    = jmf.appendSignal();
            JDFResponse r    = jmf2.appendResponse();
            JDFQuery    q    = jmf.appendQuery();

            q.setType("KnownMessages");
            r.setQuery(q);
            Assert.AreEqual(q.getID(), r.getrefID(), "refID");

            JDFMessageService ms = r.appendMessageService();

            ms.setType("KnownMessages");
            s.convertResponse(r, q);
            Assert.AreEqual(r.getType(), s.getType(), "type");
            Assert.IsTrue(ms.isEqual(s.getMessageService(0)), "ms equal");
            s = jmf.appendSignal();
            s.convertResponse(r, null);
            Assert.AreEqual(r.getType(), s.getType(), "type");
            Assert.IsTrue(ms.isEqual(s.getMessageService(0)), "ms equal");
            Assert.IsTrue(s.getXSIType().StartsWith("Signal"));
        }
Esempio n. 2
0
        public virtual void testMediaRef()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            JDFSignal s = jmf.appendSignal();

            jmf.setSenderID("DeviceSenderID");

            s.setType(EnumType.Resource);
            JDFResourceQuParams rqp = s.appendResourceQuParams();

            rqp.setJobID("JobID");
            rqp.setJobPartID("JobPartID");
            rqp.setResourceName(ElementName.EXPOSEDMEDIA);

            JDFResourceInfo ri = s.appendResourceInfo();
            JDFExposedMedia xm = (JDFExposedMedia)ri.appendElement("ExposedMedia");

            JDFResourceInfo ri2 = s.appendResourceInfo();
            JDFMedia        m   = (JDFMedia)ri2.appendElement("Media");
            JDFRefElement   rm  = xm.refElement(m);

            Assert.AreEqual(m, rm.getTarget(), "works initially ");
            Assert.AreEqual(m, rm.getTarget(), "also works with cache");
        }
Esempio n. 3
0
        public virtual void testUsageCounter()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            JDFSignal s = jmf.appendSignal();

            jmf.setSenderID("DeviceSenderID");

            s.setType(EnumType.Resource);
            JDFResourceQuParams rqp = s.appendResourceQuParams();

            rqp.setJobID("JobID");
            rqp.setJobPartID("JobPartID");
            rqp.setResourceName(ElementName.USAGECOUNTER);

            JDFResourceInfo ri = s.appendResourceInfo();

            ri.setActualAmount(42);
            JDFUsageCounter uc = (JDFUsageCounter)ri.appendElement(ElementName.USAGECOUNTER);

            uc.setID("UsageCounterID");
            uc.setScope(EnumScope.Job);
            uc.setCounterID("DeviceCounterID");
            uc.setResStatus(EnumResStatus.Available, true);
            uc.setCounterTypes(new VString("NormalSize", " "));
            doc.write2File(sm_dirTestDataTemp + "JMFResourceSignal.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
        }
Esempio n. 4
0
        public virtual void testGetDeviceID()
        {
            JDFJMF jmf = (JDFJMF) new JDFDoc("JMF").getRoot();

            jmf.setSenderID("S1");
            di = jmf.appendSignal(EnumType.Status).appendDeviceInfo();
            Assert.AreEqual(jmf.getSenderID(), di.getDeviceID());
            di.appendDevice().setDeviceID("dd");
            Assert.AreEqual("dd", di.getDeviceID());
            di.setDeviceID("da");
            Assert.AreEqual("da", di.getDeviceID());
        }
Esempio n. 5
0
        public override void setUp()
        {
            base.setUp();
            JDFElement.setLongID(false);
            doc    = new JDFDoc(ElementName.JMF);
            jmf    = doc.getJMFRoot();
            signal = jmf.appendSignal();
            jmf.setSenderID("DeviceSenderID");

            signal.setType(EnumType.Status);
            sqp = signal.appendStatusQuParams();
            sqp.setJobID("JobID");
            sqp.setJobPartID("JobPartID");
        }
Esempio n. 6
0
        public virtual void testMedia()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            JDFSignal s = jmf.appendSignal();

            jmf.setSenderID("DeviceSenderID");

            s.setType(EnumType.Resource);
            JDFResourceQuParams rqp = s.appendResourceQuParams();

            rqp.setJobID("JobID");
            rqp.setJobPartID("JobPartID");
            rqp.setResourceName(ElementName.MEDIA);

            JDFResourceInfo ri = s.appendResourceInfo();

            ri.getCreateAmountPool();
            // TODO continue
        }