public async Task StreamTest_16_Deactivation_OneProducerGrainOneConsumerGrain()
        {
            Heading("StreamTest_16_Deactivation_OneProducerGrainOneConsumerGrain");
            Guid streamId = Guid.NewGuid();

            Guid[] consumerGrainIds = { Guid.NewGuid() };
            Guid[] producerGrainIds = { Guid.NewGuid() };

            // consumer joins first, producer later
            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger, consumerGrainIds);

            producer = await ProducerProxy.NewProducerGrainsAsync(streamId, streamProviderName, null, logger, producerGrainIds);
            await BasicTestAsync(false);

            //await consumer.StopBeingConsumer();
            await StopProxies();

            await consumer.DeactivateOnIdle();

            await producer.DeactivateOnIdle();

            await TestingUtils.WaitUntilAsync(lastTry => CheckGrainsDeactivated(null, consumer, false), _timeout);

            await TestingUtils.WaitUntilAsync(lastTry => CheckGrainsDeactivated(producer, null, false), _timeout);

            logger.Info("\n\n\n*******************************************************************\n\n\n");

            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger, consumerGrainIds);

            producer = await ProducerProxy.NewProducerGrainsAsync(streamId, streamProviderName, null, logger, producerGrainIds);

            await BasicTestAsync(false);
            await StopProxies();
        }
        internal async Task StreamTest_Create_OneProducerGrainOneConsumerGrain()
        {
            Guid streamId = Guid.NewGuid();

            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger);

            producer = await ProducerProxy.NewProducerGrainsAsync(streamId, streamProviderName, null, logger);
        }
Exemplo n.º 3
0
        internal async Task StreamTest_Create_OneProducerGrainOneConsumerGrain()
        {
            Guid streamId = Guid.NewGuid();

            this.consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, this.streamProviderName, this.logger, this.client);

            this.producer = await ProducerProxy.NewProducerGrainsAsync(streamId, this.streamProviderName, null, this.logger, this.client);
        }
        public async Task StreamTest_07_ManyDifferent_ManyProducerClientsManyConsumerGrains()
        {
            Heading("StreamTest_07_ManyDifferent_ManyProducerClientsManyConsumerGrains");
            Guid streamId = Guid.NewGuid();

            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger, null, Many);

            producer = await ProducerProxy.NewProducerClientObjectsAsync(streamId, streamProviderName, null, logger, Many);
            await BasicTestAsync();
            await StopProxies();
        }
Exemplo n.º 5
0
        //------------------------ MANY to Many different grains ----------------------//

        public async Task StreamTest_05_ManyDifferent_ManyProducerGrainsManyConsumerGrains()
        {
            Heading("StreamTest_05_ManyDifferent_ManyProducerGrainsManyConsumerGrains");
            Guid streamId = Guid.NewGuid();

            this.consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, this.streamProviderName, this.logger, this.client, null, Many);

            this.producer = await ProducerProxy.NewProducerGrainsAsync(streamId, this.streamProviderName, null, this.logger, this.client, null, Many);
            await BasicTestAsync();
            await StopProxies();
        }
        public async Task StreamTest_12_ManySame_ManyProducerClientsManyConsumerGrains()
        {
            Heading("StreamTest_12_ManySame_ManyProducerClientsManyConsumerGrains");
            Guid streamId = Guid.NewGuid();
            Guid grain1   = Guid.NewGuid();

            Guid[] consumerGrainIds = new Guid[] { grain1, grain1, grain1 };
            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger, consumerGrainIds);

            producer = await ProducerProxy.NewProducerClientObjectsAsync(streamId, streamProviderName, null, logger, Many);
            await BasicTestAsync();
            await StopProxies();
        }
        public async Task StreamTest_10_ManySame_ManyConsumerGrainsManyProducerGrains()
        {
            Heading("StreamTest_10_ManySame_ManyConsumerGrainsManyProducerGrains");
            Guid streamId = Guid.NewGuid();
            Guid grain1   = Guid.NewGuid();
            Guid grain2   = Guid.NewGuid();

            Guid[] consumerGrainIds = new Guid[] { grain1, grain1, grain1 };
            Guid[] producerGrainIds = new Guid[] { grain2, grain2, grain2 };
            // consumer joins first, producer later
            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger, consumerGrainIds);

            producer = await ProducerProxy.NewProducerGrainsAsync(streamId, streamProviderName, null, logger, producerGrainIds);
            await BasicTestAsync();
            await StopProxies();
        }
        public async Task StreamTest_03_OneProducerClientOneConsumerGrain()
        {
            Heading("StreamTest_03_OneProducerClientOneConsumerGrain");
            Guid streamId = Guid.NewGuid();

            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger);

            producer = await ProducerProxy.NewProducerClientObjectsAsync(streamId, streamProviderName, null, logger);
            await BasicTestAsync();
            await StopProxies();

            streamId = Guid.NewGuid();
            producer = await ProducerProxy.NewProducerClientObjectsAsync(streamId, streamProviderName, null, logger);

            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger);
            await BasicTestAsync();
            await StopProxies();
        }
        //------------------------ One to One ----------------------//
        public async Task StreamTest_01_OneProducerGrainOneConsumerGrain()
        {
            Heading("StreamTest_01_ConsumerJoinsFirstProducerLater");
            Guid streamId = Guid.NewGuid();

            // consumer joins first, producer later
            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger);

            producer = await ProducerProxy.NewProducerGrainsAsync(streamId, streamProviderName, null, logger);
            await BasicTestAsync();
            await StopProxies();

            streamId = Guid.NewGuid();
            // produce joins first, consumer later
            producer = await ProducerProxy.NewProducerGrainsAsync(streamId, streamProviderName, null, logger);

            consumer = await ConsumerProxy.NewConsumerGrainsAsync(streamId, streamProviderName, logger);
            await BasicTestAsync();
            await StopProxies();
        }