コード例 #1
0
        public virtual void testMatch()
        {
            for (int i = 0; i < 100; i++)
            {
                JDFQueueEntry qe = theQueue.appendQueueEntry();
                qe.setQueueEntryID("q" + i);
            }

            filter.setMaxEntries(10);
            filter.match(theQueue);
            Assert.AreEqual(10, theQueue.numEntries(null));
            filter.setQueueEntryDetails(EnumQueueEntryDetails.None);
            filter.match(theQueue);
            Assert.AreEqual(0, theQueue.numEntries(null));
        }
コード例 #2
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);
        }