UpgradeTestCase.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* 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
*
*
* Portions Copyright 2013-2015 ForgeRock AS.
*/
/**
* A set of test cases for the Upgrade tool.
*/
@SuppressWarnings("javadoc")
public class UpgradeTestCase extends ToolsTestCase
{
/**
* Sets the args for the upgrade tools. The configFile parameter is configured
* by default.
*
* <pre>
* usage : {@code}setArgs("--force", "--no-prompt") {@code}
* corresponds to command line : ./upgrade --force -n
* </pre>
*
* @param args
* The argument you want for testing.
* @return An array of string containing the args.
*/
{
{
{
}
}
return mainArgs;
}
/**
* Returns {@code true} if the output contain the expected message.
*
* @param output
* The upgrade's output.
* @param expectedMessage
* The expected message.
*/
{
}
/**
* Tests display help information.
*/
@Test
public void testUpgradeToolDisplaysHelpUsage()
{
try
{
// The 'main' should exit with success code.
}
finally
{
}
}
/**
* Tests display help information.
*/
@Test
public void testUpgradeToolDisplaysHelpUsage2()
{
try
{
// The 'main' should exit with success code.
}
finally
{
}
}
/**
* Tests display help information.
*/
@Test
public void testUpgradeToolDisplaysHelpUsage3()
{
try
{
// The 'main' should exit with success code.
}
finally
{
}
}
/**
* Tests the upgrade tool with an invalid sub-command.
*/
@Test
public void testUpgradeToolDoesntAllowWrongSubcommand()
{
try
{
// The 'main' should exit with an error code.
}
finally
{
}
}
/**
* Tests the upgrade tool with an invalid sub-command.
*/
@Test
public void testUpgradeToolDoesntAllowWrongSubcommand2()
{
try
{
// The 'main' should exit with an error code.
}
finally
{
}
}
/**
* The upgrade tool disallows the force sub-command used with 'interactive
* mode'.
*/
@Test
public void testUpgradeToolDoesntAllowInteractiveAndForce()
{
try
{
// The 'main' should exit with an error code.
// Because interactive mode is not compatible with force upgrade mode.
OPTION_LONG_FORCE_UPGRADE, "interactive mode"));
}
finally
{
}
}
/**
* Upgrade tool allows use of force and no-prompt sub-commands.
*/
@Test
public void testUpgradeToolAllowsNonInteractiveAndForce() throws Exception
{
try
{
// The 'main' should exit with success code.
// The sub-commands have been checked ok but upgrade must exist on
// version's verification.
}
finally
{
}
}
}