diff --git a/web/modeshape-web-jcr-rest-client/src/test/java/org/modeshape/web/jcr/rest/client/json/JsonRestClientTest.java b/web/modeshape-web-jcr-rest-client/src/test/java/org/modeshape/web/jcr/rest/client/json/JsonRestClientTest.java index 89fed29..725d880 100644 --- a/web/modeshape-web-jcr-rest-client/src/test/java/org/modeshape/web/jcr/rest/client/json/JsonRestClientTest.java +++ b/web/modeshape-web-jcr-rest-client/src/test/java/org/modeshape/web/jcr/rest/client/json/JsonRestClientTest.java @@ -73,6 +73,7 @@ public final class JsonRestClientTest { private static final String FILE_PATH = WORKSPACE_PATH + "document.txt"; private static final String BINARY_FILE_PATH = WORKSPACE_PATH + "picture.jpg"; private static final String DDL_FILE_PATH = WORKSPACE_PATH + "oracle_test_create.ddl"; + private static final String BOOKS_MODEL_PATH = WORKSPACE_PATH + "Books_Oracle.xmi"; private static final String WORKSPACE_UNUSUALPATH = "/myproject/My.Test - Folder/"; private static final String FILE_UNUSUALPATH = WORKSPACE_UNUSUALPATH + "Test File_.a-().txt"; @@ -218,6 +219,27 @@ public final class JsonRestClientTest { String actual = ((JsonRestClient)this.restClient).getFileContents(WORKSPACE1, WORKSPACE_PATH, file); assertThat(actual, is(expected)); } + + @Test + public void shouldPublishMulipleVersionsOfResource() throws Exception { + URL ddlFile = getClass().getResource(BOOKS_MODEL_PATH); + assertThat(ddlFile, is(notNullValue())); + + // publish first time + File file = new File(ddlFile.toURI()); + Status status = this.restClient.publish(WORKSPACE1, WORKSPACE_PATH, file, true); + + // make sure no error when publishing the first time + assertThat(status.getMessage(), status.isOk(), is(true)); + + // publish second time + status = this.restClient.publish(WORKSPACE1, WORKSPACE_PATH, file, true); + + // make sure no error when publishing the second time + assertThat(status.getMessage(), status.isOk(), is(true)); + + // TODO still need to verify that the 2 versions exist in repository + } @Test public void shouldPublishResourcesHavingNonLettersNonNumbersInName() throws Exception {