From dfcb1b5674ba90e20a12c34c45016920531b1a44 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 20 Jan 2015 14:17:43 +0000
Subject: [PATCH] More code cleanup
---
opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java b/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java
index 6080518..a19e534 100644
--- a/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java
+++ b/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java
@@ -22,23 +22,22 @@
*
*
* Copyright 2008 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2015 ForgeRock AS
*/
package com.forgerock.opendj.cli;
+import static com.forgerock.opendj.cli.CliMessages.*;
+
import java.util.ArrayList;
import java.util.List;
import org.fest.assertions.Assertions;
import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.i18n.LocalizableMessageBuilder;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import static com.forgerock.opendj.cli.CliMessages.*;
-
/**
* Unit tests for the SubCommand class.
*/
@@ -49,7 +48,6 @@
/** First sub-command. */
private SubCommand sc1;
-
/** Second sub-command. */
private SubCommand sc2;
@@ -88,7 +86,9 @@
*/
@DataProvider(name = "validCommandLineArgs")
public Object[][] createValidCommandLineArgs() {
- return new Object[][] { { new String[] {}, null }, { new String[] { "sub-command1" }, sc1 },
+ return new Object[][] {
+ { new String[] {}, null },
+ { new String[] { "sub-command1" }, sc1 },
{ new String[] { "sub-command2", "one", "two" }, sc2 },
{ new String[] { "sub-command2", "one", "two", "three" }, sc2 },
{ new String[] { "sub-command2", "one", "two", "three", "four" }, sc2 }, };
@@ -131,8 +131,10 @@
*/
@DataProvider(name = "invalidCommandLineArgs")
public Object[][] createInvalidCommandLineArgs() {
- return new Object[][] { { new String[] { "sub-command1", "one" } },
- { new String[] { "sub-command1", "one", "two" } }, { new String[] { "sub-command2" } },
+ return new Object[][] {
+ { new String[] { "sub-command1", "one" } },
+ { new String[] { "sub-command1", "one", "two" } },
+ { new String[] { "sub-command2" } },
{ new String[] { "sub-command2", "one" } },
{ new String[] { "sub-command2", "one", "two", "three", "four", "five" } }, };
}
@@ -162,7 +164,7 @@
@Test(dataProvider = "indentAndWrapProvider")
public void testIndentAndWrap(String text, int wrapColumn, String indent, String expected) {
- final LocalizableMessageBuilder buffer = new LocalizableMessageBuilder();
+ final StringBuilder buffer = new StringBuilder();
SubCommandArgumentParser.indentAndWrap(indent, wrapColumn, LocalizableMessage.raw(text), buffer);
Assertions.assertThat(buffer.toString()).isEqualTo(expected);
}
--
Gitblit v1.10.0