本文整理汇总了C#中Db4objects.Db4o.Foundation.BooleanByRef类的典型用法代码示例。如果您正苦于以下问题:C# BooleanByRef类的具体用法?C# BooleanByRef怎么用?C# BooleanByRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BooleanByRef类属于Db4objects.Db4o.Foundation命名空间,在下文中一共展示了BooleanByRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FailingTestSuite
private FailingTestSuite(bool failOnSetup, bool failOnTeardown, BooleanByRef tearDownCalled
, IClosure4 tests) : base(tests)
{
_failOnSetUp = failOnSetup;
_failOnTeardown = failOnTeardown;
_tearDownCalled = tearDownCalled;
}
示例2: Test
/// <exception cref="System.Exception"></exception>
public virtual void Test()
{
BooleanByRef disconnected = new BooleanByRef();
Lock4 Lock = new Lock4();
if (IsNetworking())
{
IDb4oClientServerFixture clientServerFixture = (IDb4oClientServerFixture)Fixture(
);
IObjectServerEvents objectServerEvents = (IObjectServerEvents)clientServerFixture
.Server();
objectServerEvents.ClientDisconnected += new System.EventHandler<Db4objects.Db4o.Events.StringEventArgs>
(new _IEventListener4_46(Lock, disconnected).OnEvent);
}
DeleteOnDeletingCallbackTestCase.RootItem root = ((DeleteOnDeletingCallbackTestCase.RootItem
)RetrieveOnlyInstance(typeof(DeleteOnDeletingCallbackTestCase.RootItem)));
root.child = new DeleteOnDeletingCallbackTestCase.Item();
Db().Store(root);
Db().Delete(root);
Reopen();
if (IsNetworking())
{
Lock.Run(new _IClosure4_63(disconnected, Lock));
}
AssertClassIndexIsEmpty();
}
示例3: AssertSingleEntry
public virtual void AssertSingleEntry(LocalObjectContainer container, long id)
{
var called = new BooleanByRef();
Index(container).TraverseKeys(container.SystemTransaction(), new _IVisitor4_24(id
, called));
Assert.IsTrue(called.value);
}
示例4: _IEventListener4_51
public _IEventListener4_51(string clientName, BooleanByRef eventRaised, Lock4 Lock
)
{
this.clientName = clientName;
this.eventRaised = eventRaised;
this.Lock = Lock;
}
示例5: TestExceptionInUpdateCallback
/// <exception cref="System.Exception"></exception>
public virtual void TestExceptionInUpdateCallback()
{
BooleanByRef doThrow = new BooleanByRef();
EventRegistryFactory.ForObjectContainer(Db()).Updated += new System.EventHandler<Db4objects.Db4o.Events.ObjectInfoEventArgs>
(new _IEventListener4_42(doThrow).OnEvent);
ExceptionsInCallbackTestCase.Holder holder = new ExceptionsInCallbackTestCase.Holder
();
ExceptionsInCallbackTestCase.Item item = new ExceptionsInCallbackTestCase.Item();
Store(holder);
Store(item);
Commit();
doThrow.value = true;
holder.list = new ArrayList();
holder.list.Add(item);
try
{
Db().Store(holder, int.MaxValue);
}
catch (Exception)
{
}
// rex.printStackTrace();
Checkdb();
Commit();
Checkdb();
Reopen();
Checkdb();
}
示例6: TestExceptionInUpdateCallback
/// <exception cref="System.Exception"></exception>
public virtual void TestExceptionInUpdateCallback()
{
var doThrow = new BooleanByRef();
EventRegistryFactory.ForObjectContainer(Db()).Updated += new _IEventListener4_42(doThrow).OnEvent;
var holder = new Holder
();
var item = new Item();
Store(holder);
Store(item);
Commit();
doThrow.value = true;
holder.list = new ArrayList();
holder.list.Add(item);
try
{
Db().Store(holder, int.MaxValue);
}
catch (Exception)
{
}
// rex.printStackTrace();
Checkdb();
Commit();
Checkdb();
Reopen();
Checkdb();
}
示例7: TestClientDisconnectedEvent
// closing is asynchronous, relying on completion is hard
// That's why there is no test here.
// ClientProcessesTestCase tests closing.
public virtual void TestClientDisconnectedEvent()
{
var client = (ClientObjectContainer) OpenClient();
var clientName = client.UserName;
var eventRaised = new BooleanByRef();
var events = (IObjectServerEvents) server;
var Lock = new Lock4();
events.ClientDisconnected += new _IEventListener4_51(clientName, eventRaised, Lock).OnEvent;
Lock.Run(new _IClosure4_58(client, eventRaised, Lock));
}
示例8: TestSplits
public virtual void TestSplits()
{
BooleanByRef splitNotified = new BooleanByRef();
IBTreeStructureListener listener = new _IBTreeStructureListener_18(splitNotified);
_btree.StructureListener(listener);
for (int i = 0; i < BtreeNodeSize + 1; i++)
{
Add(i);
}
Assert.IsTrue(splitNotified.value);
}
示例9: TestFailOnTearDown
public virtual void TestFailOnTearDown()
{
BooleanByRef tearDownCalled = new BooleanByRef();
TestResult result = new TestResult();
new TestRunner(Iterators.Iterable(new OpaqueTestSuiteFailureTestCase.FailingTestSuite
[] { new OpaqueTestSuiteFailureTestCase.FailingTestSuite(false, true, tearDownCalled
) })).Run(result);
Assert.AreEqual(1, result.TestCount);
Assert.AreEqual(2, result.Failures.Count);
Assert.IsTrue(tearDownCalled.value);
}
示例10: ShareParentForClass
internal override QConClass ShareParentForClass(IReflectClass a_class, BooleanByRef
removeExisting)
{
if (i_parent == null)
{
return null;
}
QConClass newConstraint = new QConClass(i_trans, i_parent, GetField(), a_class);
Morph(removeExisting, newConstraint, a_class);
return newConstraint;
}
示例11: TestTransactionInEventArgs
public virtual void TestTransactionInEventArgs()
{
var factory = EventRegistryFactory.ForObjectContainer(Db());
var called = new BooleanByRef();
var foundTrans = new ObjectByRef();
factory.Creating += new _IEventListener4_20(called, foundTrans).OnEvent;
Db().Store(new Item());
Db().Commit();
Assert.IsTrue(called.value);
Assert.AreSame(Trans(), foundTrans.value);
}
示例12: TestClientDisconnectedEvent
// closing is asynchronous, relying on completion is hard
// That's why there is no test here.
// ClientProcessesTestCase tests closing.
public virtual void TestClientDisconnectedEvent()
{
ClientObjectContainer client = (ClientObjectContainer)OpenClient();
string clientName = client.UserName;
BooleanByRef eventRaised = new BooleanByRef();
IObjectServerEvents events = (IObjectServerEvents)server;
Lock4 Lock = new Lock4();
events.ClientDisconnected += new System.EventHandler<Db4objects.Db4o.Events.StringEventArgs>
(new _IEventListener4_51(clientName, eventRaised, Lock).OnEvent);
Lock.Run(new _IClosure4_58(client, eventRaised, Lock));
}
示例13: TestTransactionInEventArgs
public virtual void TestTransactionInEventArgs()
{
IEventRegistry factory = EventRegistryFactory.ForObjectContainer(Db());
BooleanByRef called = new BooleanByRef();
ObjectByRef foundTrans = new ObjectByRef();
factory.Creating += new System.EventHandler<Db4objects.Db4o.Events.CancellableObjectEventArgs>
(new _IEventListener4_20(called, foundTrans).OnEvent);
Db().Store(new EventArgsTransactionTestCase.Item());
Db().Commit();
Assert.IsTrue(called.value);
Assert.AreSame(Trans(), foundTrans.value);
}
示例14: TestFailOnSetup
public virtual void TestFailOnSetup()
{
var tearDownCalled = new BooleanByRef();
var result = new TestResult();
new TestRunner(Iterators.Iterable(new[]
{
new FailingTestSuite(true, false, tearDownCalled
)
})).Run(result);
Assert.AreEqual(0, result.TestCount);
Assert.AreEqual(1, result.Failures.Count);
Assert.IsFalse(tearDownCalled.value);
}
示例15: Test
//COR-1839
#if !SILVERLIGHT
/// <exception cref="System.Exception"></exception>
public virtual void Test()
{
if (!Platform4.HasWeakReferences())
{
return;
}
WeakReferenceCollectionTestCase.Item item = new WeakReferenceCollectionTestCase.Item
();
Store(item);
Commit();
ByRef reference = new ByRef();
ReferenceSystem().TraverseReferences(new _IVisitor4_30(reference));
Assert.IsNotNull(((ObjectReference)reference.value));
item = null;
long timeout = 10000;
long startTime = Runtime.CurrentTimeMillis();
while (true)
{
long currentTime = Runtime.CurrentTimeMillis();
if (currentTime - startTime >= timeout)
{
Assert.Fail("Timeout waiting for WeakReference collection.");
}
Runtime.Gc();
Runtime.RunFinalization();
Thread.Sleep(1);
if (((ObjectReference)reference.value).GetObject() == null)
{
break;
}
}
startTime = Runtime.CurrentTimeMillis();
while (true)
{
long currentTime = Runtime.CurrentTimeMillis();
if (currentTime - startTime >= timeout)
{
Assert.Fail("Timeout waiting for removal of ObjectReference from ReferenceSystem."
);
}
BooleanByRef found = new BooleanByRef();
ReferenceSystem().TraverseReferences(new _IVisitor4_63(reference, found));
if (!found.value)
{
return;
}
Thread.Sleep(10);
}
}