Esempio n. 1
0
        public virtual void testValidatePrivateDoc()
        {
            JDFDoc       doc      = new JDFDoc("JDF");
            JDFValidator checkJDF = new JDFValidator();

            checkJDF.setPrint(false);
            checkJDF.bQuiet = true;
            checkJDF.level  = EnumValidationLevel.Incomplete;
            JDFNode n = doc.getJDFRoot();

            checkJDF.setIgnorePrivate(true);

            n.setAttribute("foo:bar", "foobar", "www.foo.cpm");
            XMLDoc   schemaValidationResult = checkJDF.processSingleDocument(doc);
            KElement root = schemaValidationResult.getRoot();

            Assert.AreEqual(root.getXPathAttribute("TestFile/CheckJDFOutput/@IsValid", "booboo"), "true");

            n.removeAttribute("bar", "www.foo.cpm");
            n.appendElement("foo:bar", "www.foo.cpm");
            schemaValidationResult = checkJDF.processSingleDocument(doc);
            root = schemaValidationResult.getRoot();
            Assert.AreEqual(root.getXPathAttribute("TestFile[2]/CheckJDFOutput/@IsValid", "booboo"), "true");

            n.setAttribute("jdfbar", "thisbebad");
            schemaValidationResult = checkJDF.processSingleDocument(doc);
            root = schemaValidationResult.getRoot();
            Assert.AreEqual(root.getXPathAttribute("TestFile[3]/CheckJDFOutput/@IsValid", "booboo"), "false");

            n.removeAttribute("jdfbar", null);
            n.appendElement("jdfbar", null);
            schemaValidationResult = checkJDF.processSingleDocument(doc);
            root = schemaValidationResult.getRoot();
            Assert.AreEqual(root.getXPathAttribute("TestFile[4]/CheckJDFOutput/@IsValid", "booboo"), "false");
        }
Esempio n. 2
0
        public virtual void testIsPresentPartition()
        {
            JDFAction act = devicecap.appendActionPool().appendActionTest(EnumTerm.IsPresentEvaluation, true);
            JDFTest   tst = act.getTest();

            tst.setContext("//Component");
            JDFIsPresentEvaluation ipe = (JDFIsPresentEvaluation)tst.getTerm();

            ipe.setRefTarget(ptState);
            Assert.AreEqual(ptState.getID(), ipe.getrRef());

            JDFDoc  doc  = new JDFDoc("JDF");
            JDFNode node = doc.getJDFRoot();

            node.setType("fnarf", false);
            JDFComponent comp = (JDFComponent)node.addResource("Component", null, EnumUsage.Input, null, null, null, null);

            comp.setProductType("Cover");

            XMLDoc   rep     = new XMLDoc("root", null);
            KElement eRep    = rep.getRoot();
            bool     fitsJDF = tst.fitsJDF(comp, eRep);

            Assert.IsTrue(fitsJDF);
            comp    = (JDFComponent)comp.addPartition(EnumPartIDKey.SheetName, "s1");
            fitsJDF = tst.fitsJDF(comp, eRep);
            Assert.IsTrue(fitsJDF, "also partition leaves ");
        }
Esempio n. 3
0
        public virtual void testValidateCombined()
        {
            JDFDoc       doc      = new JDFDoc("JDF");
            JDFValidator checkJDF = new JDFValidator();

            checkJDF.setPrint(false);
            checkJDF.bQuiet = true;
            JDFNode n = doc.getJDFRoot();

            n.setType(EnumType.Combined);
            int v = 0;

            while (true)
            {
                checkJDF.level = EnumValidationLevel.getEnum(v);
                if (checkJDF.level == null)
                {
                    break;
                }
                for (int i = 0; i < 3; i++)
                {
                    if (i >= 1)
                    {
                        doc = null;
                    }
                    XMLDoc   schemaValidationResult = checkJDF.processSingleDocument(doc);
                    KElement root = schemaValidationResult.getRoot();
                    Assert.IsNotNull(root.getXPathElement("TestFile/SchemaValidationOutput"));
                    Assert.IsNotNull(root.getXPathElement("TestFile/CheckJDFOutput"));
                    Assert.AreEqual(root.getXPathAttribute("TestFile/CheckJDFOutput/@IsValid", "booboo"), "true");
                }
                v++;
            }
        }
Esempio n. 4
0
        public virtual void testValidateJMF()
        {
            // Write temp JMF
            string   jmf     = "<?xml version='1.0' encoding='UTF-8'?><JMF xmlns='http://www.CIP4.org/JDFSchema_1_1' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'  SenderID='Alces' TimeStamp='2004-08-30T17:23:00+01:00' Version='1.2'><Query ID='M001' Type='KnownDevices' xsi:type='QueryKnownDevices'><DeviceFilter DeviceDetails='None'/></Query></JMF>";
            FileInfo jmfFile = new FileInfo(Path.Combine(Path.GetTempPath(), "Query-KnownDevices.jmf"));

            SupportClass.FileSupport.CreateNewFile(jmfFile);
            // jmfFile.deleteOnExit();
            StreamWriter @out = new StreamWriter(new FileStream(jmfFile.FullName, FileMode.Open));

            @out.Write(jmf);
            @out.Close();
            jmfFile.Refresh();
            Assert.IsTrue(jmfFile.Exists);

            FileInfo reportFile = new FileInfo(Path.Combine(Path.GetTempPath(), "Queue-KnownDevices-report.xml"));

            SupportClass.FileSupport.CreateNewFile(reportFile);
            // reportFile.deleteOnExit();

            // Run JDFValidator
            string[] args    = { jmfFile.FullName, "-cq", "-x " + reportFile.FullName };
            CheckJDF checker = new CheckJDF();
            XMLDoc   d       = checker.validate(args, null);
            KElement dRoot   = d.getRoot();

            Assert.AreEqual("true", dRoot.getXPathAttribute("/CheckOutput/TestFile/CheckJDFOutput/@IsValid", null));

            // Check that report exists
            reportFile.Refresh();
            Assert.IsTrue(reportFile.Exists);
            jmfFile.Delete();
            reportFile.Delete();
        }
Esempio n. 5
0
        public virtual void testProcessAllFiles()
        {
            JDFValidator checkJDF = new JDFValidator();

            checkJDF.setPrint(false);
            checkJDF.bQuiet = true;
            checkJDF.level  = EnumValidationLevel.Complete;
            VString files = new VString();

            files.Add(sm_dirTestData + "job.jdf");
            checkJDF.allFiles = files;
            XMLDoc schemaValidationResult = checkJDF.processAllFiles();

            Assert.IsNotNull(schemaValidationResult.getRoot().getXPathElement("TestFile/SchemaValidationOutput"));
            Assert.IsNotNull(schemaValidationResult.getRoot().getXPathElement("TestFile/CheckJDFOutput"));
        }
Esempio n. 6
0
 public virtual void testNonAsciiFileURL()
 {
     for (int i = 0; i < 2; i++) // loop over escape and non-escape
     {
         FileInfo f  = new FileInfo("4€5%äö.txt");
         FileInfo f2 = FileUtil.getFileInDirectory(new DirectoryInfo(sm_dirTestDataTemp), f);
         f2.Delete();
         SupportClass.FileSupport.CreateNewFile(f2);
         f2.Refresh();
         Assert.IsTrue(f2.Exists);
         string   url  = UrlUtil.fileToUrl(f2, i == 0);
         XMLDoc   doc  = new XMLDoc("URL", null);
         KElement root = doc.getRoot();
         root.setAttribute("url", url);
         doc.write2File(sm_dirTestDataTemp + "url.xml", 2, false);
         JDFParser p = new JDFParser();
         p.bKElementOnly = true;
         JDFDoc   d        = p.parseFile(sm_dirTestDataTemp + "url.xml");
         KElement root2    = d.getRoot();
         string   urlParse = root2.getAttribute("url");
         Assert.AreEqual(url, urlParse);
         FileInfo f3 = UrlUtil.urlToFile(urlParse);
         Assert.AreEqual(f2.FullName, f3.FullName);
         Assert.IsTrue(f3.Exists);
     }
 }
Esempio n. 7
0
        public virtual void testValidateExtensionschema()
        {
            JDFDoc       doc      = new JDFDoc("JDF");
            JDFValidator checkJDF = new JDFValidator();

            checkJDF.setPrint(false);
            checkJDF.bQuiet = true;
            checkJDF.level  = EnumValidationLevel.Incomplete;
            DirectoryInfo foo = new DirectoryInfo(sm_dirTestSchema);

            Assert.IsTrue(foo.Exists, "please mount the svn schema parallel to JDFLibNet");
            FileInfo jdfxsd = new FileInfo(sm_dirTestSchema + "JDF.xsd");

            checkJDF.setJDFSchemaLocation(jdfxsd);
            JDFNode n = doc.getJDFRoot();

            n.setType(EnumType.ConventionalPrinting);
            JDFMedia med = (JDFMedia)n.addResource("Media", null, EnumUsage.Input, null, null, null, null);

            checkJDF.setIgnorePrivate(false);
            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            XMLDoc @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");

            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile/SchemaValidationOutput/@ValidationResult", null), "Valid");

            checkJDF.schemaLocation += " http://www.extension.com " + sm_dirTestData + "extension.xsd";
            med.setAttribute("ext:ExtensionAtt", "a", "http://www.extension.com");
            KElement fooBar = med.appendElement("ext:FooBar", "http://www.extension.com");

            fooBar.setAttribute("ID", "f1");
            fooBar.setAttribute("Fnarf", "4");

            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");
            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile[2]/SchemaValidationOutput/@ValidationResult", null), "Error");

            med.setAttribute("ext:ExtensionAtt", "3", "http://www.extension.com");
            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");
            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile[3]/SchemaValidationOutput/@ValidationResult", null), "Valid");

            fooBar.setAttribute("Fnarf", "bad");
            doc.write2File(sm_dirTestDataTemp + "extension.jdf", 0, true);
            @out = checkJDF.processSingleFile(sm_dirTestDataTemp + "extension.jdf");
            Assert.AreEqual(@out.getRoot().getXPathAttribute("TestFile[4]/SchemaValidationOutput/@ValidationResult", null), "Error");
        }
Esempio n. 8
0
        public virtual void testValidateZip()
        {
            FileInfo     zip     = new FileInfo(sm_dirTestData + "checkjdf.zip");
            JDFValidator checker = new JDFValidator();
            XMLDoc       d       = checker.processZipFile(zip);
            KElement     root    = d.getRoot();

            Assert.AreEqual(17, root.numChildElements("TestFile", null), "checkJDF.zip has 17 files");
        }
Esempio n. 9
0
        public virtual void testValidateMime()
        {
            FileInfo     mim     = new FileInfo(sm_dirTestData + "checkjdf.mjm");
            JDFValidator checker = new JDFValidator();
            FileStream   @is     = new FileStream(mim.FullName, FileMode.Open);
            XMLDoc       d       = checker.ProcessMimeStream(@is);
            KElement     root    = d.getRoot();

            Assert.AreEqual(2, root.numChildElements("TestFile", null), "checkJDF.mjm has 2 files");
        }
Esempio n. 10
0
        public virtual void testAction()
        {
            JDFAction act = devicecap.appendActionPool().appendActionTest(EnumTerm.or, false);
            JDFTest   tst = act.getTest();

            tst.setContext("/JDF/ResourcePool/Component");
            JDFor or = (JDFor)((JDFnot)tst.getTerm()).getTerm(EnumTerm.or, 0);
            JDFIsPresentEvaluation ipe = (JDFIsPresentEvaluation)or.appendTerm(EnumTerm.IsPresentEvaluation);

            ipe.setRefTarget(ptState);
            Assert.AreEqual(ptState.getID(), ipe.getrRef());

            JDFEnumerationEvaluation enev = (JDFEnumerationEvaluation)or.appendTerm(EnumTerm.EnumerationEvaluation);

            enev.setRefTarget(compState);
            enev.setRegExp("(.+ )*FinalProduct( .+)*");

            JDFDoc  doc  = new JDFDoc("JDF");
            JDFNode node = doc.getJDFRoot();

            node.setType("fnarf", false);
            JDFComponent comp = (JDFComponent)node.addResource("Component", null, EnumUsage.Input, null, null, null, null);

            XMLDoc   rep     = new XMLDoc("root", null);
            KElement eRep    = rep.getRoot();
            bool     fitsJDF = tst.fitsJDF(comp, eRep);

            Assert.IsTrue(fitsJDF);

            comp.setProductType("foobar");
            fitsJDF = tst.fitsJDF(comp, eRep);
            Assert.IsFalse(fitsJDF, "have pt");

            List <ValuedEnum> v = new List <ValuedEnum>();

            v.Add(EnumComponentType.FinalProduct);
            comp.setComponentType(v);
            fitsJDF = tst.fitsJDF(comp, eRep);
            Assert.IsFalse(fitsJDF, "have both");

            comp.removeAttribute("ProductType");
            fitsJDF = tst.fitsJDF(comp, eRep);
            Assert.IsFalse(fitsJDF, "have final");

            v = new List <ValuedEnum>();
            v.Add(EnumComponentType.PartialProduct);
            comp.setComponentType(v);
            fitsJDF = tst.fitsJDF(comp, eRep);
            Assert.IsTrue(fitsJDF, "have no final");
        }
Esempio n. 11
0
        public virtual void testDepthWalk()
        {
            BaseWalkerFactory bf = new BaseWalkerFactory();

            new TestWalker(bf);
            XMLDoc        d    = new XMLDoc("a", null);
            ElementWalker ew   = new ElementWalker(bf);
            KElement      root = d.getRoot();

            Assert.AreEqual(1, ew.walk(root));
            for (int i = 1; i <= 10; i++)
            {
                root.getCreateXPathElement("b/c/d[" + i + "]");
            }
            Assert.AreEqual(13, ew.walk(root), "a,b,c+10*d=13");
        }
Esempio n. 12
0
        private void processSingleFile(string fileName, bool bShouldValidate, EnumValidationLevel level)
        {
            JDFValidator checkJDF = new JDFValidator();

            checkJDF.setPrint(false);
            checkJDF.bQuiet = true;
            checkJDF.level  = level != null ? level : EnumValidationLevel.Complete;
            XMLDoc   schemaValidationResult = checkJDF.processSingleFile(fileName);
            KElement root = schemaValidationResult.getRoot();

            Assert.IsNotNull(root.getXPathElement("TestFile/SchemaValidationOutput"));
            Assert.IsNotNull(root.getXPathElement("TestFile/CheckJDFOutput"));

            checkJDF = new JDFValidator();
            checkJDF.setPrint(false);
            checkJDF.bQuiet = true;
            checkJDF.level  = EnumValidationLevel.Complete;
            checkJDF.processSingleFile(fileName);
            Assert.IsNotNull(root);

            if (bShouldValidate)
            {
                Assert.AreEqual(root.getXPathAttribute("TestFile/CheckJDFOutput/@IsValid", ""), "true", fileName + " should validate");
            }
            else
            {
                Assert.AreEqual(root.getXPathAttribute("TestFile/CheckJDFOutput/@IsValid", ""), "false", fileName + " should not validate");
            }

            // now repeat including schema
            checkJDF.setJDFSchemaLocation(new FileInfo(sm_dirTestSchema + "JDF.xsd"));
            checkJDF.processSingleDocument(null);
            Assert.IsNotNull(root);

            if (bShouldValidate)
            {
                Assert.AreEqual(root.getXPathAttribute("TestFile/CheckJDFOutput/@IsValid", ""), "true");
            }
            else
            {
                Assert.AreEqual(root.getXPathAttribute("TestFile/CheckJDFOutput/@IsValid", ""), "false");
            }
        }
Esempio n. 13
0
        public virtual void testBadResLink()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.Stitching);
            JDFResource     r  = n.addResource(ElementName.STITCHINGPARAMS, EnumUsage.Input);
            JDFResourceLink rl = n.getLink(r, null);

            Assert.IsTrue(rl.isValid(EnumValidationLevel.Complete));
            Assert.IsTrue(n.isValid(EnumValidationLevel.Incomplete));
            rl.setrRef("badLink");
            Assert.IsFalse(rl.isValid(EnumValidationLevel.Complete));
            Assert.IsFalse(n.isValid(EnumValidationLevel.Complete));
            JDFValidator cj   = new JDFValidator();
            XMLDoc       res  = cj.processSingleDocument(d);
            KElement     root = res.getRoot();
            string       s    = root.ToString();

            Assert.IsTrue(s.IndexOf("Dangling") > 0);
        }
Esempio n. 14
0
        private string parseArgs(string[] commandLineArgs)
        {
            MyArgs args = new MyArgs(commandLineArgs, "?cmqPQvVntwU", "dlfLuhpTxX", null);

            if (args.boolParameter('?', false))
            {
                sysOut.println("JDFValidator:\n" + version + '\n' + usage);
                Application.Exit();
            }
            bWarning         = args.boolParameter('w', false);
            bTiming          = args.boolParameter('t', false);
            bQuiet           = args.boolParameter('q', false);
            bWarnDanglingURL = args.boolParameter('U', false);

            this.setPrint(!args.boolParameter('Q', false));
            xmlOutputName = args.parameterString('x');
            xslStyleSheet = args.parameterString('X');
            getTranslation(args);
            pOut = new XMLDoc("CheckOutput", null);
            KElement xmlRoot = pOut.getRoot();

            xmlRoot.setAttribute("Language", "EN");

            bool bVersion = !bQuiet || args.boolParameter('V', false);

            if (bVersion)
            {
                sysOut.println('\n' + version + '\n');
                sysOut.println(args.ToString());
                xmlRoot.setAttribute("Arguments", StringUtil.setvString(commandLineArgs, " ", null, null));
            }

            bPrintNameSpace = args.boolParameter('n', false);
            bMultiID        = args.boolParameter('m', false);

            if (args.hasParameter('h'))
            {
                proxyHost = args.parameterString('h');
                proxyPort = args.parameterString('p');
            }

            if (args.hasParameter('c'))
            {
                if (args.boolParameter('c', false))
                {
                    level = EnumValidationLevel.Complete;
                }
                else
                {
                    level = EnumValidationLevel.Incomplete;
                }
            }

            string parameterString = args.parameterString('L');

            if (parameterString != null)
            {
                setJDFSchemaLocation(new FileInfo(parameterString));
            }

            string schemaLocation0 = args.parameterString('l');

            // convert "," to blank
            if (schemaLocation0 != null)
            {
                VString vs = new VString(schemaLocation0, JDFConstants.COMMA);
                if (vs.Count % 2 != 0)
                {
                    sysOut.println("error in schema location: format is \"NameSpaceURI1,Location1,NameSpaceURI2,Location2\"\n - bailing out!" + usage);
                    Application.Exit();
                }
                schemaLocation0 = StringUtil.setvString(vs, JDFConstants.BLANK, JDFConstants.EMPTYSTRING, JDFConstants.EMPTYSTRING);
                schemaLocation += schemaLocation0;
            }

            if (args.hasParameter('d'))
            {
                devCapFile = args.parameterString('d');
                FileInfo fDC = UrlUtil.urlToFile(devCapFile);
                if (fDC == null || !fDC.Exists)
                {
                    sysOut.println("Error reading devcap file: " + devCapFile + "\n - bailing out!\n" + usage);
                    Application.Exit();
                }
            }

            bValidate = (args.boolParameter('v', false)) || (schemaLocation != null);
            string jdfVersion = args.parameterString('f');

            if (jdfVersion != null)
            {
                EnumVersion v = EnumVersion.getEnum(jdfVersion);
                JDFElement.setDefaultJDFVersion(v);
                JDFVersions.ForceVersion = true;
            }

            if (args.nargs() == 0)
            {
                sysOut.println(args.usage(usage));
                Application.Exit();
            }

            testlists = EnumFitsValue.Allowed;
            if (args.boolParameter('P', false))
            {
                testlists = EnumFitsValue.Present;
            }

            string url = args.parameterString('u');

            setAllFiles(args);
            return(url);
        }
Esempio n. 15
0
        ///
        ///	 <summary> * Composes a BugReport in XML form for the given JDFNode 'jdfRoot'. Gives a list of error messages for 'jdfRoot'
        ///	 * and every child rejected Node.<br>
        ///	 * Returns <code>null</code> if there are no errors.
        ///	 *  </summary>
        ///	 * <param name="jdfRoot"> the node to test </param>
        ///	 * <param name="testlists"> testlists that are specified for the State elements (FitsValue_Allowed or FitsValue_Present)<br>
        ///	 *            Will be used in fitsValue method of the State class. </param>
        ///	 * <param name="level"> validation level </param>
        ///	 * <returns> XMLDoc - XMLDoc output of the error messages. If XMLDoc is null there are no errors. </returns>
        ///
        public XMLDoc getBadJDFInfo(JDFNode jdfRoot, EnumFitsValue testlists, EnumValidationLevel level)
        {
            VElement vDC = getChildElementVector(ElementName.DEVICECAP, null, null, true, -1, false);

            if (vDC == null || vDC.IsEmpty())
            {
                return(null);
            }

            VElement vn = new VElement();

            for (int i = 0; i < vDC.Count; i++)
            {
                JDFDeviceCap dc        = (JDFDeviceCap)vDC[i];
                XMLDoc       bugReport = dc.getBadJDFInfo(jdfRoot, testlists, level);
                if (bugReport == null)
                {
                    return(null);
                }
                vn.addAll(bugReport.getRoot().getChildElementVector(null, null, null, true, -1, false));
            }

            int vnSize = vn.Count;

            if (vnSize == 0)
            {
                return(null);
            }

            XMLDoc   bugReport2 = new XMLDoc("BugReport", null);
            KElement root       = bugReport2.getRoot();
            bool     bFit       = false;

            for (int i = 0; i < vnSize; i++)
            {
                KElement e = vn[i];
                if (JDFConstants.TRUE.Equals(e.getAttribute(JDFDeviceCap.FITS_TYPE)))
                {
                    bFit = true;
                }
            }
            if (bFit)
            {
                for (int i = 0; i < vnSize; i++)
                {
                    KElement e = vn[i];
                    if (JDFConstants.FALSE.Equals(e.getAttribute(JDFDeviceCap.FITS_TYPE)))
                    {
                        vn[i] = null;
                    }
                }
            }
            for (int i = 0; i < vnSize; i++)
            {
                if (vn[i] != null)
                {
                    root.moveElement(vn.item(i), null);
                }
            }
            return(bugReport2);
        }
Esempio n. 16
0
        public virtual void testJMFDevCaps()
        {
            JDFDoc doc   = new JDFDoc(ElementName.JMF);
            JDFJMF jmfDC = doc.getJMFRoot();

            JDFResponse r = jmfDC.appendResponse(EnumType.KnownMessages);

            jmfDC.setSenderID("DeviceSenderID");

            JDFMessageService ms = r.appendMessageService();

            ms.setJMFRole(EnumJMFRole.Sender);
            ms.setQuery(true);
            ms.setType("KnownDevices");
            JDFDevCaps dcs = ms.appendDevCaps();

            dcs.setName("DeviceList");
            JDFDevCap dc   = dcs.appendDevCapInPool();
            JDFDevCap dcDI = dc.appendDevCap();

            dcDI.setName(ElementName.DEVICEINFO);
            dcDI.setMinOccurs(1);
            dcDI.setMaxOccurs(1);
            JDFStringState state = dcDI.appendStringState(AttributeName.DEVICEID);

            state.setRequired(true);

            state = dcDI.appendStringState(AttributeName.DEVICESTATUS);
            state.setRequired(true);
            state.appendValueAllowedValue("Running");

            ms = r.appendMessageService();
            ms.setJMFRole(EnumJMFRole.Sender);
            ms.setQuery(true);
            ms.setType("KnownMessages");
            dcs = ms.appendDevCaps();
            dcs.setName("MessageService");
            dc    = dcs.appendDevCapInPool();
            state = dc.appendStringState(AttributeName.TYPE);
            state.setRequired(true);
            state = dc.appendStringState("Foo");
            state.setRequired(false);

            JDFActionPool ap = ms.appendActionPool();
            JDFAction     a  = ap.appendActionTest(EnumTerm.IsPresentEvaluation, true);
            JDFTest       t  = a.getTest();

            // JDFTerm term=
            t.getTerm();
            // TODO
            JDFDoc docJMF = new JDFDoc("JMF");
            JDFJMF jmf    = docJMF.getJMFRoot();

            for (int i = 0; i < 3; i++)
            {
                JDFResponse   resp = jmf.appendResponse(EnumType.KnownDevices);
                JDFDeviceList dl   = resp.appendDeviceList();
                JDFDeviceInfo di   = dl.appendDeviceInfo();
                di.setDeviceID("d123");
                di.setDeviceStatus(EnumDeviceStatus.Running);
                XMLDoc report = JDFDeviceCap.getJMFInfo(jmf, r, EnumFitsValue.Allowed, EnumValidationLevel.Complete, true);
                Assert.AreEqual("true", report.getRoot().getAttribute("IsValid"));
            }
            {
                JDFResponse       resp = jmf.appendResponse(EnumType.KnownMessages);
                JDFMessageService mi   = resp.appendMessageService();
                mi.setType("FooBar");
                doc.write2File(sm_dirTestDataTemp + "JMFDevCap.xml", 2, false);
                docJMF.write2File(sm_dirTestDataTemp + "JMFDevCapTest.jmf", 2, false);
            }
            XMLDoc report_1 = JDFDeviceCap.getJMFInfo(jmf, r, EnumFitsValue.Allowed, EnumValidationLevel.Complete, true);

            Assert.AreEqual("true", report_1.getRoot().getAttribute("IsValid"));

            doc.write2File(sm_dirTestDataTemp + "JMFDevCap.xml", 2, false);
            docJMF.write2File(sm_dirTestDataTemp + "JMFDevCapTest.jmf", 2, false);
            {
                jmf.appendResponse(EnumType.AbortQueueEntry);
            }
            report_1 = JDFDeviceCap.getJMFInfo(jmf, r, EnumFitsValue.Allowed, EnumValidationLevel.Complete, true);
            Assert.AreEqual("false", report_1.getRoot().getAttribute("IsValid"));
        }