Beispiel #1
0
        public virtual void TestBindIsolation()
        {
            EmbeddedClientObjectContainerTestCase.Item storedItem = StoreItemToClient1AndCommit
                                                                        ();
            long id = _client1.GetID(storedItem);

            EmbeddedClientObjectContainerTestCase.Item retrievedItem = RetrieveItemFromClient2
                                                                           ();
            EmbeddedClientObjectContainerTestCase.Item boundItem = new EmbeddedClientObjectContainerTestCase.Item
                                                                       (ChangedName);
            _client1.Bind(boundItem, id);
            Assert.AreSame(boundItem, _client1.GetByID(id));
            Assert.AreSame(retrievedItem, _client2.GetByID(id));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
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));
		}