Ejemplo n.º 1
0
 public void testInit()
 {
     CountdownLatch latch = new CountdownLatch(1);
     InitListener listener = new InitListener(latch);
     Platform.init(listener);
     latch.Wait();
     Assert.AreEqual(listener.initState, InitStateChangedEvent.InitState.INITIALIZED);
     tearDown();
 }
Ejemplo n.º 2
0
        public void testInit()
        {
            CountdownLatch latch    = new CountdownLatch(1);
            InitListener   listener = new InitListener(latch);

            Platform.init(listener);
            latch.Wait();
            Assert.AreEqual(listener.initState, InitStateChangedEvent.InitState.INITIALIZED);
            tearDown();
        }
Ejemplo n.º 3
0
 public void testGetService()
 {
     CountdownLatch latch = new CountdownLatch(1);
     InitListener listener = new InitListener(latch);
     Assert.IsNull(Platform.getService());
     Platform.init(listener);
     latch.Wait();
     Assert.IsNotNull(Platform.getService());
     tearDown();
 }
Ejemplo n.º 4
0
        public void testGetService()
        {
            CountdownLatch latch    = new CountdownLatch(1);
            InitListener   listener = new InitListener(latch);

            Assert.IsNull(Platform.getService());
            Platform.init(listener);
            latch.Wait();
            Assert.IsNotNull(Platform.getService());
            tearDown();
        }
        public void testGetScreenSharingSources()
        {
            _service.getScreenCaptureSources(createScrSourcesResponder(), 160);
            List <ScreenCaptureSource> sources = awaitScrSourcesResult(10000);

            Assert.IsTrue(sources.Count > 0);
            Console.Error.WriteLine("Got sources: " + sources.Count);
            CountdownLatch latch = new CountdownLatch(1);
            PictureForm    pForm = new PictureForm(sources);

            pForm.ShowDialog();
        }
 public void testEchoNotification()
 {
     CountdownLatch latch = new CountdownLatch();
     MockEventListener listener = new MockEventListener(latch);
     _service.addServiceListener(createVoidResponder(), listener);
     awaitVoidResult("addServiceListener");
     _service.sendEchoNotification(createVoidResponder(), "whatever");
     awaitVoidResult();
     Assert.IsTrue(latch.Wait(), "Got timeout when waiting for the event");
     Assert.IsNotNull(listener.receivedEvent);
     Assert.AreEqual("whatever", listener.receivedEvent.echoValue);
 }
Ejemplo n.º 7
0
        public void testEchoNotification()
        {
            CountdownLatch    latch    = new CountdownLatch();
            MockEventListener listener = new MockEventListener(latch);

            _service.addServiceListener(createVoidResponder(), listener);
            awaitVoidResult("addServiceListener");
            _service.sendEchoNotification(createVoidResponder(), "whatever");
            awaitVoidResult();
            Assert.IsTrue(latch.Wait(), "Got timeout when waiting for the event");
            Assert.IsNotNull(listener.receivedEvent);
            Assert.AreEqual("whatever", listener.receivedEvent.echoValue);
        }
        protected void setUp()
        {
            CountdownLatch latch    = new CountdownLatch(1);
            InitListener   listener = new InitListener(latch);

            Platform.init(listener);
            latch.Wait();
            Assert.AreEqual(InitStateChangedEvent.InitState.INITIALIZED, listener.initState, "Failed to initialize the platform due to: " + listener.errMsg);
            _service   = Platform.getService();
            dispatcher = new AddLiveServiceEventDispatcher();
            _service.addServiceListener(createVoidResponder(), dispatcher);
            awaitVoidResult("addServiceListener");
        }
 private void setupCall()
 {
     _lastError = 0;
     _latch = new CountdownLatch();
 }
 protected void setUp()
 {
     CountdownLatch latch = new CountdownLatch(1);
     InitListener listener = new InitListener(latch);
     Platform.init(listener);
     latch.Wait();
     Assert.AreEqual(InitStateChangedEvent.InitState.INITIALIZED, listener.initState, "Failed to initialize the platform due to: " + listener.errMsg);
     _service = Platform.getService();
     dispatcher = new AddLiveServiceEventDispatcher();
     _service.addServiceListener(createVoidResponder(), dispatcher);
     awaitVoidResult("addServiceListener");
 }
Ejemplo n.º 11
0
 public InitListener(CountdownLatch latch)
 {
     _latch = latch;
 }
Ejemplo n.º 12
0
 public MockEventListener(CountdownLatch latch)
 {
     _latch = latch;
 }
 private void setupCall()
 {
     _lastError = 0;
     _latch     = new CountdownLatch();
 }
 public void testGetScreenSharingSources()
 {
     _service.getScreenCaptureSources(createScrSourcesResponder(), 160);
     List<ScreenCaptureSource> sources = awaitScrSourcesResult(10000);
     Assert.IsTrue(sources.Count > 0);
     Console.Error.WriteLine("Got sources: " + sources.Count);
     CountdownLatch latch = new CountdownLatch(1);
     PictureForm pForm = new PictureForm(sources);
     pForm.ShowDialog();
 }
Ejemplo n.º 15
0
 public InitListener(CountdownLatch latch)
 {
     _latch = latch;
 }
 public MockEventListener(CountdownLatch latch)
 {
     _latch = latch;
 }