Esempio n. 1
0
 public _IVisitor4_182(GenericReplicationSession _enclosing, IReplicationProviderInside
                       sourceProvider, IReplicationProviderInside targetProvider)
 {
     this._enclosing     = _enclosing;
     this.sourceProvider = sourceProvider;
     this.targetProvider = targetProvider;
 }
Esempio n. 2
0
 public _ICounterpartFinder_248(GenericReplicationSession _enclosing, IReplicationProviderInside
                                sourceProvider, IReplicationProviderInside targetProvider)
 {
     this._enclosing     = _enclosing;
     this.sourceProvider = sourceProvider;
     this.targetProvider = targetProvider;
 }
Esempio n. 3
0
		public virtual void Test()
		{
			if (!A().Provider().SupportsMultiDimensionalArrays())
			{
				return;
			}
			if (!B().Provider().SupportsMultiDimensionalArrays())
			{
				return;
			}
			ArrayHolder h1 = new ArrayHolder("h1");
			ArrayHolder h2 = new ArrayHolder("h2");
			h1._array = new ArrayHolder[] { h1 };
			h2._array = new ArrayHolder[] { h1, h2, null };
			h1._arrayN = new ArrayHolder[][] { new ArrayHolder[] { h1 } };
			h2._arrayN = new ArrayHolder[][] { new ArrayHolder[] { h1, null }, new ArrayHolder
				[] { null, h2 }, new ArrayHolder[] { null, null } };
			//TODO Fix ReflectArray.shape() and test with innermost arrays of varying sizes:  {{h1}, {null, h2}, {null}}
			B().Provider().StoreNew(h2);
			B().Provider().StoreNew(h1);
			B().Provider().Commit();
			IReplicationSession replication = new GenericReplicationSession(A().Provider(), B
				().Provider(), null, _fixtures.reflector);
			replication.Replicate(h2);
			//Traverses to h1.
			replication.Commit();
			IEnumerator objects = A().Provider().GetStoredObjects(typeof(ArrayHolder)).GetEnumerator
				();
			CheckNext(objects);
			CheckNext(objects);
			Assert.IsFalse(objects.MoveNext());
		}
		public virtual void Test()
		{
			Replicated obj1 = new Replicated("1");
			Replicated obj2 = new Replicated("2");
			Replicated obj3 = new Replicated("3");
			obj1.SetLink(obj2);
			obj2.SetLink(obj3);
			obj3.SetLink(obj1);
			_peerA.StoreNew(obj1);
			//_peerA.transientProviderSpecificStore(obj2);
			//_peerA.transientProviderSpecificStore(obj3);
			IReplicationSession replication = new GenericReplicationSession(_peerA, _peerB);
			replication.Replicate(obj1);
			Assert.IsTrue(_peerA.ActivatedObjects().Contains(obj1));
			Assert.IsTrue(_peerA.ActivatedObjects().Contains(obj2));
			Assert.IsTrue(_peerA.ActivatedObjects().Contains(obj3));
			_peerA = null;
			_peerB = null;
		}
		protected virtual void ActualTest()
		{
			if (!A().Provider().SupportsHybridCollection())
			{
				return;
			}
			if (!B().Provider().SupportsHybridCollection())
			{
				return;
			}
			CollectionHolder h1 = new CollectionHolder("h1");
			CollectionHolder h2 = new CollectionHolder("h2");
			h1.Map()["key"] = "value";
			h1.Map()["key2"] = h1;
			h1.Map()[h1] = "value2";
			h2.Map()["key"] = h1;
			h2.Map()[h2] = h1;
			h1.List().Add("one");
			h1.List().Add(h1);
			h2.List().Add("two");
			h2.List().Add(h1);
			h2.List().Add(h2);
			h1.Set().Add("one");
			h1.Set().Add(h1);
			h2.Set().Add("two");
			h2.Set().Add(h1);
			h2.Set().Add(h2);
			B().Provider().StoreNew(h2);
			B().Provider().StoreNew(h1);
			IReplicationSession replication = new GenericReplicationSession(A().Provider(), B
				().Provider());
			replication.Replicate(h2);
			//Traverses to h1.
			replication.Commit();
			IEnumerator objects = A().Provider().GetStoredObjects(typeof(CollectionHolder)).GetEnumerator
				();
			Check(NextCollectionHolder(objects), h1, h2);
			Check(NextCollectionHolder(objects), h1, h2);
		}
Esempio n. 6
0
 public _IVisitor4_286(GenericReplicationSession _enclosing, IReplicationProviderInside
                       destination)
 {
     this._enclosing  = _enclosing;
     this.destination = destination;
 }
Esempio n. 7
0
			public _IVisitor4_286(GenericReplicationSession _enclosing, IReplicationProviderInside
				 destination)
			{
				this._enclosing = _enclosing;
				this.destination = destination;
			}
Esempio n. 8
0
			public _ICounterpartFinder_248(GenericReplicationSession _enclosing, IReplicationProviderInside
				 sourceProvider, IReplicationProviderInside targetProvider)
			{
				this._enclosing = _enclosing;
				this.sourceProvider = sourceProvider;
				this.targetProvider = targetProvider;
			}
Esempio n. 9
0
			public _IVisitor4_182(GenericReplicationSession _enclosing, IReplicationProviderInside
				 sourceProvider, IReplicationProviderInside targetProvider)
			{
				this._enclosing = _enclosing;
				this.sourceProvider = sourceProvider;
				this.targetProvider = targetProvider;
			}
Esempio n. 10
0
 public _IBlock4_73(GenericReplicationSession _enclosing)
 {
     this._enclosing = _enclosing;
 }
Esempio n. 11
0
 public _IBlock4_108(GenericReplicationSession _enclosing, IBlock4 block)
 {
     this._enclosing = _enclosing;
     this.block      = block;
 }
		private void InitState()
		{
			CheckEmpty(A().Provider());
			CheckEmpty(B().Provider());
			A().Provider().StoreNew(new Replicated("oldFromA"));
			B().Provider().StoreNew(new Replicated("oldFromB"));
			A().Provider().Commit();
			B().Provider().Commit();
			IReplicationSession replication = new GenericReplicationSession(A().Provider(), B
				().Provider());
			ReplicateQueryingFrom(replication, A().Provider(), B().Provider());
			ReplicateQueryingFrom(replication, B().Provider(), A().Provider());
			replication.Commit();
		}
		private void DoIt()
		{
			InitState();
			PrintProvidersContent("before changes");
			PerformChanges();
			PrintProvidersContent("after changes");
			IReplicationEventListener listener = new _IReplicationEventListener_170(this);
			//Default replication behaviour.
			IReplicationSession replication = new GenericReplicationSession(A().Provider(), B
				().Provider(), listener, _fixtures.reflector);
			if (_direction.Size() == 1)
			{
				if (_direction.Contains(AStuff))
				{
					replication.SetDirection(B().Provider(), A().Provider());
				}
				if (_direction.Contains(BStuff))
				{
					replication.SetDirection(A().Provider(), B().Provider());
				}
			}
			Out("DIRECTION: " + _direction);
			bool successful = TryToReplicate(replication);
			replication.Commit();
			PrintProvidersContent("after replication");
			if (successful)
			{
				CheckNames();
			}
			Clean();
		}
			public _IBlock4_73(GenericReplicationSession _enclosing)
			{
				this._enclosing = _enclosing;
			}
			public _IBlock4_108(GenericReplicationSession _enclosing, IBlock4 block)
			{
				this._enclosing = _enclosing;
				this.block = block;
			}
Esempio n. 16
0
		private void InitState()
		{
			CheckEmpty(A().Provider());
			CheckEmpty(B().Provider());
			A().Provider().StoreNew(new Replicated("oldFromA"));
			B().Provider().StoreNew(new Replicated("oldFromB"));
			A().Provider().Commit();
			B().Provider().Commit();
			PrintProvidersContent("init state");
			IReplicationSession replication = new GenericReplicationSession(A().Provider(), B
				().Provider(), null, _fixtures.reflector);
			ReplicateQueryingFrom(replication, A().Provider(), B().Provider());
			ReplicateQueryingFrom(replication, B().Provider(), A().Provider());
			replication.Commit();
		}