Exemplo n.º 1
0
        public virtual void testRemoveChild()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("ConventionalPrinting", true);
            JDFExposedMedia xmpl = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Plate, null);
            JDFExposedMedia xmpr = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Proof, null);
            JDFMedia        m    = xmpr.appendMedia();

            Assert.IsNotNull(xmpr.getMedia());
            m.setID("id1");
            KElement t1 = n.getTarget("id1", "ID");

            m = (JDFMedia)m.makeRootResource(null, null, true);
            Assert.AreEqual(m, t1);
            Assert.IsNotNull(xmpr.getMedia());
            xmpl.refElement(m);
            Assert.IsNotNull(xmpl.getMedia());
            JDFResourcePool rp = n.getResourcePool();

            Assert.IsNotNull(rp.getElement("Media"));
            xmpl.removeChild("Media", null, 0);
            Assert.IsNull(xmpl.getMedia());
            Assert.IsNotNull(rp.getElement("Media"));
            xmpr.removeChildren("Media", null, null);
            Assert.IsNull(xmpr.getMedia());
            Assert.IsNotNull(rp.getElement("Media"));
        }
Exemplo n.º 2
0
        public virtual void testGetHRefs()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType("ConventionalPrinting", true);
            JDFExposedMedia xmpl = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Plate, null);
            JDFExposedMedia xmpr = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", EnumProcessUsage.Proof, null);
            JDFMedia        m    = xmpr.appendMedia();

            Assert.IsNotNull(xmpr.getMedia());
            m.setID("id1");
            KElement t1 = n.getTarget("id1", "ID");

            m = (JDFMedia)m.makeRootResource(null, null, true);
            Assert.AreEqual(t1, m);
            Assert.IsTrue(n.getHRefs(null, true, false).Contains("id1"));
            Assert.IsTrue(xmpr.getHRefs(null, true, false).Contains("id1"));
            Assert.IsFalse(xmpl.getHRefs(null, true, false).Contains("id1"));
            Assert.IsTrue(n.getHRefs(null, true, true).Contains("id1"));
            Assert.IsTrue(xmpr.getHRefs(null, true, true).Contains("id1"));
            Assert.IsFalse(xmpl.getHRefs(null, true, true).Contains("id1"));
        }