Exemple #1
0
        public void testPageIterator()
        {
            JDFRunList rlp = (JDFRunList)rl.addPartition(EnumPartIDKey.Run, "r1");

            rlp.setPages(new JDFIntegerRangeList("1 3 5 7"));
            rlp.setNPage(3);
            JDFRunList rlp2 = (JDFRunList)rl.addPartition(EnumPartIDKey.Run, "r2");

            rlp2.setPages(new JDFIntegerRangeList("0 2 4 6"));
            IEnumerator it = rl.getPageIterator();
            int         n  = 0;

            while (it.MoveNext())
            {
                JDFRunData ri = (JDFRunData)it.Current;
                Assert.AreEqual(ri.getRunIndex(), n);
                Assert.AreEqual(ri.getRunList(), n < 3 ? rlp : rlp2);
                n++;
            }
            Assert.AreEqual(7, n);
        }
Exemple #2
0
        public void testPageIteratorSpeed()
        {
            int nMax = 3000;

            for (int i = 0; i < nMax; i++)
            {
                JDFRunList rlp = (JDFRunList)rl.addPartition(EnumPartIDKey.Run, "r" + i);
                rlp.setPages(new JDFIntegerRangeList("1 3 5 7"));
                rlp.setFileURL("FileInfo://Test" + i + ".pdf");
            }
            IEnumerator it = rl.getPageIterator();
            int         n  = 0;

            while (it.MoveNext())
            {
                JDFRunData ri = (JDFRunData)it.Current;
                Assert.AreEqual(n, ri.getRunIndex());
                Assert.AreEqual(n % 4, ((ri.getPageInFile() - 1) / 2) % 4);
                n++;
            }
            Assert.AreEqual(n, 4 * nMax);
        }