コード例 #1
0
        public virtual void testFixToNewLayout()
        {
            testBuildOldLayout();
            n.fixVersion(EnumVersion.Version_1_3);
            JDFLayout lo = (JDFLayout)n.getMatchingResource(ElementName.LAYOUT, EnumProcessUsage.AnyInput, null, 0);

            Assert.IsTrue(JDFLayout.isNewLayout(lo));
            JDFSignature si = lo.getSignature(0);

            Assert.AreEqual("Sig1", si.getSignatureName());
            Assert.IsFalse(si.hasAttribute(AttributeName.CLASS));
        }
コード例 #2
0
        public virtual void testFixVersionProblem()
        {
            JDFParser p = new JDFParser();
            JDFDoc    d = p.parseFile(sm_dirTestData + "FixVersionProblem.jdf");

            Assert.IsNotNull(d, "FixVersionProblem exists");
            n = d.getJDFRoot();
            n.fixVersion(EnumVersion.Version_1_2);
            JDFLayout lo = (JDFLayout)n.getResourcePool().getElement(ElementName.LAYOUT, null, 0);

            Assert.AreEqual(1, lo.numChildElements("Signature", null));
        }
コード例 #3
0
ファイル: JDFElementTest.cs プロジェクト: cip4/JDFLibNet
        public virtual void testFixVersion()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.Bundling);
            JDFProcessRun pr = n.getAuditPool().addProcessRun(EnumNodeStatus.Completed, null, null);

            pr.setAttribute("Duration", "PT90S", null);
            Assert.AreEqual("PT90S", pr.getAttribute("Duration"));
            n.setAttribute("foo3", "a~.doc");
            n.fixVersion(null);
            Assert.AreEqual("PT1M30S", pr.getAttribute("Duration"));
            Assert.AreEqual("a~.doc", n.getAttribute("foo3"));
        }
コード例 #4
0
ファイル: FixVersionTest.cs プロジェクト: cip4/JDFLibNet
        public virtual void testApprovalSuccess()
        {
            n.setType("Approval", true);
            JDFApprovalSuccess @as = (JDFApprovalSuccess)n.appendMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyOutput, null);

            n.setVersion(EnumVersion.Version_1_2);
            @as.appendContact();
            @as.appendFileSpec();
            bool bRet = n.fixVersion(EnumVersion.Version_1_3);

            Assert.IsTrue(bRet, "fix ok");
            Assert.IsNotNull(@as.getApprovalDetails(0), "approvaldetails");
            bRet = n.fixVersion(EnumVersion.Version_1_2);
            Assert.IsTrue(bRet, "fix ok");
            Assert.IsNull(@as.getApprovalDetails(0), "approvaldetails");
            bRet = n.fixVersion(EnumVersion.Version_1_3);
            Assert.IsTrue(bRet, "fix ok");
            @as = (JDFApprovalSuccess)n.getMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyOutput, null, 0);
            JDFApprovalDetails ad = @as.getApprovalDetails(0);

            ad.setApprovalState(EnumApprovalState.Rejected);
            bRet = n.fixVersion(EnumVersion.Version_1_2);
            Assert.IsFalse(bRet, "fix not ok");
        }