Esempio n. 1
0
        public virtual void testLinkResource()
        {
            JDFDoc      d = new JDFDoc("JDF");
            JDFNode     n = d.getJDFRoot();
            JDFResource r = n.addResource("Component", null, null, null, null, null, null);

            Assert.IsTrue(r is JDFComponent);
            Assert.IsFalse(n.hasChildElement("ResourceLinkPool", null));
            JDFResourceLinkPool rlp = n.getCreateResourceLinkPool();

            JDFResourceLink rl = rlp.linkResource(r, EnumUsage.Input, EnumProcessUsage.BookBlock);

            Assert.IsNotNull(rl);
            Assert.AreEqual(EnumProcessUsage.BookBlock, rl.getEnumProcessUsage());
            Assert.AreEqual(EnumUsage.Input, rl.getUsage());
            rl = rlp.linkResource(r, EnumUsage.Input, EnumProcessUsage.BookBlock);
            Assert.IsNotNull(rl, "no two");

            rl = rlp.linkResource(r, EnumUsage.Input, EnumProcessUsage.Cover);
            Assert.IsNotNull(rl);
            Assert.AreEqual(EnumProcessUsage.Cover, rl.getEnumProcessUsage());
            Assert.AreEqual(EnumUsage.Input, rl.getUsage());

            rl = rlp.linkResource(r, EnumUsage.Output, EnumProcessUsage.Cover);
            Assert.IsNotNull(rl);
            Assert.AreEqual(EnumProcessUsage.Cover, rl.getEnumProcessUsage());
            Assert.AreEqual(EnumUsage.Output, rl.getUsage());

            JDFResource r2 = n.addResource("foo:bar", EnumResourceClass.Parameter, null, null, null, "www.foo.com", null);

            rl = rlp.linkResource(r2, EnumUsage.Input, null);
            Assert.IsNotNull(rl);
            Assert.AreEqual(EnumUsage.Input, rl.getUsage());
        }
Esempio n. 2
0
        public virtual void testgetUnlinkedResources()
        {
            JDFDoc          d  = new JDFDoc("JDF");
            JDFNode         n  = d.getJDFRoot();
            JDFResource     r  = n.addResource("Component", null, null, null, null, null, null);
            JDFResourcePool rp = n.getResourcePool();

            Assert.IsTrue(r is JDFComponent);
            Assert.IsFalse(n.hasChildElement("ResourceLinkPool", null));
            JDFResourceLinkPool rlp = n.getCreateResourceLinkPool();

            Assert.AreEqual(r, rp.getUnlinkedResources()[0]);

            JDFResourceLink rl = rlp.linkResource(r, EnumUsage.Input, EnumProcessUsage.BookBlock);

            Assert.IsNotNull(rl);
            Assert.IsNull(rp.getUnlinkedResources());
            JDFResource rx = n.addResource("ExposedMedia", null, null, null, null, null, null);

            Assert.AreEqual(rx, rp.getUnlinkedResources()[0]);

            n.setVersion(EnumVersion.Version_1_2);
            JDFCustomerInfo ci = n.appendCustomerInfo();
            JDFContact      co = ci.appendContact();

            co = (JDFContact)co.makeRootResource(null, null, true);
            Assert.AreEqual(rx, rp.getUnlinkedResources()[0]);
            Assert.AreEqual(1, rp.getUnlinkedResources().Count);

            ci.deleteNode();
            Assert.AreEqual(co, rp.getUnlinkedResources()[1]);
            Assert.AreEqual(2, rp.getUnlinkedResources().Count);
        }
Esempio n. 3
0
        public virtual void testLinkResourcePartition()
        {
            JDFDoc      d = new JDFDoc("JDF");
            JDFNode     n = d.getJDFRoot();
            JDFResource r = n.addResource("Component", null, null, null, null, null, null);

            Assert.IsTrue(r is JDFComponent);
            r = r.addPartition(EnumPartIDKey.SignatureName, "Sig1");
            r.addPartition(EnumPartIDKey.SheetName, "S1");
            Assert.IsFalse(n.hasChildElement("ResourceLinkPool", null));
            JDFResourceLinkPool rlp = n.getCreateResourceLinkPool();

            JDFResourceLink rl = rlp.linkResource(r, EnumUsage.Input, EnumProcessUsage.BookBlock);

            Assert.IsNotNull(rl);
            Assert.AreEqual(EnumProcessUsage.BookBlock, rl.getEnumProcessUsage());
            Assert.AreEqual(EnumUsage.Input, rl.getUsage());
            VJDFAttributeMap v = new VJDFAttributeMap();

            v.Add(new JDFAttributeMap(EnumPartIDKey.SignatureName, "Sig1"));
            Assert.AreEqual(v, rl.getPartMapVector());
        }