public virtual void testMediaRef() { JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); JDFSignal s = jmf.appendSignal(); jmf.setSenderID("DeviceSenderID"); s.setType(EnumType.Resource); JDFResourceQuParams rqp = s.appendResourceQuParams(); rqp.setJobID("JobID"); rqp.setJobPartID("JobPartID"); rqp.setResourceName(ElementName.EXPOSEDMEDIA); JDFResourceInfo ri = s.appendResourceInfo(); JDFExposedMedia xm = (JDFExposedMedia)ri.appendElement("ExposedMedia"); JDFResourceInfo ri2 = s.appendResourceInfo(); JDFMedia m = (JDFMedia)ri2.appendElement("Media"); JDFRefElement rm = xm.refElement(m); Assert.AreEqual(m, rm.getTarget(), "works initially "); Assert.AreEqual(m, rm.getTarget(), "also works with cache"); }
public virtual void testUsageCounter() { JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); JDFSignal s = jmf.appendSignal(); jmf.setSenderID("DeviceSenderID"); s.setType(EnumType.Resource); JDFResourceQuParams rqp = s.appendResourceQuParams(); rqp.setJobID("JobID"); rqp.setJobPartID("JobPartID"); rqp.setResourceName(ElementName.USAGECOUNTER); JDFResourceInfo ri = s.appendResourceInfo(); ri.setActualAmount(42); JDFUsageCounter uc = (JDFUsageCounter)ri.appendElement(ElementName.USAGECOUNTER); uc.setID("UsageCounterID"); uc.setScope(EnumScope.Job); uc.setCounterID("DeviceCounterID"); uc.setResStatus(EnumResStatus.Available, true); uc.setCounterTypes(new VString("NormalSize", " ")); doc.write2File(sm_dirTestDataTemp + "JMFResourceSignal.jmf", 2, false); Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete)); }
public virtual void testPrivateMessage() { JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); JDFSignal s = (JDFSignal)jmf.appendMessageElement(EnumFamily.Signal, null); s.setType("foo:test"); s.appendDevice(); Assert.IsNull(s.getXSIType()); Assert.IsTrue(s.getDevice(0) != null, "get device"); }
public override void setUp() { base.setUp(); JDFElement.setLongID(false); doc = new JDFDoc(ElementName.JMF); jmf = doc.getJMFRoot(); signal = jmf.appendSignal(); jmf.setSenderID("DeviceSenderID"); signal.setType(EnumType.Status); sqp = signal.appendStatusQuParams(); sqp.setJobID("JobID"); sqp.setJobPartID("JobPartID"); }
public virtual void testJobPhase() { JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); JDFSignal s = (JDFSignal)jmf.appendMessageElement(EnumFamily.Signal, null); s.setType("Status"); JDFStatusQuParams sqp = s.appendStatusQuParams(); sqp.setDeviceDetails(EnumDeviceDetails.Brief); JDFDeviceInfo di = s.appendDeviceInfo(); JDFJobPhase jp = di.appendJobPhase(); Assert.AreEqual(di.getJobPhase(0), jp); jp = (JDFJobPhase)di.appendElement("jdf:JobPhase", JDFElement.getSchemaURL()); Assert.AreEqual(di.getJobPhase(1), jp); Assert.IsNull(di.getJobPhase(2)); jp.appendNode(); Assert.IsTrue(jp.isValid(EnumValidationLevel.Incomplete)); }
public virtual void testMedia() { JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); JDFSignal s = jmf.appendSignal(); jmf.setSenderID("DeviceSenderID"); s.setType(EnumType.Resource); JDFResourceQuParams rqp = s.appendResourceQuParams(); rqp.setJobID("JobID"); rqp.setJobPartID("JobPartID"); rqp.setResourceName(ElementName.MEDIA); JDFResourceInfo ri = s.appendResourceInfo(); ri.getCreateAmountPool(); // TODO continue }