コード例 #1
0
ファイル: Serializer.cs プロジェクト: stefb965/web-tests
 public static XElement Write(object instance)
 {
     if (instance is string)
     {
         return(TestSerializer.WriteString((string)instance));
     }
     else if (instance is XElement)
     {
         return(TestSerializer.WriteElement((XElement)instance));
     }
     else if (instance is TestResult)
     {
         return(TestSerializer.WriteTestResult((TestResult)instance));
     }
     else if (instance is TestLoggerBackend.LogEntry)
     {
         return(TestSerializer.WriteLogEntry((TestLoggerBackend.LogEntry)instance));
     }
     else if (instance is TestLoggerBackend.StatisticsEventArgs)
     {
         return(TestSerializer.WriteStatisticsEvent((TestLoggerBackend.StatisticsEventArgs)instance));
     }
     else if (instance is ObjectProxy)
     {
         return(RemoteObjectManager.WriteProxy((ObjectProxy)instance));
     }
     else
     {
         throw new ServerErrorException();
     }
 }
コード例 #2
0
        internal override async Task OnStart(CancellationToken cancellationToken)
        {
            var handshake = new Handshake {
                WantStatisticsEvents = true, Settings = App.Settings
            };

            await RemoteObjectManager.Handshake(this, App.Logger.Backend, handshake, cancellationToken);

            await base.Start(cancellationToken);
        }
コード例 #3
0
ファイル: TestCaseClient.cs プロジェクト: stefb965/web-tests
        static XElement WriteTestCaseList(IEnumerable <TestCaseServant> list)
        {
            var root = new XElement("TestCaseList");

            foreach (var child in list)
            {
                root.Add(RemoteObjectManager.WriteProxy(child));
            }
            return(root);
        }
コード例 #4
0
ファイル: TestCaseClient.cs プロジェクト: stefb965/web-tests
        async Task <List <TestCaseClient> > ReadTestCaseList(XElement node, CancellationToken cancellationToken)
        {
            if (!node.Name.LocalName.Equals("TestCaseList"))
            {
                throw new ServerErrorException();
            }

            var list = new List <TestCaseClient> ();

            foreach (var element in node.Elements())
            {
                var proxy = RemoteObjectManager.ReadTestCase(Session, element);
                var test  = await FromProxy(proxy, cancellationToken);

                list.Add(test);
            }

            return(list);
        }
コード例 #5
0
        internal static async Task <TestSessionClient> FromProxy(ObjectProxy proxy, CancellationToken cancellationToken)
        {
            var session = (TestSessionClient)proxy;

            if (session.suite != null)
            {
                return(session);
            }

            session.provider = await RemoteObjectManager.GetRemoteTestConfiguration(session, cancellationToken).ConfigureAwait(false);

            session.configuration = new TestConfiguration(session.provider, session.Connection.App.Settings);
            session.name          = session.provider.Name;

            session.suite = await RemoteObjectManager.GetRemoteTestSuite(session, cancellationToken).ConfigureAwait(false);

            session.root = await RemoteObjectManager.GetRootTestCase(session, cancellationToken);

            return(session);
        }
コード例 #6
0
        public override async Task UpdateSettings(CancellationToken cancellationToken)
        {
            await RemoteObjectManager.UpdateSettings(this, cancellationToken);

            OnConfigurationChanged();
        }
コード例 #7
0
 public override Task <TestCase> ResolveFromPath(XElement path, CancellationToken cancellationToken)
 {
     return(RemoteObjectManager.ResolveFromPath(this, path, cancellationToken));
 }
コード例 #8
0
ファイル: TestServer.cs プロジェクト: pjcollins/web-tests
 protected override Task <TestSession> GetTestSession(CancellationToken cancellationToken)
 {
     return(RemoteObjectManager.GetRemoteTestSession(client, cancellationToken));
 }