evaluateScript("cometd.configure({url: '" + cometdURL + "', logLevel: '" + getLogLevel() + "'});");
evaluateScript("var handshakeLatch = new Latch(1);");
Latch handshakeLatch = get("handshakeLatch");
evaluateScript("cometd.addListener('/meta/handshake', handshakeLatch, 'countDown');");
evaluateScript("cometd.handshake();");
Assert.assertTrue(handshakeLatch.await(5000));
evaluateScript("var latch1 = new Latch(1);");
Latch latch1 = get("latch1");
evaluateScript("cometd.subscribe('/test', dojo.hitch(latch1, 'countDown'), {});");
evaluateScript("var latch2 = new Latch(1);");