Пример #1
0
        public virtual void testEvent()
        {
            Assert.IsNull(sc.getDocJMFNotification(false));
            sc.setEvent("id", "value", "blah blah");
            d = sc.getDocJMFNotification(false);
            JDFDoc d2 = sc.getDocJMFNotification(false);

            Assert.IsTrue(d.getRoot().isEqual(d2.getRoot()));
            d  = sc.getDocJMFNotification(true);
            d2 = sc.getDocJMFNotification(false);
            Assert.IsNull(d2);
            JDFJMF          jmf  = d.getJMFRoot();
            JDFNotification noti = jmf.getSignal(0).getNotification();

            Assert.AreEqual(noti.getJobID(), n.getJobID(true));
            Assert.IsNotNull(noti.getEvent());
            d.write2File(sm_dirTestDataTemp + "jmfNotification.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
            sc.setEvent("id1", "value", "blah blah");
            sc.setEvent("id2", "value", "blah blah blah");
            d   = sc.getDocJMFNotification(false);
            jmf = d.getJMFRoot();
            Assert.AreEqual(2, jmf.numChildElements(ElementName.SIGNAL,null));
            sc.setEvent("id2","value","blah blah blah");
            d   = sc.getDocJMFNotification(true);
            jmf = d.getJMFRoot();
            Assert.AreEqual(3,jmf.numChildElements(ElementName.SIGNAL,null));
            d = sc.getDocJMFNotification(true);
            Assert.IsNull(d);
        }