示例#1
0
        protected async Task OneTimeSetUp()
        {
            // make sure all servers started in travis use a different port, or test will fail
            int testPort = 50000 + (((Int32)DateTime.UtcNow.ToFileTimeUtc() / 10000) & 0x1fff);

            _serverCapabilities = new ServerCapabilities();
            _randomSource       = new RandomSource(randomStart);
            _dataGenerator      = new DataGenerator(_randomSource);
            _server             = new GlobalDiscoveryTestServer(true);
            await _server.StartServer(true, testPort);

            await Task.Delay(1000);

            // load clients
            _gdsClient = new GlobalDiscoveryTestClient(true);
            await _gdsClient.LoadClientConfiguration(testPort);

            _pushClient = new ServerConfigurationPushTestClient(true);
            await _pushClient.LoadClientConfiguration(testPort);

            // connect once
            await _gdsClient.GDSClient.Connect(_gdsClient.GDSClient.EndpointUrl);

            await _pushClient.PushClient.Connect(_pushClient.PushClient.EndpointUrl);

            ConnectGDSClient(true);
            RegisterPushServerApplication(_pushClient.PushClient.EndpointUrl);

            _selfSignedServerCert = new X509Certificate2(_pushClient.PushClient.Session.ConfiguredEndpoint.Description.ServerCertificate);
            _domainNames          = Utils.GetDomainsFromCertficate(_selfSignedServerCert).ToArray();

            CreateCATestCerts(_pushClient.TempStorePath);
        }
示例#2
0
        protected void OneTimeSetUp()
        {
#if DEBUG
            // work around travis issue by selecting different ports on every run
            const int testPort = 60000;
#else
            const int testPort = 60010;
#endif
            _serverCapabilities = new ServerCapabilities();
            _randomSource       = new RandomSource(randomStart);
            _dataGenerator      = new DataGenerator(_randomSource);
            _server             = new GlobalDiscoveryTestServer(true);
            _server.StartServer(true, testPort).Wait();

            // load client
            _gdsClient = new GlobalDiscoveryTestClient(true);
            _gdsClient.LoadClientConfiguration(testPort).Wait();

            // good applications test set
            _goodApplicationTestSet    = ApplicationTestSet(goodApplicationsTestCount, false);
            _invalidApplicationTestSet = ApplicationTestSet(invalidApplicationsTestCount, true);

            _goodRegistrationOk    = false;
            _invalidRegistrationOk = false;
        }
示例#3
0
        protected void OneTimeSetUp()
        {
            // work around travis issue by selecting different ports on every run
            int testPort = 50000 + (((Int32)DateTime.UtcNow.ToFileTimeUtc() / 10000) & 0x1fff);

            _server = new GlobalDiscoveryTestServer(true);
            _server.StartServer(true, testPort).Wait();

            // load client
            _gdsClient = new GlobalDiscoveryTestClient(true);
            _gdsClient.LoadClientConfiguration(testPort).Wait();

            // good applications test set
            _appTestDataGenerator      = new ApplicationTestDataGenerator(1);
            _goodApplicationTestSet    = _appTestDataGenerator.ApplicationTestSet(goodApplicationsTestCount, false);
            _invalidApplicationTestSet = _appTestDataGenerator.ApplicationTestSet(invalidApplicationsTestCount, true);

            _goodRegistrationOk      = false;
            _invalidRegistrationOk   = false;
            _goodNewKeyPairRequestOk = false;
        }