From 7d7913228e6f52273f2fdada6822a380f95e0f8c Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 20 Oct 2014 12:11:48 +0000
Subject: [PATCH] Autorefactored simplifying expressions: - removed useless parentheses - added parentheses to disambiguate expressions - removed useless use of "this" keyword in method calls - removed useless null checks in conjunction with use of instanceof operator
---
opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandTestCase.java | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandTestCase.java b/opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandTestCase.java
index 38c0875..1ce1846 100644
--- a/opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandTestCase.java
+++ b/opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandTestCase.java
@@ -46,7 +46,7 @@
*/
@Test
public void testAllowsTrailingArgumentsFalse1() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
Assert.assertFalse(sc.allowsTrailingArguments());
@@ -60,7 +60,7 @@
*/
@Test
public void testAllowsTrailingArgumentsFalse2() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
Assert.assertFalse(sc.allowsTrailingArguments());
@@ -74,7 +74,7 @@
*/
@Test
public void testAllowsTrailingArgumentsTrue() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
LocalizableMessage.raw("XXX"));
@@ -89,7 +89,7 @@
*/
@Test
public void testGetMaxTrailingArguments1() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
Assert.assertEquals(sc.getMaxTrailingArguments(), 0);
@@ -103,7 +103,7 @@
*/
@Test
public void testGetMaxTrailingArguments2() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
Assert.assertEquals(sc.getMaxTrailingArguments(), 0);
@@ -117,7 +117,7 @@
*/
@Test
public void testGetMaxTrailingArguments3() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
LocalizableMessage.raw("XXX"));
@@ -132,7 +132,7 @@
*/
@Test
public void testGetMinTrailingArguments1() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
Assert.assertEquals(sc.getMinTrailingArguments(), 0);
@@ -146,7 +146,7 @@
*/
@Test
public void testGetMinTrailingArguments2() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
Assert.assertEquals(sc.getMinTrailingArguments(), 0);
@@ -160,7 +160,7 @@
*/
@Test
public void testGetMinTrailingArguments3() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
LocalizableMessage.raw("XXX"));
@@ -175,7 +175,7 @@
*/
@Test
public void testGetTrailingArgumentsDisplayName1() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
Assert.assertNull(sc.getTrailingArgumentsDisplayName());
@@ -189,7 +189,7 @@
*/
@Test
public void testGetTrailingArgumentsDisplayName2() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
Assert.assertNull(sc.getTrailingArgumentsDisplayName());
@@ -203,7 +203,7 @@
*/
@Test
public void testGetTrailingArgumentsDisplayName3() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
LocalizableMessage.raw("XXX"));
@@ -218,7 +218,7 @@
*/
@Test
public void testGetTrailingArguments1() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
parser.parseArguments(new String[] { "sub-command1" });
@@ -233,7 +233,7 @@
*/
@Test
public void testGetTrailingArguments2() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
parser.parseArguments(new String[] { "sub-command2" });
@@ -248,7 +248,7 @@
*/
@Test
public void testGetTrailingArguments3() throws Exception {
- SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
+ SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
LocalizableMessage.raw("test description"), true);
SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
LocalizableMessage.raw("XXX"));
--
Gitblit v1.10.0