public void CastCheckExpectedCompatIds() { Type t = typeof(ISimpleGrain); int expectedInterfaceId = GrainInterfaceData.GetGrainInterfaceId(t); GrainReference grain = (GrainReference)GrainClient.GrainFactory.GetGrain <ISimpleGrain>(random.Next(), SimpleGrain.SimpleGrainNamePrefix); Assert.IsTrue(grain.IsCompatible(expectedInterfaceId)); }
public void CastFailInternalCastFromBadType() { Type t = typeof(ISimpleGrain); GrainReference grain = (GrainReference)GrainClient.GrainFactory.GetGrain <ISimpleGrain>(random.Next(), SimpleGrain.SimpleGrainNamePrefix); IAddressable cast = GrainReference.CastInternal( typeof(Boolean), null, grain, GrainInterfaceData.GetGrainInterfaceId(t)); Assert.Fail("Exception should have been raised"); }
public void CastCheckExpectedCompatIds2() { // GeneratorTestDerivedDerivedGrainReference extends GeneratorTestDerivedGrain2Reference // GeneratorTestDerivedGrain2Reference extends GeneratorTestGrainReference Type t1 = typeof(IGeneratorTestDerivedDerivedGrain); Type t2 = typeof(IGeneratorTestDerivedGrain2); Type t3 = typeof(IGeneratorTestGrain); int id1 = GrainInterfaceData.GetGrainInterfaceId(t1); int id2 = GrainInterfaceData.GetGrainInterfaceId(t2); int id3 = GrainInterfaceData.GetGrainInterfaceId(t3); GrainReference grain = (GrainReference)GrainClient.GrainFactory.GetGrain <IGeneratorTestDerivedDerivedGrain>(GetRandomGrainId()); Assert.IsTrue(grain.IsCompatible(id1)); Assert.IsTrue(grain.IsCompatible(id2)); Assert.IsTrue(grain.IsCompatible(id3)); }
public void ConfirmServiceInterfacesListContents() { // GeneratorTestDerivedDerivedGrainReference extends GeneratorTestDerivedGrain2Reference // GeneratorTestDerivedGrain2Reference extends GeneratorTestGrainReference Type t1 = typeof(IGeneratorTestDerivedDerivedGrain); Type t2 = typeof(IGeneratorTestDerivedGrain2); Type t3 = typeof(IGeneratorTestGrain); int id1 = GrainInterfaceData.GetGrainInterfaceId(t1); int id2 = GrainInterfaceData.GetGrainInterfaceId(t2); int id3 = GrainInterfaceData.GetGrainInterfaceId(t3); var interfaces = GrainInterfaceData.GetRemoteInterfaces(typeof(IGeneratorTestDerivedDerivedGrain)); Assert.IsNotNull(interfaces); Assert.AreEqual(3, interfaces.Keys.Count); Assert.IsTrue(interfaces.Keys.Contains(id1), "id1 is present"); Assert.IsTrue(interfaces.Keys.Contains(id2), "id2 is present"); Assert.IsTrue(interfaces.Keys.Contains(id3), "id3 is present"); }
public void InterfaceRules_ObserverGrain_PropertySetter() { GrainInterfaceData.ValidateInterface(typeof(IInheritedGrain_ObserverGrain_PropertySetter)); }
public void InterfaceRules_ObserverGrain_IntMethod() { GrainInterfaceData.ValidateInterface(typeof(IInheritedGrain_ObserverGrain_IntMethod)); }
public void InterfaceRules_RefArgument() { GrainInterfaceData.ValidateInterface(typeof(ITestGrain_RefArgument)); }
public void InterfaceRules_Observer_Property() { GrainInterfaceData.ValidateInterface(typeof(ITestObserver_Property)); }
public void InterfaceRules_Observer_NonVoidMethod() { GrainInterfaceData.ValidateInterface(typeof(ITestObserver_NonVoidMethod)); }
public void InterfaceRules_PropertySetter() { GrainInterfaceData.ValidateInterface(typeof(ITestGrain_PropertySetter)); }
public void InterfaceRules_IntProperty() { GrainInterfaceData.ValidateInterface(typeof(ITestGrain_IntProperty)); }
public void InterfaceRules_IntMethod() { GrainInterfaceData.ValidateInterface(typeof(ITestGrain_IntMethod)); }