TextParameterDataSegment extends AbstractDataSegment { public final void addAll (final SettingsMap textKeys) { for (Map.Entry<OperationalTextKey , String> e : textKeys.entrySet()) { add(e.getKey(), e.getValue()); } isDirty = true; } TextParameterDataSegment(final int initChunkSize); final void add(final OperationalTextKey textKey, final String value); final void addAll(final SettingsMap textKeys); final int append(final ByteBuffer src, final int len); final int deserialize(final ByteBuffer src, final int len); final SettingsMap getSettings(); final void clear(); final boolean equals(final Object anObject); @Override final int hashCode();  }
@Test public final void testAddAll () throws Exception { final TextParameterDataSegment dataSegment = new TextParameterDataSegment(CHUNK_SIZE); assertNotNull(dataSegment); dataSegment.add(OperationalTextKey.DATA_DIGEST, "Yes"); dataSegment.add(OperationalTextKey.HEADER_DIGEST, "No"); dataSegment.add(OperationalTextKey.MAX_CONNECTIONS, "50"); assertEquals(3, dataSegment.getSettings().entrySet().size()); assertFalse(dataSegment.getSettings().entrySet().isEmpty()); final TextParameterDataSegment anotherDataSegment = new TextParameterDataSegment(CHUNK_SIZE); assertNotNull(anotherDataSegment); anotherDataSegment.addAll(dataSegment.getSettings()); assertNotNull(anotherDataSegment); assertEquals(3, anotherDataSegment.getSettings().entrySet().size()); assertFalse(anotherDataSegment.getSettings().entrySet().isEmpty()); }