Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(timeout = 10_000) public void shouldProcessAllBatchesOnSingleCoreSystems() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldProcessAllBatchesOnSingleCoreSystems()
        {
            // GIVEN
            StageControl control    = mock(typeof(StageControl));
            int          processors = 1;

            int            batches    = 10;
            BatchProcessor step       = new BatchProcessor(control, processors);
            TrackingStep   downstream = new TrackingStep();

            step.Downstream = downstream;

            // WHEN
            step.Start(0);
            for (int i = 1; i <= batches; i++)
            {
                step.Receive(i, new Batch(processors));
            }
            step.EndOfUpstream();
            step.AwaitCompleted();
            step.Close();

            // THEN
            assertEquals(batches, downstream.Received.get());
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotDetachProcessorsFromBatchChains() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustNotDetachProcessorsFromBatchChains()
        {
            // GIVEN
            StageControl control    = mock(typeof(StageControl));
            int          processors = 1;

            int            batches    = 10;
            BatchProcessor step       = new BatchProcessor(control, processors);
            TrackingStep   downstream = new TrackingStep();

            step.Downstream = downstream;
            int delta = processors - step.Processors(0);

            step.Processors(delta);

            // WHEN
            step.Start(0);
            for (int i = 1; i <= batches; i++)
            {
                step.Receive(i, new Batch(processors));
            }
            step.EndOfUpstream();
            step.AwaitCompleted();
            step.Close();

            // THEN
            assertEquals(batches, downstream.Received.get());
        }