Code Monkey home page Code Monkey logo

ccl-testing's People

Contributors

dependabot[bot] avatar feckertson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccl-testing's Issues

Documentation Fixes

Make the Resolving Build Issues page available face-up from the main readme and fix its prompt patterns link which does not route to the configuration options page. Fix the highlighting of the osPromptPattern option on the configuration options page.

Issue deserializing F8 values on reply message

I am seeing an issue where large F8 values are not being deserialized from the JSON reply record correctly. Basically, my script's reply message has an F8 field that gets filled out with the value 123541212.000000 (just a normal id value from a table). That value gets properly set in the JSON file and downloaded back to the machine running the tests. However, when the RecordWriter goes to create a Java object from the JSON String, the value that gets set in the Java object is slightly off (1.23541216E8).

This appears to be because the JSONObject utility uses the old NumberUtils library from the Apache commons-lang dependency to create the number from the JSON value and the version of NumberUtils in commons-lang has a defect where the value gets packed into a Float object instead of a Double and loses some precision. That defect was later fixed in commons-lang3, but AFIK nothing was patched back into commons-lang.

Am I doing something wrong here by using the F8 data type to store id values or is there some sort of workaround that I have not figured out?

CDoc plugin requires that subroutine arguments are typed even though CCL does not

Currently, it is valid CCL to not declare a type on subroutine parameters. See: https://wiki.cerner.com/display/public/1101discernHP/SUBROUTINE+Using+Discern+Explorer

param_name [= datatype[(REF | VALUE[,param_default])]]

This allows CCL to be dynamically typed. Observe the below listing (which includes the program):

1)drop program tartest_1:group1 go
1)create program tartest_1:group1
2)
3)subroutine (testArgumentBug(argument) = null)
4)	call echo(reflect(argument))
5)	call echo(argument)
6)end
7)
8)call testArgumentBug(1)
9)call testArgumentBug("first")
10)
11)end
12)go
1)
1)execute tartest_1:group1 go
I4
1
C5
first

Command run

mvn clean site -Psolm64

Line in question:

Error Message:

[INFO] --- maven-site-plugin:3.7.1:site (default-site) @ ccl-unit-template ---
[INFO] configuring report plugin com.cerner.ccl.cdoc:cdoc-maven-plugin:1.2
[info] entering CDocReportMojo constructor
[INFO] 1 report detected for cdoc-maven-plugin:1.2: cdoc-report
[INFO] configuring report plugin com.cerner.ccl.testing:cerreal-maven-plugin:2.1
[INFO] 2 reports detected for cerreal-maven-plugin:2.1: coverage-report, test-report
[INFO] configuring report plugin com.cerner.ccl.whitenoise:whitenoise-maven-plugin:2.3
[INFO] 1 report detected for whitenoise-maven-plugin:2.3: whitenoise-report
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.0.0
[INFO] 15 reports detected for maven-project-info-reports-plugin:3.0.0: ci-management, dependencies, dependency-info, dependency-management, distribution-management, index, issue-management, licenses, mailing-lists, modules, plugin-management, plugins, scm, summary, team
[INFO] Cannot generate CCL Coverage report due to missing test-results directory
[INFO] Cannot generate Cerreal report due to missing test-results directory
[INFO] Rendering site with default locale English (en)
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering content with org.apache.maven.skins:maven-default-skin:jar:1.2 skin.
[INFO] Generating "CDoc" report --- cdoc-maven-plugin:1.2:cdoc-report
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.133 s
[INFO] Finished at: 2019-05-20T15:39:24-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project ccl-unit-template: Error generating cdoc-maven-plugin:1.2:cdoc-report report: Failed to parse script tartest_1.prg: Invalid argument definition: argument -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

CCL Unit Framework Version

3.3

Target folder

target.zip

Expected Output

Ideally, since it seems CCL can actually support dynamic typing, I would expect that the CDoc plugin could handle that and either display it as such or not display the type at all. If we want to encourage people not to do this, then I think it should be a Whitenoise rule, and CDoc should still succeed.

What I don't think should happen is for CDoc to fail even when the CCL is valid, can be compiled in the domain, and run without error.

comment or strings which contain '\u' breaks unit testing

CCL Maven plugin crashes/ fails build due to misinterpretation of valid text/character sequences in comments, constants and varaibles/strings code comments.

It is interpreting text/strings that resemble a Unicode encoded character, but are just a string which resembles a Unicode encoded character. It seems the ccl-testing plugin tries to interpret string that start with \u as an actual Unicode character and not as the text they are in the source code.

If code comments or string values contain a character sequence that looks like a Unicode encoded character (ie '\u'), the plugin will fail the built, due to its inability to retrieve, parse and save the program's source code.

Example 1

The code comments contains the text string '\u0000' (also fails with other Unicode characters: ie '\u0001')

Error:

ERROR] Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: Failed to write xml program listing for UnicodeTest: Failed to properly parse XML document. Error on line 1 of document : An invalid XML character (Unicode: 0x0) was found in the CDATA section. Nested exception: An invalid XML character (Unicode: 0x0) was found in the CDATA section. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal
com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: Failed to write xml program listing for UnicodeTest

Code:

/**
    Function comment

    @param  var some string param
    @returns TRUE or FALSE for some reason
 */
subroutine (dummyFunctionFortestingUnicodeIssue( var=vc)=i4)
    ; this comment contains text, which resembles a Unicode character, but is just text
    ; \u0000 this is a string 6 characters long, which just happens to resemble the Unicode character 0x0 encoding....
    null
end ; subroutine

Example 2

code contains the text '\u' followed by a space and then some numbers.

Error:

[ERROR] Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: For input string: " 000" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: For input string: " 000

Code:

/**
    Function comment

    @param  var some string param
    @returns TRUE or FALSE for some reason
 */
subroutine (dummyFunctionFortestingUnicodeIssue( var=vc)=i4)
    ; this comment contains text, which resembles a Unicode character, but is just text
    ; \u 0000 this is a string 2 characters long one space and then 4 digits...
    null
end ; subroutine

Example 3

Code comment contains the text '\u' only (no decimals behind it)
The plugin will try to parse whatever is behind the '\u' and interpret that as the character code....

Error:

[ERROR] Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: For input string: " thi" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: For input string: " thi"

Code:

/**
    Function comment

    @param  var some string param
    @returns TRUE or FALSE for some reason
 */
subroutine (dummyFunctionFortestingUnicodeIssue( var=vc)=i4)
    ; this comment contains text, which resembles the start of a Unicode character, but is just text
    ; \u this is a string 2 characters long, which just happens to resemble the start of a Unicode character....
    null
end ; subroutine

Example 4

Block-comment contains the text-string (not a Unicode character) '\u0000':

Error:

[ERROR] Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: Failed to write xml program listing for UnicodeTest: Failed to properly parse XML document. Error on line 1 of document : An invalid XML character (Unicode: 0x0) was found in the CDATA section. Nested exception: An invalid XML character (Unicode: 0x0) was found in the CDATA section. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: Failed to write xml program listing for UnicodeTest

Code:

/**
    Function comment

    \u0000 this is a string 6 characters long, which just happens to resemble the Unicode character 0x0 encoding....

    @param  var some string param
    @returns TRUE or FALSE for some reason
 */
subroutine (dummyFunctionFortestingUnicodeIssue( var=vc)=i4)
    null
end ; subroutine

Example 5

If a program contains a string variable/constant which resembles a Unicode encoded character, it fails the build as well

Error:

[ERROR] Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: Failed to write xml program listing for UnicodeTest: Failed to properly parse XML document. Error on line 1 of document : An invalid XML character (Unicode: 0x0) was found in the CDATA section. Nested exception: An invalid XML character (Unicode: 0x0) was found in the CDATA section. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test (default-test) on project UnicodeTest: Execution default-test of goal com.cerner.ccl.testing:ccl-maven-plugin:3.2:test failed: Failed to write xml program listing for UnicodeTest

Code:

/**
    Function comment

    @param  var some string param
    @returns TRUE or FALSE for some reason
 */
subroutine (dummyFunctionFortestingUnicodeIssue( var=vc)=i4)
    declare myString = vc with protect, noconstant("abc")

    ; this is a string 6 characters long, which just happens to resemble the Unicode character 0x0 encoding....
    set myString = "\u0000"
end ; subroutine

archive this project

Is this project active? Can we archive this project? By archiving, previously release assets will be untouched, but support will cease for this project going forward. If anyone has any reasons this project should not be archived, please comment by March 1st.

Comments on Declare statements break site creation

When I try to create the target site, I am failing to create it because of some comments on the same line as a declare statement. When I remove the comments the problem is fixed.

Command run

mvn clean test site -Psoldev64aix

Line in question:

declare generatePortalInvites(dPatientPersonId = f8, dPmHistTrackingId = f8) = null ;569134 added dPmHistTrackingId

Error Message:

[INFO] --- maven-site-plugin:3.3:site (default-site) @ ccl-parent-pom ---
[INFO] configuring report plugin com.cerner.ccl.testing:cerreal-maven-plugin:2.1
[INFO] configuring report plugin com.cerner.ccl.whitenoise:whitenoise-maven-plugin:2.5
[INFO] configuring report plugin com.cerner.ccl.cdoc:cdoc-maven-plugin:1.2
[info] entering CDocReportMojo constructor
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.2
[INFO] configuring report plugin org.apache.maven.plugins:maven-site-plugin:3.3
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating "CCL Coverage Report" report --- cerreal-maven-plugin:2.1
[INFO] Generating "Cerreal Report" report --- cerreal-maven-plugin:2.1
[INFO] Generating "Whitenoise" report --- whitenoise-maven-plugin:2.5
[INFO] validating compile ccl_xml_translator_1557776900683.out
[INFO] Generating "CDoc" report --- cdoc-maven-plugin:1.2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:03 min
[INFO] Finished at: 2019-05-13T14:48:24-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project ccl-parent-pom: Error during page generation: Error rendering Maven report: Failed to parse
include file pfmt_pm_person_portal_invite.inc: Unrecognized declaration: null ;569134 added dPmHistTrackingId; normalized to NULL ;569134 ADDED DPMHISTTRACKINGID -> [Help 1]

CCL Unit Framework Version

3.3

Target folder

target.zip

Originally Posted

cerner/cclunit-framework#26

Unit test failing due to invalid json?

This issue is related to #42
This time the unit test case fail, not on the null-character as mentioned in issue 42, but on a simple double quote in the source code (");

I have sent you a DM with the the project/code used to reproduce this issue. The files generated on the backend are in the folder ./ccl/output/.

The Error/test failure I get with this testcase is:
“Expected a ',' or '}' at character 899 of {"CCLUTREPLY": …“

On position 899 I find: <![CDATA[declare ut_logtext = vc with protect, noconstant("")]]>
(position 899 is the second ")

In the output.log I can see that the test case succeeded/was executed.
When I have other test cases run under the same conditions, they do not fail on these quotes even though the very same include file is included in those test cases as well… In those cases I can see that the quotes have been escaped correctly in the json.

mvn -version:

Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: C:\Program Files (x86)\apache-maven-3.6.0\bin\..
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jre1.8.0_201
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Maven command to test:

cd ccl
mvn clean test -Pt18vx 

I have sent you a DM/email with all relevant files & a code project that I used to reproduce this single test case.

Other details:

  • cclunit framework: 3.3 (3.4/master gives the same issues)
  • Domain versions / DevDomain environments used:
    • 2018.01-STP7.5
    • 2018.03.01

Ability to compile and test without having to save to $cclsource

For this plugin to compile or run unit tests in non-development domains (where most dba users are not allowed to save to $cclsource), users should still be able to compile files and test them without having to save them to $cclsource. It would be more meaningful if the save operation to $cclsource is performed only during a maven install.

Consider an application like DiscernVisualDeveloper.exe, that allows users to compile/build files without saving it to $cclsource.

Error in whitenoise 18nRules

The following constructs crash whitenoise (2.5) with IndexOutOfBoundsException.

This exposes two problems: (1) the stated issue and (2) there is no way to bypass a problematic rule.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.