TestSubCommandArgumentParserTestCase.java revision 6870993d12bf8a2b9d5cd103dc5ccabc42f9bf5d
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008 Sun Microsystems, Inc.
* Portions Copyright 2014 ForgeRock AS
*/
/**
* Unit tests for the SubCommand class.
*/
@SuppressWarnings("javadoc")
public final class TestSubCommandArgumentParserTestCase extends CliTestCase {
private SubCommandArgumentParser parser;
/** First sub-command. */
private SubCommand sc1;
/** Second sub-command. */
private SubCommand sc2;
/**
* Create the sub-commands and parser.
*
* @throws Exception
* If something unexpected happened.
*/
parser = new SubCommandArgumentParser(this.getClass().getName(), LocalizableMessage.raw("test description"),
true);
}
/**
* Test the getSubCommand method.
*
* @throws Exception
* If something unexpected happened.
*/
@Test
public void testGetSubCommand() throws Exception {
}
/**
* Provide valid command line args.
*
* @return Array of valid command line args.
*/
public Object[][] createValidCommandLineArgs() {
}
/**
* Test the parseArguments method with valid args.
*
* @param args
* The command line args.
* @param sc
* The expected sub-command.
* @throws Exception
* If something unexpected happened.
*/
// Check the correct sub-command was parsed.
// Check that the trailing arguments were retrieved correctly and
// in the right order.
}
} else {
}
}
/**
* Provide invalid command line args.
*
* @return Array of invalid command line args.
*/
public Object[][] createInvalidCommandLineArgs() {
}
/**
* Test the parseArguments method with invalid args.
*
* @param args
* The command line args.
* @throws Exception
* If something unexpected happened.
*/
}
return new Object[][] {
{ "test1", 5, " ", " test1\n" },
{ "test1 test2", 5, " ", " test1\n test2\n" },
{ "test1 test2test3", 5, " ", " test1\n test2test3\n" },
{ "test1 test2test3 test4", 5, " ", " test1\n test2test3\n test4\n" },
};
}
}
}