public void testStart() { // remove this comments to test this class standalone // jxmeService.initComponent(); // jxmeService.startComponent(null); jxmeService.addMessageListener(new TestListener()); if (LOG.isDebugEnabled()) { LOG.debug("adding IMessageListener to JxmeService"); } LOG.info("JUNIT: init BluetoothComponent"); // btcop.initComponent(); // btcop.startComponent(null); assertTrue(true); if (btcop.isRendezVousPeer()) { while (btcop.numberOfConnections() == 0) { synchronized (this) { try { this.wait(1000); } catch (InterruptedException e) { LOG.error("interrupted during waiting for incomming messages", e); } } } IElement[] elements = new Element[1]; elements[0] = new Element("test", "test"); IMessage msg = new Message(elements); try { jxmeService.send(null, msg); if (LOG.isDebugEnabled()) { LOG.debug("============> sent message"); } } catch (IOException e) { LOG.fatal("IOException during sending message: ", e); } } else { synchronized (this) { try { this.wait(30000); } catch (InterruptedException e) { LOG.error("interrupted during waiting for incomming messages", e); } } } synchronized (this) { try { this.wait(3000); } catch (InterruptedException e) { LOG.error("interrupted during waiting for incomming messages", e); } } }