[
https://issues.apache.org/jira/browse/HADOOP-15520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505997#comment-16505997
]
Steve Loughran commented on HADOOP-15520:
-----------------------------------------
thanks for this
* I like the detail on assert failures, always good.
* We have a 80 chars wide line width rule though; you are going to have to
split down things. Sorry.
* in \{{TestLimitInputStream}}, inner class \{{TestInputStream}} should have a
different name (no Test* prefix), make static.
* And for strictness, use try-with-resources to trigger closing of the streams,
even on an assert failure
* If you want preformatted text in the javadocs, you'll need to use <pre>
sections, or <ol><li> clauses.
* There are some requirements about test timeouts (mandatory) and preferences
(naming threads). If your tests extend org.apache.hadoop.test.HadoopTestBase
then you get these.
ordering of imports is trouble: its not strictly enforced the way spark does,
but we have some preferences
and like them to be followed: imports are often where merge conflict arises, so
once in we can't easily reorder
them (example: TestShell).
the order I have in my IDE is
{code}
javax.*
java.*
\n
(other())
\n
org.apache.*
\
all static imports, alpha sorted.
{code}
(+static imports can use .* if they want)
Before
{code}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.hadoop.util.IntrusiveCollection.Element;
import org.junit.Test;
{code}
After
{code}
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.junit.Test;
import org.apache.hadoop.util.IntrusiveCollection.Element;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
{code}
Other than those details, the tests themselves look good. Revised title &
component to reflect area of coverage
> Add tests for various org.apache.hadoop.util classes
> ----------------------------------------------------
>
> Key: HADOOP-15520
> URL: https://issues.apache.org/jira/browse/HADOOP-15520
> Project: Hadoop Common
> Issue Type: Test
> Components: test, util
> Affects Versions: 3.2.0
> Environment: CentOS 7 - amd64
> Oracle JDK 8u172
> Maven 3.5.3
> hadoop trunk
> Reporter: Arash Nabili
> Priority: Minor
> Attachments: HADOOP-15520.002.patch
>
>
> Created new JUnit test classes for the following classes:
> * org.apache.hadoop.util.CloseableReferenceCount
> * org.apache.hadoop.util.IntrusiveCollection
> * org.apache.hadoop.util.LimitInputStream
> * org.apache.hadoop.util.UTF8ByteArrayUtils
> Added new JUnit test cases to the following test classes:
> * org.apache.hadoop.util.TestShell
> * org.apache.hadoop.util.TestStringUtils
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]