Subversion Repository Public Repository

ConnectionOdbcSdk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
´╗┐using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Cisco.UnityConnection.OdbcSdk;

namespace ConnectionServerOdbcIntegrationTests
{
    [TestClass]
    public class IntegrationTest : BaseIntegrationTests
    {

        #region Additional test attributes

        //Use ClassInitialize to run code before running the first test in the class
        [ClassInitialize]
        public new static void MyClassInitialize(TestContext testContext)
        {
            BaseIntegrationTests.MyClassInitialize(testContext);
        }

        #endregion

        [TestMethod]
        public void TestMethod1()
        {
            if (Server == null || Server.DatabaseConnectionStatus != ConnectionStatus.Connected)
            {
                return;
            }

            Console.WriteLine("Neighbor count=" + Server.NeighborLocations.Count);
            Console.WriteLine("version is greater than 9.0.0 =" + Server.IsConnectionVersionAtLeast(9, 0, 0, 0));
            Console.WriteLine("version is greater than 10.5.0 =" + Server.IsConnectionVersionAtLeast(10, 5, 0, 0));
            Console.WriteLine("1033 installed " + Server.IsLanguageInstalled(1033));
            Console.WriteLine("1066 installed " + Server.IsLanguageInstalled(1066));
            Console.WriteLine("ENU installed " + Server.IsLanguageInstalled("ENU"));
            Console.WriteLine("XXX installed " + Server.IsLanguageInstalled("XXX"));
            Server.LargeDbOperationPause(true);

            Console.WriteLine("Primary location display name:" + Server.PrimaryLocationDisplayName);
            Console.WriteLine("Primary location domain name:" + Server.PrimaryLocationDomainName);
            Console.WriteLine("Primary location objectId:" + Server.PrimaryLocationObjectId);
            Console.WriteLine("Primary location server address:" + Server.PrimaryLocationServerAddress);

            var res = Server.UpdateStatisticsForMailstore("UnityMbxDb2");
            if (res.Successful == false)
            {
                Console.WriteLine("Failure updating statistics:" + res);
            }

            res = Server.UpdateStatisticsForMailstore("Junk");
            if (res.Successful == false)
            {
                Console.WriteLine("Failure updating statistics:" + res);
            }

            if (Server.ChangeActiveDatabase("junk") == false)
            {
                Console.WriteLine("Failed changing DB to junk");
            }

            Console.WriteLine("Current database name =" + Server.CurrentDatabaseName);

            if (Server.ChangeActiveDatabase("UnityDynDb") == false)
            {
                Console.WriteLine("Failed changing DB to UnityDynDb");
            }

            Console.WriteLine("Current database name =" + Server.CurrentDatabaseName);

            if (Server.ChangeActiveDatabase("UnityDirDb") == false)
            {
                Console.WriteLine("Failed changing DB to UnityDynDb");
            }

            Console.WriteLine("Current database name =" + Server.CurrentDatabaseName);

            Console.WriteLine("Default language=" + Server.GetDefaultLanguage());

            Server.LogoutBlocking();
        }
    }
}

Commits for ConnectionOdbcSdk/trunk/ConnectionServerOdbcIntegrationTests/IntegrationTests/IntegrationTest.cs

Diff revisions: vs.
Revision Author Commited Message
8 jlindborg picture jlindborg Fri 30 Aug, 2013 00:27:58 +0000

adding some unit/integration tests into the project, doing a little cleanup.