public void CollectionTest() { string csName = "testCS1"; string clName = "testCL1"; CollectionSpace cs = null; Sequoiadb sdb = new Sequoiadb(config.conf.Coord.Address); sdb.Connect(config.conf.UserName, config.conf.Password); if(sdb.IsCollectionSpaceExist(csName)) cs = sdb.GetCollecitonSpace(csName); else cs = sdb.CreateCollectionSpace(csName); if (!cs.IsCollectionExist(clName)) cs.CreateCollection(clName); cs.DropCollection(clName); Assert.IsFalse(cs.IsCollectionExist(clName)); sdb.DropCollectionSpace(csName); sdb.Disconnect(); }
public void MyTestInitialize() { try { sdb = new Sequoiadb(config.conf.Coord.Address); sdb.Connect(config.conf.UserName, config.conf.Password); if (sdb.IsCollectionSpaceExist(csName)) sdb.DropCollectionSpace(csName); cs = sdb.CreateCollectionSpace(csName); coll = cs.CreateCollection(cName); } catch (BaseException e) { Console.WriteLine("Failed to Initialize in DBCollectionTest, ErrorType = {0}", e.ErrorType); Environment.Exit(0); } }
public void MyTestInitialize() { sdb = new Sequoiadb(config.conf.Coord.Address); sdb.Connect(config.conf.UserName, config.conf.Password); if (sdb.IsCollectionSpaceExist(csName)) sdb.DropCollectionSpace(csName); cs = sdb.CreateCollectionSpace(csName); coll = cs.CreateCollection(cName); }
public void ConnectWithSSLTest() { ConfigOptions cfgOpt = null ; CollectionSpace cs2 = null; DBCollection coll2 = null; Sequoiadb sdb2 = new Sequoiadb(config.conf.Coord.Address); System.Console.WriteLine(config.conf.Coord.Address.ToString()); // set connect using ssl cfgOpt = new ConfigOptions(); cfgOpt.UseSSL = true; // connect to database sdb2.Connect("", "", cfgOpt); if (true == sdb2.IsCollectionSpaceExist("testSSL")) cs2 = sdb2.GetCollecitonSpace("testSSL"); else cs2 = sdb2.CreateCollectionSpace("testSSL"); if (true == cs2.IsCollectionExist("testSSL")) coll2 = cs2.GetCollection("testSSL"); else coll2 = cs2.CreateCollection("testSSL"); sdb2.DropCollectionSpace("testSSL"); }