Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross test rig for running Daffodil-flavor TDML on IBM DFDL #1

Merged
merged 12 commits into from
Nov 30, 2018
Merged

Conversation

mbeckerle
Copy link
Contributor

Dynamically loaded by Daffodil if found on the class path.

Using DFDLCatalogResolver from Daffodil to insure include/imports
resolve the same as on Daffodil.

There are test-rig-tests here, and also the sample that comes with
IBM DFDL is here as a TDML test.

All the tests pass on Daffodil and IBM DFDL.

See the README.txt file for how to setup and run.

README.txt Outdated Show resolved Hide resolved
Dynamically loaded by Daffodil if found on the class path.

Using DFDLCatalogResolver from Daffodil to insure include/imports
resolve the same as on Daffodil.

There are test-rig-tests here, and also the sample that comes with
IBM DFDL can be run as TDML tests. You just have to copy files from the
IBM DFDL installation to the lib and src/test/resources directories.

All the tests pass on Daffodil and IBM DFDL.

See the README.txt file for how to setup and run.
org.apache.daffodil.tdml.processor package, to be found on the
classpath.

Depends only on daffodil's TDML runner, not the rest of daffodil.
Current test results from this are:

[error] Failed: Total 112, Failed 15, Errors 0, Passed 79, Skipped 18
[error] Failed tests:
[error] 	org.apache.daffodil.IBMTestsThatPass2
[error] 	org.apache.daffodil.IBMTestsThatPass
[error] 	org.apache.daffodil.TresysTests
Fixed bug in IBM DFDLToSAXEventAdapter not escaping strings.
Now escapes them with Daffodil's escape util, which should 
allow daffodil-tests that expect daffodil-style XML-escaping (such as
NUL to  to work. 

This illustrates how to add more DFDLSchemas to this cross-test rig.

Setup source and resource folders for eclipse, so that you can test
daffodil-test-ibm1 tests from here locally under eclipse, as well as run
NACHA tests from here locally under eclipse.

Also works from sbt.
This is symmetric with changes that map XML-illegals to the Unicode
Private Use Area on parsing.

Ex: On parse NUL (aka U+0) becomes U+E000. On unparse U+E000 becomes 0,
that is NUL again.

This should allow daffodil TDML tests that depend on this escaping and
substitution convention to be portable to IBM DFDL as well.
Must be published i.e., 'sbt publishLocal' so test modules can load it
as a managed dependency.

A plugin will auto-edit classpaths to use the IBM DFDL tdml processor. 

See README.md for instructions on the plugin.
Copy link
Contributor

@stevedlawrence stevedlawrence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, only concern is some files do not have a license, and some have IBM wording that makes me think that maybe we can't redistribute them?

*
* US Government Users Restricted Rights - Use, duplication, or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
**********************************************************************/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The licensing isn't clear to me for some of these files. Are we allowed to redistribute these files from IBM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not. I'll have to pull this all down.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, my plan is to write a replacement of this class in scala.

smhdfdl and others added 2 commits November 29, 2018 17:36
Format the trees correctly in README.md

@Override
public void entry(IDFDLTrace traceItem) {
// System.err.println("TraceListener : entry() "+traceItem.getMessage() );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this and "exit" below have commented out print statements, but the rest don't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. They aren't desirable to see in a trace. They're really in case you implement indenting. For a basic simple trace output you don't need to see these events.

Assert.invariant(schemaSource.isInstanceOf[URISchemaSource])
val grammar =
try {
// LoggingDefaults.setLoggingLevel(LogLevel.Resolver)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out logging and print statement below

Copy link

@jadams-tresys jadams-tresys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 with some commented out stuff removed and license work-around

@mbeckerle mbeckerle merged commit a4de927 into start Nov 30, 2018
mbeckerle added a commit that referenced this pull request Nov 30, 2018
* Cross test rig for running Daffodil-flavor TDML on IBM DFDL

Dynamically loaded by Daffodil if found on the class path.

Using DFDLCatalogResolver from Daffodil to insure include/imports
resolve the same as on Daffodil.

There are test-rig-tests here, and also the sample that comes with
IBM DFDL can be run as TDML tests. You just have to copy files from the
IBM DFDL installation to the lib and src/test/resources directories.

All the tests pass on Daffodil and IBM DFDL.

See the README.txt file for how to setup and run.

* Must be named DaffodilTDMLDFDLProcessorFactory in the
org.apache.daffodil.tdml.processor package, to be found on the
classpath.

Depends only on daffodil's TDML runner, not the rest of daffodil.

* Incorporate review feedback as of 2018-11-19.

* Update README.txt to match current behavior.

* Works from sbt now, and tests daffodil-test-ibm1 tests.

Current test results from this are:

[error] Failed: Total 112, Failed 15, Errors 0, Passed 79, Skipped 18
[error] Failed tests:
[error] 	org.apache.daffodil.IBMTestsThatPass2
[error] 	org.apache.daffodil.IBMTestsThatPass
[error] 	org.apache.daffodil.TresysTests

* Added NACHA to cross-tests (all tests pass).

Fixed bug in IBM DFDLToSAXEventAdapter not escaping strings.
Now escapes them with Daffodil's escape util, which should 
allow daffodil-tests that expect daffodil-style XML-escaping (such as
NUL to  to work. 

This illustrates how to add more DFDLSchemas to this cross-test rig.

Setup source and resource folders for eclipse, so that you can test
daffodil-test-ibm1 tests from here locally under eclipse, as well as run
NACHA tests from here locally under eclipse.

Also works from sbt.

* Remap PUA back to XML Illegal chars on unparsing.

This is symmetric with changes that map XML-illegals to the Unicode
Private Use Area on parsing.

Ex: On parse NUL (aka U+0) becomes U+E000. On unparse U+E000 becomes 0,
that is NUL again.

This should allow daffodil TDML tests that depend on this escaping and
substitution convention to be portable to IBM DFDL as well.

* Add our TraceListener that is used for user and service trace
listener.

This is added whenver trace is on.

* Updated to be a library that is used by tests. 

Must be published i.e., 'sbt publishLocal' so test modules can load it
as a managed dependency.

A plugin will auto-edit classpaths to use the IBM DFDL tdml processor. 

See README.md for instructions on the plugin.

* Update README.md

* Rewrite DFDLReader1 in scala to avoid exhibiting IBM's code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants