rvesse / airline

Java annotation-based framework for parsing Git like command line structures with deep extensibility
https://rvesse.github.io/airline/
Apache License 2.0
128 stars 20 forks source link

Tests problems #42

Closed puntogil closed 8 years ago

puntogil commented 8 years ago

Hi I'm getting:

Tests run: 370, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.195 sec <<< FAILURE! - in TestSuite
occurrences_bad_too_many_02(com.github.rvesse.airline.restrictions.TestOccurrences)  Time elapsed: 0.007 sec  <<< FAILURE!
com.github.rvesse.airline.parser.errors.ParseRestrictionViolatedException: Option 'b' must be specified at least 2 times but was only found 0 times
        at com.github.rvesse.airline.restrictions.common.OccurrencesRestriction.postValidate(OccurrencesRestriction.java:61)
        at com.github.rvesse.airline.parser.command.SingleCommandParser.validate(SingleCommandParser.java:96)
        at com.github.rvesse.airline.parser.command.SingleCommandParser.parse(SingleCommandParser.java:44)
        at com.github.rvesse.airline.SingleCommand.parse(SingleCommand.java:100)
        at com.github.rvesse.airline.SingleCommand.parse(SingleCommand.java:95)
        at com.github.rvesse.airline.restrictions.TestOccurrences.occurrences_bad_too_many_02(TestOccurrences.java:42

Running com.github.rvesse.airline.help.markdown.TestHelpMarkdown
Configuring TestNG with: TestNG652Configurator
Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.632 sec <<< FAILURE! - in com.github.rvesse.airline.help.markdown.TestHelpMarkdown
user_aliases_help_markdown(com.github.rvesse.airline.help.markdown.TestHelpMarkdown)  Time elapsed: 0.021 sec  <<< FAILURE!
java.lang.AssertionError: expected [# NAME

`test` -

# SYNOPSIS

`test` *command* [ *command-args* ]

# COMMANDS

- `Args1`

  args1 description

---

# NAME

`test` `Args1` - args1 description

# SYNOPSIS

`test` `Args1` [ `-groups` *groups* ] [ `-long` *l* ] [ `-debug` ] [
`-bigdecimal` *bigd* ] [ { `-log` | `-verbose` } *verbose* ] [ `-date` *date* ]
[ `-double` *doub* ] [ `-float` *floa* ] [ `--` ] [ *parameters* ]

# OPTIONS

- `-bigdecimal` *bigd*

  A BigDecimal number

- `-date` *date*

  An ISO 8601 formatted date.

- `-debug`

  Debug mode

- `-double` *doub*

  A double number

- `-float` *floa*

  A float number

- `-groups` *groups*

  Comma-separated list of group names to be run

- `-log` *verbose* , `-verbose` *verbose*

  Level of verbosity

- `-long` *l*

  A long number

- `--`

  This option can be used to separate command-line options from the list of
  arguments (useful when arguments might be mistaken for command-line options)

- *parameters*

# USER DEFINED ALIASES

This CLI supports user defined aliases which may be placed in a test.config file
located in the following location(s):

1. `target/`

This file contains aliases defined in Java properties file style e.g.

    b.foo=bar --flag

Here an alias foo is defined which causes the bar command to be invoked with the
`--flag` option passed to it. Aliases are distinguished from other properties in
the file by the prefix `b.` as seen in the example.

Alias definitions are subject to the following conditions:

  - Aliases cannot override existing commands
  - Aliases cannot be defined in terms of other aliases
] but found [# NAME

`test` -

# SYNOPSIS

`test` *command* [ *command-args* ]

# COMMANDS

- `Args1`

  args1 description

---

# NAME

`test` `Args1` - args1 description

# SYNOPSIS

`test` `Args1` [ `-double` *doub* ] [ `-date` *date* ] [ { `-log` | `-verbose` }
*verbose* ] [ `-long` *l* ] [ `-float` *floa* ] [ `-bigdecimal` *bigd* ] [
`-groups` *groups* ] [ `-debug` ] [ `--` ] [ *parameters* ]

# OPTIONS

- `-bigdecimal` *bigd*

  A BigDecimal number

- `-date` *date*

  An ISO 8601 formatted date.

- `-debug`

  Debug mode

- `-double` *doub*

  A double number

- `-float` *floa*

  A float number

- `-groups` *groups*

  Comma-separated list of group names to be run

- `-log` *verbose* , `-verbose` *verbose*

  Level of verbosity

- `-long` *l*

  A long number

- `--`

  This option can be used to separate command-line options from the list of
  arguments (useful when arguments might be mistaken for command-line options)

- *parameters*

# USER DEFINED ALIASES

This CLI supports user defined aliases which may be placed in a test.config file
located in the following location(s):

1. `target/`

This file contains aliases defined in Java properties file style e.g.

    b.foo=bar --flag

Here an alias foo is defined which causes the bar command to be invoked with the
`--flag` option passed to it. Aliases are distinguished from other properties in
the file by the prefix `b.` as seen in the example.

Alias definitions are subject to the following conditions:

  - Aliases cannot override existing commands
  - Aliases cannot be defined in terms of other aliases
]
        at org.testng.Assert.fail(Assert.java:94)
        at org.testng.Assert.failNotEquals(Assert.java:494)
        at org.testng.Assert.assertEquals(Assert.java:123)
        at org.testng.Assert.assertEquals(Assert.java:176)
        at org.testng.Assert.assertEquals(Assert.java:186)
        at com.github.rvesse.airline.help.markdown.TestHelpMarkdown.user_aliases_help_markdown(TestHelpMarkdown.java:582)

Results :

Failed tests: 
  TestHelpMarkdown.user_aliases_help_markdown:582 expected [# NAME

`test` -

# SYNOPSIS

`test` *command* [ *command-args* ]

# COMMANDS

- `Args1`

  args1 description

---

# NAME

`test` `Args1` - args1 description

# SYNOPSIS

`test` `Args1` [ `-groups` *groups* ] [ `-long` *l* ] [ `-debug` ] [
`-bigdecimal` *bigd* ] [ { `-log` | `-verbose` } *verbose* ] [ `-date` *date* ]
[ `-double` *doub* ] [ `-float` *floa* ] [ `--` ] [ *parameters* ]

# OPTIONS

- `-bigdecimal` *bigd*

  A BigDecimal number

- `-date` *date*

  An ISO 8601 formatted date.

- `-debug`

  Debug mode

- `-double` *doub*

  A double number

- `-float` *floa*

  A float number

- `-groups` *groups*

  Comma-separated list of group names to be run

- `-log` *verbose* , `-verbose` *verbose*

  Level of verbosity

- `-long` *l*

  A long number

- `--`

  This option can be used to separate command-line options from the list of
  arguments (useful when arguments might be mistaken for command-line options)

- *parameters*

# USER DEFINED ALIASES

This CLI supports user defined aliases which may be placed in a test.config file
located in the following location(s):

1. `target/`

This file contains aliases defined in Java properties file style e.g.

    b.foo=bar --flag

Here an alias foo is defined which causes the bar command to be invoked with the
`--flag` option passed to it. Aliases are distinguished from other properties in
the file by the prefix `b.` as seen in the example.

Alias definitions are subject to the following conditions:

  - Aliases cannot override existing commands
  - Aliases cannot be defined in terms of other aliases
] but found [# NAME

`test` -

# SYNOPSIS

`test` *command* [ *command-args* ]

# COMMANDS

- `Args1`

  args1 description

---

# NAME

`test` `Args1` - args1 description

# SYNOPSIS

`test` `Args1` [ `-double` *doub* ] [ `-date` *date* ] [ { `-log` | `-verbose` }
*verbose* ] [ `-long` *l* ] [ `-float` *floa* ] [ `-bigdecimal` *bigd* ] [
`-groups` *groups* ] [ `-debug` ] [ `--` ] [ *parameters* ]

# OPTIONS

- `-bigdecimal` *bigd*

  A BigDecimal number

- `-date` *date*

  An ISO 8601 formatted date.

- `-debug`

  Debug mode

- `-double` *doub*

  A double number

- `-float` *floa*

  A float number

- `-groups` *groups*

  Comma-separated list of group names to be run

- `-log` *verbose* , `-verbose` *verbose*

  Level of verbosity

- `-long` *l*

  A long number

- `--`

  This option can be used to separate command-line options from the list of
  arguments (useful when arguments might be mistaken for command-line options)

- *parameters*

# USER DEFINED ALIASES

This CLI supports user defined aliases which may be placed in a test.config file
located in the following location(s):

1. `target/`

This file contains aliases defined in Java properties file style e.g.

    b.foo=bar --flag

Here an alias foo is defined which causes the bar command to be invoked with the
`--flag` option passed to it. Aliases are distinguished from other properties in
the file by the prefix `b.` as seen in the example.

Alias definitions are subject to the following conditions:

  - Aliases cannot override existing commands
  - Aliases cannot be defined in terms of other aliases
]

environment:
Apache Maven 3.3.3 (NON-CANONICAL_2015-07-10T12:37:52_mockbuild; 2015-07-10T14:37:52+02:00)
Maven home: /usr/share/maven
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-13.b17.fc23.i386/jre
Default locale: it_IT, platform encoding: UTF-8
OS name: "linux", version: "4.2.7-300.fc23.i686", arch: "i386", family: "unix"

Any ideas as to why?

rvesse commented 8 years ago

Looks to be related to using Java 8, will take a closer look

Java 7 does not produce this error

rvesse commented 8 years ago

There were a couple of bugs in the unit tests where environmental assumptions were made