@@ -49,26 +49,19 @@ public class HBaseCommonTestingUtil {
4949 * Compression algorithms to use in parameterized JUnit 4 tests
5050 */
5151 public static final List <Object []> COMPRESSION_ALGORITHMS_PARAMETERIZED =
52- Arrays .asList (new Object [][] {
53- { Compression .Algorithm .NONE },
54- { Compression .Algorithm .GZ }
55- });
52+ Arrays .asList (new Object [][] { { Compression .Algorithm .NONE }, { Compression .Algorithm .GZ } });
5653
5754 /**
5855 * This is for unit tests parameterized with a two booleans.
5956 */
6057 public static final List <Object []> BOOLEAN_PARAMETERIZED =
61- Arrays .asList (new Object [][] {
62- {false },
63- {true }
64- });
58+ Arrays .asList (new Object [][] { { false }, { true } });
6559
6660 /**
6761 * Compression algorithms to use in testing
6862 */
69- public static final Compression .Algorithm [] COMPRESSION_ALGORITHMS = {
70- Compression .Algorithm .NONE , Compression .Algorithm .GZ
71- };
63+ public static final Compression .Algorithm [] COMPRESSION_ALGORITHMS =
64+ { Compression .Algorithm .NONE , Compression .Algorithm .GZ };
7265
7366 protected final Configuration conf ;
7467
@@ -82,7 +75,6 @@ public HBaseCommonTestingUtil(Configuration conf) {
8275
8376 /**
8477 * Returns this classes's instance of {@link Configuration}.
85- *
8678 * @return Instance of Configuration.
8779 */
8880 public Configuration getConfiguration () {
@@ -92,8 +84,7 @@ public Configuration getConfiguration() {
9284 /**
9385 * System property key to get base test directory value
9486 */
95- public static final String BASE_TEST_DIRECTORY_KEY =
96- "test.build.data.basedirectory" ;
87+ public static final String BASE_TEST_DIRECTORY_KEY = "test.build.data.basedirectory" ;
9788
9889 /**
9990 * Default base directory for test output.
@@ -127,13 +118,11 @@ public Path getDataTestDir(final String name) {
127118
128119 /**
129120 * Sets up a directory for a test to use.
130- *
131121 * @return New directory path, if created.
132122 */
133123 protected Path setupDataTestDir () {
134124 if (this .dataTestDir != null ) {
135- LOG .warn ("Data test dir already setup in " +
136- dataTestDir .getAbsolutePath ());
125+ LOG .warn ("Data test dir already setup in " + dataTestDir .getAbsolutePath ());
137126 return null ;
138127 }
139128 Path testPath = getRandomDir ();
@@ -151,16 +140,15 @@ protected Path setupDataTestDir() {
151140 }
152141
153142 /**
154- * Returns A dir with a random (uuid) name under the test dir
143+ * Returns a dir with a random (uuid) name under the test dir
155144 * @see #getBaseTestDir()
156145 */
157146 public Path getRandomDir () {
158147 return new Path (getBaseTestDir (), getRandomUUID ().toString ());
159148 }
160149
161150 public static UUID getRandomUUID () {
162- return new UUID (ThreadLocalRandom .current ().nextLong (),
163- ThreadLocalRandom .current ().nextLong ());
151+ return new UUID (ThreadLocalRandom .current ().nextLong (), ThreadLocalRandom .current ().nextLong ());
164152 }
165153
166154 protected void createSubDir (String propertyName , Path parent , String subDirName ) {
@@ -212,8 +200,7 @@ public boolean cleanupTestDir(final String subdir) {
212200 * @see #setupDataTestDir()
213201 */
214202 private Path getBaseTestDir () {
215- String PathName = System .getProperty (
216- BASE_TEST_DIRECTORY_KEY , DEFAULT_BASE_TEST_DIRECTORY );
203+ String PathName = System .getProperty (BASE_TEST_DIRECTORY_KEY , DEFAULT_BASE_TEST_DIRECTORY );
217204
218205 return new Path (PathName );
219206 }
@@ -248,24 +235,23 @@ boolean deleteDir(final File dir) {
248235 /**
249236 * Wrapper method for {@link Waiter#waitFor(Configuration, long, Predicate)}.
250237 */
251- public <E extends Exception > long waitFor (long timeout , Predicate <E > predicate )
252- throws E {
238+ public <E extends Exception > long waitFor (long timeout , Predicate <E > predicate ) throws E {
253239 return Waiter .waitFor (this .conf , timeout , predicate );
254240 }
255241
256242 /**
257243 * Wrapper method for {@link Waiter#waitFor(Configuration, long, long, Predicate)}.
258244 */
259245 public <E extends Exception > long waitFor (long timeout , long interval , Predicate <E > predicate )
260- throws E {
246+ throws E {
261247 return Waiter .waitFor (this .conf , timeout , interval , predicate );
262248 }
263249
264250 /**
265251 * Wrapper method for {@link Waiter#waitFor(Configuration, long, long, boolean, Predicate)}.
266252 */
267- public <E extends Exception > long waitFor (long timeout , long interval ,
268- boolean failIfTimeout , Predicate <E > predicate ) throws E {
253+ public <E extends Exception > long waitFor (long timeout , long interval , boolean failIfTimeout ,
254+ Predicate <E > predicate ) throws E {
269255 return Waiter .waitFor (this .conf , timeout , interval , failIfTimeout , predicate );
270256 }
271257
@@ -331,12 +317,11 @@ public int randomFreePort() {
331317 }
332318
333319 /**
334- * Returns a random port. These ports cannot be registered with IANA and are
335- * intended for dynamic allocation (see http://bit.ly/dynports).
320+ * Returns a random port. These ports cannot be registered with IANA and are intended for
321+ * dynamic allocation (see http://bit.ly/dynports).
336322 */
337323 private int randomPort () {
338- return MIN_RANDOM_PORT
339- + random .nextInt (MAX_RANDOM_PORT - MIN_RANDOM_PORT );
324+ return MIN_RANDOM_PORT + random .nextInt (MAX_RANDOM_PORT - MIN_RANDOM_PORT );
340325 }
341326
342327 interface AvailablePortChecker {
0 commit comments