Hi Fabio,
Just one small process detail: the XWIKI-3102 issue has already been
released so these 2 commits will appear in that release fisheye tab
thus making readers think these changes are in XE 1.8M1.
In general our practice is to not reuse issues that have been closed.
So in this case you could either create a new jira issue or just
commit without a jira issue if the changes are not user-visible and
thus users don't need to see a jira issue in the release notes.
-Vincent
PS: Rules are here:
http://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#HIterati…
On Jan 28, 2009, at 10:29 PM, fmancinelli (SVN) wrote:
Author: fmancinelli
Date: 2009-01-28 22:29:35 +0100 (Wed, 28 Jan 2009)
New Revision: 15848
Modified:
enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/AbstractHttpTest.java
enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/CommentsResourceTest.java
enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/PageResourceTest.java
enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/PagesResourceTest.java
enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/RootResourceTest.java
enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/SpacesResourceTest.java
Log:
XWIKI-3102: Develop the initial feature set of the REST API
Replaced assertTrue with assertEquals in order to get information
about expected output in case of failure.
Added comments and page at previous version tests.
Improved link checking tests.
Modified: enterprise/trunk/distribution-test/rest-tests/src/test/it/
org/xwiki/rest/it/AbstractHttpTest.java
===================================================================
--- enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/AbstractHttpTest.java 2009-01-28 21:20:34 UTC (rev
15847)
+++ enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/AbstractHttpTest.java 2009-01-28 21:29:35 UTC (rev
15848)
@@ -153,7 +153,7 @@
public String getWiki() throws Exception
{
GetMethod getMethod =
executeGet(getFullUri(getUriPatternForResource(WikisResource.class)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Wikis wikis = (Wikis)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -169,7 +169,7 @@
for (Link link : linkCollection.getLinks()) {
System.out.format("Relation '%s': ", link.getRel());
GetMethod getMethod = executeGet(link.getHref());
- assertTrue(getMethod.getStatusCode() ==
HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK,
getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
}
}
Modified: enterprise/trunk/distribution-test/rest-tests/src/test/it/
org/xwiki/rest/it/CommentsResourceTest.java
===================================================================
--- enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/CommentsResourceTest.java 2009-01-28 21:20:34 UTC (rev
15847)
+++ enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/CommentsResourceTest.java 2009-01-28 21:29:35 UTC (rev
15848)
@@ -29,7 +29,12 @@
import org.xwiki.rest.Utils;
import org.xwiki.rest.model.Comment;
import org.xwiki.rest.model.Comments;
+import org.xwiki.rest.model.History;
+import org.xwiki.rest.model.HistorySummary;
+import org.xwiki.rest.model.Page;
+import org.xwiki.rest.model.Relations;
import org.xwiki.rest.resources.comments.CommentsResource;
+import org.xwiki.rest.resources.pages.PageHistoryResource;
public class CommentsResourceTest extends AbstractHttpTest
{
@@ -40,11 +45,13 @@
public void testRepresentation() throws Exception
{
TestUtils.banner("testRepresentation()");
- /* Everything is done in testCreateComments() */
+ /* Everything is done in test methods */
}
public void testCreateComments() throws Exception
{
+ TestUtils.banner("testCreateComments()");
+
Map<String, String> parametersMap = new HashMap<String,
String>();
parametersMap.put(Constants.WIKI_NAME_PARAMETER, getWiki());
parametersMap.put(Constants.SPACE_NAME_PARAMETER, SPACE_NAME);
@@ -54,7 +61,7 @@
getFullUri
(Utils
.formatUriTemplate(getUriPatternForResource(CommentsResource.class),
parametersMap));
GetMethod getMethod = executeGet(commentsUri);
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Comments comments = (Comments)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -68,20 +75,22 @@
comment.setText("Comment");
PostMethod postMethod = executePost(commentsUri, comment,
"Admin", "admin");
- assertTrue(postMethod.getStatusCode() ==
HttpStatus.SC_CREATED);
+ assertEquals(HttpStatus.SC_CREATED,
postMethod.getStatusCode());
TestUtils.printHttpMethodInfo(postMethod);
getMethod = executeGet(commentsUri);
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
comments = (Comments)
xstream.fromXML(getMethod.getResponseBodyAsString());
- assertTrue(comments.getCommentList().size() ==
numberOfComments + 1);
+ assertEquals(numberOfComments + 1,
comments.getCommentList().size());
}
public void testGetComment() throws Exception
{
+ TestUtils.banner("testGetComment()");
+
Map<String, String> parametersMap = new HashMap<String,
String>();
parametersMap.put(Constants.WIKI_NAME_PARAMETER, getWiki());
parametersMap.put(Constants.SPACE_NAME_PARAMETER, SPACE_NAME);
@@ -91,16 +100,47 @@
getFullUri
(Utils
.formatUriTemplate(getUriPatternForResource(CommentsResource.class),
parametersMap));
GetMethod getMethod = executeGet(commentsUri);
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Comments comments = (Comments)
xstream.fromXML(getMethod.getResponseBodyAsString());
if (comments.getCommentList() != null) {
for (Comment comment : comments.getCommentList()) {
- checkLinks(comments);
+ checkLinks(comment);
}
}
}
+ public void testCommentsAtPreviousVersions() throws Exception
+ {
+ TestUtils.banner("testCommentsAtPreviousVersions");
+
+ Map<String, String> parametersMap = new HashMap<String,
String>();
+ parametersMap.put(Constants.WIKI_NAME_PARAMETER, getWiki());
+ parametersMap.put(Constants.SPACE_NAME_PARAMETER,
SPACE_NAME);
+ parametersMap.put(Constants.PAGE_NAME_PARAMETER, PAGE_NAME);
+
+ String pageHistoryUri =
+
getFullUri
(Utils
.formatUriTemplate
(getUriPatternForResource(PageHistoryResource.class), parametersMap));
+
+ GetMethod getMethod = executeGet(pageHistoryUri);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
+ TestUtils.printHttpMethodInfo(getMethod);
+
+ History history = (History)
xstream.fromXML(getMethod.getResponseBodyAsString());
+
+ for (HistorySummary historySummary :
history.getHistorySummaryList()) {
+ getMethod =
executeGet
(historySummary.getFirstLinkByRelation(Relations.PAGE).getHref());
+ assertEquals(HttpStatus.SC_OK,
getMethod.getStatusCode());
+ TestUtils.printHttpMethodInfo(getMethod);
+
+ Page page = (Page)
xstream.fromXML(getMethod.getResponseBodyAsString());
+ getMethod =
executeGet(page.getFirstLinkByRelation(Relations.COMMENTS).getHref());
+ assertEquals(HttpStatus.SC_OK,
getMethod.getStatusCode());
+ TestUtils.printHttpMethodInfo(getMethod);
+ }
+
+ }
+
}
Modified: enterprise/trunk/distribution-test/rest-tests/src/test/it/
org/xwiki/rest/it/PageResourceTest.java
===================================================================
--- enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/PageResourceTest.java 2009-01-28 21:20:34 UTC (rev
15847)
+++ enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/PageResourceTest.java 2009-01-28 21:29:35 UTC (rev
15848)
@@ -29,6 +29,8 @@
import org.apache.commons.httpclient.methods.PutMethod;
import org.xwiki.rest.Constants;
import org.xwiki.rest.Utils;
+import org.xwiki.rest.model.History;
+import org.xwiki.rest.model.HistorySummary;
import org.xwiki.rest.model.Link;
import org.xwiki.rest.model.Page;
import org.xwiki.rest.model.PageSummary;
@@ -38,6 +40,7 @@
import org.xwiki.rest.model.Spaces;
import org.xwiki.rest.model.Wiki;
import org.xwiki.rest.model.Wikis;
+import org.xwiki.rest.resources.pages.PageHistoryResource;
import org.xwiki.rest.resources.pages.PageResource;
import org.xwiki.rest.resources.pages.PageTranslationResource;
import org.xwiki.rest.resources.wikis.WikisResource;
@@ -47,7 +50,7 @@
private Page getPage() throws Exception
{
GetMethod getMethod =
executeGet(getFullUri(getUriPatternForResource(WikisResource.class)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Wikis wikis = (Wikis)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -58,7 +61,7 @@
assertNotNull(link);
getMethod = executeGet(link.getHref());
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Spaces spaces = (Spaces)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -70,7 +73,7 @@
assertNotNull(link);
getMethod = executeGet(link.getHref());
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Pages pages = (Pages)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -81,7 +84,7 @@
assertNotNull(link);
getMethod = executeGet(link.getHref());
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Page page = (Page)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -115,7 +118,7 @@
GetMethod getMethod =
executeGet
(getFullUri
(Utils
.formatUriTemplate(getUriPatternForResource(PageResource.class),
parametersMap)));
- assertTrue(getMethod.getStatusCode() ==
HttpStatus.SC_NOT_FOUND);
+ assertEquals(HttpStatus.SC_NOT_FOUND,
getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
}
@@ -136,7 +139,7 @@
assertNotNull(link);
PutMethod putMethod = executePut(link.getHref(), newPage,
"Admin", "admin");
- assertTrue(putMethod.getStatusCode() ==
HttpStatus.SC_ACCEPTED);
+ assertEquals(HttpStatus.SC_ACCEPTED,
putMethod.getStatusCode());
TestUtils.printHttpMethodInfo(putMethod);
String body = putMethod.getResponseBodyAsString();
@@ -157,7 +160,7 @@
assertNotNull(link);
PutMethod putMethod = executePut(link.getHref(), page);
- assertTrue(putMethod.getStatusCode() ==
HttpStatus.SC_FORBIDDEN);
+ assertEquals(HttpStatus.SC_FORBIDDEN,
putMethod.getStatusCode());
TestUtils.printHttpMethodInfo(putMethod);
}
@@ -185,15 +188,15 @@
executePut(
getFullUri
(Utils
.formatUriTemplate(getUriPatternForResource(PageResource.class),
parametersMap)), page,
"Admin", "admin");
- assertTrue(putMethod.getStatusCode() ==
HttpStatus.SC_CREATED);
+ assertEquals(HttpStatus.SC_CREATED,
putMethod.getStatusCode());
TestUtils.printHttpMethodInfo(putMethod);
String body = putMethod.getResponseBodyAsString();
Page modifiedPage = (Page) xstream.fromXML(body);
- assertEquals(modifiedPage.getContent(), CONTENT);
- assertEquals(modifiedPage.getTitle(), TITLE);
- assertEquals(modifiedPage.getParent(), PARENT);
+ assertEquals(CONTENT, modifiedPage.getContent());
+ assertEquals(TITLE, modifiedPage.getTitle());
+ assertEquals(PARENT, modifiedPage.getParent());
}
public void testPUTWithInvalidRepresentation() throws Exception
@@ -204,7 +207,7 @@
Link link = page.getFirstLinkByRelation(Relations.SELF);
PutMethod putMethod = executePut(link.getHref(),
Utils.getResourceAsString(TestConstants.INVALID_PAGE_XML));
- assertTrue(putMethod.getStatusCode() ==
HttpStatus.SC_NOT_ACCEPTABLE);
+ assertEquals(HttpStatus.SC_NOT_ACCEPTABLE,
putMethod.getStatusCode());
TestUtils.printHttpMethodInfo(putMethod);
}
@@ -226,11 +229,11 @@
page.setContent(content);
PutMethod putMethod = executePut(uri, page, "Admin",
"admin");
- assertTrue(putMethod.getStatusCode() ==
HttpStatus.SC_CREATED);
+ assertEquals(HttpStatus.SC_CREATED,
putMethod.getStatusCode());
TestUtils.printHttpMethodInfo(putMethod);
getMethod = executeGet(uri);
- assertTrue(getMethod.getStatusCode() ==
HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK,
getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
System.out.format("Page %s.%s created.\n", spaceName,
pageName);
} else {
@@ -258,7 +261,7 @@
PutMethod putMethod =
executePut
(getFullUri
(Utils
.formatUriTemplate
(getUriPatternForResource(PageTranslationResource.class),
parametersMap)), page, "Admin", "admin");
- assertTrue(putMethod.getStatusCode() ==
HttpStatus.SC_CREATED);
+ assertEquals(HttpStatus.SC_CREATED,
putMethod.getStatusCode());
TestUtils.printHttpMethodInfo(putMethod);
parametersMap = new HashMap<String, String>();
@@ -270,12 +273,12 @@
GetMethod getMethod =
executeGet
(getFullUri
(Utils
.formatUriTemplate
(getUriPatternForResource(PageTranslationResource.class),
parametersMap)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Page modifiedPage = (Page)
xstream.fromXML(getMethod.getResponseBodyAsString());
- assertTrue(languageId.equals(modifiedPage.getLanguage()));
- assertTrue(languageId.equals(modifiedPage.getLanguage()));
+ assertEquals(languageId, modifiedPage.getLanguage());
+ assertEquals(languageId, modifiedPage.getLanguage());
}
public void testGETTranslations() throws Exception
@@ -289,7 +292,7 @@
GetMethod getMethod =
executeGet
(getFullUri
(Utils
.formatUriTemplate(getUriPatternForResource(PageResource.class),
parametersMap)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Page page = (Page)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -300,12 +303,12 @@
for (Link translationLink : translationLinks) {
System.out.format("Translation link: %s\n",
translationLink.getHref());
getMethod = executeGet(translationLink.getHref());
- assertTrue(getMethod.getStatusCode() ==
HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK,
getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
page = (Page)
xstream.fromXML(getMethod.getResponseBodyAsString());
-
assertTrue(page.getLanguage().equals(translationLink.getHrefLang()));
+ assertEquals(page.getLanguage(),
translationLink.getHrefLang());
}
checkLinks(page.getTranslations());
@@ -322,7 +325,7 @@
GetMethod getMethod =
executeGet
(getFullUri
(Utils
.formatUriTemplate(getUriPatternForResource(PageResource.class),
parametersMap)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
parametersMap = new HashMap<String, String>();
@@ -334,7 +337,7 @@
getMethod =
executeGet
(getFullUri
(Utils
.formatUriTemplate
(getUriPatternForResource(PageTranslationResource.class),
parametersMap)));
- assertTrue(getMethod.getStatusCode() ==
HttpStatus.SC_NOT_FOUND);
+ assertEquals(HttpStatus.SC_NOT_FOUND,
getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
}
@@ -354,13 +357,74 @@
DeleteMethod deleteMethod =
executeDelete
(getFullUri
(Utils.formatUriTemplate(getUriPatternForResource(PageResource.class),
parametersMap)));
- assertTrue(deleteMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, deleteMethod.getStatusCode());
TestUtils.printHttpMethodInfo(deleteMethod);
GetMethod getMethod =
executeGet
(getFullUri
(Utils
.formatUriTemplate(getUriPatternForResource(PageResource.class),
parametersMap)));
- assertTrue(getMethod.getStatusCode() ==
HttpStatus.SC_NOT_FOUND);
+ assertEquals(HttpStatus.SC_NOT_FOUND,
getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
}
+ public void testPageHistory() throws Exception
+ {
+ TestUtils.banner("testPageHistory");
+
+ Page originalPage = getPage();
+
+ Map<String, String> parametersMap = new HashMap<String,
String>();
+ parametersMap.put(Constants.WIKI_NAME_PARAMETER, getWiki());
+ parametersMap.put(Constants.SPACE_NAME_PARAMETER,
originalPage.getSpace());
+ parametersMap.put(Constants.PAGE_NAME_PARAMETER,
originalPage.getName());
+
+ String pageHistoryUri =
+
getFullUri
(Utils
.formatUriTemplate
(getUriPatternForResource(PageHistoryResource.class), parametersMap));
+
+ GetMethod getMethod = executeGet(pageHistoryUri);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
+ TestUtils.printHttpMethodInfo(getMethod);
+
+ History history = (History)
xstream.fromXML(getMethod.getResponseBodyAsString());
+
+ for (HistorySummary historySummary :
history.getHistorySummaryList()) {
+ getMethod =
executeGet
(historySummary.getFirstLinkByRelation(Relations.PAGE).getHref());
+ assertEquals(HttpStatus.SC_OK,
getMethod.getStatusCode());
+ TestUtils.printHttpMethodInfo(getMethod);
+
+ Page page = (Page)
xstream.fromXML(getMethod.getResponseBodyAsString());
+
+ checkLinks(page);
+ }
+ }
+
+ public void testPageTranslationHistory() throws Exception
+ {
+ TestUtils.banner("testPageTranslationHistory");
+
+ Map<String, String> parametersMap = new HashMap<String,
String>();
+ parametersMap.put(Constants.WIKI_NAME_PARAMETER, getWiki());
+ parametersMap.put(Constants.SPACE_NAME_PARAMETER,
TestConstants.TEST_SPACE_NAME);
+ parametersMap.put(Constants.PAGE_NAME_PARAMETER,
TestConstants.TRANSLATIONS_PAGE_NAME);
+
+ String pageHistoryUri =
+
getFullUri
(Utils
.formatUriTemplate
(getUriPatternForResource(PageHistoryResource.class), parametersMap));
+
+ GetMethod getMethod = executeGet(pageHistoryUri);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
+ TestUtils.printHttpMethodInfo(getMethod);
+
+ History history = (History)
xstream.fromXML(getMethod.getResponseBodyAsString());
+
+ for (HistorySummary historySummary :
history.getHistorySummaryList()) {
+ getMethod =
executeGet
(historySummary.getFirstLinkByRelation(Relations.PAGE).getHref());
+ assertEquals(HttpStatus.SC_OK,
getMethod.getStatusCode());
+ TestUtils.printHttpMethodInfo(getMethod);
+
+ Page page = (Page)
xstream.fromXML(getMethod.getResponseBodyAsString());
+
+ checkLinks(page);
+ checkLinks(page.getTranslations());
+ }
+ }
+
}
Modified: enterprise/trunk/distribution-test/rest-tests/src/test/it/
org/xwiki/rest/it/PagesResourceTest.java
===================================================================
--- enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/PagesResourceTest.java 2009-01-28 21:20:34 UTC (rev
15847)
+++ enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/PagesResourceTest.java 2009-01-28 21:29:35 UTC (rev
15848)
@@ -37,7 +37,7 @@
TestUtils.banner("testRepresentation()");
GetMethod getMethod =
executeGet(getFullUri(getUriPatternForResource(WikisResource.class)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Wikis wikis = (Wikis)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -48,7 +48,7 @@
assertNotNull(link);
getMethod = executeGet(link.getHref());
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Spaces spaces = (Spaces)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -59,7 +59,7 @@
assertNotNull(link);
getMethod = executeGet(link.getHref());
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Pages pages = (Pages)
xstream.fromXML(getMethod.getResponseBodyAsString());
Modified: enterprise/trunk/distribution-test/rest-tests/src/test/it/
org/xwiki/rest/it/RootResourceTest.java
===================================================================
--- enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/RootResourceTest.java 2009-01-28 21:20:34 UTC (rev
15847)
+++ enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/RootResourceTest.java 2009-01-28 21:29:35 UTC (rev
15848)
@@ -33,7 +33,7 @@
TestUtils.banner("testRepresentation()");
GetMethod getMethod =
executeGet(getFullUri(getUriPatternForResource(RootResource.class)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
XWikiRoot xwikiRoot = (XWikiRoot)
xstream.fromXML(getMethod.getResponseBodyAsString());
Modified: enterprise/trunk/distribution-test/rest-tests/src/test/it/
org/xwiki/rest/it/SpacesResourceTest.java
===================================================================
--- enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/SpacesResourceTest.java 2009-01-28 21:20:34 UTC (rev
15847)
+++ enterprise/trunk/distribution-test/rest-tests/src/test/it/org/
xwiki/rest/it/SpacesResourceTest.java 2009-01-28 21:29:35 UTC (rev
15848)
@@ -35,7 +35,7 @@
TestUtils.banner("testRepresentation()");
GetMethod getMethod =
executeGet(getFullUri(getUriPatternForResource(WikisResource.class)));
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Wikis wikis = (Wikis)
xstream.fromXML(getMethod.getResponseBodyAsString());
@@ -46,7 +46,7 @@
assertNotNull(link);
getMethod = executeGet(link.getHref());
- assertTrue(getMethod.getStatusCode() == HttpStatus.SC_OK);
+ assertEquals(HttpStatus.SC_OK, getMethod.getStatusCode());
TestUtils.printHttpMethodInfo(getMethod);
Spaces spaces = (Spaces)
xstream.fromXML(getMethod.getResponseBodyAsString());