@BeforeEach void setUp() throws Exception { try { // prevents access problems with a just previously closed port Thread.sleep(50); lnk = new KNXNetworkLinkFT12(Util.getSerialPort(), TPSettings.TP1); } catch (final Exception e) { Util.tearDownLogging(); throw e; } nll = new NLListenerImpl(); lnk.addLinkListener(nll); frame = new CEMILData( CEMILData.MC_LDATA_REQ, new IndividualAddress(0), new GroupAddress(0, 0, 1), new byte[] {0, (byte) (0x80 | 1)}, Priority.LOW); frame2 = new CEMILData( CEMILData.MC_LDATA_REQ, new IndividualAddress(0), new GroupAddress(0, 0, 1), new byte[] {0, (byte) (0x80 | 0)}, Priority.URGENT, true, 3); frame3 = new CEMILData( CEMILData.MC_LDATA_REQ, new IndividualAddress(0), new GroupAddress(0, 0, 3), new byte[] {0, (byte) (0x80 | 0)}, Priority.NORMAL); }
/** * Test method for {@link * KNXNetworkLinkFT12#addLinkListener(tuwien.auto.calimero.link.NetworkLinkListener)}. */ @Test public final void testAddLinkListener() { lnk.addLinkListener(nll); lnk.addLinkListener(nll); }