[Iiop-net-commits] IIOPNet/IntegrationTests/Direct/TestClient TestClient.cs,1.20,1.21
Brought to you by:
dullmann,
patrik_reali
From: Dominic U. <dul...@us...> - 2004-08-11 20:18:40
|
Update of /cvsroot/iiop-net/IIOPNet/IntegrationTests/Direct/TestClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11094/IIOPNet/IntegrationTests/Direct/TestClient Modified Files: TestClient.cs Log Message: check OrbServices.object_to_string Index: TestClient.cs =================================================================== RCS file: /cvsroot/iiop-net/IIOPNet/IntegrationTests/Direct/TestClient/TestClient.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TestClient.cs 20 Jun 2004 08:17:51 -0000 1.20 --- TestClient.cs 11 Aug 2004 20:18:32 -0000 1.21 *************** *** 34,37 **** --- 34,38 ---- using NUnit.Framework; using Ch.Elca.Iiop; + using Ch.Elca.Iiop.Idl; using Ch.Elca.Iiop.Services; using omg.org.CosNaming; *************** *** 892,895 **** --- 893,929 ---- Assertion.AssertEquals("wrong adder result", arg1 + arg2, adder.Add(arg1, arg2)); } + + [Test] + public void TestObjectToString() { + OrbServices orbServices = OrbServices.GetSingleton(); + string id = "myAdderId2"; + Adder adder = m_testService.CreateNewWithUserID(id); + string iorString = orbServices.object_to_string(adder); + Ior adderIor = new Ior(iorString); + Assertion.AssertEquals(8087, adderIor.Port); + Assertion.AssertEquals(1, adderIor.Version.Major); + Assertion.AssertEquals(2, adderIor.Version.Minor); + + byte[] oid = { 0x6d, 0x79, 0x41, 0x64, 0x64, 0x65, 0x72, 0x49, 0x64, 0x32 }; + CheckIorKey(oid, adderIor.ObjectKey); + + string testServiceIorString = m_testService.GetIorStringForThisObject(); + Ior testServiceIor = new Ior(testServiceIorString); + Assertion.AssertEquals(8087, testServiceIor.Port); + Assertion.AssertEquals(1, testServiceIor.Version.Major); + Assertion.AssertEquals(2, testServiceIor.Version.Minor); + + byte[] oidTestService = { 0x74, 0x65, 0x73, 0x74 }; + CheckIorKey(oidTestService, testServiceIor.ObjectKey); + + + } + + private void CheckIorKey(byte[] expected, byte[] actual) { + Assertion.AssertEquals("wrong id length", expected.Length, actual.Length); + for (int i = 0; i <expected.Length; i++) { + Assertion.AssertEquals("wrong element nr " + i, expected[i], actual[i]); + } + } [Test] |