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

Providing landing page as "iut" results in a NullPointerException #27

Closed
aaime opened this issue Aug 6, 2018 · 8 comments
Closed

Providing landing page as "iut" results in a NullPointerException #27

aaime opened this issue Aug 6, 2018 · 8 comments

Comments

@aaime
Copy link

aaime commented Aug 6, 2018

The README.md does not say which URL to provide (exemplifies a xml schema location instead), but giving a landing page one results in a NPE here:
https://github.com/opengeospatial/ets-wfs30/blob/a25a516309a54384599db5d0346ddb6b7c1e189a/src/main/java/org/opengis/cite/wfs30/collections/FeatureCollectionsMetadataOperation.java#L84

The method is apparently using the user provided URI to make the request, getting a landing page, that has no "collections" element, but just links to API, conformance and the collections page.

Giving the test a collections page link makes this pass. As discussed in the meeting, there is confusing about which URL one would have to give the tests, so maybe the easiest approach for the users is to accept any of them and adapt as a consequence (each has unique attributes that should help identify what one has got).

@aaime
Copy link
Author

aaime commented Aug 6, 2018

Giving the tests the "collections" page makes that test pass, but it seems the same URI is also used in the LandingPage class, which results in a odd error message:

"The landing page must include at least links with relation type 'service', 'conformance' and 'data', but contains [self, alternate] expected [true] but found [false]"

The "Expected true but found false is a side effect of the assertTrue call, but don't think the user should see it (seems to imply a "true" or "false" rel are needed).

@aaime
Copy link
Author

aaime commented Aug 6, 2018

Ah, in case you want to reproduce, use this as the "iut": http://cloudsdi.geo-solutions.it/geoserver/wfs3
The server there still deploys three times a day and does not have all the latest fixes, but has enough to reproduce the NPE issue.

@aaime
Copy link
Author

aaime commented Aug 6, 2018

Hum... how are you getting to the collections page? I've tried to just look at the code, and it seems to be using the rootURI, without adding "/collections", however, the actual request seems impossible to debug, rest assured is written in groovy and intelllij cannot give anything meaningul when decompiling its sources while I try to "step in" into the "request" method.

@lgoltz
Copy link
Contributor

lgoltz commented Aug 7, 2018

Thanks a lot for your feedback! As far as I see we have several issues here:

  1. Enhance the documentation (see Create documentation of test suite #9).
  2. Improve the ETS to accept the URL to the landing page or the API definition. Currently the URL to the landing page must be provided.
  3. The collections are currently parsed from the landing page to test A.4.4.5. Validate the Feature Collections Metadata Operation Response (Test method 4. Validate that the returned document includes a collections property for each collection in the dataset.). Meanwhile I think this test method cannot be tested by ETS as there is no list of collections provided by the WFS. The collections must be named in the landing page and a templateing mechanism can be used in the APE definition (https://github.com/opengeospatial/WFS_FES/blob/master/openapi.yaml) @aaime What do you think?
    The affected test is FeatureCollectionsMetadataOperation.validateFeatureCollectionsMetadataOperationResponse_Collections ().
  4. Improve message of failing test LandingTest.landingPageValidation()
  5. The collections page is retrieved using a parsed TestPoint for 'collection' from the API definition. We have strictly implemented A.4.3.2. Identify Server URIs to identify the test points (see also Clean up retrieval of urls/test points #24).

@aaime
Copy link
Author

aaime commented Aug 7, 2018

I think there is a misunderstanding of the spec here (or between us). The landing page does not contain the list of collections, it merely has a links to the collection metadata operation. The links must be followed and the collection metadata operation used to run test A.4.4.5

By specification, even the OpenAPI must contain a "collections" endpoint, not a "collection" one. Following it gives you a full list of collections, e.g:

@lgoltz
Copy link
Contributor

lgoltz commented Aug 7, 2018

Yes, I agree with you. That's why I think the test method 4. Validate that the returned document includes a collections property for each collection in the dataset. is not testable by the ETS as we know the "collections" only from the feature collection metadata operation response which is the returned document under test.

@aaime
Copy link
Author

aaime commented Aug 13, 2018

Works for me

@lgoltz lgoltz closed this as completed Aug 14, 2018
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

No branches or pull requests

2 participants