Exemple #1
0
        public virtual void testGetTargetVectorSparse()
        {
            JDFNode         n    = new JDFDoc("JDF").getJDFRoot();
            JDFExposedMedia xm   = (JDFExposedMedia)n.getCreateResource("ExposedMedia", EnumUsage.Input, 0);
            JDFExposedMedia xmb  = (JDFExposedMedia)xm.addPartition(EnumPartIDKey.Separation, "Black");
            JDFExposedMedia xmbe = (JDFExposedMedia)xmb.addPartition(EnumPartIDKey.PartVersion, "EN");
            JDFExposedMedia xmbd = (JDFExposedMedia)xmb.addPartition(EnumPartIDKey.PartVersion, "DE");
            JDFExposedMedia xmc  = (JDFExposedMedia)xm.addPartition(EnumPartIDKey.Separation, "Cyan");

            xm.setPartUsage(EnumPartUsage.Sparse);
            JDFResourceLink rl = n.getLink(xm, null);

            rl.setPartMap(new JDFAttributeMap("PartVersion", "DE"));
            VElement v = rl.getTargetVector(-1);

            Assert.AreEqual(2, v.Count, "DE/Black + Cyan");
            Assert.AreEqual(xmbd, v[0]);
            Assert.AreEqual(xmc, v[1]);
            rl.setPartMap(new JDFAttributeMap("PartVersion", "EN"));
            v = rl.getTargetVector(-1);
            Assert.AreEqual(2, v.Count);
            Assert.AreEqual(xmbe, v[0]);
            Assert.AreEqual(xmc, v[1]);
            rl.setPartMap(new JDFAttributeMap("PartVersion", "FR"));
            v = rl.getTargetVector(-1);
            Assert.AreEqual(1, v.Count);
            Assert.AreEqual(xmc, v[0]);
            xm.setPartUsage(EnumPartUsage.Implicit);
            v = rl.getTargetVector(-1);
            Assert.AreEqual(2, v.Count);
            // TODO should be xmb?
            Assert.AreEqual(xm, v[0]);
            Assert.AreEqual(xmc, v[1]);
        }