cerner / ccl-testing Goto Github PK
View Code? Open in Web Editor NEWA collection of maven plugins and their dependencies to perform CCL Unit tests and static analyses and to generate reports from the results.
License: Apache License 2.0
A collection of maven plugins and their dependencies to perform CCL Unit tests and static analyses and to generate reports from the results.
License: Apache License 2.0
The troubleshooting guide needs updated to more clearly indicate that "validating *.out) is specifying a listing file that can be found in $cer_temp if there is a compile failure.
Errors can occur when a single-table database query does not use an alias for the table if a referenced table attribute matches the name of a variable that is in scope, CCL will misinterpret the identifier to be a reference to the variable.
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.
set logical file_location location
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?
The only value in specifying ccl-testCase is to speed things up. Performing the unnecessary file transfers and compilations defeats that purpose.
Add JSch.setLogger(new JschLogger());
to the public key createSession method like is done for the username/password method.
If the update fails, then some rows were not locked.
If a program does not check for and handle a lock failure, then its subsequent behavior will probably be incorrect.
Failure to enable validation when parsing XML gives an attacker the opportunity to supply malicious input.
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
mvn clean site -Psolm64
[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
3.3
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.
This might not occur if MIT Kerberos is installed and configured on the build device.
The will not occur if there is a system property javax.security.auth.useSubjectCredsOnly equal to true.
The jsch-util code should be updated so that JSch only uses password authentication when there are configured credentials.
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.
The code comments contains the text string '\u0000' (also fails with other Unicode characters: ie '\u0001')
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
/**
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
code contains the text '\u' followed by a space and then some numbers.
[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
/**
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
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] 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"
/**
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
Block-comment contains the text-string (not a Unicode character) '\u0000':
[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
/**
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
If a program contains a string variable/constant which resembles a Unicode encoded character, it fails the build as well
[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
/**
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
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.
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.
mvn clean test site -Psoldev64aix
declare generatePortalInvites(dPatientPersonId = f8, dPmHistTrackingId = f8) = null ;569134 added dPmHistTrackingId
[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]
3.3
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:
This CCL issue causes some integration tests to fail. Turning on CCL "line mode" with %t circumvents the problem.
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.
Current link is - https://github.com/cerner/cclunit-framework/blob/master/cclunit-framework-source/doc/QUICKSTART.md
should be : https://github.com/cerner/cclunit-framework/blob/master/doc/QUICKSTART.md if I am getting this right
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.
Adding subroutineName to violationId + scriptName + variableName stops the filtering.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.