Java Source Code Parser - startjava
Purpose
The Source Code Parser for Component Testing for Java analyzes a set of Java source files that contain classes, and produces a test harness template and metrics.
When the -metric option is specified, the Source Code Parser produces static metrics for the specified source files.
Syntax
startjava <java source files> <options>
where:
<java source file> is the list of files containing classes to be tested.
<options> is a series of command line options. See the section Options.
Description
The Java source files are parsed by the integrated Java analyzer. A candidate classes list is automatically deduced from the content of source files.
The Metric Generator generates one metric file for each source file in the <java source file> list.
The Source Code Parser generates only one Java test driver script that contains all classes under test. It also generates stub file containing stub declarations for classes specified in the –stub option.
Options
-J2SE | -J2ME
Specifies the Java target testing framework. The default framework is J2ME.
-classpath <val>
Sets the EDGCLASSPATH value to <val>. EDGCLASSPATH is the environment variable used by the parser to search for Java classes.
-typical
With this option, all used classes are stubbed.
-pref <prefix>
Use this option to change the prefix of generated test class names. The default prefix is Test.
-metric
Generates a .met static metric files for each specified Java class. When the -metrics option is used, no other action is performed by the Source Code Parser.
-odir <output directory>
Specifies the directory where results files are to be generated.
-test_class|-tc <java classes>
Specifies the classes to be explicitly tested. List of classes could be specified by giving Java source file or class names.
-test_method|-tm <method name> <line>
Specifies the methods to be explicitly tested. <method_name> is the fully qualified name of the method (fully qualified class name with method name, without return values or parameters). <line> is the line number of the method. For example:
-test_method "package.class.method1" "50" "package.class.method2" "70"
-o <file name>
Specifies the name of the generated test. This option is ignored when no test generation is required (see option –test_class).
-stub_class | -sc <java classes>
Specifies the classes to be explicitly stubbed. List of classes could be specified by giving Java source file or class names.
-studio_log
This option is for internal usage only.
Return Codes
After execution, the program exits with the following return codes
Code |
Description |
0 |
End of execution with no errors |
1 |
Abnormal termination |
All messages are sent to the standard error output device.