示例#1
0
        // This is a copy of RunAllStressTests with the tests that are not supported by Net.Tcp binding commented out
        public static void RunAllNetTcpStressTests()
        {
            //A full cycle of create/use/destroy
            CreateAndCloseFactoryAndChannelFullCycleTest <WcfService1.IService1, HelloWorldTest> .CreateFactoriesAndChannelsUseAllOnceCloseAll();

            CreateAndCloseFactoryAndChannelFullCycleTest <WcfService1.IDuplexService, DuplexTest> .CreateFactoriesAndChannelsUseAllOnceCloseAll();

            //CreateAndCloseFactoryAndChannelFullCycleTest<WcfService1.IStreamingService, StreamingTest>.CreateFactoriesAndChannelsUseAllOnceCloseAll();

            // Pool channel factories and always create/destroy channels
            PooledFactories <WcfService1.IService1, HelloWorldTest> .CreateUseAndCloseChannels();

            PooledFactories <WcfService1.IDuplexService, DuplexTest> .CreateUseAndCloseChannels();

            //PooledFactories<WcfService1.IStreamingService, StreamingTest>.CreateUseAndCloseChannels();

            // Pool channel factories, always create/destroy channels, recycle factories while using them
            RecyclablePooledFactories <WcfService1.IService1, HelloWorldTest> .RunAllScenariosWithWeights(100, 1);

            RecyclablePooledFactories <WcfService1.IDuplexService, DuplexTest> .RunAllScenariosWithWeights(100, 1);

            //RecyclablePooledFactories<WcfService1.IStreamingService, StreamingTest>.RunAllScenariosWithWeights(100, 1);

            // Pool both channel factories and channels, never recycle
            PooledFactoriesAndChannels <WcfService1.IService1, HelloWorldTest> .UseChannelsInPooledFactoriesAndChannels();

            PooledFactoriesAndChannels <WcfService1.IDuplexService, DuplexTest> .UseChannelsInPooledFactoriesAndChannels();

            //PooledFactoriesAndChannels<WcfService1.IStreamingService, StreamingTest>.UseChannelsInPooledFactoriesAndChannels();


            //// These will get stuck with wcf/issues/108
            //// So we comment them out and use *_OpenOnce workaround instead
            //RecyclablePooledFactoriesAndChannels<WcfService1.IService1, HelloWorldTestTemplate>.RunAllScenariosWithWeights(100, 1, 1);
            //RecyclablePooledFactoriesAndChannels<WcfService1.IDuplexService, DuplexTestTemplate>.RunAllScenariosWithWeights(100, 1, 1);
            //RecyclablePooledFactoriesAndChannels<WcfService1.IStreamingService, StreamingTest>.RunAllScenariosWithWeights(100, 1, 1);

            // Pool both channel factories and channels, recycle both factories and channels while using them
            RecyclablePooledFactoriesAndChannels_OpenOnce <WcfService1.IService1, HelloWorldTest> .RunAllScenariosWithWeights(100, 1, 1);

            RecyclablePooledFactoriesAndChannels_OpenOnce <WcfService1.IDuplexService, DuplexTest> .RunAllScenariosWithWeights(100, 1, 1);

            //RecyclablePooledFactoriesAndChannels_OpenOnce<WcfService1.IStreamingService, StreamingTest>.RunAllScenariosWithWeights(100, 1, 1);


            // Pool both factories and channels, use their async methods, recycle both factories and channels while using them
            RecyclablePooledFactoriesAndChannelsAsync_OpenOnce <WcfService1.IService1, HelloWorldTest> .RunAllScenariosWithWeightsAsync(1000, 1, 1).Wait();

            RecyclablePooledFactoriesAndChannelsAsync_OpenOnce <WcfService1.IDuplexService, DuplexTest> .RunAllScenariosWithWeightsAsync(1000, 1, 1).Wait();

            //RecyclablePooledFactoriesAndChannelsAsync_OpenOnce<WcfService1.IStreamingService, StreamingTest>.RunAllScenariosWithWeightsAsync(1000, 1, 1).Wait();
        }
示例#2
0
        public static void RunAllStressTests <ChannelType, TestTemplate, TestParams>()
            where ChannelType : class
            where TestTemplate : ITestTemplate <ChannelType, TestParams>, IExceptionPolicy, new()
            where TestParams : IPoolTestParameter
        {
            CreateAndCloseFactoryAndChannelFullCycleTest <ChannelType, TestTemplate, TestParams> .CreateFactoriesAndChannelsUseAllOnceCloseAll();

            PooledFactories <ChannelType, TestTemplate, TestParams> .CreateUseAndCloseChannels();

            PooledFactoriesAndChannels <ChannelType, TestTemplate, TestParams> .UseChannelsInPooledFactoriesAndChannels();

            RecyclablePooledFactories <ChannelType, TestTemplate, TestParams> .RunAllScenariosWithWeights(100, 1);

            RecyclablePooledFactoriesAndChannels_OpenOnce <ChannelType, TestTemplate, TestParams> .RunAllScenariosWithWeights(100, 1, 1);
        }