Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Lyo/LDPTestSuiteExploration"
< Lyo
Line 2: | Line 2: | ||
== Options being explored == | == Options being explored == | ||
− | * TestNG + REST-asured | + | * [http://testng.org/doc/index.html TestNG] + [https://code.google.com/p/rest-assured/ REST-asured] |
− | * Frisby.js | + | |
+ | Sample test: | ||
+ | |||
+ | <code><pre> | ||
+ | @Test(groups = { MUST }, dependsOnMethods = { "testCreateResource" } ) | ||
+ | public void testResourceHasLdpLinkHeader() throws URISyntaxException { | ||
+ | RestAssured.given() | ||
+ | .header(ACCEPT, TEXT_TURTLE) | ||
+ | .expect().statusCode(HttpStatus.SC_OK).header(LINK, LDPR_LINK_HEADER_VALUE) | ||
+ | .when().get(new URI(uri)); | ||
+ | } | ||
+ | </pre></code> | ||
+ | |||
+ | * [http://frisbyjs.com/ Frisby.js] + [https://github.com/mhevery/jasmine-node jasmine-node] + [http://nodejs.org/ node.js] | ||
+ | |||
+ | Sample test: | ||
+ | |||
+ | <code><pre> | ||
+ | frisby.create('MUST: Test Link header on LDPR') | ||
+ | .addHeader('Accept', 'text/turtle') | ||
+ | .head(resourceURI) | ||
+ | .expectStatus(200) | ||
+ | .expectHeaderContains('Link', '<http://www.w3.org/ns/ldp#Resource>; rel="type"') | ||
+ | .toss(); | ||
+ | </pre></code> | ||
== References == | == References == | ||
* [http://www.w3.org/2012/ldp/wiki/Testing W3C LDP Testing page] | * [http://www.w3.org/2012/ldp/wiki/Testing W3C LDP Testing page] |
Revision as of 09:45, 24 March 2014
Page will gather various notes about how a LDP test suite may be implemented, with looking not just at the general needs of LDP server implementations but also how it can be leveraged for OSLC needs.
Options being explored
Sample test:
@Test(groups = { MUST }, dependsOnMethods = { "testCreateResource" } )
public void testResourceHasLdpLinkHeader() throws URISyntaxException {
RestAssured.given()
.header(ACCEPT, TEXT_TURTLE)
.expect().statusCode(HttpStatus.SC_OK).header(LINK, LDPR_LINK_HEADER_VALUE)
.when().get(new URI(uri));
}
Sample test:
frisby.create('MUST: Test Link header on LDPR')
.addHeader('Accept', 'text/turtle')
.head(resourceURI)
.expectStatus(200)
.expectHeaderContains('Link', '<http://www.w3.org/ns/ldp#Resource>; rel="type"')
.toss();