public virtual void testGetExecutableJDF() { string docTest = "MISPrepress_ICS_Minimal.jdf"; string docDevCap = "DevCaps_Product_MISPrepress_ICS_Minimal.jdf"; // parse input file JDFParser p = new JDFParser(); JDFDoc jmfDevCap = p.parseFile(sm_dirTestData + docDevCap); JDFJMF jmfRoot = null; Assert.IsNotNull(jmfDevCap, "Parse of file " + docDevCap + " failed"); jmfRoot = jmfDevCap.getJMFRoot(); Assert.IsNotNull(jmfRoot, "jmfRoot == null Can't start Test"); XMLDoc docOutDevCap = jmfRoot.getOwnerDocument_KElement(); docOutDevCap.write2File(sm_dirTestDataTemp + "_" + docDevCap, 0, true); JDFDoc jdfTest = p.parseFile(sm_dirTestData + docTest); JDFNode jdfRoot = jdfTest.getJDFRoot(); Assert.IsTrue(jdfRoot != null, "jdfRoot is null"); if (jdfRoot != null) { jdfRoot.getOwnerDocument_KElement(); JDFDeviceCap deviceCap = (JDFDeviceCap)jmfRoot.getChildByTagName("DeviceCap", null, 0, null, false, true); EnumFitsValue testlists = EnumFitsValue.Allowed; EnumValidationLevel level = KElement.EnumValidationLevel.Complete; VElement vExecNodes = deviceCap.getExecutableJDF(jdfRoot, testlists, level); if (vExecNodes == null) { Console.WriteLine(docDevCap + ": found No matching JDFNode"); } else { for (int n = 0; n < vExecNodes.Count; n++) { // XMLDoc docExecNodes = ((JDFNode) // vExecNodes.elementAt(n)).getOwnerDocument_KElement(); // docExecNodes.write2File ("temp\\" + "_" + docTest // +"_ExecNode" + (n+1) + // ".jdf", 0); Console.WriteLine(vExecNodes[n]); } } XMLDoc testResult = deviceCap.getBadJDFInfo(jdfRoot, testlists, level); if (testResult != null) { testResult.write2File(sm_dirTestDataTemp + "_BugReport.xml", 0, true); } } }
public virtual void testDeviceCapIsValid() { JDFParser p = new JDFParser(); string docDevCap = "DevCaps_Product_MISPrepress_ICS_Minimal.jdf"; JDFDoc jmfDevCap = p.parseFile(sm_dirTestData + docDevCap); Assert.IsNotNull(jmfDevCap, "Parse of file " + docDevCap + " failed"); JDFJMF jmfRoot = jmfDevCap.getJMFRoot(); Assert.IsNotNull(jmfRoot, "jmfRoot == null Can't start Test"); JDFDeviceCap deviceCap = (JDFDeviceCap)jmfRoot.getChildByTagName("DeviceCap", "", 0, null, false, true); Assert.IsTrue(deviceCap.isValid(KElement.EnumValidationLevel.Incomplete)); }