public TaggedComponent[] get_effective_components(int id) { IIorProfile selectedProfile = m_clientRequest.SelectedProfile; if (selectedProfile.ContainsTaggedComponent(id)) { return(selectedProfile.GetTaggedComponents(id)); } throw new BAD_PARAM(25, CompletionStatus.Completed_MayBe); }
private void CheckIorForUrl(Ior iorForUrl, int expectedNumberOfComponents, bool shouldHaveCodeSetComponent) { Assert.AreEqual(1, iorForUrl.Profiles.Length, "number of profiles"); Assert.AreEqual(typeof(MarshalByRefObject), iorForUrl.Type, "type"); IIorProfile profile = iorForUrl.FindInternetIiopProfile(); Assert.NotNull(profile, "internet iiop profile"); Assert.AreEqual( new byte[] { 116, 101, 115, 116 }, profile.ObjectKey, "profile object key"); Assert.AreEqual(new GiopVersion(1, 2), profile.Version, "profile giop version"); if (shouldHaveCodeSetComponent) { Assert.AreEqual( expectedNumberOfComponents, profile.TaggedComponents.Count, "number of components"); Assert.IsTrue(profile.ContainsTaggedComponent( CodeSetService.SERVICE_ID), "code set component present"); CodeSetComponentData data = (CodeSetComponentData) profile.TaggedComponents.GetComponentData(CodeSetService.SERVICE_ID, m_codec, CodeSetComponentData.TypeCode); Assert.AreEqual( (int)CharSet.LATIN1, data.NativeCharSet, "code set component: native char set"); Assert.AreEqual( (int)WCharSet.UTF16, data.NativeWCharSet, "code set component: native char set"); } else { Assert.IsTrue( !profile.ContainsTaggedComponent( CodeSetService.SERVICE_ID), "code set component present"); } }