Exemple #1
0
        public async Task <TestResult> Run(CancellationToken cancellationToken)
        {
            var runCommand = new RunCommand();
            var result     = await runCommand.Send(this, null, cancellationToken);

            Connection.Debug("RUN: {0}", result);
            return(result);
        }
Exemple #2
0
        internal static async Task Handshake(ClientConnection connection, TestLoggerBackend logger, Handshake handshake, CancellationToken cancellationToken)
        {
            Connection.Debug("Client Handshake: {0}", handshake);

            handshake.EventSink = new EventSinkServant(connection, logger);

            var handshakeCommand = new HandshakeCommand();
            await handshakeCommand.Send(connection, handshake, cancellationToken);

            cancellationToken.ThrowIfCancellationRequested();

            Connection.Debug("Client Handshake done");
        }
Exemple #3
0
        protected virtual async Task Initialize(CancellationToken cancellationToken)
        {
            Connection.Debug("INITIALIZE");

            cancellationToken.ThrowIfCancellationRequested();
            Session = await GetTestSession(cancellationToken);

            Connection.Debug("GOT SESSION: {0}", Session);

            cancellationToken.ThrowIfCancellationRequested();
            TestSuite = Session.Suite;

            Connection.Debug("GOT TEST SUITE: {0}", TestSuite);
        }
Exemple #4
0
        static Handshake ReadHandshake(Connection connection, XElement node)
        {
            if (!node.Name.LocalName.Equals("Handshake"))
            {
                throw new ServerErrorException();
            }

            var instance = new Handshake();

            instance.WantStatisticsEvents = bool.Parse(node.Attribute("WantStatisticsEvents").Value);

            var settings = node.Element("Settings");

            Connection.Debug("Handshake: {0}", settings);
            instance.Settings = TestSerializer.ReadSettings(settings);

            var logger = node.Element("EventSink");

            instance.EventSink = ReadProxy(connection, logger, (objectID) => new EventSinkClient((ServerConnection)connection, objectID));

            return(instance);
        }
Exemple #5
0
 protected override Task <object> Run(Connection connection, RemoteTestSession proxy, XElement argument, CancellationToken cancellationToken)
 {
     Connection.Debug("Update settings: {0}", argument);
     proxy.Servant.UpdateSettings(argument);
     return(Task.FromResult <object> (null));
 }