/// <summary> /// Returns an inflated TestResult instance given a TDS-format XML string /// </summary> /// <param name="testXml"></param> /// <returns></returns> private TestResult InflateTestResult(XmlDocument testXml, ITestResultSerializerFactory serializerFactory) { XMLAdapter xmlAdaptor = serializerFactory.CreateDeserializer(testXml); bool isValid; TestResult tr = xmlAdaptor.CreateTestResult(null, out isValid, false); if (!isValid) { tr = null; } return(tr); }
//public long InsertXml(Location location, XmlDocument contents, string callbackURL) //{ // ITestResultSerializerFactory f = AIR.Common.ServiceLocator.Resolve<ITestResultSerializerFactory>(); // if(f == null) // throw new ApplicationException("Cannot insert XML. Must register a ITestResultSerializerFactory with the ServiceLocator."); // return InsertXml(location, contents, callbackURL, f); //} public long InsertXml(Location location, XmlDocument contents, string callbackURL, ITestResultSerializerFactory serializerFactory) { string testName = null; long testeeKey, oppId; bool isDemo = false; DateTime statusDate; if (serializerFactory == null) { throw new ApplicationException("Cannot insert XML. ITestResultSerializerFactory cannot be null."); } XMLAdapter adapter = serializerFactory.CreateDeserializer(contents); adapter.GetKeyValues(out testName, out oppId, out testeeKey, out statusDate, out isDemo); return(InsertXml(location, testName, oppId.ToString(), testeeKey, statusDate, isDemo, contents, callbackURL)); }
static void Main(string[] args) { //XML适配器 XMLA To XMLB (XMLB实现XMLA需要的接口方法,但是方法名不同,需要适配器修改) XMLAdapter _XMLAdapter = new XMLAdapter(); _XMLAdapter.XMLRead(); //电压适配器 需要适配器修改220电压为110电压 DianYa220 _DianYa220 = new DianYa220(); DianYaAdapter _DianYaAdapter = new DianYaAdapter(_DianYa220); _DianYaAdapter.DianYa220ToDianYa110(); //类适配器以及对象适配器 ClientDemo _ClientDemo = new ClientDemo(); _ClientDemo.TestClassAdapter(); //类适配器 _ClientDemo.TestObjectAdapter(); //对象适配器 }
public void PreRoute(QASystem tis, XMLAdapter adapter, TestResult tr, XmlRepositoryItem xmlRepoItem, ProjectMetaData projectMetaData, SendToModifiers sendToModifiers, ITISExtenderState state) { // do nothing }
public bool ShouldScore(QASystem tis, XMLAdapter adapter, TestResult tr, ProjectMetaData projectMetaData, ITISExtenderState state) { return(true); }