public virtual void TestDeactivate() { EmbeddedClientObjectContainerTestCase.Item item = StoreItemToClient1AndCommit(); EmbeddedClientObjectContainerTestCase.ItemHolder holder = new EmbeddedClientObjectContainerTestCase.ItemHolder (item); _client1.Store(holder); _client1.Commit(); _client1.Deactivate(holder, 1); Assert.IsNull(holder._item); }
public virtual void Conc(IExtObjectContainer oc) { IQuery q = oc.Query(); q.Constrain(typeof(CascadeOnActivateTestCase.Item)); q.Descend("name").Constrain("1"); IObjectSet os = q.Execute(); CascadeOnActivateTestCase.Item item = (CascadeOnActivateTestCase.Item)os.Next(); CascadeOnActivateTestCase.Item item3 = item.child.child; Assert.AreEqual("3", item3.name); oc.Deactivate(item, int.MaxValue); Assert.IsNull(item3.name); oc.Activate(item, 1); Assert.AreEqual("3", item3.name); }
public virtual void Conc(IExtObjectContainer oc) { var q = oc.Query(); q.Constrain(typeof (Item)); q.Descend("name").Constrain("1"); var os = q.Execute(); var item = (Item) os.Next(); var item3 = item.child.child; Assert.AreEqual("3", item3.name); oc.Deactivate(item, int.MaxValue); Assert.IsNull(item3.name); oc.Activate(item, 1); Assert.AreEqual("3", item3.name); }
/// <exception cref="System.Exception"></exception> public virtual void Test() { IExtObjectContainer oc = Db(); _item.name = "1"; DeepSetTestCase.Item item = (DeepSetTestCase.Item)oc.QueryByExample(_item).Next(); item.name = "11"; item.child.name = "12"; oc.Store(item, 2); oc.Deactivate(item, int.MaxValue); item.name = "11"; item = (DeepSetTestCase.Item)oc.QueryByExample(item).Next(); Assert.AreEqual("12", item.child.name); Assert.AreEqual("3", item.child.child.name); }
public virtual void Conc(IExtObjectContainer oc) { var q = oc.Query(); q.Constrain(typeof(Item)); q.Descend("name").Constrain("1"); var os = q.Execute(); var item = (Item)os.Next(); var item3 = item.child.child; Assert.AreEqual("3", item3.name); oc.Deactivate(item, int.MaxValue); Assert.IsNull(item3.name); oc.Activate(item, 1); Assert.AreEqual("3", item3.name); }
public virtual void Conc(IExtObjectContainer oc) { var em = new ExtMethodsTestCase(); oc.Store(em); Assert.IsFalse(oc.IsClosed()); Assert.IsTrue(oc.IsActive(em)); Assert.IsTrue(oc.IsStored(em)); oc.Deactivate(em, 1); Assert.IsTrue(!oc.IsActive(em)); oc.Activate(em, 1); Assert.IsTrue(oc.IsActive(em)); var id = oc.GetID(em); Assert.IsTrue(oc.IsCached(id)); oc.Purge(em); Assert.IsFalse(oc.IsCached(id)); Assert.IsFalse(oc.IsStored(em)); Assert.IsFalse(oc.IsActive(em)); oc.Bind(em, id); Assert.IsTrue(oc.IsCached(id)); Assert.IsTrue(oc.IsStored(em)); Assert.IsTrue(oc.IsActive(em)); var em2 = (ExtMethodsTestCase)oc.GetByID(id); Assert.AreSame(em, em2); // Purge all and try again oc.Purge(); Assert.IsTrue(oc.IsCached(id)); Assert.IsTrue(oc.IsStored(em)); Assert.IsTrue(oc.IsActive(em)); em2 = (ExtMethodsTestCase)oc.GetByID(id); Assert.AreSame(em, em2); oc.Delete(em2); oc.Commit(); Assert.IsFalse(oc.IsCached(id)); Assert.IsFalse(oc.IsStored(em2)); Assert.IsFalse(oc.IsActive(em2)); // Null checks Assert.IsFalse(oc.IsStored(null)); Assert.IsFalse(oc.IsActive(null)); Assert.IsFalse(oc.IsCached(0)); }
public virtual void Conc(IExtObjectContainer oc) { ExtMethodsTestCase em = new ExtMethodsTestCase(); oc.Store(em); Assert.IsFalse(oc.IsClosed()); Assert.IsTrue(oc.IsActive(em)); Assert.IsTrue(oc.IsStored(em)); oc.Deactivate(em, 1); Assert.IsTrue(!oc.IsActive(em)); oc.Activate(em, 1); Assert.IsTrue(oc.IsActive(em)); long id = oc.GetID(em); Assert.IsTrue(oc.IsCached(id)); oc.Purge(em); Assert.IsFalse(oc.IsCached(id)); Assert.IsFalse(oc.IsStored(em)); Assert.IsFalse(oc.IsActive(em)); oc.Bind(em, id); Assert.IsTrue(oc.IsCached(id)); Assert.IsTrue(oc.IsStored(em)); Assert.IsTrue(oc.IsActive(em)); ExtMethodsTestCase em2 = (ExtMethodsTestCase)oc.GetByID(id); Assert.AreSame(em, em2); // Purge all and try again oc.Purge(); Assert.IsTrue(oc.IsCached(id)); Assert.IsTrue(oc.IsStored(em)); Assert.IsTrue(oc.IsActive(em)); em2 = (ExtMethodsTestCase)oc.GetByID(id); Assert.AreSame(em, em2); oc.Delete(em2); oc.Commit(); Assert.IsFalse(oc.IsCached(id)); Assert.IsFalse(oc.IsStored(em2)); Assert.IsFalse(oc.IsActive(em2)); // Null checks Assert.IsFalse(oc.IsStored(null)); Assert.IsFalse(oc.IsActive(null)); Assert.IsFalse(oc.IsCached(0)); }