public override void setUp() { base.setUp(); JDFElement.setLongID(false); JDFDoc doc = new JDFDoc("Device"); device = (JDFDevice)doc.getRoot(); devicecap = device.appendDeviceCap(); devicecap.setCombinedMethod(EnumCombinedMethod.None); devicecap.setTypeExpression("(fnarf)|(blub)"); devicecap.setTypes(new VString("fnarf blub", null)); JDFDevCapPool dcp = devicecap.appendDevCapPool(); JDFDevCaps dcs = devicecap.appendDevCaps(); dcs.setContext(EnumContext.Resource); dcs.setName("Component"); dcs.setRequired(true); JDFDevCap dc = dcp.appendDevCap(); dc.setID("dc_Component"); dcs.setDevCapRef(dc); compState = dc.appendEnumerationState("ComponentType"); ptState = dc.appendNameState("ProductType"); }
public virtual void testGetNameState() { JDFDoc d = new JDFDoc("DevCap"); JDFDevCap dc = (JDFDevCap)d.getRoot(); JDFNameState ns = dc.appendNameState("foo"); Assert.AreEqual("foo", ns.getName()); ns = dc.getNameState("bar"); Assert.IsNull(ns); ns = dc.getCreateNameState("bar"); Assert.IsNotNull(ns); Assert.AreEqual("bar", ns.getName()); ns = dc.getNameState("bar"); Assert.IsNotNull(ns); Assert.AreEqual("bar", ns.getName()); }
public virtual void testUsageCounterDevCaps() { JDFDoc duc = new JDFDoc("DeviceCap"); JDFDeviceCap devicecap = (JDFDeviceCap)duc.getRoot(); JDFDevCaps dcs = devicecap.appendDevCaps(); dcs.setName(ElementName.USAGECOUNTER); JDFDevCap dc = dcs.appendDevCapInPool(); dc.setMinOccurs(3); dc.setMaxOccurs(3); JDFNameState counterID = dc.appendNameState(AttributeName.COUNTERID); counterID.setAllowedValueList(new VString("ID_Black ID_Color ID_Total", null)); counterID.setListType(EnumListType.SingleValue); duc.write2File(sm_dirTestDataTemp + "DevCapUsageCounter.jdf", 2, false); }