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); }
public virtual void testBugBuild058() { // get the JDF document root element JDFDoc jdfDoc = new JDFDoc(ElementName.JDF); JDFNode productNode = jdfDoc.getJDFRoot(); productNode.setType(JDFNode.EnumType.Product.getName(), false); // Add an intent resource JDFLayoutIntent layoutIntent = (JDFLayoutIntent)productNode.appendMatchingResource("LayoutIntent", JDFNode.EnumProcessUsage.AnyInput, null); // set the type attribute JDFResourceLink rli = productNode.getMatchingLink("LayoutIntent", JDFNode.EnumProcessUsage.AnyInput, 0); bool bValid = rli.isValid(KElement.EnumValidationLevel.Complete); Assert.IsTrue(bValid); JDFLayoutIntent layoutIntent2 = (JDFLayoutIntent)rli.getTarget(); bValid = bValid && (layoutIntent2.Equals(layoutIntent)); Assert.IsTrue(bValid); }