[
https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13539409#comment-13539409
]
Surenkumar Nihalani commented on HADOOP-9154:
---------------------------------------------
It's my understanding that merging the tests is my part here. If work division
is different, please correct me.
Now, we can merge the TestMapWritable & TestSortedMapWritable into one
TestAbstractMap. However deleting the older files doesn't seem like a good
option because incase MapWritable & SortedMapWritable change, we need the
developer to be aware what he's changing, but, keeping them would mean code
duplication. I was going through JUnit's offering. I think we'll have to create
an abstract test class and then extend it in all files (TestMapWritable,
TestSortedMapWritable, TestAbstractMap)
with right initialization in a setup method.
Is there a more elegant way to do this?
> SortedMapWritable#putAll() doesn't add key/value classes to the map
> -------------------------------------------------------------------
>
> Key: HADOOP-9154
> URL: https://issues.apache.org/jira/browse/HADOOP-9154
> Project: Hadoop Common
> Issue Type: Bug
> Components: io
> Affects Versions: 2.0.2-alpha
> Reporter: Karthik Kambatla
> Assignee: Karthik Kambatla
> Attachments: hadoop-9154-draft.patch
>
>
> In the following code from {{SortedMapWritable}}, #putAll() doesn't add
> key/value classes to the class-id maps.
> {code}
> @Override
> public Writable put(WritableComparable key, Writable value) {
> addToMap(key.getClass());
> addToMap(value.getClass());
> return instance.put(key, value);
> }
> @Override
> public void putAll(Map<? extends WritableComparable, ? extends Writable> t){
> for (Map.Entry<? extends WritableComparable, ? extends Writable> e:
> t.entrySet()) {
>
> instance.put(e.getKey(), e.getValue());
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira