コード例 #1
0
        public MFTestResults TestMethod1()
        {
            MFTestResults testResult = MFTestResults.Fail;

            Log.Comment("Create the client and server sockets");

            SslServer sslServer = new SslServer();
            SslClient sslClient = new SslClient();

            try
            {
                // Set up the server here
                Log.Comment("Create server thread");
                sslServer.RunServer();

                // Set up the client here
                sslClient.serverEp = sslServer.serverEp;
                sslClient.RunClient();

                if (sslClient.messageSent == sslClient.messageReceived)
                {
                    testResult = MFTestResults.Pass;
                }
            }
            catch (Exception e)
            {
                Log.Comment("Incorrect Exception caught: " + e.ToString());
            }
            finally
            {
                try
                {
                    sslServer.Close();
                    sslClient.Close();
                }
                catch
                {
                }
            }

            Log.Comment("known issue: 20848	SSL tests don't work with loopback");
            return(testResult == MFTestResults.Fail ? MFTestResults.KnownFailure : testResult);
        }
コード例 #2
0
        private static bool TestMethod1()
        {
            // MFTestResults testResult = MFTestResults.Fail;
            bool testResult = false;

            Debug.Print("Create the client and server sockets");

            SslServer sslServer = new SslServer();
            SslClient sslClient = new SslClient();

            try
            {
                // Set up the server here
                Debug.Print("Create server thread");
                sslServer.RunServer();

                // Set up the client here
                sslClient.serverEp = sslServer.serverEp;
                sslClient.RunClient();

                if (sslClient.messageSent == sslClient.messageReceived)
                {
                    testResult = true;
                }
            }
            catch (Exception e)
            {
                Debug.Print("Incorrect Exception caught: " + e.ToString());
            }
            finally
            {
                try
                {
                    sslServer.Close();
                    sslClient.Close();
                }
                catch
                {
                }
            }
            return(testResult);
        }
コード例 #3
0
        public MFTestResults TestMethod1()
        {
            MFTestResults testResult = MFTestResults.Fail;

            Log.Comment("Create the client and server sockets");

            SslServer sslServer = new SslServer();
            SslClient sslClient = new SslClient();

            try
            {
                // Set up the server here
                Log.Comment("Create server thread");
                sslServer.RunServer();

                // Set up the client here
                sslClient.serverEp = sslServer.serverEp;
                sslClient.RunClient();

                if( sslClient.messageSent == sslClient.messageReceived )
                    testResult = MFTestResults.Pass;
            }
            catch (Exception e)
            {
                Log.Comment("Incorrect Exception caught: " + e.ToString());
            }
            finally
            {
                try
                {
                    sslServer.Close();
                    sslClient.Close();
                }
                catch
                {
                }
            }

            Log.Comment("known issue: 20848	SSL tests don't work with loopback");
            return (testResult == MFTestResults.Fail ? MFTestResults.KnownFailure : testResult);
        }