Ejemplo n.º 1
0
 /// <exception cref="System.Exception"></exception>
 public virtual void ConcReadDifferentObject(IExtObjectContainer oc, int seq)
 {
     var example = new SimpleObject(testString + seq, seq);
     var result = oc.QueryByExample(example);
     Assert.AreEqual(1, result.Count);
     Assert.AreEqual(example, result.Next());
 }
Ejemplo n.º 2
0
		/// <exception cref="System.Exception"></exception>
		public virtual void ConcReadDifferentObject(IExtObjectContainer oc, int seq)
		{
			SimpleObject expected = new SimpleObject(testString + seq, seq);
			IObjectSet result = oc.Query(new ReadObjectNQTestCase.MyPredicate(expected));
			Assert.AreEqual(1, result.Count);
			Assert.AreEqual(expected, result.Next());
		}
Ejemplo n.º 3
0
		public virtual void ConcSetRollback(IExtObjectContainer oc, int seq)
		{
			if (seq % 2 == 0)
			{
				// if the thread sequence is even, store something
				for (int i = 0; i < 1000; i++)
				{
					SimpleObject c = new SimpleObject("oc " + i, i);
					oc.Store(c);
				}
			}
			else
			{
				// if the thread sequence is odd, rollback
				for (int i = 0; i < 1000; i++)
				{
					SimpleObject c = new SimpleObject("oc " + i, i);
					oc.Store(c);
					oc.Rollback();
					c = new SimpleObject("oc2.2 " + i, i);
					oc.Store(c);
				}
				oc.Rollback();
			}
		}
Ejemplo n.º 4
0
 /// <exception cref="System.Exception"></exception>
 public virtual void ConcReadSameObject(IExtObjectContainer oc)
 {
     var mid = ThreadCount()/2;
     var example = new SimpleObject(testString + mid, mid);
     var result = oc.QueryByExample(example);
     Assert.AreEqual(1, result.Count);
     Assert.AreEqual(example, result.Next());
 }
Ejemplo n.º 5
0
		/// <exception cref="System.Exception"></exception>
		public virtual void ConcReadSameObject(IExtObjectContainer oc)
		{
			int mid = ThreadCount() / 2;
			SimpleObject expected = new SimpleObject(testString + mid, mid);
			IObjectSet result = oc.Query(new ReadObjectNQTestCase.MyPredicate(expected));
			Assert.AreEqual(1, result.Count);
			Assert.AreEqual(expected, result.Next());
		}
Ejemplo n.º 6
0
 /// <exception cref="System.Exception"></exception>
 public virtual void ConcReadSameObject(IExtObjectContainer oc)
 {
     var mid = ThreadCount()/2;
     var expected = new SimpleObject(testString + mid, mid);
     var result = oc.Query(new MyPredicate(expected));
     Assert.AreEqual(1, result.Count);
     Assert.AreEqual(expected, result.Next());
 }
Ejemplo n.º 7
0
		/// <exception cref="System.Exception"></exception>
		public virtual void ConcReadDifferentObject(IExtObjectContainer oc, int seq)
		{
			IQuery query = oc.Query();
			query.Descend("_s").Constrain(testString + seq).And(query.Descend("_i").Constrain
				(seq));
			IObjectSet result = query.Execute();
			Assert.AreEqual(1, result.Count);
			SimpleObject expected = new SimpleObject(testString + seq, seq);
			Assert.AreEqual(expected, result.Next());
		}
Ejemplo n.º 8
0
		/// <exception cref="System.Exception"></exception>
		public virtual void ConcReadSameObject(IExtObjectContainer oc)
		{
			int mid = ThreadCount() / 2;
			IQuery query = oc.Query();
			query.Descend("_s").Constrain(testString + mid).And(query.Descend("_i").Constrain
				(mid));
			IObjectSet result = query.Execute();
			Assert.AreEqual(1, result.Count);
			SimpleObject expected = new SimpleObject(testString + mid, mid);
			Assert.AreEqual(expected, result.Next());
		}
Ejemplo n.º 9
0
			public virtual bool Match(SimpleObject candidate)
			{
				return expected.Equals(candidate);
			}
Ejemplo n.º 10
0
			public MyPredicate(SimpleObject o)
			{
				this.expected = o;
			}