예제 #1
0
        public virtual void testSetTarget()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setVersion(JDFElement.EnumVersion.Version_1_3);
            n.setType("ConventionalPrinting", true);
            JDFExposedMedia  xm    = (JDFExposedMedia)n.addResource(ElementName.EXPOSEDMEDIA, null, EnumUsage.Input, null, null, null, null);
            JDFExposedMedia  xm1   = (JDFExposedMedia)xm.addPartition(JDFResource.EnumPartIDKey.SignatureName, "Sig1");
            VJDFAttributeMap vSig1 = new VJDFAttributeMap();

            vSig1.Add(xm1.getPartMap());
            // want a lower leaf partition
            xm1.addPartition(JDFResource.EnumPartIDKey.SheetName, "Sheet1");
            JDFMedia        m  = xm.appendMedia();
            JDFResourceLink rl = n.linkResource(xm, EnumUsage.Input, null);

            try
            {
                rl.setTarget(m);
                Assert.Fail("no link to subelem");
            }
            catch (JDFException)
            {
                // nop
            }
            rl.setTarget(xm1);
            Assert.AreEqual(vSig1, rl.getPartMapVector());
        }