Skip to content

Conversation

@joewiz
Copy link
Member

@joewiz joewiz commented Jun 29, 2021

This PR adapts the original java-based tests to use xqsuite and deletes the java tests, with the aim of running the tests via Maven and in CI.

joewiz added 3 commits June 29, 2021 12:57
The name for each test was derived from the "title" elements in the original test-plan.xml document. Unfortunately, the fuller descriptions in the "description" element had no counterpart in the xqsuite annotations. The only resource needed from the old resources location was keystore.ks.
@adamretter
Copy link
Contributor

@joewiz Looks good. Do you mind if I push some commits to this PR to add the parts needed to have it run via XQSuite in Maven etc?

@joewiz
Copy link
Member Author

joewiz commented Jun 29, 2021

@adamretter Not at all! Please push and modify as you see fit. Thank you!

@joewiz
Copy link
Member Author

joewiz commented Jun 29, 2021

@adamretter Doh! I should've given the test module the xqm extension, since it's a library module. Would it be possible for you to make this change in your commits?

@adamretter
Copy link
Contributor

Tests will now run with mvn verify and I added CI for that too :-)

@joewiz
Copy link
Member Author

joewiz commented Jun 29, 2021

@adamretter Cool! mvn verify runs like a charm.

The xqsuite has one remaining problem on line 52, where I had to hardcode a reference to the directory containing the keystore.ks file on my filesystem. Does mvn verify have a way of exposing an environment variable that xqsuite could use to find the file stored in its src/test/resources directory? I'm not sure how to get the xqsuite to reference this binary file independently.

I'm not actually certain that the xqsuite needs this resource. The original tests used keystore.ks in the tests for crypto:generate-signature and crypto:validate-signature, but it doesn't appear to actually use them. Can we really jettison this resource and expect the tests of these functions to perform correctly?

@nsincaglia Do you use the crypto:generate-signature or crypto:validate-signature functions? Do you have any working code that we could look at to see how these functions are supposed to work? The existing tests are a bit ambiguous.

@line-o
Copy link
Member

line-o commented Jun 30, 2021

Interestingly, the tests in baseX generate the necessary signatures. I do like that approach a lot.

@adamretter
Copy link
Contributor

The xqsuite has one remaining problem on line 52,

I have fixed this now, it just needs to be in the correct Java classpath, then you can use resource: like URI in eXist-db to retrieve it.

@adamretter
Copy link
Contributor

@joewiz @line-o As a first iteration, I think this is now ready to merge.

@windauer
Copy link
Member

@adamretter thanks a lot, looks good to me.

@windauer windauer merged commit 1e82832 into eXist-db:master Jun 30, 2021
@joewiz joewiz deleted the switch-to-xqsuite branch June 30, 2021 15:15
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.

4 participants