Package Name | Comment |
org.apache.commons.cli.avalon |
Package Documentation for org.apache.commons.cli.avalon Package
Utility code for parsing command-line options.
These classes were originally in the Avalon project in the package org.apache.avalon.excalibur.cli
Introduction
The utilities in org.apache.commons.cli.avalon assist
you in parsing command line options during startup time. It allows you
to associate a short option and a long option to the same command, and
then test for it in a switch statement.
Usage Example
import java.util.List;
import org.apache.commons.cli.avalon.CLArgsParser;
import org.apache.commons.cli.avalon.CLOption;
import org.apache.commons.cli.avalon.CLOptionDescriptor;
import org.apache.commons.cli.avalon.CLUtil;
/**
* Demonstrates the excalibur command-line parsing utility.
*
*/
public class CLDemo {
// Define our short one-letter option identifiers.
protected static final int HELP_OPT = 'h';
protected static final int VERSION_OPT = 'v';
protected static final int MSG_OPT = 'm';
/**
* Define the understood options. Each CLOptionDescriptor contains:
* - The "long" version of the option. Eg, "help" means that "--help" will
* be recognised.
* - The option flags, governing the option's argument(s).
* - The "short" version of the option. Eg, 'h' means that "-h" will be
* recognised.
* - A description of the option.
*/
protected static final CLOptionDescriptor [] options = new CLOptionDescriptor [] {
new CLOptionDescriptor("help",
CLOptionDescriptor.ARGUMENT_DISALLOWED,
HELP_OPT,
"print this message and exit"),
new CLOptionDescriptor("version",
CLOptionDescriptor.ARGUMENT_DISALLOWED,
VERSION_OPT,
"print the version information and exit"),
new CLOptionDescriptor("msg",
CLOptionDescriptor.ARGUMENT_REQUIRED,
MSG_OPT,
"the message to print"),
};
public static void main(String args[]) {
// Parse the arguments
CLArgsParser parser = new CLArgsParser(args, options);
if( null != parser.getErrorString() ) {
System.err.println( "Error: " + parser.getErrorString() );
return;
}
// Get a list of parsed options
List clOptions = parser.getArguments();
int size = clOptions.size();
for (int i = 0; i < size; i++) {
CLOption option = (CLOption) clOptions.get(i);
switch (option.getId()) {
case CLOption.TEXT_ARGUMENT:
System.out.println("Unknown arg: "+option.getArgument());
break;
case HELP_OPT:
printUsage();
break;
case VERSION_OPT:
printVersion();
break;
case MSG_OPT:
System.out.println(option.getArgument());
break;
}
}
}
private static void printVersion() {
System.out.println("1.0");
System.exit(0);
}
private static void printUsage() {
String lSep = System.getProperty("line.separator");
StringBuffer msg = new StringBuffer();
msg.append("------------------------------------------------------------------------ ").append(lSep);
msg.append("Excalibur command-line arg parser demo").append(lSep);
msg.append("Usage: java "+CLDemo.class.getName()+" [options]").append(lSep).append(lSep);
msg.append("Options: ").append(lSep);
msg.append(CLUtil.describeOptions(CLDemo.options).toString());
System.out.println(msg.toString());
System.exit(0);
}
}
Parsing Rules
The command line is parsed according to the following rules. There are
two forms of options in this package, the Long form and the Short form.
The long form of an option is preceded by the '--' characters while the
short form is preceded by a single '-'. Some example options would be;
"--an-option", "-a", "--day", "-s -f -a".
In the tradition of UNIX programs, the short form of an option can occur
immediately after another short form option. So if 'a', 'b' and 'c' are
short forms of options that take no parameters then the following
command lines are equivalent: "-abc", "-a -bc", "-a -b -c", "-ab -c", etc.
Options can also accept arguments if specified. You can specify that an
option requires an argument in which the text immediately following the
option will be considered to be an argument to the option. So if 'a' was an
option that required an argument then the following would be equivalent;
"-abc", "-a bc" (namely the option 'a' with argument 'bc').
Options can also specify optional arguments. In this case if there is any
text immediately following the option character then it is considered an
argument. Otherwise, the option has no arguments. For example if 'a' was an
option that required an optional argument then "-abc" is an option 'a' with
argument "bc" while "-a bc" is an option 'a' with no argument, followed by
the text "bc".
It is also possible to place an '=' sign between the option
and its argument. So if we assume that a is an option that
requires an argument then the following are equivalent;
"-a=bc" and "-abc".
In the case of a long option with an optional argument, the '=' sign is required.
For example. --optarg=1, not --optarg 1.
In some cases it is also necessary to disable command line parsing so that you
can pass a text argument to the program that starts with a '-' character. To do
this insert the sequence '--' onto the command line with no text immediately
following it. This will disable processing for the rest of the command line.
The '--' characters will not be passed to the user program. For instance the
line "-- -b" would result in the program being passed the
text "-b" (ie. not as an option).
|
org.apache.jmeter | |
org.apache.jmeter.assertions |
Assertions
Assertions
Methods to be implemented
getResult(SampleResult)
Calling sequence
When the test plan is prepared for running, one instance of the class is created for each occurrence
of an assertion in each thread.
Assertions are called from the same thread as the sampler
|
org.apache.jmeter.assertions.gui | |
org.apache.jmeter.config | |
org.apache.jmeter.config.gui | |
org.apache.jmeter.control | |
org.apache.jmeter.control.gui | |
org.apache.jmeter.engine | |
org.apache.jmeter.engine.event | |
org.apache.jmeter.engine.util | |
org.apache.jmeter.examples.sampler | |
org.apache.jmeter.examples.sampler.gui | |
org.apache.jmeter.examples.testbeans.example1 | |
org.apache.jmeter.examples.testbeans.example2 | |
org.apache.jmeter.exceptions | |
org.apache.jmeter.extractor | |
org.apache.jmeter.extractor.gui | |
org.apache.jmeter.functions | |
org.apache.jmeter.functions.gui | |
org.apache.jmeter.functions.util | |
org.apache.jmeter.gui | |
org.apache.jmeter.gui.action | |
org.apache.jmeter.gui.tree | |
org.apache.jmeter.gui.util | |
org.apache.jmeter.junit | |
org.apache.jmeter.junit.stubs | |
org.apache.jmeter.modifiers | |
org.apache.jmeter.modifiers.gui | |
org.apache.jmeter.monitor.model | |
org.apache.jmeter.monitor.model.benchmark | |
org.apache.jmeter.monitor.parser | |
org.apache.jmeter.monitor.util | |
org.apache.jmeter.plugin | |
org.apache.jmeter.processor | |
org.apache.jmeter.processor.gui | |
org.apache.jmeter.protocol.ftp.config.gui | |
org.apache.jmeter.protocol.ftp.control.gui | |
org.apache.jmeter.protocol.ftp.sampler | |
org.apache.jmeter.protocol.http.config | |
org.apache.jmeter.protocol.http.config.gui | |
org.apache.jmeter.protocol.http.control | |
org.apache.jmeter.protocol.http.control.gui | |
org.apache.jmeter.protocol.http.gui | |
org.apache.jmeter.protocol.http.modifier | |
org.apache.jmeter.protocol.http.modifier.gui | |
org.apache.jmeter.protocol.http.parser | |
org.apache.jmeter.protocol.http.proxy | |
org.apache.jmeter.protocol.http.proxy.gui | |
org.apache.jmeter.protocol.http.sampler | |
org.apache.jmeter.protocol.http.util | |
org.apache.jmeter.protocol.http.util.accesslog | |
org.apache.jmeter.protocol.java.config | |
org.apache.jmeter.protocol.java.config.gui | |
org.apache.jmeter.protocol.java.control.gui | |
org.apache.jmeter.protocol.java.sampler | |
org.apache.jmeter.protocol.java.test | |
org.apache.jmeter.protocol.jdbc.config | |
org.apache.jmeter.protocol.jdbc.sampler | |
org.apache.jmeter.protocol.jms.client | |
org.apache.jmeter.protocol.jms.control.gui | |
org.apache.jmeter.protocol.jms.sampler | |
org.apache.jmeter.protocol.ldap.config.gui | |
org.apache.jmeter.protocol.ldap.control.gui | |
org.apache.jmeter.protocol.ldap.sampler | |
org.apache.jmeter.protocol.mail.sampler | |
org.apache.jmeter.protocol.mail.sampler.gui | |
org.apache.jmeter.protocol.tcp.config.gui | |
org.apache.jmeter.protocol.tcp.control.gui | |
org.apache.jmeter.protocol.tcp.sampler | |
org.apache.jmeter.report | |
org.apache.jmeter.report.engine | |
org.apache.jmeter.report.gui | |
org.apache.jmeter.report.gui.action | |
org.apache.jmeter.report.gui.tree | |
org.apache.jmeter.report.writers | |
org.apache.jmeter.report.writers.gui | |
org.apache.jmeter.reporters | |
org.apache.jmeter.reporters.gui | |
org.apache.jmeter.resources | |
org.apache.jmeter.sampler | |
org.apache.jmeter.sampler.gui | |
org.apache.jmeter.samplers | |
org.apache.jmeter.samplers.gui | |
org.apache.jmeter.save | |
org.apache.jmeter.save.converters | |
org.apache.jmeter.services | |
org.apache.jmeter.swing | |
org.apache.jmeter.testbeans | |
org.apache.jmeter.testbeans.gui | |
org.apache.jmeter.testelement | |
org.apache.jmeter.testelement.property | |
org.apache.jmeter.threads | |
org.apache.jmeter.threads.gui | |
org.apache.jmeter.timers | |
org.apache.jmeter.timers.gui | |
org.apache.jmeter.util | |
org.apache.jmeter.util.keystore | |
org.apache.jmeter.visualizers |
This package contains the interfaces that have to be implemented by
any class wishing to display or present data collected in SampleResults.
The primary classes/interfaces to be concerned with for implementers is the {@link org.apache.jmeter.visualizers.Visualizer Visualizer} interface, and the {@link org.apache.jmeter.visualizers.gui.AbstractVisualizer AbstractVisualizer} abstract class.
|
org.apache.jmeter.visualizers.gui | |
org.apache.jorphan | |
org.apache.jorphan.collections | |
org.apache.jorphan.gui | |
org.apache.jorphan.gui.layout | |
org.apache.jorphan.io | |
org.apache.jorphan.logging | |
org.apache.jorphan.math | |
org.apache.jorphan.reflect | |
org.apache.jorphan.test | |
org.apache.jorphan.timer | |
org.apache.jorphan.util | |