示例#1
0
        public virtual void testAddPhaseTime()
        {
            JDFDoc        doc = new JDFDoc("JDF");
            JDFNode       n   = doc.getJDFRoot();
            JDFAuditPool  ap  = n.getCreateAuditPool();
            JDFProcessRun pr  = ap.addProcessRun(EnumNodeStatus.Completed, null, null);
            JDFPhaseTime  pt0 = null;

            for (int i = 0; i < 10; i++)
            {
                JDFPhaseTime pt = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);
                if (i == 0)
                {
                    pt0 = pt;
                }

                JDFDate start = new JDFDate();
                start.TimeInMillis = start.TimeInMillis + i * 1000 * 1000;
                pt.setStart(start);
                JDFDate end = new JDFDate();
                end.TimeInMillis = end.TimeInMillis + 100 * 1000 + i * 1000 * 1000;
                pt.setEnd(end);
                Assert.AreEqual(100, pt.getDuration().Duration, 1.0);

                pr.addPhase(pt);
                Assert.AreEqual((i + 1) * 100, pr.getDuration().Duration, 1.0);
                if (pt0 != null)
                {
                    Assert.AreEqual(pr.getStart(), pt0.getStart());
                }
                Assert.AreEqual(pr.getEnd(), pt.getEnd());
            }
        }
示例#2
0
        public virtual void testModuleIDs()
        {
            JDFDoc       doc = new JDFDoc("JDF");
            JDFNode      n   = doc.getJDFRoot();
            JDFAuditPool ap  = n.getCreateAuditPool();
            JDFPhaseTime pt  = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);

            pt.setModules(new VString("m1 m2", " "), new VString("RIP Press", " "));
            Assert.AreEqual(2, pt.numChildElements(ElementName.MODULEPHASE, null));
            Assert.AreEqual("m1", pt.getModulePhase(0).getModuleID());
            Assert.AreEqual("m2", pt.getModulePhase(1).getModuleID());
            Assert.AreEqual("Press", pt.getModulePhase(1).getModuleType());
            // Assert.IsTrue(pt.isValid(EnumValidationLevel.Complete));
        }
示例#3
0
        public virtual void testGetDuration()
        {
            JDFDoc       doc = new JDFDoc("JDF");
            JDFNode      n   = doc.getJDFRoot();
            JDFAuditPool ap  = n.getCreateAuditPool();
            JDFPhaseTime pt  = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);

            pt.setStart(new JDFDate());
            JDFDate end = new JDFDate();

            end.TimeInMillis = end.TimeInMillis + 100 * 1000;
            pt.setEnd(end);
            Assert.AreEqual(100.0, pt.getDuration().Duration, 1.0);
        }
示例#4
0
        public virtual void testGetLink()
        {
            JDFDoc          doc = new JDFDoc("JDF");
            JDFNode         n   = doc.getJDFRoot();
            JDFResource     r   = n.addResource("www.foo", EnumResourceClass.Parameter, EnumUsage.Input, null, null, "www.www.com", null);
            JDFResourceLink rl  = n.getLink(r, null);
            VElement        vRL = new VElement();

            vRL.Add(rl);

            JDFAuditPool ap = n.getCreateAuditPool();
            JDFPhaseTime pt = ap.addPhaseTime(EnumNodeStatus.InProgress, null, null);

            pt.appendComment().setText("foo");
            pt.setLinks(vRL);
            pt.setStart(new JDFDate());
            Assert.AreEqual(rl.ToString(), pt.getLink(0).ToString());
        }