コード例 #1
0
        private void TstObjectUpdate()
        {
            SPCChild child = new SPCChild("c1");

            A().Provider().StoreNew(child);
            A().Provider().Commit();
            StartReplication();
            SPCChild reloaded = GetOneChildFromA();
            long     oldVer   = A().Provider().ProduceReference(reloaded, null, null).Version();

            CommitReplication();
            SPCChild reloaded2 = GetOneChildFromA();

            reloaded2.SetName("c3");
            //System.out.println("==============BEGIN DEBUG");
            A().Provider().Update(reloaded2);
            A().Provider().Commit();
            //System.out.println("==============END DEBUG");
            StartReplication();
            SPCChild reloaded3 = GetOneChildFromA();
            long     newVer    = A().Provider().ProduceReference(reloaded3, null, null).Version();

            CommitReplication();
            Assert.IsGreater(oldVer, newVer);
        }
コード例 #2
0
        private void EnsureNames(IDrsProviderFixture fixture, string childName)
        {
            EnsureOneInstance(fixture, typeof(SPCChild));
            SPCChild child = GetTheObject(fixture);

            Assert.AreEqual(childName, child.GetName());
        }
コード例 #3
0
            private void StoreInA()
            {
                SPCChild child = new SPCChild("c1");

                A().Provider().StoreNew(child);
                A().Provider().Commit();
                EnsureNames(A(), "c1");
            }
コード例 #4
0
        private void ModifyInA()
        {
            SPCChild child = GetTheObject(A());

            child.SetName("c3");
            A().Provider().Update(child);
            A().Provider().Commit();
            EnsureNames(A(), "c3");
        }
コード例 #5
0
        private void StoreInA()
        {
            string   name  = "c1";
            SPCChild child = CreateChildObject(name);

            A().Provider().StoreNew(child);
            A().Provider().Commit();
            EnsureNames(A(), "c1");
        }
コード例 #6
0
        private void StoreParentAndChildToProviderA()
        {
            SPCChild  child  = new SPCChild(InA);
            SPCParent parent = new SPCParent(child, InA);

            A().Provider().StoreNew(parent);
            A().Provider().Commit();
            EnsureNames(A(), InA, InA);
        }
コード例 #7
0
        private void Replicate()
        {
            SPCChild  child  = new SPCChild("c1");
            SPCParent parent = new SPCParent(child, "p1");

            A().Provider().StoreNew(parent);
            A().Provider().Commit();
            ReplicateAll(A().Provider(), B().Provider());
        }
コード例 #8
0
        private SPCChild StoreInA()
        {
            string   name  = "c1";
            SPCChild child = CreateChildObject(name);

            A().Provider().StoreNew(child);
            A().Provider().Commit();
            return(child);
        }
コード例 #9
0
        private void ModifyInProviderB()
        {
            SPCParent parent = (SPCParent)GetOneInstance(B(), typeof(SPCParent));

            parent.SetName(ModifiedInB);
            SPCChild child = parent.GetChild();

            child.SetName(ModifiedInB);
            B().Provider().Update(parent);
            B().Provider().Update(child);
            B().Provider().Commit();
            EnsureNames(B(), ModifiedInB, ModifiedInB);
        }
コード例 #10
0
        private void ModifyParentAndChildInProviderA()
        {
            SPCParent parent = (SPCParent)GetOneInstance(A(), typeof(SPCParent));

            parent.SetName("p3");
            SPCChild child = parent.GetChild();

            child.SetName("c3");
            A().Provider().Update(parent);
            A().Provider().Update(child);
            A().Provider().Commit();
            EnsureNames(A(), "p3", "c3");
        }
コード例 #11
0
        public virtual void Test()
        {
            SPCChild child = StoreInA();

            Replicate();
            IReplicationReference @ref = A().Provider().ProduceReference(child);

            B().Provider().ClearAllReferences();
            IDrsUUID expectedUuid = @ref.Uuid();
            IReplicationReference referenceByUUID = B().Provider().ProduceReferenceByUUID(expectedUuid
                                                                                          , null);

            Assert.IsNotNull(referenceByUUID);
            IDrsUUID actualUuid = referenceByUUID.Uuid();

            Assert.AreEqual(expectedUuid.GetLongPart(), actualUuid.GetLongPart());
        }