Skip to content

Conversation

@jamesagardner
Copy link
Contributor

No description provided.

jamesagardner and others added 28 commits January 3, 2019 16:11
Removing lots of code that sat alongside list-from-database() calls that
was doing filesystem reads.  Updated list-from-database() so that it
detects and reads from the filesystem whenever the database-id is 0.

This removed the duplication of logic used to detect tests, suites, and
custom formats.
Removed arguments that were ultimately combined together to form a
complete path.  Ultimately this moves the logic out of this helper
method and into the parent method where the logic belongs.

Also added a few niceties:
1) Now replace the directory separator based on file system in
   one place instead of having to do it multiple times
2) Now add trailing '/' when the path didn't have one.
Now filtering out ignored directories and files by using a map instead
of string comparison.  This should scale much better.  Also re-organized
the code so it's a bit easier to read and follow.
Now populating a map of suites and tests.  No longer asking for all of
the tests in the module database two different times.  Removed a few
extra string operators in the process.
Most files added have comments explaining why they exist, and how files
either named in such a way or living in such a directory should be used
out in the wild.
The system will recursive descend through the test suites directory and
run any tests that are not part of an ignored directory nor an ignored
file.

Updating the list of ignored directories and ignored files is as simple
as adding it to the map.
This is still a bit of a work in progress.  Everything seems to work
when testing and building using gradle from the command line.  However,
the ParameterizedTest class isn't detecting test classes from inside
IDEA.

While updating the namespaces, I moved the assertion functions out into
a separate assert library.  Since everyone's imports are already going
to break with the namespace change, I felt this was a good time to re-
organize the code so that we have better separation of internal and
external libraries.
After review feedback we'll reserve /lib to be the proper directory for
storing re-usable library modules.
Made the parser namespace aware.  Now checking against the namespace as
well as the localname. The parser should be a little more resiliant now.
Before it was matching on the serialized namespace prefix of the XML
which is very brittle.
Moving assertion methods back into the single test-helper library.
Integrated namespace updates
Specify permissions and collections in test:load-test-file
Changed the way assert equal works so that it can accept a custom error
message to be displayed upon failure.  By default it will now display
the expected and actual values passed in.

Added custom message support to assert-http* methods
Moved failure message content into the description argument, of
fn:error() instead of relying on the data argument to fn:error().

Updated assert-throws-error-with-message() to assert against the
message element in the failure stack instead of format-string.  Added
a few new tests cases for this, and updated the existing tests.

Added custom failure message to assert-throws-error-with-message()
Issue #55: Converted xdmp:eval to xdmp:invoke-function
Moving optional failure message argument to the end of the parameters
list.  This is consistent with JUnit 5, and generally consistent with
keeping optional arguments at the end of a parameter list.
Bumped version to 0.13.develop. Once this is ready for 0.13.0 or 1.0.0, will need to update the references to 0.13.develop. 

Also made a fix in marklogic-unit-test-client/build.gradle so that createHttpCredentials isn't executed when any task is run, but only when it's run. 

See the README file in the marklogic-junit directory for more information.
Removing implications of this only being a unit testing framework as it
will include integration and unit testing components.
@jamesagardner jamesagardner merged commit 1b1a26a into master Apr 26, 2019
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