utPLSQL / utPLSQL-cli

Command line client for invoking utPLSQL
Apache License 2.0
40 stars 15 forks source link

NullPointerException when specifying -o key without -f key #170

Closed alesana-san closed 4 years ago

alesana-san commented 4 years ago

Hey!

My preset is:

C:\Users\Shiryaev1-RY>utplsql.bat info "some_user"/"q1w2e3r4t5y6u7i8o9p0"@local_pdb
utPLSQL-cli 3.1.8-SNAPSHOT.local
utPLSQL-java-api 3.1.8.546
utPLSQL 3.1.6.2735

Here's what I get when I put -o without -f specified:

D:\repos\sp-db-beholder>D:\soft\utPLSQL-cli\bin\utplsql.bat run some_user/q1w2e3r4t5y6u7i8o9p0@local_pdb -p=SP.UT_SP_HAND_MR.XFER_SYNC_WAIT_ERR_CALL -d -o=output.txt
2019-11-28 13:51:19 [main] INFO  org.utplsql.cli.RunAction - ############# utPLSQL cli ##############
#                                      #
#   utPLSQL-cli 3.1.8-SNAPSHOT.local   #
#   utPLSQL-java-api 3.1.8.546         #
#   Java-Version: 1.8.0_221            #
#   ORACLE_HOME: null                  #
#   NLS_LANG: null                     #
#                                      #
#   Thanks for testing!                #
#                                      #
########################################
2019-11-28 13:51:19 [main] INFO  org.utplsql.cli.RunAction -
2019-11-28 13:51:20 [main] INFO  o.u.c.d.TestedDataSourceProvider - Use connection string jdbc:oracle:thin:****/****@local_pdb
2019-11-28 13:51:20 [main] INFO  org.utplsql.cli.RunAction - Successfully connected to database. UtPLSQL core: v3.1.6.2735
2019-11-28 13:51:20 [main] INFO  org.utplsql.cli.RunAction - Oracle-Version: 12.2.0.1.0
java.lang.NullPointerException
        at org.utplsql.cli.ReporterOptions.getReporterName(ReporterOptions.java:37)
        at org.utplsql.cli.ReporterManager.initReporters(ReporterManager.java:89)
        at org.utplsql.cli.RunAction.initReporters(RunAction.java:219)
        at org.utplsql.cli.RunAction.doRun(RunAction.java:70)
        at org.utplsql.cli.RunAction.run(RunAction.java:121)
        at org.utplsql.cli.RunPicocliCommand.run(RunPicocliCommand.java:254)
        at org.utplsql.cli.Cli.runPicocliWithExitCode(Cli.java:44)
        at org.utplsql.cli.Cli.main(Cli.java:13)

And when I specify -f flag everything works as expected: file is created, termination is normal:


D:\repos\sp-db-beholder>D:\soft\utPLSQL-cli\bin\utplsql.bat run some_user/q1w2e3r4t5y6u7i8o9p0@local_pdb -p=SP.UT_SP_HAND_MR.XFER_SYNC_WAIT_ERR_CALL -d -f=UT_DOCUMENTATION_REPORTER -o=output.txt
2019-11-28 13:51:41 [main] INFO  org.utplsql.cli.RunAction - ############# utPLSQL cli ##############
#                                      #
#   utPLSQL-cli 3.1.8-SNAPSHOT.local   #
#   utPLSQL-java-api 3.1.8.546         #
#   Java-Version: 1.8.0_221            #
#   ORACLE_HOME: null                  #
#   NLS_LANG: null                     #
#                                      #
#   Thanks for testing!                #
#                                      #
########################################
2019-11-28 13:51:41 [main] INFO  org.utplsql.cli.RunAction -
2019-11-28 13:51:42 [main] INFO  o.u.c.d.TestedDataSourceProvider - Use connection string jdbc:oracle:thin:****/****@local_pdb
2019-11-28 13:51:42 [main] INFO  org.utplsql.cli.RunAction - Successfully connected to database. UtPLSQL core: v3.1.6.2735
2019-11-28 13:51:42 [main] INFO  org.utplsql.cli.RunAction - Oracle-Version: 12.2.0.1.0
2019-11-28 13:51:43 [main] DEBUG org.utplsql.api.reporter.Reporter - Database-reporter initialized, Type: UT_DOCUMENTATION_REPORTER, ID: 9866E6142AFD94BDE053020012ACFF1C
2019-11-28 13:51:43 [pool-1-thread-1] INFO  org.utplsql.cli.RunTestRunnerTask - Running tests now.
2019-11-28 13:51:43 [pool-1-thread-1] INFO  org.utplsql.cli.RunTestRunnerTask - --------------------------------------
2019-11-28 13:51:43 [pool-1-thread-1] INFO  org.utplsql.api.TestRunner - TestRunner initialized
2019-11-28 13:51:43 [pool-1-thread-1] INFO  org.utplsql.api.TestRunner - Running on utPLSQL v3.1.6.2735
2019-11-28 13:51:43 [pool-1-thread-1] INFO  org.utplsql.api.TestRunner - Initializing reporters
2019-11-28 13:51:43 [pool-1-thread-1] INFO  org.utplsql.api.TestRunner - Running tests
2019-11-28 13:51:43 [pool-1-thread-1] INFO  org.utplsql.api.TestRunner - Running tests finished.
2019-11-28 13:51:44 [main] INFO  org.utplsql.cli.RunAction - --------------------------------------
2019-11-28 13:51:44 [main] INFO  org.utplsql.cli.RunAction - All tests done.

I guess if by default I get UT_DOCUMENTATION_REPORTER output on the screen without specifying -f key so I should be getting the same reporter when it's written to file.