Subversion Repository Public Repository

ConnectionOdbcSdk

Diff Revisions 9 vs 10 for /trunk/ConnectionServerOdbcIntegrationTests/IntegrationTests/ConnectionServerOdbcIntegrationTests.cs

Diff revisions: vs.
  @@ -21,10 +21,9 @@
21 21
22 22
23 23 [TestMethod]
24 - public void PrintServerPropertiesTests()
24 + public void PrintServerStringPropertiesTests()
25 25 {
26 26 Assert.IsTrue(!string.IsNullOrEmpty(Server.CurrentDatabaseName), "CurrentDatabaseName value empty");
27 - Assert.IsTrue(Server.DatabaseConnectionStatus == ConnectionStatus.Connected, "DatabaseConnectionStatus value false");
28 27 Assert.IsTrue(!string.IsNullOrEmpty(Server.DatabaseLoginName), "DatabaseLoginName value empty");
29 28 Assert.IsTrue(!string.IsNullOrEmpty(Server.DatabaseLoginPassword), "DatabaseLoginPassword value empty");
30 29 Assert.IsTrue(!string.IsNullOrEmpty(Server.DatabaseServerIpAddress), "DatabaseServerIpAddress value empty");
  @@ -37,6 +36,19 @@
37 36 }
38 37
39 38 [TestMethod]
39 + public void IntegerPropertyTests()
40 + {
41 + Console.WriteLine("Neighbor count=" + Server.NeighborLocations.Count);
42 + Assert.IsTrue(Server.DatabaseConnectionStatus == ConnectionStatus.Connected, "DatabaseConnectionStatus value false");
43 + Assert.IsTrue(Server.UnityVersionMajor >0, "Version Major is not greater than 0:"+Server.UnityVersionMajor);
44 + Console.WriteLine(Server.UnityVersionRev);
45 + Console.WriteLine(Server.UnityVersionMinor);
46 + Console.WriteLine(Server.UnityVersionBuild);
47 + Assert.IsFalse(Server.UnityVersionIsCoRes,"Server reporting as CoRes which is no longer supported");
48 + }
49 +
50 +
51 + [TestMethod]
40 52 public void ChangeDatabaseTests()
41 53 {
42 54 bool ret = Server.ChangeActiveDatabase("junk");
  @@ -84,34 +96,47 @@
84 96 Assert.IsTrue(iLang>0,"Default language Id invalid:"+iLang);
85 97 }
86 98
99 +
87 100 [TestMethod]
88 - public void TestMethod1()
101 + public void VersionCheckTests()
102 + {
103 + Assert.IsTrue(Server.IsConnectionVersionAtLeast(1, 0, 0, 0),"Version is not reporting as greater than 1.0.0.0");
104 + Assert.IsFalse(Server.IsConnectionVersionAtLeast(22, 0, 0, 0), "Version is not reporting as less than 22.0.0.0");
105 + }
106 +
107 + [TestMethod]
108 + public void LargeDbOperationPause()
89 109 {
90 - Console.WriteLine("Neighbor count=" + Server.NeighborLocations.Count);
91 - Console.WriteLine("version is greater than 9.0.0 =" + Server.IsConnectionVersionAtLeast(9, 0, 0, 0));
92 - Console.WriteLine("version is greater than 10.5.0 =" + Server.IsConnectionVersionAtLeast(10, 5, 0, 0));
93 - Console.WriteLine("1033 installed " + Server.IsLanguageInstalled(1033));
94 - Console.WriteLine("1066 installed " + Server.IsLanguageInstalled(1066));
95 - Console.WriteLine("ENU installed " + Server.IsLanguageInstalled("ENU"));
96 - Console.WriteLine("XXX installed " + Server.IsLanguageInstalled("XXX"));
97 110 Server.LargeDbOperationPause(true);
111 + }
98 112
99 - var res = Server.UpdateStatisticsForMailstore("UnityMbxDb2");
100 - if (res.Successful == false)
101 - {
102 - Console.WriteLine("Failure updating statistics:" + res);
103 - }
113 + [TestMethod]
114 + public void LoginLogoutTest()
115 + {
116 + ConnectionServerOdbc oServer = new ConnectionServerOdbc(new ConnectionInformixAdoNetDatabaseFunctions("Test"));
117 + var res=oServer.LoginDatabaseBlocking(Server.DatabaseLoginName, Server.DatabaseLoginPassword,Server.DatabaseServerName);
118 + Assert.IsTrue(res.Successful,"Failed to log in to second instance of server:"+res);
119 +
120 + oServer.LogoutBlocking();
121 + }
104 122
105 - res = Server.UpdateStatisticsForMailstore("Junk");
106 - if (res.Successful == false)
107 - {
108 - Console.WriteLine("Failure updating statistics:" + res);
109 - }
110 123
124 + [TestMethod]
125 + public void UpdateStatisticsTest()
126 + {
127 + var res = Server.UpdateStatisticsForMailstore("UnityMbxDb2");
128 + Assert.IsTrue(res.Successful,"Failed updating UnityMbxDb2 statistics:"+res);
111 129
112 -
130 + res = Server.UpdateStatisticsForMailstore("Junk");
131 + Assert.IsFalse(res.Successful,"Updating statistics on invalid database name should fail:"+res);
132 + }
113 133
114 - Server.LogoutBlocking();
134 + [TestMethod]
135 + public void GetLogingErrorTests()
136 + {
137 + //currently there is no public constructor on the OdbcException class so testing this is difficult at best
138 + Assert.IsTrue(string.IsNullOrEmpty(Server.GetLoginErrorString(null)),"Empty string should be returned from " +
139 + "GetLoginErrorString with null param");
115 140 }
116 141 }
117 142 }