Exemple #1
0
        public virtual void testgetMatchingElementsFromParentMulti()
        {
            JDFDoc    ddc = new JDFDoc("DevCap");
            JDFDoc    dde = new JDFDoc("Layout");
            JDFDevCap dc  = (JDFDevCap)ddc.getRoot();
            JDFLayout e   = (JDFLayout)dde.getRoot();

            for (int i = 0; i < 2; i++)
            {
                JDFDevCap dc1 = dc.appendDevCap();
                dc1.setName("Media");
                dc1.setMaxOccurs(1);
                dc1.setMinOccurs(1);
                JDFEnumerationState es = dc1.appendEnumerationState("MediaType");
                string mediaType       = i == 0 ? "Paper" : "Plate";
                es.setAllowedValueList(new VString(mediaType, null));

                e.appendElement("Media").setAttribute("MediaType", mediaType);
            }
            VElement devCapVector = dc.getDevCapVector(null, true);

            for (int i = 0; i < 2; i++)
            {
                VElement vMatch = ((JDFDevCap)devCapVector.item(i)).getMatchingElementsFromParent(e, devCapVector);
                Assert.AreEqual(1, vMatch.Count);
                Assert.AreEqual(e.getElement("Media", null, i), vMatch.item(0));
            }
        }
Exemple #2
0
        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");
        }
Exemple #3
0
        public virtual void testGetEnumerationState()
        {
            JDFDoc              d  = new JDFDoc("DevCap");
            JDFDevCap           dc = (JDFDevCap)d.getRoot();
            JDFEnumerationState es = dc.appendEnumerationState("foo");

            Assert.AreEqual("foo", es.getName());
            es = dc.getEnumerationState("bar");
            Assert.IsNull(es);
            es = dc.getCreateEnumerationState("bar");
            Assert.IsNotNull(es);
            Assert.AreEqual("bar", es.getName());
            es = dc.getEnumerationState("bar");
            Assert.IsNotNull(es);
            Assert.AreEqual("bar", es.getName());
        }