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

HTTP Client 2.0 tests #96

Open
adamretter opened this issue Aug 25, 2018 · 2 comments
Open

HTTP Client 2.0 tests #96

adamretter opened this issue Aug 25, 2018 · 2 comments

Comments

@adamretter
Copy link
Member

adamretter commented Aug 25, 2018

We need a test suite for HTTP Client 2.0.

For example, at the moment I want to make sure we can handle the various XDM <-> HTTP JSON request/responses that we want, e.g. sending null etc.

I think we should specify it using the same grammar as https://github.com/w3c/qt3tests. AFAIK the following processors already support that:

  1. BaseX
  2. eXist-db
  3. Saxon

We should be able to easily add something to the environment of the qt3tests grammar to define/mock a simple HTTP response from the server. I would be happy to take on this task if others are in agreement, and will contribute tests too.

@ChristianGruen
Copy link
Member

Great initiative! I’ll definitely add some test cases once it’s available.

In the unit tests of BaseX, we defined a FakeHttpConnection class. It’s fairly restricted, though. We could also send requests to http://httpbin.org or similar sites.

I’m looking forward to your approach.

@fgeorges
Copy link
Member

From experience, the only way to test a HTTP Client is to define a HTTP Server that returns specific informations based on the URL and maybe other bits from the request.

In the test grammar, that would probably be an extension of the environments (now that's the bit providing the accessible documents, schemas, etc.) Or any configuration that would tell a piece of software acting as a HTTP Server how to respond to specific requests.

I guess there is a bit of development there :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants