本文整理汇总了Java中org.apache.commons.cli.ParseException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ParseException.printStackTrace方法的具体用法?Java ParseException.printStackTrace怎么用?Java ParseException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.cli.ParseException
的用法示例。
在下文中一共展示了ParseException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDefaults
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testDefaults() {
String[] arguments = new String[]{"a-marc-file.mrc"};
try {
CommonParameters parameters = new CommonParameters(arguments);
assertFalse(parameters.doHelp());
assertTrue(parameters.doLog);
assertNotNull(parameters.getArgs());
assertEquals(1, parameters.getArgs().length);
assertEquals("a-marc-file.mrc", parameters.getArgs()[0]);
} catch (ParseException e) {
e.printStackTrace();
}
}
示例2: testDefaults
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testDefaults() {
String[] arguments = new String[]{"a-marc-file.mrc"};
try {
FormatterParameters parameters = new FormatterParameters(arguments);
assertNotNull(parameters.getArgs());
assertEquals(1, parameters.getArgs().length);
assertEquals("a-marc-file.mrc", parameters.getArgs()[0]);
assertFalse(parameters.doHelp());
assertNull(parameters.getId());
assertNull(parameters.getFormat());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例3: testSearch
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testSearch() {
String[] arguments = new String[]{"--search", "920$a=book", "a-marc-file.mrc"};
try {
FormatterParameters parameters = new FormatterParameters(arguments);
assertNotNull(parameters.getSearch());
assertTrue(parameters.hasSearch());
assertEquals("920$a=book", parameters.getSearch());
assertEquals("920$a", parameters.getPath());
assertEquals("book", parameters.getQuery());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例4: testNoLog
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testNoLog() {
String[] arguments = new String[]{"--nolog", "a-marc-file.mrc"};
try {
CommonParameters parameters = new CommonParameters(arguments);
assertFalse(parameters.doLog());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例5: testId
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testId() {
String[] arguments = new String[]{"--id", "xyz", "a-marc-file.mrc"};
try {
FormatterParameters parameters = new FormatterParameters(arguments);
assertNotNull(parameters.getId());
assertEquals("xyz", parameters.getId());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例6: testValidFormat
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testValidFormat() {
String[] arguments = new String[]{"--format", "tab-separated", "a-marc-file.mrc"};
try {
ValidatorParameters parameters = new ValidatorParameters(arguments);
assertEquals(ValidationErrorFormat.TAB_SEPARATED, parameters.getFormat());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例7: testFormat
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testFormat() {
String[] arguments = new String[]{"--format", "xyz", "a-marc-file.mrc"};
try {
FormatterParameters parameters = new FormatterParameters(arguments);
assertNotNull(parameters.getFormat());
assertEquals("xyz", parameters.getFormat());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例8: testLimit
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testLimit() {
String[] arguments = new String[]{"--limit", "3", "a-marc-file.mrc"};
try {
ValidatorParameters parameters = new ValidatorParameters(arguments);
assertEquals(3, parameters.getLimit());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例9: testSummary
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testSummary() {
String[] arguments = new String[]{"--summary", "a-marc-file.mrc"};
try {
ValidatorParameters parameters = new ValidatorParameters(arguments);
assertTrue(parameters.doSummary());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例10: testSolrFieldTypeMixed
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testSolrFieldTypeMixed() {
String[] arguments = new String[]{"--solrFieldType", "mixed", "a-marc-file.mrc"};
try {
MarcToSolrParameters parameters = new MarcToSolrParameters(arguments);
assertEquals(SolrFieldType.MIXED, parameters.getSolrFieldType());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例11: testLimit
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testLimit() {
String[] arguments = new String[]{"--limit", "3", "a-marc-file.mrc"};
try {
ThompsonTraillCompletenessParameters parameters = new ThompsonTraillCompletenessParameters(arguments);
assertEquals(3, parameters.getLimit());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例12: testOffset
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testOffset() {
String[] arguments = new String[]{"--offset", "3", "a-marc-file.mrc"};
try {
ThompsonTraillCompletenessParameters parameters = new ThompsonTraillCompletenessParameters(arguments);
assertEquals(3, parameters.getOffset());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例13: testHelp
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testHelp() {
String[] arguments = new String[]{"--help", "a-marc-file.mrc"};
try {
ValidatorParameters parameters = new ValidatorParameters(arguments);
assertTrue(parameters.doHelp());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例14: testFileNameStdOut
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testFileNameStdOut() {
String[] arguments = new String[]{"--fileName", "stdout", "a-marc-file.mrc"};
try {
ThompsonTraillCompletenessParameters parameters = new ThompsonTraillCompletenessParameters(arguments);
assertEquals("stdout", parameters.getFileName());
assertTrue(parameters.useStandardOutput());
} catch (ParseException e) {
e.printStackTrace();
}
}
示例15: testHelp
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Test
public void testHelp() {
String[] arguments = new String[]{"--help", "a-marc-file.mrc"};
try {
ThompsonTraillCompletenessParameters parameters = new ThompsonTraillCompletenessParameters(arguments);
assertTrue(parameters.doHelp());
} catch (ParseException e) {
e.printStackTrace();
}
}