Beispiel #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"));
        }