CommandLineOptionsTest.java revision a937449043f1e649320ccb609d9d1de16f6a9208
2ronwalf/*
2ronwalf * CDDL HEADER START
2ronwalf *
2ronwalf * The contents of this file are subject to the terms of the
2ronwalf * Common Development and Distribution License (the "License").
2ronwalf * You may not use this file except in compliance with the License.
2ronwalf *
2ronwalf * See LICENSE.txt included in this distribution for the specific
2ronwalf * language governing permissions and limitations under the License.
2ronwalf *
2ronwalf * When distributing Covered Code, include this CDDL HEADER in each
2ronwalf * file and include the License file at LICENSE.txt.
2ronwalf * If applicable, add the following below this CDDL HEADER, with the
2ronwalf * fields enclosed by brackets "[]" replaced with your own identifying
2ronwalf * information: Portions Copyright [yyyy] [name of copyright owner]
2ronwalf *
2ronwalf * CDDL HEADER END
2ronwalf */
2ronwalf
2ronwalf/*
2ronwalf * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2ronwalf * Use is subject to license terms.
2ronwalf */
2ronwalfpackage org.opensolaris.opengrok.index;
2ronwalf
2ronwalfimport java.io.IOException;
2ronwalfimport java.util.Iterator;
2ronwalfimport org.junit.After;
2ronwalfimport org.junit.AfterClass;
2ronwalfimport org.junit.Before;
2ronwalfimport org.junit.BeforeClass;
2ronwalfimport org.junit.Test;
2ronwalfimport static org.junit.Assert.*;
2ronwalf
2ronwalf/**
2ronwalf * Check the CommandLineOption class
2ronwalf *
* @author Trond Norbye
*/
public class CommandLineOptionsTest {
public CommandLineOptionsTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getCommandString method, of class CommandLineOptions.
*/
@Test
public void testCommandLineOptions() throws IOException {
CommandLineOptions instance = new CommandLineOptions();
String cmdString = instance.getCommandString();
assertNotNull(cmdString);
int ii = 0;
while (ii < cmdString.length()) {
char c = cmdString.charAt(ii);
if (c != ':') {
assertNotNull(instance.getCommandUsage(c));
}
++ii;
}
Iterator<CommandLineOptions.Option> iter = instance.getOptionsIterator();
while (iter.hasNext()) {
CommandLineOptions.Option o = iter.next();
assertNotNull(o.description);
}
assertNotNull(instance.getUsage());
assertNotNull(instance.getManPage());
}
}