public virtual void testEvent() { Assert.IsNull(sc.getDocJMFNotification(false)); sc.setEvent("id", "value", "blah blah"); d = sc.getDocJMFNotification(false); JDFDoc d2 = sc.getDocJMFNotification(false); Assert.IsTrue(d.getRoot().isEqual(d2.getRoot())); d = sc.getDocJMFNotification(true); d2 = sc.getDocJMFNotification(false); Assert.IsNull(d2); JDFJMF jmf = d.getJMFRoot(); JDFNotification noti = jmf.getSignal(0).getNotification(); Assert.AreEqual(noti.getJobID(), n.getJobID(true)); Assert.IsNotNull(noti.getEvent()); d.write2File(sm_dirTestDataTemp + "jmfNotification.jmf", 2, false); Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete)); sc.setEvent("id1", "value", "blah blah"); sc.setEvent("id2", "value", "blah blah blah"); d = sc.getDocJMFNotification(false); jmf = d.getJMFRoot(); Assert.AreEqual(2, jmf.numChildElements(ElementName.SIGNAL,null)); sc.setEvent("id2","value","blah blah blah"); d = sc.getDocJMFNotification(true); jmf = d.getJMFRoot(); Assert.AreEqual(3,jmf.numChildElements(ElementName.SIGNAL,null)); d = sc.getDocJMFNotification(true); Assert.IsNull(d); }
public virtual void testPerfectingJMF() { JDFElement.setLongID(false); JDFJMF jmfStatus = JDFJMF.createJMF(EnumFamily.Signal, EnumType.Status); jmfStatus.setSenderID("thePress"); JDFSignal sig = jmfStatus.getSignal(0); JDFDeviceInfo di = sig.appendDeviceInfo(); di.setDeviceStatus(EnumDeviceStatus.Running); JDFJobPhase jp = di.appendJobPhase(); jp.setJobID("jobID"); jp.setJobPartID("jobPartID"); jp.setStatus(EnumNodeStatus.InProgress); JDFModuleStatus ms = jp.appendModuleStatus(); ms.setModuleID("ID_Perfecting_1"); ms.setModuleType("PerfectingModule"); ms.setDeviceStatus(EnumDeviceStatus.Idle); ms = jp.appendModuleStatus(); ms.setModuleType("PrintModule"); ms.setDeviceStatus(EnumDeviceStatus.Running); ms.setModuleIndex(new JDFIntegerRangeList("0 1 3 4")); ms = jp.appendModuleStatus(); ms.setModuleType("PrintModule"); ms.setDeviceStatus(EnumDeviceStatus.Idle); ms.setModuleIndex(new JDFIntegerRangeList("2")); jmfStatus.getOwnerDocument_JDFElement().write2File(sm_dirTestDataTemp + "StatusPerfecting.jmf", 2, false); Assert.IsTrue(jmfStatus.isValid(EnumValidationLevel.Complete), "known defect - wait for autoclass fix"); }