Ejemplo n.º 1
0
        public virtual void TestAsyncDiskService()
        {
            string[]         vols    = new string[] { "/0", "/1" };
            AsyncDiskService service = new AsyncDiskService(vols);
            int total = 100;

            for (int i = 0; i < total; i++)
            {
                service.Execute(vols[i % 2], new TestAsyncDiskService.ExampleTask(this));
            }
            Exception e = null;

            try
            {
                service.Execute("no_such_volume", new TestAsyncDiskService.ExampleTask(this));
            }
            catch (RuntimeException ex)
            {
                e = ex;
            }
            NUnit.Framework.Assert.IsNotNull("Executing a task on a non-existing volume should throw an "
                                             + "Exception.", e);
            service.Shutdown();
            if (!service.AwaitTermination(5000))
            {
                Fail("AsyncDiskService didn't shutdown in 5 seconds.");
            }
            Assert.Equal(total, count);
        }
Ejemplo n.º 2
0
 public _ThreadFactory_73(AsyncDiskService _enclosing)
 {
     this._enclosing = _enclosing;
 }