Example #1
0
        public void testRegistrationCallbacks()
        {
            long startTime = DateTime.Now.Millisecond;

            TestRegistrationCallbacks.Counter counter = new TestRegistrationCallbacks.Counter();

            // register the prefix and count when it registers successfully
            face.registerPrefix(new Name("/test/register/callbacks"),
                                (OnInterestCallback)null, new TestRegistrationCallbacks.Anonymous_C1(startTime), new TestRegistrationCallbacks.Anonymous_C0(counter, startTime));

            // wait until complete or the test times out
            long endTime = startTime + MAX_TEST_DURATION_MS;

            while (counter.count < 1 && DateTime.Now.Millisecond < endTime)
            {
                face.processEvents();
                ILOG.J2CsMapping.Threading.ThreadWrapper.sleep(PROCESS_EVENTS_INTERVAL_MS);
            }

            Assert.AssertEquals(1, counter.count);
        }
Example #2
0
 public Anonymous_C0(TestRegistrationCallbacks.Counter counter_0, long startTime_1)
 {
     this.counter   = counter_0;
     this.startTime = startTime_1;
 }