public async Task BadActivate_GetValue()
        {
            try
            {
                int id = random.Next();
                IBadActivateDeactivateTestGrain grain = this.GrainFactory.GetGrain <IBadActivateDeactivateTestGrain>(id);

                long key = await grain.GetKey();

                Assert.True(false, "Expected ThrowSomething call to fail as unable to Activate grain, but returned " + key);
            }
            catch (ApplicationException exc)
            {
                Assert.Contains("Application-OnActivateAsync", exc.Message);
            }
        }
Пример #2
0
        public async Task BadActivate_GetValue()
        {
            try
            {
                int id = random.Next();
                IBadActivateDeactivateTestGrain grain = GrainClient.GrainFactory.GetGrain <IBadActivateDeactivateTestGrain>(id);

                long key = await grain.GetKey();

                Assert.True(false, "Expected ThrowSomething call to fail as unable to Activate grain, but returned " + key);
            }
            catch (Exception exc)
            {
                AssertIsNotInvalidOperationException(exc, "Application-OnActivateAsync");
            }
        }
Пример #3
0
        public async Task BadActivate_Await()
        {
            try
            {
                int id = random.Next();
                IBadActivateDeactivateTestGrain grain = this.GrainFactory.GetGrain <IBadActivateDeactivateTestGrain>(id);

                await grain.ThrowSomething();

                Assert.True(false, "Expected ThrowSomething call to fail as unable to Activate grain");
            }
            catch (Exception exc)
            {
                AssertIsNotInvalidOperationException(exc, "Application-OnActivateAsync");
            }
        }
Пример #4
0
        public async Task BadActivate_GetValue()
        {
            try
            {
                int id = random.Next();
                IBadActivateDeactivateTestGrain grain = GrainClient.GrainFactory.GetGrain <IBadActivateDeactivateTestGrain>(id);

                long key = await grain.GetKey();

                Assert.Fail("Expected ThrowSomething call to fail as unable to Activate grain, but returned " + key);
            }
            catch (Exception exc)
            {
                Console.WriteLine("Received exception: " + exc);
                Exception e = exc.GetBaseException();
                Console.WriteLine("Nested exception type: " + e.GetType().FullName);
                Console.WriteLine("Nested exception message: " + e.Message);
                Assert.IsInstanceOfType(e, typeof(Exception), "Did not get expected exception type returned: " + e);
                Assert.IsNotInstanceOfType(e, typeof(InvalidOperationException), "Did not get expected exception type returned: " + e);
                Assert.IsTrue(e.Message.Contains("Application-OnActivateAsync"), "Did not get expected exception message returned: " + e.Message);
            }
        }
 public async Task ForwardCall(IBadActivateDeactivateTestGrain otherGrain)
 {
     logger.Info("ForwardCall to " + otherGrain);
     await otherGrain.ThrowSomething();
 }
Пример #6
0
 public async Task ForwardCall(IBadActivateDeactivateTestGrain otherGrain)
 {
     logger.LogInformation("ForwardCall to {OtherGrain}", otherGrain);
     await otherGrain.ThrowSomething();
 }
 public async Task ForwardCall(IBadActivateDeactivateTestGrain otherGrain)
 {
     logger.Info("ForwardCall to " + otherGrain);
     await otherGrain.ThrowSomething();
 }