public void TestCorbaLocIiopSsl() {
            string testCorbaLoc = "corbaloc:iiop-ssl:elca.ch:1234/test";
            Corbaloc parsed = new Corbaloc(testCorbaLoc, m_codec,
                                           new object[] { m_defaultCodeSetTaggedComponent });
            Assert.AreEqual("test", parsed.KeyString);
            IorProfile[] profiles = parsed.GetProfiles();
            Assert.AreEqual(1, profiles.Length);
            Assert.AreEqual(typeof(InternetIiopProfile), profiles[0].GetType());
            InternetIiopProfile prof = (InternetIiopProfile)(profiles[0]);
            Assert.AreEqual(1, prof.Version.Major);
            Assert.AreEqual(0, prof.Version.Minor);
            Assert.AreEqual("elca.ch", prof.HostName);
            Assert.AreEqual(0, prof.Port);


            Assert.IsTrue(profiles[0].TaggedComponents.ContainsTaggedComponent(
                                 CodeSetService.SERVICE_ID));
            Assert.IsTrue(profiles[0].TaggedComponents.ContainsTaggedComponent(
                                 TAG_SSL_SEC_TRANS.ConstVal));
        }
        public void TestSingleCompleteCorbaLocIiop() {
            string testCorbaLoc = "corbaloc:iiop:[email protected]:1234/test";
            Corbaloc parsed = new Corbaloc(testCorbaLoc, m_codec,
                                           new object[] { m_defaultCodeSetTaggedComponent });
            Assert.AreEqual("test", parsed.KeyString);

            Assert.AreEqual(1, parsed.GetProfiles().Length);
            Assert.AreEqual(typeof(InternetIiopProfile), parsed.GetProfiles()[0].GetType());
            InternetIiopProfile profile = (InternetIiopProfile)parsed.GetProfiles()[0];
            Assert.IsTrue(profile.TaggedComponents.ContainsTaggedComponent(
                                CodeSetService.SERVICE_ID));

            Assert.AreEqual(1, profile.Version.Major);
            Assert.AreEqual(2, profile.Version.Minor);
            Assert.AreEqual("elca.ch", profile.HostName);
            Assert.AreEqual(1234, profile.Port);

            // port > 32768
            testCorbaLoc = "corbaloc:iiop:[email protected]:61234/test";
            parsed = new Corbaloc(testCorbaLoc, m_codec,
                                  new object[] { m_defaultCodeSetTaggedComponent });
            Assert.AreEqual("test", parsed.KeyString);

            Assert.AreEqual(1, parsed.GetProfiles().Length);
            Assert.AreEqual(typeof(InternetIiopProfile), parsed.GetProfiles()[0].GetType());
            profile = (InternetIiopProfile)parsed.GetProfiles()[0];
            Assert.IsTrue(profile.TaggedComponents.ContainsTaggedComponent(
                                CodeSetService.SERVICE_ID));

            Assert.AreEqual(1, profile.Version.Major);
            Assert.AreEqual(2, profile.Version.Minor);
            Assert.AreEqual("elca.ch", profile.HostName);
            Assert.AreEqual(61234, profile.Port);

        }
        public void TestIncompleteCorbaLocIiop() {
            string testCorbaLoc = "corbaloc::/test";
            Corbaloc parsed = new Corbaloc(testCorbaLoc, m_codec,
                                           new object[] { m_defaultCodeSetTaggedComponent });
            Assert.AreEqual("test", parsed.KeyString);
            IorProfile[] profiles = parsed.GetProfiles();
            Assert.AreEqual(1, profiles.Length);
            Assert.AreEqual(typeof(InternetIiopProfile), profiles[0].GetType());
            InternetIiopProfile prof = (InternetIiopProfile)(profiles[0]);
            Assert.AreEqual(1, prof.Version.Major);
            Assert.AreEqual(0, prof.Version.Minor);
            Assert.AreEqual("localhost", prof.HostName);
            Assert.AreEqual(2809, prof.Port);

            testCorbaLoc = "corbaloc::elca.ch/test";
            parsed = new Corbaloc(testCorbaLoc, m_codec,
                                  new object[] { m_defaultCodeSetTaggedComponent });
            Assert.AreEqual("test", parsed.KeyString);
            profiles = parsed.GetProfiles();
            Assert.AreEqual(1, profiles.Length);
            Assert.AreEqual(typeof(InternetIiopProfile), profiles[0].GetType());
            prof = (InternetIiopProfile)(profiles[0]);
            Assert.AreEqual(1, prof.Version.Major);
            Assert.AreEqual(0, prof.Version.Minor);
            Assert.AreEqual("elca.ch", prof.HostName);
            Assert.AreEqual(2809, prof.Port);

            testCorbaLoc = "corbaloc:iiop:[email protected]/test";
            parsed = new Corbaloc(testCorbaLoc, m_codec,
                                  new object[] { m_defaultCodeSetTaggedComponent });
            Assert.AreEqual("test", parsed.KeyString);
            profiles = parsed.GetProfiles();
            Assert.AreEqual(1, profiles.Length);
            Assert.AreEqual(typeof(InternetIiopProfile), profiles[0].GetType());
            prof = (InternetIiopProfile)(profiles[0]);
            Assert.AreEqual(1, prof.Version.Major);
            Assert.AreEqual(2, prof.Version.Minor);
            Assert.AreEqual("elca.ch", prof.HostName);
            Assert.AreEqual(2809, prof.Port);

            testCorbaLoc = "corbaloc::elca.ch:1234/test";
            parsed = new Corbaloc(testCorbaLoc, m_codec,
                                  new object[] { m_defaultCodeSetTaggedComponent });
            Assert.AreEqual("test", parsed.KeyString);
            profiles = parsed.GetProfiles();
            Assert.AreEqual(1, profiles.Length);
            Assert.AreEqual(typeof(InternetIiopProfile), profiles[0].GetType());
            prof = (InternetIiopProfile)(profiles[0]);
            Assert.AreEqual(1, prof.Version.Major);
            Assert.AreEqual(0, prof.Version.Minor);
            Assert.AreEqual("elca.ch", prof.HostName);
            Assert.AreEqual(1234, prof.Port);
        }
 /// <summary>creates an IOR for the object described by the Url url</summary>
 /// <param name="url">an url of the form IOR:--hex-- or iiop://addr/key</param>
 /// <param name="targetType">if the url contains no info about the target type, use this type</param>
 public Ior CreateIorForUrl(string url, string repositoryId)
 {
     Ior ior = null;
     if (IsIorString(url))
     {
         ior = new Ior(url);
     }
     else if (url.StartsWith("iiop"))
     {
         // iiop1.0, iiop1.1, iiop1.2 (=iiop); extract version in protocol tag
         IiopLoc iiopLoc = new IiopLoc(url, m_codec,
                                       m_defaultAdditionalTaggedComponents);
         // now create an IOR with the above information
         ior = new Ior(repositoryId, iiopLoc.GetProfiles());
     }
     else if (url.StartsWith("corbaloc"))
     {
         Corbaloc loc = new Corbaloc(url, m_codec,
                                     m_defaultAdditionalTaggedComponents);
         IorProfile[] profiles = loc.GetProfiles();
         ior = new Ior(repositoryId, profiles);
     }
     else
     {
         throw new INV_OBJREF(1963, CompletionStatus.Completed_MayBe);
     }
     return ior;
 }