@Test public void testWriteChannel() throws Exception { DeviceLocator deviceLocator = createDeviceLocator(driver.getDriverId(), "", "", null); ChannelLocator channelLocator = createChannelLocator("1", deviceLocator); driver.channels.put(channelLocator, new AtomicInteger()); ChannelConfiguration configuration = channelManager.addChannel(channelLocator, Direction.DIRECTION_OUTPUT, ChannelConfiguration.NO_READ_NO_LISTEN); for (int i = 0; i < 10; i++) { channelManager.setChannelValue(configuration, new IntegerValue(i)); assertTrue(driver.writeChannelsCount == i + 1); assertTrue(driver.channels.get(channelLocator).get() == i); } }
void writeChannel(Value value) throws ChannelAccessException { synchronized (writeList) { writeList.get(0).setValue(value); try { driver.writeChannels(writeList); } catch (Exception e) { throw new ChannelAccessException("write failed: " + channelLocator, e); } } }
Channel { void writeChannel(Value value) throws ChannelAccessException { synchronized (writeList) { writeList.get(0).setValue(value); try { driver.writeChannels(writeList); } catch (Exception e) { throw new ChannelAccessException("write failed: " + channelLocator, e); } } } }
Channel { void writeChannel(Value value) throws ChannelAccessException { synchronized (writeList) { writeList.get(0).setValue(value); try { driver.writeChannels(writeList); } catch (Exception e) { throw new ChannelAccessException("write failed: " + channelLocator, e); } } } Channel(Driver driver, ChannelLocator channelLocator); }
Channel { void writeChannel(Value value) throws ChannelAccessException { synchronized (writeList) { writeList.get(0).setValue(value); try { driver.writeChannels(writeList); } catch (Exception e) { throw new ChannelAccessException("write failed: " + channelLocator, e); } } } Channel(Driver driver, ChannelLocator channelLocator);  }
Channel { void writeChannel(Value value) throws ChannelAccessException { synchronized (writeList) { writeList.get(0).setValue(value); try { driver.writeChannels(writeList); } catch (Exception e) { throw new ChannelAccessException("write failed: " + channelLocator, e); } } } Channel(Driver driver, ChannelLocator channelLocator);   }