aboutsummaryrefslogtreecommitdiffstats
path: root/tools/tools-common/src
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@ericsson.com>2018-11-29 13:47:30 +0000
committerramverma <ram.krishna.verma@ericsson.com>2018-11-29 14:46:03 +0000
commitea736d0c60f042d4e6255136da789724ee178193 (patch)
tree98d0a8f73f0ff5f822e863ecc245e36e66c2d99f /tools/tools-common/src
parent80540def7348e195ffacfbbc7c23e2e68e154965 (diff)
Fixing issues in apex documents
Change-Id: Ibc07c20fa8ac1018443a3c061613fdaecc5efb83 Issue-ID: POLICY-1280 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'tools/tools-common/src')
-rw-r--r--tools/tools-common/src/site-docs/adoc/fragments/example-cli-version.adoc4
-rw-r--r--tools/tools-common/src/site-docs/adoc/fragments/example-cli.adoc18
2 files changed, 11 insertions, 11 deletions
diff --git a/tools/tools-common/src/site-docs/adoc/fragments/example-cli-version.adoc b/tools/tools-common/src/site-docs/adoc/fragments/example-cli-version.adoc
index 031a3776d..178799c44 100644
--- a/tools/tools-common/src/site-docs/adoc/fragments/example-cli-version.adoc
+++ b/tools/tools-common/src/site-docs/adoc/fragments/example-cli-version.adoc
@@ -22,14 +22,14 @@ First, create a new CLI Parser object, add some options (in the example an optio
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersion.java[tags=setupParser,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersionTest.java[tags=setupParser,indent=0]
----
Next, we check if the version option was used in the command line and print application name and version if it was used:
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersion.java[tags=processCliVersion,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersionTest.java[tags=processCliVersion,indent=0]
----
The output will be:
diff --git a/tools/tools-common/src/site-docs/adoc/fragments/example-cli.adoc b/tools/tools-common/src/site-docs/adoc/fragments/example-cli.adoc
index 32a0e957b..d2edc446d 100644
--- a/tools/tools-common/src/site-docs/adoc/fragments/example-cli.adoc
+++ b/tools/tools-common/src/site-docs/adoc/fragments/example-cli.adoc
@@ -34,7 +34,7 @@ Manually importing means to add the following lines to the start of your applica
[source,java, linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=import,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=import,indent=0]
----
Now, inside your `main()` method, start setting some general application properties.
@@ -43,7 +43,7 @@ For instance:
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=setApp,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=setApp,indent=0]
----
Next, create a new CLI Parser and add a few CLI options from the standard `CliOptions`.
@@ -51,14 +51,14 @@ The following example adds options for help, version, and a model file:
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=setCli,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=setCli,indent=0]
----
Next, parse the given CLI arguments:
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=parseCli,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=parseCli,indent=0]
----
Once the command line is parsed, we can look into the individual options, check if they are set, and then act accordingly.
@@ -67,7 +67,7 @@ If the option is present, we print a help screen and return:
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=processCliHelp,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=processCliHelp,indent=0]
----
Next, we process the option for __version__.
@@ -76,7 +76,7 @@ The CLI Parser already provides a method to obtain the correct version for an AP
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=processCliVersion,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=processCliVersion,indent=0]
----
Once help and version arguments are processed, we can proceed to look at all other options.
@@ -86,7 +86,7 @@ If we cannot load a model, we print an error and return.
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=processCliModel,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=processCliModel,indent=0]
----
With a model file being loadable, we finish parsing command line arguments.
@@ -94,7 +94,7 @@ We also print some status messages to note that the application now is ready to
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=someStartPrint,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=someStartPrint,indent=0]
----
The last action now is to run the actual application.
@@ -102,7 +102,7 @@ The example below is taken from a version of the `Model2Cli` application, which
[source,java,linenums,subs="attributes+"]
----
-include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParser.java[tags=yourApp,indent=0]
+include::{adsite-tools-common-dir}/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java[tags=yourApp,indent=0]
----
If this new application is now called with the command line `-h` or `--help` it will print the following help screen: